:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: #111214;
  --surface-2: #17181b;
  --surface-3: #1d1f23;
  --line: #292b30;
  --text: #f5f4f1;
  --muted: #929397;
  --orange: #ff6b32;
  --orange-soft: rgba(255, 107, 50, 0.13);
  --green: #6fd6a1;
  --red: #ff7b73;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 15%, #202125 0, var(--bg) 38%); }
.login-card { width: min(420px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 28px; background: rgba(17,18,20,.92); box-shadow: 0 32px 100px rgba(0,0,0,.42); }
.login-card h1 { margin: 13px 0 10px; font-size: 34px; letter-spacing: -.04em; }
.login-copy { margin: 0 0 30px; color: var(--muted); line-height: 1.55; }
.login-card label { display: block; margin-bottom: 8px; color: #cacacd; font-size: 13px; }
.login-card input { width: 100%; height: 52px; padding: 0 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 13px; outline: none; }
.login-card input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.login-card .button { width: 100%; margin-top: 14px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
.brand-mark { width: 54px; height: 54px; padding: 10px; display: grid; grid-template-columns: 12px 1fr; grid-template-rows: repeat(3, 1fr); gap: 4px 6px; border-radius: 15px; background: #030303; border: 1px solid #292929; }
.brand-mark span { grid-row: 1 / 4; border-radius: 7px; background: radial-gradient(circle at 50% 70%, #ddd 0 11%, #555 12% 22%, #111 23%); }
.brand-mark i { height: 2px; align-self: center; background: #7d7d7d; border-radius: 9px; }
.brand-mark--small { width: 38px; height: 38px; padding: 8px; border-radius: 10px; grid-template-columns: 8px 1fr; gap: 2px 4px; }
.eyebrow { margin: 0; color: var(--orange); font: 600 11px/1 var(--mono); letter-spacing: .18em; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 16px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #0c0d0e; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand b { font-size: 19px; letter-spacing: -.02em; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { width: 100%; padding: 12px 14px; color: var(--muted); text-align: left; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.is-active { color: var(--text); background: var(--surface-2); }
.nav-item.is-active::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 10px 1px 0; border-radius: 50%; background: var(--orange); }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(111,214,161,.09); }
.link-button { margin-left: auto; padding: 0; color: var(--muted); background: none; border: 0; cursor: pointer; }
.link-button:hover { color: var(--text); }
.workspace { min-width: 0; padding: 31px clamp(22px, 4vw, 58px) 72px; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.topbar h1 { margin: 8px 0 0; font-size: clamp(28px, 3vw, 39px); letter-spacing: -.045em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar select, .icon-button { height: 40px; color: #d9d9da; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.topbar select { padding: 0 34px 0 12px; }
.icon-button { width: 40px; cursor: pointer; font-size: 19px; }
.button { min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.button--primary { color: #fff; background: var(--orange); border-color: var(--orange); font-weight: 650; }
.button--quiet { background: var(--surface); }
.sync-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 12px var(--mono); }
.sync-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sync-status.is-loading i { background: var(--orange); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
.error-banner { margin-bottom: 20px; padding: 14px 16px; color: #ffd2ce; background: rgba(255,123,115,.1); border: 1px solid rgba(255,123,115,.24); border-radius: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.metric { min-height: 132px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 34px; font-weight: 550; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric em { color: var(--muted); font-size: 11px; font-style: normal; font-family: var(--mono); }
.section-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 18px; }
.panel { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.panel-head { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-sub { color: var(--muted); font-size: 12px; }
.chart { height: 230px; display: flex; align-items: flex-end; gap: 7px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.chart-column { height: 100%; min-width: 12px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.chart-bar { width: min(24px, 80%); min-height: 3px; background: linear-gradient(180deg, #ff8c60, var(--orange)); border-radius: 5px 5px 2px 2px; }
.chart-label { height: 15px; color: #696a6e; font: 9px var(--mono); white-space: nowrap; }
.breakdown { display: grid; gap: 14px; }
.breakdown-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr 38px; align-items: center; gap: 12px; font-size: 12px; }
.breakdown-row > span:first-child { overflow: hidden; color: #cfcfd1; text-overflow: ellipsis; white-space: nowrap; }
.track { height: 7px; overflow: hidden; background: var(--surface-3); border-radius: 10px; }
.track i { display: block; height: 100%; background: var(--orange); border-radius: inherit; }
.breakdown-row b { text-align: right; font: 12px var(--mono); }
.view-toolbar { margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.search-input { width: min(420px, 100%); height: 43px; padding: 0 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; outline: none; }
.search-input:focus { border-color: var(--orange); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.pill { display: inline-flex; padding: 4px 8px; color: #c9c9cb; background: var(--surface-3); border-radius: 999px; font: 10px var(--mono); white-space: nowrap; }
.pill--yes { color: var(--green); background: rgba(111,214,161,.1); }
.pill--orange { color: #ff946b; background: var(--orange-soft); }
.cell-meta { display: block; max-width: 250px; margin-top: 5px; overflow: hidden; color: var(--muted); font: 10px/1.25 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.match { display: inline-flex; color: var(--muted); font-size: 12px; }
.match--yes { color: var(--green); }
.answers { max-width: 430px; display: grid; gap: 7px; }
.answer { color: #d1d1d2; line-height: 1.45; }
.answer small { display: block; margin-bottom: 2px; color: var(--muted); }
.survey-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.survey-group { display: grid; gap: 16px; margin-bottom: 34px; }
.survey-group__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.survey-group__head .eyebrow { margin: 0 0 6px; }
.survey-group__head h2 { margin: 0; font-size: 22px; }
.survey-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.survey-card h2 { min-height: 40px; margin: 0 0 17px; font-size: 15px; line-height: 1.4; }
.survey-card .panel-sub { display: block; margin-bottom: 18px; }
.activity-list { display: grid; gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 16px; }
.activity-item { padding: 15px 17px; display: grid; grid-template-columns: 170px minmax(180px, 1fr) minmax(180px, 1.3fr) 180px; gap: 16px; background: var(--surface); align-items: center; }
.activity-event { color: #ff946b; font: 11px var(--mono); }
.empty { padding: 46px 20px; color: var(--muted); text-align: center; }
.operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: 1fr; }
  .sync-status { display: none; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding-bottom: 14px; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .workspace { padding: 24px 15px 60px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; overflow-x: auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 112px; padding: 16px; }
  .metric strong { font-size: 29px; }
  .activity-item { grid-template-columns: 1fr; gap: 7px; }
  .operations-grid { grid-template-columns: 1fr; }
}
