:root {
  --page: #f6f7f9;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --soft: #9ca3af;
  --brand: #126f65;
  --brand-soft: #e9f7f4;
  --ok: #16865f;
  --ok-bg: #eaf8f2;
  --warn: #a35f00;
  --warn-bg: #fff7e6;
  --danger: #c13535;
  --danger-bg: #fff0f0;
  --blue: #2563eb;
  --brown: #8a4b20;
  --violet: #6d44c5;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--page); color: var(--text); font-family: var(--font); }
button, input { font: inherit; }
a { color: inherit; }
.app-shell { min-height: 100vh; }

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .75fr);
  background: var(--surface);
}
.login-aside {
  padding: 72px;
  background: #f0f7f6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #dceae7;
}
.login-aside h2 { max-width: 560px; margin: 0; font-size: clamp(36px, 4.4vw, 64px); line-height: 1.05; letter-spacing: -.05em; }
.login-aside p { max-width: 520px; color: #4f6f6a; font-size: 17px; line-height: 1.7; }
.login-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; }
.login-point { padding: 14px; border: 1px solid #d6e7e3; border-radius: 12px; background: rgba(255,255,255,.62); }
.login-point strong { display: block; font-size: 13px; }
.login-point span { color: #66817c; font-size: 12px; }
.login-main { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(420px, 100%); animation: enter .4s ease both; }
.brand-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font-weight: 700; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.brand-title { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.brand-sub { margin: 10px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 7px; color: #374151; font-size: 13px; font-weight: 600; }
.field input { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 13px 14px; outline: none; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18,111,101,.12); }
.error-banner { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #f3b7b7; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.info-banner { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #bee6d7; border-radius: 10px; background: #f5fcf9; color: #147a4d; font-size: 13px; }
.otp-input { letter-spacing: .35em; font-size: 22px; font-weight: 700; text-align: center; font-family: var(--mono); }
.login-secondary { display: flex; gap: 8px; margin-top: 12px; }
.login-secondary .btn { flex: 1; }

.btn { border: 1px solid transparent; border-radius: 9px; padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { width: 100%; margin-top: 5px; padding: 13px 16px; background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0d5c54; }
.btn-accent { background: var(--brand); color: #fff; }
.btn-ghost { background: #fff; color: #374151; border-color: var(--border); }
.btn-ghost:hover { background: #f9fafb; }
.footer-note { margin-top: 18px; color: var(--soft); font-size: 12px; line-height: 1.5; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 26px; font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.side-section { padding: 11px 10px 7px; color: var(--soft); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-list { display: grid; gap: 4px; }
.nav-item { width: 100%; border: 0; border-radius: 9px; padding: 10px 11px; background: transparent; color: #4b5563; cursor: pointer; display: flex; align-items: center; gap: 10px; text-align: left; font-size: 13px; font-weight: 550; }
.nav-item:hover { background: #f6f7f9; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 6px; font-size: 10px; font-weight: 750; }
.nav-item.disabled { color: #b4bac3; cursor: default; }
.side-user { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--border); }
.side-user strong { display: block; font-size: 12px; }
.side-user span { color: var(--muted); font-size: 11px; }

.main { min-width: 0; }
.topbar { min-height: 72px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--text); }
.top-actions { display: flex; gap: 9px; }
.content { max-width: 1380px; margin: 0 auto; padding: 28px; animation: enter .35s ease both; }
.page-head { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.page-head h1 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.last-check { color: var(--soft); font-family: var(--mono); font-size: 11px; white-space: nowrap; }

.summary-grid { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.summary-card { min-height: 126px; animation: enter .4s ease both; }
.summary-card:nth-child(2) { animation-delay: .04s; }
.summary-card:nth-child(3) { animation-delay: .08s; }
.summary-card:nth-child(4) { animation-delay: .12s; }
.health-summary { display: flex; align-items: center; gap: 16px; }
.score-ring { --p: 0; width: 76px; height: 76px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ok) calc(var(--p) * 1%), #edf0f2 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.score-ring strong { position: relative; z-index: 1; font-size: 22px; }
.status-line { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.down { background: var(--danger); animation: pulse 1.2s infinite; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.metric-value { margin-top: 12px; font-size: 28px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric-foot { margin-top: 7px; color: var(--soft); font-size: 11px; }

.section { margin-top: 20px; }
.section-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.count-chip { padding: 5px 9px; border-radius: 999px; background: #f3f4f6; color: var(--muted); font-size: 11px; }

.journey { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 0; overflow-x: auto; }
.journey-step { min-width: 125px; padding: 16px 12px; background: #fff; border: 1px solid var(--border); border-right: 0; position: relative; }
.journey-step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.journey-step:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.journey-step span { display: block; color: var(--soft); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.journey-step strong { display: block; margin: 7px 0 10px; font-size: 12px; }
.journey-state { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.feature-card { padding: 0; overflow: hidden; }
.feature-top { padding: 16px 17px 14px; border-bottom: 1px solid var(--border); }
.feature-accent { width: 30px; height: 4px; border-radius: 4px; margin-bottom: 13px; background: var(--brand); }
.feature-card.travel .feature-accent { background: var(--blue); }
.feature-card.homes .feature-accent { background: var(--brown); }
.feature-card.rides .feature-accent { background: var(--ok); }
.feature-card.marketplace .feature-accent { background: var(--violet); }
.feature-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.feature-title h3 { margin: 0; font-size: 14px; }
.feature-body { padding: 14px 17px 16px; }
.feature-stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f1f2; font-size: 12px; }
.feature-stat:last-child { border-bottom: 0; }
.feature-stat span { color: var(--muted); }
.feature-stat strong { font-family: var(--mono); font-size: 11px; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 12px; }
.table-card { padding: 0; overflow: hidden; }
.table-head { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
table.checks { width: 100%; border-collapse: collapse; font-size: 12px; }
table.checks th { padding: 10px 14px; background: var(--surface-subtle); border-bottom: 1px solid var(--border); color: var(--muted); text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
table.checks td { padding: 13px 14px; border-bottom: 1px solid #f0f1f2; vertical-align: middle; }
table.checks tr:last-child td { border-bottom: 0; }
.endpoint-name { font-weight: 600; color: #273142; }
.endpoint-sub { max-width: 330px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); font-family: var(--mono); font-size: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.badge.up { background: var(--ok-bg); color: var(--ok); }
.badge.down { background: var(--danger-bg); color: var(--danger); }
.badge.empty { background: var(--warn-bg); color: var(--warn); }
.mono { font-family: var(--mono); font-size: 11px; }
.muted { color: var(--muted); }

.insights { display: grid; gap: 10px; }
.insight { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.insight strong { display: block; margin-bottom: 5px; font-size: 12px; }
.insight p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.insight.good { border-color: #bee6d7; background: #f5fcf9; }
.insight.warn { border-color: #f1d7a5; background: #fffaf0; }
.insight.bad { border-color: #efc0c0; background: #fff7f7; }

.grade { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 700; font-size: 12px; border: 1px solid transparent; }
.grade-a { background: #eafaf2; color: #147a4d; border-color: #bee6d7; }
.grade-b { background: #f2f9ea; color: #4f7a14; border-color: #d4e6be; }
.grade-c { background: #fff7e6; color: #9a6b0a; border-color: #f1d7a5; }
.grade-f { background: #fdefef; color: #b3261e; border-color: #efc0c0; }

.check-row { cursor: pointer; }
.check-row:hover td { background: #fafbfc; }
.check-row.open td { background: #f7f9fa; border-bottom-color: transparent; }
.check-row .caret { width: 22px; color: var(--soft); font-size: 11px; }
.detail-row td { background: #f7f9fa; padding: 0 14px 16px; }
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 18px; padding: 14px 8px 4px; border-top: 1px dashed var(--border); }
.detail-title { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); font-weight: 700; margin-bottom: 8px; }
.detail-list { margin: 0 0 12px; padding-left: 17px; font-size: 12px; line-height: 1.7; }
.detail-list.bad-list li { color: #a13a34; }
.detail-list.good-list li { color: #1d7a52; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #eef1f3; font-size: 12px; }
.kv span { color: var(--muted); white-space: nowrap; }
.kv strong { font-weight: 600; text-align: right; }

.waterfall-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.waterfall-bar i { display: block; height: 100%; }
.waterfall-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.waterfall-legend span { display: inline-flex; align-items: center; gap: 5px; }
.waterfall-legend i { width: 9px; height: 9px; border-radius: 3px; }
.wf-0 { background: #7aa7d9; }
.wf-1 { background: #86c7b1; }
.wf-2 { background: #c9b1e3; }
.wf-3 { background: #f0b667; }
.wf-4 { background: #9fb2bd; }

.metrics-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.metric-pill { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.metric-pill span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.metric-pill strong { font-size: 18px; letter-spacing: -.02em; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart-card { padding: 16px 16px 12px; min-height: 220px; animation: enter .45s ease both; }
.chart-wide { grid-column: 1 / -1; min-height: 190px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.chart-head h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.chart-head span { color: var(--soft); font-size: 11px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #eef1f3; stroke-width: 1; }
.chart-axis { fill: var(--soft); font-size: 9.5px; font-family: var(--mono); }
.chart-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { stroke: none; }
.chart-dot { stroke: #fff; stroke-width: 1.5; }

.chart-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; font-size: 11px; color: #3f4a54; border: 1px solid transparent; line-height: 1.4; animation: enter .35s ease both; }
.chip strong { font-family: var(--mono); font-size: 10.5px; font-weight: 700; }
.chip-idx { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 9.5px; font-weight: 700; font-style: normal; font-family: var(--mono); color: inherit; }
.chip-0 { background: #eaf3fd; border-color: #d3e4f8; color: #23538f; }
.chip-1 { background: #eafaf2; border-color: #cdeeda; color: #146a48; }
.chip-2 { background: #f4eefc; border-color: #e3d5f5; color: #5c3d99; }
.chip-3 { background: #fff5e8; border-color: #f6e2c4; color: #8a5a12; }
.chip-4 { background: #fdeff3; border-color: #f6d6de; color: #9c3d58; }
.chip-5 { background: #e9f7f7; border-color: #cfeaea; color: #17696b; }
.chart-empty { display: grid; place-items: center; min-height: 120px; color: var(--muted); font-size: 12px; text-align: center; padding: 20px; }

.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; min-height: 150px; }
.donut-center { font-size: 22px; font-weight: 700; fill: var(--text); }
.donut-sub { font-size: 10px; fill: var(--soft); }
.donut-legend { display: grid; gap: 8px; }
.donut-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.donut-item i { width: 10px; height: 10px; border-radius: 3px; }
.donut-item span { color: var(--muted); }
.donut-item strong { font-family: var(--mono); }

.loading-veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(255,255,255,.72); }
.spinner { width: 34px; height: 34px; border: 3px solid #dfe4e7; border-top-color: var(--brand); border-radius: 50%; animation: spin .75s linear infinite; }
.empty-state { padding: 30px; color: var(--muted); text-align: center; font-size: 13px; }

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .lower-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
  .metrics-kpis { grid-template-columns: 1fr 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 760px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { min-height: 100vh; padding: 24px; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-brand, .side-section, .side-user { display: none; }
  .nav-list { grid-template-columns: repeat(4, minmax(90px, 1fr)); overflow-x: auto; }
  .nav-item { justify-content: center; white-space: nowrap; }
  .nav-item.disabled { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 14px 40px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .summary-grid, .feature-grid, .metrics-kpis { grid-template-columns: 1fr; }
}
