:root {
  --office-bg: #06131a;
  --office-bg-alt: #0d2029;
  --office-panel: rgba(11, 31, 41, 0.88);
  --office-panel-strong: rgba(16, 43, 57, 0.96);
  --office-border: rgba(151, 209, 190, 0.16);
  --office-text: #eaf5ef;
  --office-muted: #9ab8b1;
  --office-accent: #c8ff6a;
  --office-accent-alt: #6ae6ff;
  --office-alert: #ff8f6b;
  --office-warn: #ffd166;
  --office-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(106, 230, 255, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(200, 255, 106, 0.08), transparent 24%),
    linear-gradient(180deg, #06131a 0%, #071017 100%);
  color: var(--office-text);
  font-family: "IBM Plex Sans", sans-serif;
}

body {
  overflow: hidden;
}

.office-dashboard {
  position: relative;
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

.office-dashboard__header,
.office-dashboard__footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  position: absolute;
  left: 32px;
  right: 32px;
  z-index: 20;
  pointer-events: none;
}

.office-dashboard__header {
  top: 28px;
}

.office-dashboard__footer {
  bottom: 20px;
}

.office-dashboard__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--office-accent-alt);
  margin-bottom: 6px;
}

.office-dashboard__title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.5rem;
  line-height: 1;
}

