:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --navy: #071a52;
  --blue: #1746d1;
  --blue-soft: #edf3ff;
  --ink: #172033;
  --muted: #687386;
  --line: #e2e7ef;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --green: #138a5b;
  --red: #c43e3e;
  --shadow: 0 8px 28px rgba(26, 43, 79, .07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font-sans); }
button, input, select, textarea, optgroup, option { font: inherit; }
button { cursor: pointer; }
.topbar { color: white; background: linear-gradient(115deg, #06133f, #092d83); border-bottom: 3px solid #2f68ff; }
.topbar-inner, main { width: min(1380px, calc(100% - 40px)); margin: auto; }
.topbar-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand, .user-area, .panel-heading, .welcome { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand > div:last-child { min-width: 0; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: white; color: var(--blue); font-weight: 900; font-size: 22px; }
.brand-refresh { flex: 0 0 42px; padding: 0; border: 0; box-shadow: none; line-height: 1; -webkit-tap-highlight-color: transparent; }
.brand-refresh:hover { background: #eef4ff; }
.brand-refresh:active { transform: scale(.96); }
.brand-refresh:focus-visible { outline: 3px solid #8fb0ff; outline-offset: 3px; }
h1 { margin: 1px 0 0; font-size: 20px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: #aebfe9; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.blue { color: var(--blue); }
.esb-freshness-bar { border-top: 1px solid rgba(255,255,255,.12); background: rgba(3, 15, 54, .42); }
.esb-freshness-inner { width: min(1380px, calc(100% - 40px)); margin: auto; padding: 7px 0 8px; }
.esb-freshness { display: block; margin: 0; color: #dbe5fb; font-size: 11px; font-weight: 750; line-height: 1.3; white-space: nowrap; }
.esb-freshness.is-current::before { content: "●"; margin-right: 5px; color: #55d79b; }
.esb-freshness.is-unavailable { color: #ffd6a1; }
.user-area { gap: 10px; font-size: 13px; }
.user-area div { display: grid; }
.user-area small { color: #b9c7e8; margin-top: 2px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #55d79b; box-shadow: 0 0 0 4px rgba(85, 215, 155, .14); }
.outline { border: 1px solid rgba(255,255,255,.35); color: white; background: transparent; border-radius: 8px; padding: 8px 12px; margin-left: 8px; }
.outline.dark { color: var(--blue); border-color: #b9c9f1; }
main { padding: 30px 0 60px; }
.welcome { justify-content: space-between; margin-bottom: 22px; }
.welcome h2 { margin: 4px 0; font-size: 28px; letter-spacing: -.03em; }
.welcome p:not(.eyebrow) { margin: 0; color: var(--muted); }
.period-pill, .badge { border: 1px solid #d7e1f7; background: #fff; color: #52627b; border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.period-pill span { color: var(--green); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.filters { display: grid; grid-template-columns: repeat(5, 1fr) auto; align-items: end; gap: 12px; padding: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 11px; font-weight: 750; color: #526079; }
select, input[type="date"] { width: 100%; padding: 10px 11px; border: 1px solid #ccd5e2; border-radius: 8px; color: var(--ink); background: white; }
.primary, .file-button { border: 0; border-radius: 8px; padding: 11px 18px; color: white; background: linear-gradient(135deg, #1646cf, #0b2f96); font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 14px 0 18px; }
.kpi { min-height: 116px; padding: 18px; display: flex; align-items: center; gap: 13px; }
.kpi-icon { flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 900; }
.kpi-icon.grand { color: #7c3aed; background: #f2edff; }
.kpi-icon.bills { color: #b66b00; background: #fff5df; }
.kpi-icon.traffic { color: #00848d; background: #e4f8f7; }
.kpi-icon.basket { color: #b52b57; background: #ffedf3; }
.kpi div { min-width: 0; display: grid; }
.kpi small { color: var(--muted); font-weight: 650; }
.kpi strong { margin: 4px 0 3px; font-size: clamp(18px, 1.55vw, 24px); letter-spacing: -.04em; white-space: nowrap; }
.kpi em { color: var(--green); font-size: 11px; font-style: normal; }
.kpi em span { display: block; line-height: 1.35; }
.kpi em .run-rate { font-weight: 800; }
.kpi em.negative { color: var(--red); }
.owner-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.owner-card { min-height: 170px; padding: 18px; }
.owner-card .panel-heading { margin-bottom: 10px; }
.target-card > strong { display: block; margin: 6px 0 10px; font-size: 21px; letter-spacing: -.03em; }
.target-card p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.target-run-rate { margin: -4px 0 10px; color: var(--green); font-size: 12px; font-weight: 850; }
.target-run-rate.negative { color: var(--red); }
.branch-run-rates { display: grid; gap: 0; margin-top: 14px; max-height: 224px; overflow-y: auto; padding: 0 8px 2px 0; scrollbar-gutter: stable; }
.branch-run-rates div { min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.branch-run-rates div:last-child { border-bottom: 0; }
.branch-run-rates span { min-width: 0; color: var(--muted); font-size: 11px; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
.branch-run-rates strong { min-width: max-content; display: grid; justify-items: end; gap: 2px; color: var(--green); font-size: 12px; line-height: 1.2; text-align: right; }
.branch-run-rates strong em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 750; white-space: nowrap; }
.branch-run-rates .negative strong { color: var(--red); }
.action-list { display: grid; gap: 8px; max-height: 178px; overflow-y: auto; padding-right: 4px; }
.action-item { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.action-item > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.action-item strong { min-width: 0; color: var(--ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-item b { color: var(--green); font-size: 12px; }
.action-item b.negative { color: var(--red); }
.action-item span { color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.3; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e8edf6; }
.progress-track span { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #1646cf, #16a085); transition: width .25s ease; }
.compact-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.compact-list li { border-left: 3px solid #e0a11b; border-radius: 7px; color: #3d465a; background: #fff9e9; font-size: 12px; line-height: 1.35; overflow: hidden; }
.alert-action { width: 100%; display: grid; gap: 7px; padding: 10px 11px; border: 0; color: inherit; background: transparent; text-align: left; font: inherit; line-height: inherit; cursor: pointer; }
.alert-action:hover, .alert-action:focus-visible { background: #fff4d4; outline: 0; }
.alert-action:focus-visible { box-shadow: inset 0 0 0 2px #d69a18; }
.alert-action small { color: #a06a00; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.alert-action:disabled { cursor: wait; }
.ranking-list { display: grid; gap: 8px; }
.ranking-list div { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ranking-list span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ranking-list strong { color: var(--ink); font-size: 12px; }
.ranking-list em { color: var(--blue); font-size: 11px; font-style: normal; font-weight: 850; }
.calendar-list { display: grid; gap: 7px; }
.calendar-toolbar { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 6px; }
.calendar-toolbar strong { color: var(--ink); font-size: 12px; text-align: center; }
.calendar-toolbar button { width: 28px; height: 28px; border: 1px solid #d7e1f7; border-radius: 7px; color: var(--blue); background: white; font-size: 20px; line-height: 1; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.calendar-weekdays span { color: var(--muted); font-size: 8px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; aspect-ratio: 1; min-width: 0; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; color: #46536a; background: #f7f9fc; font-size: 10px; }
.calendar-day:hover { border-color: #b9c9f1; background: var(--blue-soft); }
.calendar-day.outside { background: transparent; }
.calendar-day.today { border-color: var(--blue); color: var(--blue); font-weight: 900; }
.calendar-day.selected { color: white; background: var(--blue); font-weight: 900; }
.calendar-day i { position: absolute; right: 2px; bottom: 2px; min-width: 11px; height: 11px; display: grid; place-items: center; border-radius: 999px; color: white; background: #e0a11b; font-size: 7px; font-style: normal; font-weight: 900; }
.calendar-day.selected i { color: #8a5800; background: #ffe6a6; }
.calendar-detail { min-height: 57px; padding-top: 7px; border-top: 1px solid var(--line); }
.calendar-detail > strong { color: var(--blue); font-size: 10px; }
.calendar-detail > div { max-height: 68px; overflow-y: auto; margin-top: 4px; }
.calendar-detail article { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.calendar-detail article b { min-width: 0; overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-detail article span, .calendar-detail article em, .calendar-detail p { color: var(--muted); font-size: 8px; font-style: normal; }
.calendar-detail article em { grid-column: 1 / -1; font-weight: 800; text-transform: uppercase; }
.calendar-detail p { margin: 6px 0 0; }
.bar-target-marker { stroke: #d93535; stroke-width: 2; stroke-dasharray: 5 4; }
.bar-target-label { fill: #b32626 !important; font-size: 9px !important; font-weight: 900; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.pie-slice { cursor: pointer; stroke: #fff; stroke-width: 2; }
.planning-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.planning-card { padding: 20px; }
.suggestion-list { display: grid; gap: 10px; margin-top: 14px; }
.suggestion-item { display: grid; gap: 9px; padding: 12px; border: 1px solid #d7e1f7; border-radius: 10px; background: #f8fbff; }
.suggestion-item > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.suggestion-item strong { color: var(--ink); font-size: 13px; }
.suggestion-item span { color: var(--muted); font-size: 11px; }
.suggestion-item dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.suggestion-item dt { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.suggestion-item dd { margin: 2px 0 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.target-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.target-option-grid section { display: grid; gap: 7px; padding: 10px; border: 1px solid #dfe7f5; border-radius: 8px; background: white; }
.target-option-grid b { color: var(--blue); font-size: 12px; }
.target-option-grid small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid #d7deea; }
.tab { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 11px 16px; font-weight: 700; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.page { display: none; }
.page.active { display: block; }
.target-results-panel { padding: 20px; margin-bottom: 14px; }
.target-results-table td:first-child { text-align: left; }
.target-results-table td:first-child strong, .target-results-table td:first-child small { display: block; }
.target-results-table td:first-child small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.target-results-table .positive { color: var(--green); font-weight: 800; }
.target-results-table .negative { color: var(--red); font-weight: 800; }
.target-results-table .neutral { color: #8a5a00; font-weight: 800; }
.result-status { display: inline-block; padding: 4px 7px; border-radius: 999px; background: #fff8e8; font-size: 10px; font-weight: 850; }
.result-status.positive { background: #dff7ec; }
.result-status.negative { background: #fee7e7; }
.monthly-report-button { min-width: 112px; border: 1px solid #9fb5de; border-radius: 7px; padding: 7px 10px; background: #fff; color: var(--blue); font-size: 10px; font-weight: 800; }
.monthly-report-button.ready { border-color: #1746c2; background: #edf3ff; }
.report-pending { display: inline-block; max-width: 110px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.monthly-report-dialog { width: min(980px, calc(100% - 28px)); max-height: calc(100vh - 32px); }
.monthly-report-dialog form { display: grid; gap: 13px; }
.monthly-report-provider { margin: -4px 0 0; color: var(--muted); font-size: 11px; }
.monthly-report-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.monthly-report-metrics div { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fd; }
.monthly-report-metrics span, .monthly-report-metrics strong { display: block; }
.monthly-report-metrics span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.monthly-report-metrics strong { margin-top: 5px; font-size: 13px; }
.monthly-report-body { max-height: min(58vh, 600px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.monthly-report-body h3, .monthly-report-body h4, .monthly-report-body h5 { color: var(--navy); }
.monthly-report-actions { justify-content: flex-end; }
@media (max-width: 680px) {
  .monthly-report-metrics { grid-template-columns: 1fr 1fr; }
  .monthly-report-actions > button { flex: 1 1 100%; }
}
.content-grid { display: grid; grid-template-columns: 1.72fr .8fr; gap: 14px; margin-bottom: 14px; }
.content-grid.equal { grid-template-columns: 1fr 1fr; }
.assistant-panel { grid-column: 1 / -1; display: grid; gap: 14px; padding: 20px; background: linear-gradient(180deg, #fff 0%, #f5f8ff 100%); }
.assistant-workspace { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 16px; align-items: stretch; }
.assistant-tools { display: grid; align-content: space-between; gap: 16px; min-width: 0; }
.assistant-panel .assistant-answer { min-height: 190px; max-height: 420px; }
.trend-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.compact-select { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.compact-select select { min-width: 142px; height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
.period-context { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.non-sales-panel { margin-bottom: 14px; padding: 20px; }
.operating-heading-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.operating-expand-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 11px; }
.operating-expand-button span:first-child { font-size: 17px; line-height: 1; }
.non-sales-panel.expanded { position: fixed; inset: 12px; z-index: 1200; margin: 0; overflow: auto; background: #fff; box-shadow: 0 24px 80px rgba(7, 24, 61, .32); }
.non-sales-panel.expanded .non-sales-table-wrap { max-height: min(46vh, 520px); }
body.operating-expanded { overflow: hidden; }
.non-sales-controls { display: flex; gap: 6px; }
.non-sales-controls .seg { min-height: 36px; padding: 7px 13px; border: 1px solid #cbd8ea; border-radius: 7px; background: #fff; color: var(--blue); font-weight: 800; }
.non-sales-controls .seg.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.non-sales-range { display: flex; justify-content: flex-end; align-items: flex-end; gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); background: #f7faff; }
.non-sales-range.hidden { display: none; }
.non-sales-range label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.non-sales-range input { min-height: 38px; border: 1px solid #cbd8ea; border-radius: 7px; padding: 0 10px; }
.non-sales-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); margin: 14px 0; }
.non-sales-summary div { display: grid; gap: 5px; padding: 13px 15px; border-right: 1px solid var(--line); }
.non-sales-summary div:last-child { border-right: 0; }
.non-sales-summary span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.non-sales-summary strong { font-size: 17px; }
.non-sales-table-wrap { max-height: 310px; overflow: auto; border: 1px solid var(--line); }
.non-sales-table-wrap table { min-width: 780px; }
.non-sales-table-wrap thead { position: sticky; top: 0; z-index: 1; background: #f4f7fb; }
.operating-branch { vertical-align: top; }
.operating-branch strong, .operating-branch small { display: block; }
.operating-branch small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.operating-stack { display: grid; gap: 0; min-width: 0; }
.operating-stack-item, .mapping-tooltip { min-height: 38px; display: flex; align-items: center; border-bottom: 1px solid #e3eaf4; }
.metric-stack { text-align: right; font-variant-numeric: tabular-nums; }
.metric-stack .operating-stack-item { justify-content: flex-end; white-space: nowrap; }
.operating-stack-total { min-height: 34px; display: flex; align-items: center; justify-content: flex-end; padding-top: 7px; color: var(--ink); font-weight: 850; white-space: nowrap; }
.mapping-category-list .operating-stack-total { justify-content: flex-start; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.mapping-tooltip { position: relative; display: block; max-width: 100%; }
.mapping-tooltip summary { list-style: none; }
.mapping-tooltip summary::-webkit-details-marker { display: none; }
.mapping-label { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; padding: 5px 9px; border: 0; border-radius: 5px; background: #f7faff; color: var(--ink); font-weight: 800; cursor: pointer; }
.mapping-label small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.mapping-tooltip-panel { position: absolute; left: 0; top: calc(100% + 5px); z-index: 40; display: none; width: min(430px, calc(100vw - 48px)); max-height: min(280px, calc(100vh - 48px)); padding: 12px; border: 1px solid #b9c9e2; border-radius: 7px; background: #fff; color: var(--ink); box-shadow: 0 18px 45px rgba(10, 27, 67, .24); overflow: auto; }
.mapping-tooltip[open] .mapping-tooltip-panel { display: block; }
.mapping-tooltip-panel strong { display: block; margin-bottom: 8px; }
.mapping-detail-list { display: grid; gap: 6px; }
.mapping-detail-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 8px; border: 1px solid var(--line); background: #f7faff; }
.mapping-detail-row > span:last-child { text-align: right; }
.mapping-detail-row b, .mapping-detail-row small { display: block; }
.mapping-detail-row b { font-size: 11px; overflow-wrap: anywhere; }
.mapping-detail-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.mapping-empty { color: var(--muted); font-size: 10px; }
.operating-ai-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.operating-ai-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.operating-ai-heading h4 { margin: 3px 0 2px; font-size: 15px; }
.operating-ai-heading small { color: var(--muted); font-size: 10px; }
.operating-ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.operating-ai-grid article { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 10px; align-items: start; min-height: 72px; padding: 12px; border: 1px solid #d4e0f2; border-left: 3px solid var(--blue); background: #f7faff; }
.operating-ai-grid article > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #e8efff; color: var(--blue); font-size: 10px; font-weight: 900; }
.operating-ai-grid article p { margin: 1px 0 0; color: var(--ink); font-size: 11px; line-height: 1.5; }
.run-rate-as-of { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 700; }
.chart-panel, .insights, .page > .panel { padding: 20px; }
.panel-heading { justify-content: space-between; gap: 16px; margin-bottom: 15px; }
h3 { margin: 3px 0 0; font-size: 16px; }
.legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.legend i:nth-child(2) { background: #aebbd4; margin-left: 6px; }
.chart-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.seg { border: 1px solid #ccd5e2; border-radius: 7px; padding: 6px 10px; color: #526079; background: white; font-size: 11px; font-weight: 800; }
.seg.active { color: white; border-color: #1646cf; background: #1646cf; }
.badge { color: #8a5a00; background: #fff8e8; border-color: #f4dfad; }
.chart { min-height: 286px; position: relative; }
.chart.large { min-height: 350px; }
.chart svg { width: 100%; height: 286px; display: block; overflow: visible; }
.chart.large svg { height: 350px; }
.chart text { fill: #748096; font-size: 11px; }
.gridline { stroke: #e8ecf3; stroke-width: 1; }
.latest-line { fill: none; stroke: var(--blue); stroke-width: 3; }
.previous-line { fill: none; stroke: #aebbd4; stroke-width: 2; stroke-dasharray: 5 5; }
.target-line { fill: none; stroke: #d93535; stroke-width: 2.4; stroke-dasharray: 7 5; }
.target-label { fill: #b32626 !important; font-size: 10px !important; font-weight: 900; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.series-line { fill: none; stroke-width: 2.5; }
.series-line.average { stroke: #9aa8bf; stroke-width: 2; stroke-dasharray: 6 5; }
.point { fill: white; stroke: var(--blue); stroke-width: 3; }
.previous-point { fill: white; stroke: #aebbd4; stroke-width: 2; }
.series-point { fill: white; stroke-width: 2.5; }
.point-label { fill: #10214c !important; font-size: 10px !important; font-weight: 800; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.point-label.previous { fill: #7e8ba2 !important; }
.series-label { font-size: 10px !important; font-weight: 800; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.series-value-label { font-size: 9px !important; font-weight: 800; paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.hit-point { fill: transparent; stroke: transparent; cursor: pointer; pointer-events: all; }
.chart-tooltip { position: absolute; z-index: 5; width: 206px; padding: 10px 11px; color: white; background: #10214c; border-radius: 8px; box-shadow: 0 14px 32px rgba(16,33,76,.24); font-size: 11px; pointer-events: none; }
.chart-tooltip strong, .chart-tooltip > span { display: block; }
.chart-tooltip strong { font-size: 13px; margin-bottom: 3px; }
.chart-tooltip span { color: #c7d4f4; margin-bottom: 6px; }
.tooltip-details { display: grid; gap: 5px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.18); }
.tooltip-details div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tooltip-details span { margin: 0; color: #aebfe9; font-size: 9px; }
.tooltip-details b { color: white; font-size: 10px; text-align: right; }
.badge.ai { color: #0d6f4a; border-color: #b8e3d1; background: #eefaf5; }
.badge.fallback { color: #8a5b00; border-color: #f1d394; background: #fff9e9; }
.bar { fill: #2c57d5; rx: 5; }
.bar.alt { fill: #7d9bea; }
.hit-bar { fill: transparent; stroke: transparent; cursor: pointer; pointer-events: all; }
.line-toggles { max-width: 520px; }
.line-toggles .seg { border-left-width: 5px; }
.insights ul { margin: 4px 0 18px; padding: 0; list-style: none; }
.insights li { padding: 12px 0 12px 25px; border-bottom: 1px solid var(--line); position: relative; font-size: 13px; line-height: 1.45; }
.insights li::before { content: "↗"; position: absolute; left: 0; top: 12px; color: var(--blue); font-weight: 900; }
.coming-soon { display: grid; gap: 4px; padding: 13px; border-radius: 10px; color: #465676; background: var(--blue-soft); font-size: 12px; }
.coming-soon strong { color: var(--blue); }
.assistant-box { display: grid; gap: 13px; padding: 16px; border: 1px solid #cddcf7; border-radius: 8px; background: linear-gradient(180deg, #f4f8ff 0%, #eaf2ff 100%); box-shadow: 0 10px 24px rgba(20, 58, 135, .08); }
.assistant-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assistant-head div { display: grid; gap: 2px; }
.assistant-head strong { color: #123fb6; font-size: 15px; }
.assistant-head span:not(.badge) { color: #61718d; font-size: 11px; }
.ai-badge { padding: 5px 8px; font-size: 10px; }
.quick-prompts { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-prompts button { min-height: 34px; border: 1px solid #bfd0f3; border-radius: 6px; padding: 7px 10px; color: #1746d1; background: rgba(255,255,255,.9); font-size: 11px; font-weight: 800; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.quick-prompts button:hover { border-color: #1746d1; background: white; transform: translateY(-1px); }
.assistant-answer { min-height: 150px; max-height: 360px; overflow: auto; padding: 18px; border: 1px solid #cbd9ef; border-radius: 7px; color: #26354f; background: white; font-size: 12px; line-height: 1.58; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); scrollbar-width: thin; scrollbar-color: #9baccc #eef3fa; }
.assistant-answer h3, .assistant-answer h4, .assistant-answer h5 { margin: 18px 0 8px; color: #132b55; line-height: 1.25; }
.assistant-answer h3:first-child, .assistant-answer h4:first-child, .assistant-answer h5:first-child { margin-top: 0; }
.assistant-answer h3 { font-size: 16px; }
.assistant-answer h4 { font-size: 14px; }
.assistant-answer h5 { font-size: 13px; }
.assistant-answer p { margin: 0 0 10px; }
.assistant-answer p:last-child { margin-bottom: 0; }
.assistant-answer ul, .assistant-answer ol { display: grid; gap: 6px; margin: 6px 0 14px; padding-left: 20px; }
.assistant-answer li::marker { color: var(--blue); font-weight: 800; }
.assistant-answer strong { color: #112b5a; }
.assistant-answer code { padding: 2px 5px; border-radius: 4px; color: #173d9b; background: #edf3ff; font-size: 11px; }
.assistant-table-wrap { margin: 10px 0 16px; overflow-x: auto; border: 1px solid #d7e0ed; border-radius: 6px; }
.assistant-answer table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 11px; }
.assistant-answer th, .assistant-answer td { padding: 9px 10px; border-bottom: 1px solid #e2e8f1; text-align: left; white-space: normal; }
.assistant-answer th { color: #425574; background: #f4f7fb; font-size: 10px; text-transform: uppercase; }
.assistant-answer tbody tr:last-child td { border-bottom: 0; }
.assistant-answer.error { color: var(--red); border-color: #f3bbbb; background: #fff7f7; }
.target-opinion { margin-top: 10px; }
.assistant-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.assistant-input textarea { width: 100%; resize: vertical; min-height: 48px; max-height: 140px; padding: 11px 12px; border: 1px solid #bdcce3; border-radius: 7px; color: var(--ink); background: white; line-height: 1.4; }
.assistant-input textarea:focus { outline: 2px solid rgba(28, 77, 211, .18); border-color: var(--blue); }
.assistant-input .primary { min-width: 72px; padding-inline: 16px; border-radius: 7px; }
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); background: #f7f9fc; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; }
.upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.upload-card { min-height: 250px; padding: 26px; display: flex; flex-direction: column; align-items: flex-start; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); border-radius: 13px; font-weight: 900; }
.upload-card h3 { margin-top: 20px; }
.upload-card p { max-width: 480px; color: var(--muted); line-height: 1.5; }
.file-button { display: inline-block; margin-top: auto; cursor: pointer; }
.file-button input { display: none; }
.file-status { margin-top: 10px; color: var(--muted); }
.file-status.error { color: var(--red); }
.upload-preview { width: 100%; margin: 16px 0; padding: 14px; border: 1px solid #c9d8f6; border-radius: 10px; background: var(--blue-soft); }
.upload-preview dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.upload-preview dl div { display: grid; gap: 2px; }
.upload-preview dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.upload-preview dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 750; }
.validation-success { margin: 12px 0 0 !important; color: var(--green) !important; font-size: 12px; }
.upload-card .primary { margin-top: 2px; }
.upload-card .primary:disabled { cursor: wait; opacity: .65; }
.import-history-card { align-items: stretch; }
.import-history { width: 100%; display: grid; gap: 8px; margin-top: 8px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.import-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.import-item > div { display: grid; gap: 3px; min-width: 0; }
.import-item > div:last-child { justify-items: end; white-space: nowrap; }
.import-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.import-item span, .empty-state { color: var(--muted); }
.import-item b { padding: 3px 7px; border-radius: 999px; font-size: 9px; text-transform: uppercase; }
.status-completed { color: #08734a; background: #dff7ec; }
.status-processing { color: #795713; background: #fff3cf; }
.status-failed { color: var(--red); background: #fee7e7; }
.status-rolled_back { color: #526079; background: #eef2f7; }
.coverage-summary { width: 100%; display: grid; gap: 12px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.coverage-group { display: grid; gap: 6px; }
.coverage-group h4 { margin: 0; font-size: 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; }
.coverage-group p { margin: 0; color: var(--muted); font-size: 12px; }
.month-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.month-chip { display: inline-grid; gap: 1px; padding: 6px 9px; border: 1px solid #c9d7f2; border-radius: 8px; background: white; color: var(--ink); font-size: 12px; font-weight: 850; }
.month-chip em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 750; }
.empty-state { padding: 24px 0; text-align: center; font-size: 12px; }
.notice { margin-top: 14px; padding: 14px 16px; border: 1px solid #f0d89d; color: #795713; background: #fff9e9; border-radius: 10px; font-size: 13px; }
.staff-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: 14px; margin-bottom: 14px; }
.staff-card { padding: 20px; }
.staff-history-wrap { max-height: 360px; overflow-y: auto; }
.staff-form { display: grid; gap: 12px; }
.staff-form .primary { margin-top: 4px; }
.form-status { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-status.error { color: var(--red); }
.inline-select { min-width: 120px; padding: 7px 9px; font-size: 12px; }
.access-status { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.access-status.active { color: #08734a; background: #dff7ec; }
.access-status.inactive { color: #795713; background: #fff3cf; }
td strong, td small { display: block; }
td small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.link-button { border: 0; padding: 4px 6px; color: var(--blue); background: transparent; font-size: 11px; font-weight: 800; }
.link-button.danger { color: var(--red); }
.access-picker { display: grid; gap: 9px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.access-picker legend { padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.access-picker label, .app-access-controls label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.app-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.app-badge { display: inline-flex; padding: 4px 7px; border-radius: 6px; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.app-badge.finance { color: #1648c8; background: #e9f0ff; }
.app-badge.payments { color: #087469; background: #ddf7f2; }
.app-access-controls { display: grid; gap: 5px; min-width: 96px; text-align: left; }
.chooser-screen { min-height: 100vh; padding: 42px 24px; background: #f4f7fc; }
.chooser-inner { width: min(1040px, 100%); margin: 0 auto; }
.chooser-heading { display: flex; align-items: center; justify-content: space-between; }
.chooser-heading .brand { color: var(--ink); }
.chooser-copy { margin: 86px 0 28px; }
.chooser-copy h2 { margin: 8px 0; font-size: 42px; }
.chooser-copy > p:last-child { color: var(--muted); font-size: 17px; }
.app-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.app-choice { min-height: 190px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 28px; border: 1px solid #d6deeb; border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 12px 34px rgba(18, 42, 86, .06); text-align: left; }
.app-choice:hover { border-color: #7e9ee8; transform: translateY(-2px); box-shadow: 0 16px 42px rgba(18, 42, 86, .1); }
.app-choice-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 8px; font-size: 18px; font-weight: 900; }
.app-choice-icon.finance { color: var(--blue); background: var(--blue-soft); }
.app-choice-icon.payments { color: #087469; background: #ddf7f2; }
.app-choice span:nth-child(2) { display: grid; gap: 8px; }
.app-choice strong { font-size: 18px; }
.app-choice small { max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.app-choice b { color: var(--blue); font-size: 12px; }
.payments-shell { width: min(100% - 48px, 1380px); margin: 0 auto; padding: 38px 0 70px; }
.payments-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.payments-welcome h2 { margin: 8px 0; font-size: 34px; }
.payments-welcome p:not(.eyebrow) { margin: 0; color: var(--muted); }
.payment-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.payment-kpi { min-height: 126px; display: grid; align-content: center; gap: 7px; padding: 20px; }
.payment-kpi small { color: var(--muted); font-size: 12px; font-weight: 800; }
.payment-kpi strong { font-size: 28px; }
.payment-kpi span { color: #087469; font-size: 13px; font-weight: 800; }
.payment-tabs { margin-bottom: 18px; }
.payment-page { display: none; }
.payment-page.active { display: block; }
.payment-panel { padding: 22px; }
.payment-filter-row { display: flex; justify-content: flex-end; margin: -2px 0 12px; }
.payment-filter-row select { width: auto; min-width: 180px; }
.payment-two-column { display: grid; grid-template-columns: .72fr 1.28fr; gap: 14px; }
.payment-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #526079; background: #eef2f7; font-size: 9px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.status-manager_review, .status-finance_review, .status-owner_review { color: #80570a; background: #fff2ca; }
.status-approved, .status-scheduled { color: #0b5fba; background: #e5f2ff; }
.status-paid { color: #08734a; background: #dff7ec; }
.status-returned, .status-rejected { color: var(--red); background: #fee7e7; }
.payment-dialog { width: min(880px, calc(100% - 30px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(3, 15, 45, .3); }
.payment-dialog::backdrop { background: rgba(4, 15, 42, .6); backdrop-filter: blur(2px); }
.payment-dialog form { padding: 26px; overflow-y: auto; }
.compact-dialog { width: min(560px, calc(100% - 30px)); }
.insight-action-dialog form { max-height: calc(100vh - 32px); }
.alert-action-summary { margin: 0 0 12px; padding: 12px 14px; border-left: 3px solid #e0a11b; border-radius: 6px; color: #3d465a; background: #fff9e9; font-size: 12px; line-height: 1.5; }
.alert-action-provider { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.insight-action-dialog .assistant-answer { min-height: 220px; max-height: min(420px, 48vh); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 6px 0 0; }
.icon-close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: #f0f3f8; font-size: 24px; line-height: 1; }
.request-type-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; padding: 4px; border-radius: 8px; background: #edf1f7; }
.request-type-switch button { padding: 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-weight: 800; }
.request-type-switch button.active { color: var(--blue); background: white; box-shadow: 0 2px 7px rgba(20, 44, 90, .1); }
.dialog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.field small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.review-actions { justify-content: space-between; }
.danger-outline { border-color: #efb6b6 !important; color: var(--red) !important; }
.toast { position: fixed; right: 22px; bottom: 22px; transform: translateY(90px); opacity: 0; padding: 13px 16px; color: white; background: #16254c; border-radius: 9px; box-shadow: 0 12px 40px rgba(0,0,0,.18); transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.hidden { display: none !important; }
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .82fr) 1.18fr; background: white; }
.auth-card { width: min(440px, calc(100% - 48px)); margin: auto; padding: 42px 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: white; background: var(--navy); border-radius: 14px; padding: 13px 16px; }
.auth-copy { margin: 62px 0 26px; }
.auth-copy h2 { margin: 8px 0; font-size: 34px; letter-spacing: -.04em; }
.auth-copy p:not(.eyebrow), .auth-message { color: var(--muted); line-height: 1.5; }
.google-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 16px; border: 1px solid #cbd5e1; border-radius: 9px; color: var(--ink); background: white; font-weight: 750; box-shadow: 0 2px 5px rgba(15,23,42,.05); }
.google-button:hover { background: #f8fafc; }
.google-mark { color: #174ea6; font-size: 18px; font-weight: 900; }
.auth-message { margin: 14px 0; text-align: center; font-size: 12px; }
.auth-message.error { color: var(--red); }
.demo-access { margin-top: 30px; padding: 14px; border: 1px dashed #b8c7e5; border-radius: 10px; background: var(--blue-soft); }
.demo-access > div:first-child { display: grid; gap: 3px; color: var(--blue); font-size: 12px; font-weight: 800; }
.demo-access small { color: var(--muted); font-weight: 500; }
.demo-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.demo-buttons button { border: 1px solid #b9c9ef; border-radius: 7px; color: var(--blue); background: white; padding: 8px; font-size: 12px; font-weight: 750; }
.auth-aside { display: flex; flex-direction: column; justify-content: center; padding: 10%; color: white; background: radial-gradient(circle at 90% 10%, #2459db, transparent 28%), linear-gradient(145deg, #07153f, #0a2f87); }
.auth-aside > div { max-width: 620px; }
.auth-aside h2 { margin: 14px 0 18px; max-width: 570px; font-size: clamp(36px, 4vw, 62px); line-height: 1.02; letter-spacing: -.05em; }
.auth-aside p:not(.eyebrow) { max-width: 540px; color: #c4d0ed; font-size: 17px; line-height: 1.6; }
.auth-aside ul { display: grid; gap: 18px; margin: 55px 0 0; padding: 0; list-style: none; }
.auth-aside li { display: grid; gap: 4px; padding-left: 20px; border-left: 2px solid #4f7ff1; }
.auth-aside li span { color: #b7c5e7; font-size: 13px; }

.network-banner { position: sticky; top: 0; z-index: 1000; padding: 9px 16px; color: #6b4300; background: #fff4d4; border-bottom: 1px solid #edcf76; text-align: center; font-size: 13px; }
.network-banner button { min-height: 36px; margin-left: 10px; padding: 6px 14px; border: 1px solid #b87500; border-radius: 6px; color: #6b4300; background: #fff; font-weight: 750; }
.privacy-curtain { position: fixed; inset: 0; z-index: 9999; display: none; place-content: center; justify-items: center; gap: 14px; color: #fff; background: #071b55; }
.privacy-curtain.active { display: grid; }
.privacy-curtain .brand-mark { width: 68px; height: 68px; color: #1647cb; background: #fff; font-size: 34px; }
.capacitor-native body { padding-top: env(safe-area-inset-top); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); }
.capacitor-native .topbar { top: env(safe-area-inset-top); }
.capacitor-native button, .capacitor-native a, .capacitor-native input, .capacitor-native select { min-height: 44px; }
.capacitor-native input[type="file"] { max-width: 100%; }
.keyboard-open .payment-dialog, .keyboard-open dialog { max-height: 72dvh; }

@media (max-width: 1050px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-grid { grid-template-columns: repeat(2, 1fr); }
  .owner-grid, .planning-grid { grid-template-columns: 1fr 1fr; }
  .content-grid, .content-grid.equal { grid-template-columns: 1fr; }
  .assistant-panel { grid-column: auto; }
  .assistant-workspace { grid-template-columns: 1fr; }
  .trend-heading { align-items: flex-start; }
  .trend-actions { width: 100%; justify-content: space-between; }
  .non-sales-summary { grid-template-columns: 1fr 1fr; }
  .non-sales-summary div:nth-child(even) { border-right: 0; }
  .non-sales-summary div:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .non-sales-summary div:last-child { grid-column: 1 / -1; border-right: 0; }
  .payment-kpis { grid-template-columns: repeat(2, 1fr); }
  .app-choice-grid, .payment-two-column { grid-template-columns: 1fr; }
}

.heading-actions { display: flex; align-items: center; gap: 8px; }
.icon-action { width: 38px; height: 38px; border: 1px solid #cbd8ef; background: #fff; color: #1647cb; font-size: 24px; line-height: 1; cursor: pointer; border-radius: 6px; }
.icon-action:hover { background: #eef4ff; }
.health-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.health-kpi { padding: 20px; display: grid; gap: 6px; }
.health-kpi span, .health-kpi small { color: #66748d; }
.health-kpi strong { color: #0d1b3a; font-size: 28px; }
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.health-grid > .panel { padding: 24px; min-height: 420px; }
.health-list { max-height: 430px; overflow: auto; border-top: 1px solid #dce4f2; }
.health-row { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 16px 4px; border-bottom: 1px solid #e2e8f2; }
.health-row strong { display: block; color: #14213d; text-transform: capitalize; }
.health-row p { margin: 4px 0; color: #485a78; }
.health-row small { color: #71809a; }
.health-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: #12a085; }
.health-row.medium .health-dot { background: #e5a10a; }
.health-row.high .health-dot { background: #dc3d3d; }
.health-ok, .health-warning { padding: 22px 4px; color: #087f68; }
.health-warning { color: #b36b00; }
.alert-tracking-fields { margin-top: 18px; padding: 16px; border: 1px solid #d5e0f2; border-radius: 6px; }
.alert-tracking-fields legend { padding: 0 6px; color: #1647cb; font-weight: 700; }
.alert-tracking-fields label { display: grid; gap: 6px; color: #455571; font-weight: 600; }
.alert-tracking-fields select, .alert-tracking-fields textarea { width: 100%; border: 1px solid #bdcbe2; padding: 10px; background: #fff; color: #14213d; }
.form-grid.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 800px) {
  .health-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-grid, .form-grid.two-column { grid-template-columns: 1fr; }
  .health-grid > .panel { min-height: 0; }
}
@media (max-width: 680px), (hover: none) and (pointer: coarse) and (max-width: 1100px) {
  body { overflow-x: hidden; }
  .topbar-inner, main { width: min(100% - 20px, 1380px); }
  .topbar-inner { min-height: 62px; gap: 10px; padding: 9px 0; }
  .brand { min-width: 0; gap: 9px; }
  .brand-mark { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; font-size: 18px; }
  .brand h1 { max-width: 160px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .brand .eyebrow { font-size: 8px; letter-spacing: .12em; }
  .esb-freshness-inner { width: min(100% - 20px, 1380px); padding: 6px 0 7px; }
  .esb-freshness { max-width: none; overflow: visible; font-size: 10px; text-overflow: clip; white-space: normal; }
  .user-area { flex: 0 0 auto; gap: 4px; }
  .user-area .outline { min-height: 36px; margin-left: 2px; padding: 7px 9px; font-size: 11px; }
  .user-area > div, .status-dot { display: none; }
  main { padding: 18px 0 42px; }
  .welcome { align-items: flex-start; gap: 15px; flex-direction: column; }
  .welcome { margin-bottom: 14px; }
  .welcome h2 { font-size: 23px; }
  .welcome p:not(.eyebrow) { font-size: 13px; line-height: 1.45; }
  .period-pill { width: 100%; padding: 8px 10px; text-align: center; }
  .filters, .owner-grid, .planning-grid, .upload-grid, .staff-grid { grid-template-columns: 1fr; }
  .filters { gap: 10px; padding: 13px; }
  .filters .primary { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 10px 0 12px; }
  .kpi { min-height: 104px; align-items: flex-start; gap: 8px; padding: 12px 10px; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; font-size: 10px; }
  .kpi small { font-size: 10px; }
  .kpi strong { margin-top: 3px; font-size: 16px; }
  .kpi em { font-size: 9px; }
  .owner-grid { gap: 10px; margin-bottom: 12px; }
  .owner-card { min-height: 0; padding: 15px; }
  .owner-card .compact-list, .owner-card .action-list, .owner-card .ranking-list { max-height: 240px; overflow-y: auto; padding-right: 3px; }
  .target-option-grid { grid-template-columns: 1fr; }
  .tabs { gap: 0; margin: 0 -10px 12px; padding: 0 10px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; min-height: 44px; padding: 10px 13px; white-space: nowrap; scroll-snap-align: start; }
  .target-results-panel, .chart-panel, .insights, .page > .panel, .planning-card, .staff-card { padding: 15px; }
  .assistant-panel { padding: 15px; }
  .panel-heading { align-items: flex-start; gap: 10px; margin-bottom: 12px; }
  .panel-heading h3 { margin-top: 3px; font-size: 16px; line-height: 1.25; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .chart { min-height: 250px; }
  .chart.large { min-height: 300px; }
  .legend { gap: 6px; font-size: 10px; }
  .page .table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
  .planning-grid { gap: 10px; margin-bottom: 10px; }
  .planning-grid > *, .page, .page > *, .health-grid > * { min-width: 0; }
  .planning-card .staff-form { gap: 10px; }
  .upload-card { min-height: 0; padding: 18px; }
  .upload-card h3 { margin-top: 13px; }
  .upload-card p { font-size: 12px; }
  .health-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; }
  .health-kpi { min-height: 112px; align-content: center; padding: 14px; }
  .health-kpi span { font-size: 11px; }
  .health-kpi strong { font-size: 22px; }
  .health-kpi small { font-size: 10px; }
  .health-grid { gap: 10px; }
  .health-grid > .panel { padding: 15px; }
  .health-list { max-height: 360px; }
  .health-row { gap: 9px; padding: 12px 2px; }
  .health-row strong { font-size: 12px; }
  .health-row p, .health-row small { font-size: 10px; line-height: 1.4; }
  .staff-directory-table th:nth-child(3), .staff-directory-table td:nth-child(3),
  .staff-directory-table th:nth-child(5), .staff-directory-table td:nth-child(5),
  .staff-directory-table th:nth-child(6), .staff-directory-table td:nth-child(6),
  .staff-access-table th:nth-child(4), .staff-access-table td:nth-child(4) { display: none; }
  .staff-card table { font-size: 11px; }
  .staff-card th, .staff-card td { padding: 10px 8px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card { width: min(440px, calc(100% - 32px)); }
  .chooser-screen { padding: 24px 16px; }
  .chooser-copy { margin-top: 56px; }
  .chooser-copy h2 { font-size: 32px; }
  .app-choice { grid-template-columns: auto 1fr; min-height: 150px; padding: 20px; }
  .app-choice b { display: none; }
  .payments-shell { width: min(100% - 24px, 1380px); padding-top: 24px; }
  .payments-welcome { align-items: flex-start; flex-direction: column; }
  .payment-kpis, .dialog-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .payment-dialog form { padding: 20px; }
  dialog, .modal, .payment-dialog { width: min(100% - 16px, 760px); max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); margin: auto; }
  dialog::backdrop { background: rgba(7, 20, 54, .58); }
  input, select, textarea { font-size: 16px; }
  .table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .non-sales-panel { padding: 15px; }
  .non-sales-panel .panel-heading { align-items: flex-start; gap: 12px; }
  .operating-heading-actions { width: 100%; justify-content: stretch; }
  .operating-heading-actions .compact-select { width: 100%; }
  .operating-heading-actions select { width: 100%; }
  .non-sales-controls { width: 100%; }
  .non-sales-controls .seg { flex: 1; }
  .operating-expand-button { width: 100%; }
  .non-sales-range { align-items: stretch; flex-direction: column; }
  .non-sales-range label, .non-sales-range input, .non-sales-range button { width: 100%; }
  .non-sales-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .non-sales-summary div { border-bottom: 1px solid var(--line); }
  .non-sales-summary div:nth-child(2n) { border-right: 0; }
  .operating-ai-grid { grid-template-columns: 1fr; }
  .non-sales-panel.expanded { inset: 6px; padding: 14px; }
  .chart svg, .chart canvas { touch-action: pan-y; }
}

@media (max-width: 390px) {
  .brand h1 { max-width: 128px; font-size: 14px; }
  .user-area .outline { padding-inline: 7px; }
  .kpi { padding-inline: 9px; }
  .kpi-icon { display: none; }
  .health-kpi { min-height: 104px; padding: 12px; }
}

.menu-performance-panel { margin-top: 20px; }
.menu-performance-controls { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.menu-performance-switches { display: flex; gap: 6px; }
.menu-performance-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--line); }
.menu-performance-summary div { display: grid; gap: 6px; padding: 16px; border-right: 1px solid var(--line); }
.menu-performance-summary div:last-child { border-right: 0; }
.menu-performance-summary span { color: #63718a; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.menu-performance-summary strong { color: #14213d; font-size: 21px; }
.menu-performance-layout { margin-top: 18px; }
.menu-performance-chart { display: grid; align-content: start; gap: 12px; min-height: 260px; max-height: 390px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; }
.menu-performance-bar { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(90px, 2fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.menu-performance-bar-meta { display: grid; gap: 3px; min-width: 0; }
.menu-performance-bar-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-performance-bar-meta small { color: #71809b; }
.menu-performance-bar-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e8eef9; }
.menu-performance-bar-track i { display: block; height: 100%; border-radius: inherit; background: #1f4fd5; }
.menu-performance-bar b { font-size: 12px; white-space: nowrap; }
.menu-performance-table-wrap { max-height: 390px; }

@media (max-width: 680px) {
  .menu-performance-controls { width: 100%; justify-content: stretch; }
  .menu-performance-controls .compact-select, .menu-performance-controls select { width: 100%; }
  .menu-performance-switches { width: 100%; }
  .menu-performance-switches .seg { flex: 1; }
  .menu-performance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-performance-summary div { border-bottom: 1px solid var(--line); }
  .menu-performance-summary div:nth-child(2n) { border-right: 0; }
  .menu-performance-bar { grid-template-columns: minmax(100px, 1fr) minmax(70px, 1fr) auto; font-size: 11px; }
}
