/* Innterpret product demo mockup */
:root {
  color-scheme: light dark;

  --ink: #0b1f2a;
  --ink-soft: #243b48;
  --fog: #e8f1f0;
  --paper: #f0f5f4;
  --surface: #ffffff;
  --surface-2: #f7fbfa;
  --teal: #157a6e;
  --teal-deep: #0e5a51;
  --teal-mist: #c5e4df;
  --amber: #c48a2a;
  --rose: #b54a4a;
  --line: rgba(11, 31, 42, 0.1);
  --muted: #5a6f7a;
  --sidebar-w: 15.5rem;
  --top-h: 3.75rem;
  --radius: 12px;
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --good: #1f7a4d;
  --warn: #9a6b12;
  --bad: #a33b3b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8f1f0;
    --ink-soft: #c5d4d8;
    --fog: #07151c;
    --paper: #08151c;
    --surface: #0f222c;
    --surface-2: #122833;
    --teal: #3db8a8;
    --teal-deep: #6fd4c6;
    --teal-mist: #14353a;
    --amber: #e0b35a;
    --rose: #e07a7a;
    --line: rgba(232, 241, 240, 0.1);
    --muted: #8aa0aa;
    --good: #5dca8f;
    --warn: #e0b35a;
    --bad: #e07a7a;
  }
}

:root[data-theme="dark"] {
  --ink: #e8f1f0;
  --ink-soft: #c5d4d8;
  --fog: #07151c;
  --paper: #08151c;
  --surface: #0f222c;
  --surface-2: #122833;
  --teal: #3db8a8;
  --teal-deep: #6fd4c6;
  --teal-mist: #14353a;
  --amber: #e0b35a;
  --rose: #e07a7a;
  --line: rgba(232, 241, 240, 0.1);
  --muted: #8aa0aa;
  --good: #5dca8f;
  --warn: #e0b35a;
  --bad: #e07a7a;
}

:root[data-theme="light"] {
  --ink: #0b1f2a;
  --ink-soft: #243b48;
  --fog: #e8f1f0;
  --paper: #f0f5f4;
  --surface: #ffffff;
  --surface-2: #f7fbfa;
  --teal: #157a6e;
  --teal-deep: #0e5a51;
  --teal-mist: #c5e4df;
  --amber: #c48a2a;
  --rose: #b54a4a;
  --line: rgba(11, 31, 42, 0.1);
  --muted: #5a6f7a;
  --good: #1f7a4d;
  --warn: #9a6b12;
  --bad: #a33b3b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.15rem 0.9rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  padding: 0.35rem 0.55rem;
}

.brand-mark {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 0.35rem;
  background: linear-gradient(145deg, var(--teal), var(--teal-deep));
}

.demo-pill {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 14%, transparent);
  padding: 0.28rem 0.45rem;
  border-radius: 0.4rem;
}

.nav-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.65rem;
  margin-bottom: 0.4rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.side-nav a,
.side-nav button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-radius: 0.65rem;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.side-nav a:hover,
.side-nav button:hover {
  background: var(--surface-2);
}

.side-nav a.is-active,
.side-nav button.is-active {
  background: color-mix(in srgb, var(--teal) 14%, var(--surface));
  color: var(--teal-deep);
  font-weight: 600;
}

.nav-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.sidebar-foot {
  margin-top: auto;
  padding: 0.75rem 0.55rem 0.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-foot a,
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.45rem;
  border-radius: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-foot a:hover,
.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.top-meta strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.content {
  padding: 1.35rem 1.5rem 2.5rem;
}

.panel {
  display: none;
  animation: fade-up 0.45s var(--ease);
}

.panel.is-active {
  display: block;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.metric {
  padding: 1rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-delta {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.metric-delta.up {
  color: var(--good);
}

.metric-delta.down {
  color: var(--bad);
}

.metric-delta.flat {
  color: var(--muted);
}

.layout-2 {
  display: grid;
  grid-template-columns: 2.2fr 0.7fr;
  gap: 1rem;
}

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.block-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.block-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-2);
}

tr:last-child td {
  border-bottom: none;
}

.property {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.property strong {
  font-weight: 600;
}

.property span {
  font-size: 0.8rem;
  color: var(--muted);
}

.bar {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 7.5rem;
}

.bar-track {
  flex: 1;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 12%, var(--surface-2));
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.status.ok {
  color: var(--good);
}

.status.watch {
  color: var(--warn);
}

.status.alert {
  color: var(--bad);
}

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.alert-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.alert-list li:last-child {
  border-bottom: none;
}

.alert-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.45rem;
  border-radius: 0.35rem;
  height: fit-content;
}

.alert-tag.ops {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  color: var(--warn);
}

.alert-tag.rev {
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  color: var(--teal-deep);
}

.alert-tag.sys {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.alert-list strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.alert-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.compare-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 0;
}

.compare-card h3 {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.compare-card .loc {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.stat-row span:first-child {
  color: var(--muted);
}

.stat-row strong {
  font-variant-numeric: tabular-nums;
}

.ops-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.ops-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 22rem;
}

.ops-col h2 {
  margin: 0;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.ops-item {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.ops-item:last-child {
  border-bottom: none;
}

.ops-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

.ops-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--teal) 45%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.banner a {
  font-weight: 600;
  color: var(--teal-deep);
}

.mobile-nav {
  display: none;
}

/* Property details */
.detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-bottom: 1.15rem;
  padding: 0.95rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(100%, 16rem);
}

.field span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field select {
  appearance: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6f7a' d='M1.1 1.2 6 6.1l4.9-4.9 1.1 1.1L6 8.2 0 2.3z'/%3E%3C/svg%3E")
    no-repeat right 0.85rem center / 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  min-height: 2.6rem;
}

.field select:focus {
  outline: 2px solid color-mix(in srgb, var(--teal) 45%, transparent);
  outline-offset: 1px;
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.detail-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.detail-header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-period {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-deep);
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--teal) 12%, transparent);
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.chart-wrap {
  padding: 0.75rem 0.85rem 1rem;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-svg .grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-svg .axis-label {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font-body);
}

.chart-svg .series-current {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-svg .series-y1 {
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 35%, var(--muted));
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.chart-svg .series-y2 {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.5;
  stroke-dasharray: 2 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.chart-svg .series-y3 {
  fill: none;
  stroke: var(--rose);
  stroke-width: 1.35;
  stroke-dasharray: 1 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.chart-legend i {
  display: inline-block;
  width: 1.1rem;
  height: 0.15rem;
  margin-right: 0.35rem;
  vertical-align: middle;
  border-radius: 1px;
}

.chart-legend .lg-current {
  background: var(--teal);
}

.chart-legend .lg-y1 {
  background: color-mix(in srgb, var(--ink) 35%, var(--muted));
}

.chart-legend .lg-y2 {
  background: var(--amber);
}

.chart-legend .lg-y3 {
  background: var(--rose);
}

.yoy-delta.up {
  color: var(--good);
  font-weight: 600;
}

.yoy-delta.down {
  color: var(--bad);
  font-weight: 600;
}

.yoy-delta.flat {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-2,
  .ops-board {
    grid-template-columns: 1fr;
  }

  .compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trend-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.75rem 1.5rem 0;
  }

  .mobile-nav button {
    flex: 0 0 auto;
    padding: 0.5rem 0.8rem;
    border-radius: 0.55rem;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 600;
  }

  .mobile-nav button.is-active {
    border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
    color: var(--teal-deep);
    background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }
}
