:root {
  --ink: #17211d;
  --muted: #69736f;
  --line: #dde3df;
  --surface: #ffffff;
  --canvas: #f4f6f4;
  --green: #0f6b4f;
  --green-soft: #e3f1eb;
  --red: #b53b35;
  --red-soft: #f8e8e6;
  --amber: #a56717;
  --blue: #2f5f98;
  --sidebar: #18221e;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; background: var(--sidebar); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { color: #a7b5ae; margin-top: 2px; font-size: 11px; }
.brand-mark { width: 31px; height: 31px; display: flex; align-items: end; gap: 3px; padding: 6px; background: #e8f3ed; border-radius: 6px; }
.brand-mark i { display: block; width: 5px; background: var(--green); border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 9px; }.brand-mark i:nth-child(2) { height: 17px; }.brand-mark i:nth-child(3) { height: 13px; }
nav { display: grid; gap: 5px; }
.nav-item { border: 0; background: transparent; color: #abb8b2; text-align: left; padding: 10px 12px; border-radius: 5px; }
.nav-item span { display: inline-block; width: 24px; }
.nav-item.active { background: #2a3832; color: #fff; }
.sidebar-footer { margin-top: auto; padding: 14px 8px 2px; border-top: 1px solid #33423b; display: flex; gap: 9px; align-items: center; }
.sidebar-footer strong, .sidebar-footer small { display: block; }.sidebar-footer strong { font-size: 12px; }.sidebar-footer small { color: #92a199; font-size: 10px; margin-top: 2px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6dd5a7; box-shadow: 0 0 0 3px rgba(109,213,167,.12); }
main { min-width: 0; }
.topbar { height: 86px; padding: 18px 28px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
h1, h2, h3, p { margin: 0; } h1 { font-size: 23px; line-height: 1.2; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.eyebrow { color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 700; margin-bottom: 5px; }
.platform-switch, .segments { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #f5f7f5; }
.platform-switch button, .segments button { border: 0; background: transparent; color: var(--muted); padding: 7px 13px; border-radius: 4px; }
.platform-switch button.active, .segments button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(24,34,30,.12); font-weight: 600; }
.platform-switch button:disabled { cursor: not-allowed; opacity: .45; }
.control-band { padding: 18px 28px; display: flex; gap: 18px; align-items: end; border-bottom: 1px solid var(--line); background: #fafbfa; }
.account-fields { display: flex; gap: 8px; }
label, .field-label { color: var(--muted); font-size: 11px; font-weight: 600; }
label input { display: block; }
input, select { height: 36px; border: 1px solid #cdd5d0; border-radius: 5px; background: #fff; color: var(--ink); padding: 0 10px; outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,107,79,.08); }
.account-fields input { width: 138px; margin-top: 6px; }
.date-block { min-width: 230px; }.date-range { display: flex; align-items: center; gap: 7px; margin-top: 6px; }.date-range input { width: 132px; }.date-range span { color: var(--muted); font-size: 11px; }
.compare-control { min-width: 274px; }.switch { height: 20px; display: flex; align-items: center; gap: 7px; cursor: pointer; }.switch input { display: none; }.switch span { position: relative; width: 29px; height: 16px; background: #c5cec9; border-radius: 10px; transition: .2s; }.switch span::after { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }.switch input:checked + span { background: var(--green); }.switch input:checked + span::after { transform: translateX(13px); }
.comparison { margin-top: 6px; }.hidden { display: none !important; }
.primary-button, .secondary-button, .insight-button { height: 36px; border-radius: 5px; padding: 0 14px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.primary-button { margin-left: auto; color: #fff; background: var(--green); }.primary-button:hover { background: #0b5a42; }.primary-button:disabled { opacity: .6; cursor: wait; }
.secondary-button { background: #fff; border-color: var(--line); color: var(--ink); }.insight-button { color: #fff; background: #243e68; }.secondary-button:disabled, .insight-button:disabled { opacity: .45; cursor: not-allowed; }
.summary-strip { padding: 18px 28px; display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; }
.metric-card { min-height: 92px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px; }.metric-card .label { color: var(--muted); font-size: 11px; }.metric-card .value { margin-top: 9px; font-size: 22px; font-weight: 700; }.metric-card .change { display: inline-block; margin-top: 7px; font-size: 11px; font-weight: 600; }.positive { color: var(--green); }.negative { color: var(--red); }.neutral { color: var(--muted); }
.workspace { margin: 0 28px 28px; background: #fff; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.workspace-header { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }.workspace-header p { color: var(--muted); margin-top: 4px; font-size: 11px; }.actions { display: flex; gap: 7px; }
.dimension-bar { min-height: 54px; padding: 9px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }.dimension-bar > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.segments button { padding: 6px 10px; font-size: 11px; }
.filter-bar { min-height: 48px; padding: 7px 18px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); background: #fafbfa; }.filter-bar:empty::before { content: "Filters appear after data is loaded"; color: #9aa39f; font-size: 11px; }.filter-bar select { height: 31px; max-width: 190px; font-size: 11px; }
.warning-list { padding: 0 18px; }.warning { margin: 10px 0; padding: 9px 11px; color: #795114; background: #fff6dd; border-left: 3px solid #d59b30; font-size: 11px; }
.table-wrap { position: relative; min-height: 320px; overflow: auto; max-height: calc(100vh - 410px); }
.pagination { min-height: 46px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }.pagination div { display: flex; gap: 5px; }.pagination button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); font-size: 18px; }.pagination button:disabled { opacity: .35; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; min-width: 990px; } th { position: sticky; top: 0; z-index: 2; padding: 10px 12px; background: #f2f5f3; color: #55615b; font-size: 10px; text-transform: uppercase; text-align: right; border-bottom: 1px solid var(--line); } th:first-child, th:nth-child(2), td:first-child, td:nth-child(2) { text-align: left; } td { height: 54px; padding: 8px 12px; text-align: right; border-bottom: 1px solid #edf0ee; font-variant-numeric: tabular-nums; } tbody tr:hover { background: #f8faf8; }
.entity strong, .entity small { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.entity strong { font-size: 12px; }.entity small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.metric-main { font-weight: 600; }.metric-compare { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }.delta { display: inline-block; min-width: 48px; margin-left: 5px; font-weight: 600; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; color: var(--muted); }.empty-state h3 { color: var(--ink); margin: 16px 0 6px; }.empty-state p { font-size: 12px; }.empty-chart { height: 46px; display: flex; gap: 5px; align-items: end; }.empty-chart i { width: 10px; background: #bbd2c7; border-radius: 2px 2px 0 0; }.empty-chart i:nth-child(1){height:15px}.empty-chart i:nth-child(2){height:28px}.empty-chart i:nth-child(3){height:21px}.empty-chart i:nth-child(4){height:42px;background:var(--green)}.empty-chart i:nth-child(5){height:34px}
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,24,20,.28); opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 9; }.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.insight-drawer { position: fixed; right: 0; top: 0; z-index: 10; width: min(440px, 100vw); height: 100vh; background: #fff; box-shadow: -14px 0 36px rgba(20,31,26,.18); transform: translateX(105%); transition: transform .24s ease; display: flex; flex-direction: column; }.insight-drawer.open { transform: translateX(0); }.insight-drawer header { height: 76px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 22px; }.insight-content { flex: 1; overflow: auto; padding: 18px; }.insight-section { padding: 14px 0; border-bottom: 1px solid var(--line); }.insight-section:first-child { padding-top: 0; }.insight-section h3 { margin-bottom: 7px; }.insight-section p { color: #4e5954; line-height: 1.55; font-size: 12px; }.ai-markdown { white-space: pre-wrap; color: #34413b; line-height: 1.55; font-size: 12px; }.chat-message { margin: 12px 0; padding: 11px; border-radius: 6px; background: #f2f6f3; line-height: 1.5; font-size: 12px; }.chat-message.user { margin-left: 40px; background: #e6eef8; }.chat-box { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 7px; }.chat-box input { flex: 1; }.chat-box button { width: 36px; height: 36px; border: 0; border-radius: 5px; background: var(--green); color: #fff; font-size: 17px; }
.insight-drawer header small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }.rich-response { color: #34413b; line-height: 1.55; font-size: 12px; }.rich-response h3 { margin: 13px 0 6px; color: var(--ink); font-size: 14px; }.rich-response h3:first-child { margin-top: 0; }.rich-response ul { margin: 6px 0; padding-left: 18px; }.rich-response li { margin: 4px 0; }.rich-response p { margin: 7px 0; }.chat-thinking { color: var(--muted); font-style: italic; }
.cache-note { margin-bottom: 12px; padding: 8px 10px; border-left: 3px solid var(--green); background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 20; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 5px; background: #17211d; color: #fff; font-size: 12px; transition: .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }.toast.error { background: #8d2f2b; }
.loading-row td { padding: 0; }.loading-bar { height: 3px; background: var(--green); animation: loading 1.2s infinite ease-in-out; transform-origin: left; } @keyframes loading { 0%{transform:scaleX(.05)} 50%{transform:scaleX(.75)} 100%{transform:scaleX(.05);transform-origin:right} }
@media (max-width: 1100px) { .control-band { flex-wrap: wrap; }.primary-button { margin-left: 0; }.summary-strip { grid-template-columns: repeat(3, 1fr); }.account-fields { width: 100%; }.table-wrap { max-height: none; } }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; }.sidebar { position: static; width: 100%; height: auto; padding: 12px; flex-direction: row; align-items: center; }.brand { padding: 0; }.brand small, .sidebar-footer, .nav-item span { display: none; } nav { margin-left: auto; display: flex; }.nav-item { padding: 8px; font-size: 11px; }.topbar { height: auto; padding: 15px; align-items: start; }.platform-switch button { padding: 6px 8px; font-size: 11px; }.control-band, .summary-strip { padding: 14px; }.control-band { display: grid; }.account-fields { display: grid; grid-template-columns: 1fr 1fr; }.account-fields input, .date-range input { width: 100%; }.date-range { display: grid; grid-template-columns: 1fr auto 1fr; }.summary-strip { grid-template-columns: repeat(2, 1fr); }.workspace { margin: 0 14px 14px; }.workspace-header { align-items: start; gap: 10px; }.dimension-bar { align-items: start; flex-direction: column; }.segments { width: 100%; overflow-x: auto; }.segments button { flex: 0 0 auto; }.filter-bar { overflow-x: auto; }.filter-bar select { flex: 0 0 auto; } }