.office-dashboard__meta {
  text-align: right;
  margin-left: auto;
  padding: 10px 14px 12px;
  border-radius: 18px;
  background: rgba(6, 19, 26, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.office-dashboard__clock {
  font-family: "Space Grotesk", sans-serif;
  font-size: 3rem;
  line-height: 1;
}

.office-dashboard__date,
.office-dashboard__footer {
  color: var(--office-muted);
  font-size: 0.95rem;
}

.office-dashboard__main {
  min-height: 0;
  height: 100%;
}

.office-dashboard__screens {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-wrap: nowrap;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.office-dashboard__screen {
  position: relative;
  inset: auto;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  opacity: 1;
  pointer-events: none;
  transform: none;
  transition: none;
}

.office-dashboard__screen.is-active {
  pointer-events: auto;
}

.office-dashboard__screen-grid {
  display: grid;
  height: 100%;
  gap: 18px;
  padding: 28px 32px 20px;
  box-sizing: border-box;
}

.office-dashboard__screen-grid--overview {
  grid-template-columns: 1.15fr 1fr;
  grid-template-rows: auto 1fr;
}

.office-dashboard__screen-grid--overview .office-panel--hero {
  grid-column: 1 / span 2;
}

.office-dashboard__screen-grid--routes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.office-dashboard__screen-grid--sensors {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.office-dashboard__screen-grid--cctv {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

.office-dashboard__sensor-ticker {
  overflow: hidden;
  width: 100%;
}

.office-dashboard__sensor-track {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: max-content;
  animation: office-sensor-marquee 42s linear infinite;
  will-change: transform;
}

.office-panel {
  min-height: 0;
  border: 1px solid var(--office-border);
  background: linear-gradient(180deg, var(--office-panel) 0%, var(--office-panel-strong) 100%);
  border-radius: 24px;
  box-shadow: var(--office-shadow);
  padding: 18px 20px;
  overflow: hidden;
}

.office-dashboard__screen-grid--cctv .office-panel {
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
  background: #000;
}

.office-dashboard__screen--cctv {
  transform: none;
}

.office-dashboard__screen--overlay {
  transform: none;
}

.office-dashboard__screen--route-map {
  transform: none;
}

.office-dashboard__backdrop {
  position: absolute;
  inset: 0;
}

.office-dashboard__backdrop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  gap: 0;
}

.office-dashboard__backdrop-grid .office-panel,
.office-dashboard__backdrop-grid .office-cctv {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  background: #000;
}

.office-dashboard__backdrop-grid .office-cctv__frame,
.office-dashboard__backdrop-grid .office-cctv__iframe,
.office-dashboard__backdrop-grid .office-cctv__fallback,
.office-dashboard__backdrop-grid .office-cctv__placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.office-dashboard__backdrop-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 10, 15, 0.2), rgba(4, 10, 15, 0.12) 45%, rgba(4, 10, 15, 0.72) 100%);
  pointer-events: none;
}

.office-dashboard__route-backdrop,
.office-dashboard__route-shade {
  position: absolute;
  inset: 0;
}

.office-dashboard__route-backdrop {
  background:
    radial-gradient(circle at top left, rgba(106, 230, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #0a151b 0%, #091118 100%);
  overflow: hidden;
}

.office-dashboard__route-backdrop img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.office-dashboard__route-shade {
  background:
    linear-gradient(180deg, rgba(4, 11, 16, 0.12) 0%, rgba(4, 11, 16, 0.2) 42%, rgba(4, 11, 16, 0.76) 100%);
  pointer-events: none;
}

.office-dashboard__overlay-wrap {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 5;
}

.office-dashboard__overlay-wrap--left {
  right: auto;
  width: min(620px, calc(100vw - 48px));
}

.office-panel__title {
  margin: 0 0 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  color: var(--office-text);
}

.office-panel__subtitle {
  margin-top: 6px;
  color: var(--office-muted);
  font-size: 1rem;
}

.office-hero-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.office-kpi {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.office-kpi__label {
  color: var(--office-muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.office-kpi__value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 4.1rem;
  line-height: 1;
}

.office-kpi__meta {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--office-muted);
}

.office-route-summary,
.office-sensor-list {
  display: grid;
  gap: 12px;
}

.office-route-summary--inline {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.office-route-summary__item,
.office-sensor {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.office-route-summary__top,
.office-sensor__top,
.office-route-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.office-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--office-muted);
}

.office-chip--good {
  color: var(--office-accent);
}

.office-chip--warn {
  color: var(--office-warn);
}

.office-chip--alert {
  color: var(--office-alert);
}

.office-route-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
}

.office-route-card--fullscreen {
  gap: 12px;
  max-width: 100%;
  margin-inline: 0;
}

.office-route-card--fullscreen .office-route-card__title {
  font-size: 0.76rem;
}

.office-route-card--fullscreen .office-panel__subtitle {
  font-size: 0.72rem;
  margin-top: 4px;
}

.office-route-card--fullscreen .office-chip {
  font-size: 0.62rem;
  padding: 4px 8px;
}

.office-route-card__title,
.office-sensor__label,
.office-cctv__label {
  font-weight: 600;
  font-size: 1.02rem;
}

.office-route-card__map {
  position: relative;
  min-height: 220px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(135deg, rgba(106, 230, 255, 0.12), rgba(200, 255, 106, 0.05)),
    rgba(255, 255, 255, 0.02);
}

.office-route-card__map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.office-route-card__map-fallback,
.office-cctv__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--office-muted);
}

.office-route-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.office-route-card__stats--fullscreen {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.office-stat {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.office-stat--large {
  min-height: 108px;
}

.office-stat--hero {
  min-height: 110px;
  padding: 12px 14px;
}

.office-stat__label {
  font-size: 0.92rem;
  color: var(--office-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.office-stat__value {
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.12;
  font-family: "Space Grotesk", sans-serif;
}

.office-stat--large .office-stat__value {
  font-size: 2.5rem;
}

.office-stat--hero .office-stat__value {
  font-size: 2.2rem;
}

.office-route-card--fullscreen .office-stat__label {
  font-size: 0.7rem;
  margin-bottom: 6px;
}

.office-route-card--fullscreen .office-stat__value {
  line-height: 1.04;
}

.office-sensor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.office-sensor--alert {
  border-color: rgba(255, 143, 107, 0.35);
  background: rgba(255, 143, 107, 0.08);
}

.office-sensor__value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.65rem;
  line-height: 1;
}

.office-sensor--ticker {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

.office-cctv {
  display: block;
  position: relative;
  height: 100%;
}

.office-cctv__frame {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 0;
  background: #000;
}

.office-cctv__iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.office-cctv__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(4, 11, 16, 0.84), rgba(4, 11, 16, 0.94)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.04) 12px,
      transparent 12px,
      transparent 24px
    );
  color: var(--office-text);
}

.office-cctv__fallback[hidden] {
  display: none;
}

.office-cctv__fallback-icon {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--office-accent-alt);
}

.office-cctv__fallback-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.office-cctv__fallback-meta {
  font-size: 0.9rem;
  color: var(--office-muted);
}

.office-cctv__label,
.office-cctv .office-panel__subtitle {
  display: none;
}

.office-dashboard__footer-right {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(6, 19, 26, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.office-dashboard__loading {
  height: 100%;
  display: grid;
  place-items: center;
  gap: 14px;
  color: var(--office-muted);
}

.office-dashboard__spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--office-accent);
  animation: office-spin 0.9s linear infinite;
}

.office-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--office-muted);
  text-align: center;
  padding: 24px;
}

@keyframes office-spin {
  to { transform: rotate(360deg); }
}

@keyframes office-sensor-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 7px)); }
}

@media (max-width: 1280px) {
  .office-dashboard__title {
    font-size: 2rem;
  }

  .office-dashboard__clock {
    font-size: 2.4rem;
  }

  .office-dashboard__header {
    top: 20px;
    left: 20px;
    right: 20px;
  }

  .office-dashboard__footer {
    bottom: 16px;
    left: 20px;
    right: 20px;
  }

  .office-dashboard__screen-grid {
    padding: 20px;
  }

  .office-dashboard__screen-grid--cctv {
    padding: 0;
  }

  .office-sensor--ticker {
    width: 210px;
    min-width: 210px;
    max-width: 210px;
  }

  .office-route-summary--inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .office-route-card__stats--fullscreen {
    grid-template-columns: minmax(0, 1fr);
  }

  .office-dashboard__overlay-wrap {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .office-dashboard__overlay-wrap--left {
    width: min(560px, calc(100vw - 32px));
  }

  .office-hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .office-kpi__value {
    font-size: 3.4rem;
  }

  .office-stat--hero .office-stat__value {
    font-size: 1.9rem;
  }
}
