:root {
  --navy: #0b1f33;
  --navy-2: #12324d;
  --ink: #152536;
  --muted: #6d7d8d;
  --line: #dfe7ed;
  --surface: #ffffff;
  --canvas: #f4f7f9;
  --teal: #1f9d96;
  --teal-light: #dff5f1;
  --gold: #d7aa4a;
  --gold-light: #fff6df;
  --red: #cc5e59;
  --red-light: #fff0ee;
  --purple: #756bc5;
  --shadow: 0 18px 45px rgba(14, 36, 54, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { display: block; color: var(--teal); font-size: 0.68rem; letter-spacing: 0.15em; font-weight: 800; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.55fr); background: linear-gradient(135deg, #fbfcfd 0%, #eef5f5 100%); }
.login-panel { width: min(560px, calc(100% - 56px)); margin: auto; padding: 42px; background: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.9); border-radius: 28px; box-shadow: var(--shadow); }
.brand-lockup, .sidebar-brand { display: flex; gap: 14px; align-items: center; }
.brand-mark { width: 58px; height: 58px; object-fit: contain; border-radius: 16px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.65rem, 3vw, 2.45rem); letter-spacing: -0.04em; line-height: 1.05; }
.login-lead { margin: 35px 0 28px; max-width: 430px; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.login-form { display: grid; gap: 16px; }
.login-form label, .compact-field { display: grid; gap: 7px; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,157,150,0.13); }
.button { border: 0; border-radius: 10px; padding: 12px 16px; font-weight: 800; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--navy); box-shadow: 0 10px 22px rgba(11,31,51,0.16); }
.button.secondary { color: var(--navy); background: var(--teal-light); }
.button.ghost { color: var(--navy); background: transparent; border: 1px solid var(--line); }
.form-error { min-height: 18px; margin: 0; color: var(--red); font-size: 0.8rem; }
.login-note { margin: 24px 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.login-rail { display: grid; align-content: center; gap: 18px; padding: 48px; background: var(--navy); color: white; }
.rail-card { display: grid; grid-template-columns: 42px 1fr; gap: 5px 14px; max-width: 360px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.13); }
.rail-card span:last-child { grid-column: 2; color: #afc4d3; font-size: 0.88rem; line-height: 1.5; }
.rail-number { color: var(--gold); font-weight: 800; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 24px 16px; background: var(--navy); color: white; }
.sidebar-mark { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; background: white; }
.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand .eyebrow { color: #90d9d1; }
.sidebar-context { display: grid; gap: 4px; margin: 38px 8px 25px; color: #d7e4ec; font-size: 0.78rem; }
.context-label { color: #7892a7; font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; }
.online-dot { color: #a9e6cb; font-size: 0.7rem; }
.online-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #61d6a2; vertical-align: middle; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px; padding: 12px 10px; text-align: left; color: #a9bfd0; background: transparent; font-size: 0.84rem; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,0.1); }
.nav-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(255,255,255,0.16); border-radius: 6px; color: var(--gold); font-size: 0.68rem; font-weight: 900; }
.sidebar-footer { display: grid; gap: 5px; margin: auto 8px 4px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.12); color: #a9bfd0; font-size: 0.72rem; line-height: 1.5; }
.sidebar-footer strong { color: white; font-size: 0.78rem; }
.main-content { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 34px 21px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.84); }
.topbar h2 { margin: 2px 0 0; font-size: 1.7rem; letter-spacing: -0.035em; }
.topbar-actions { display: flex; align-items: end; gap: 11px; }
.compact-field { min-width: 120px; }
.compact-field select { padding: 8px 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; margin-left: 8px; padding-left: 13px; border-left: 1px solid var(--line); }
.user-chip strong, .user-chip span:last-of-type { display: block; }
.user-chip strong { font-size: 0.78rem; white-space: nowrap; }
.user-chip span:last-of-type { color: var(--muted); font-size: 0.68rem; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: white; background: var(--teal); font-size: 0.67rem; font-weight: 900; }
.icon-button { border: 0; color: var(--muted); background: transparent; font-weight: 900; }
.content-area { padding: 30px 34px 50px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h3 { margin: 0 0 4px; font-size: 1.12rem; letter-spacing: -0.02em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 0.78rem; }
.section-actions { display: flex; gap: 8px; }
.cards-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; }
.metric-card { position: relative; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 20px rgba(14,36,54,0.03); text-align: left; }
button.metric-card { width: 100%; border: 1px solid var(--line); cursor: pointer; }
.metric-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-card .metric-label { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.metric-card .metric-value { display: block; margin: 9px 0 6px; overflow: hidden; color: var(--navy); font-size: 1.2rem; font-weight: 850; letter-spacing: -0.035em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card .metric-foot { display: block; color: var(--muted); font-size: 0.68rem; }
.metric-card::before { content: ""; position: absolute; top: 0; left: 17px; right: 17px; height: 3px; border-radius: 0 0 4px 4px; background: var(--teal); }
.metric-card.green::before { background: var(--teal); }.metric-card.gold::before { background: var(--gold); }.metric-card.red::before { background: var(--red); }.metric-card.purple::before { background: var(--purple); }.metric-card.teal::before { background: #42b8c9; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr); gap: 18px; margin-top: 22px; }
.workflow-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 18px 0 22px; }
.workflow-card { display: grid; gap: 7px; min-height: 145px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); text-align: left; box-shadow: 0 7px 20px rgba(14,36,54,0.03); }
.workflow-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.workflow-card strong { color: var(--navy); font-size: 1.35rem; letter-spacing: -0.04em; }
.workflow-label { color: var(--teal); font-size: 0.72rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.05em; }
.workflow-card span:not(.workflow-label):not(.workflow-link) { min-height: 34px; color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.workflow-link { color: var(--navy); font-size: 0.68rem; font-weight: 850; }
.notice-panel { margin-bottom: 18px; padding: 15px 17px; border: 1px solid #cce8e4; border-left: 4px solid var(--teal); border-radius: 12px; color: var(--navy); background: var(--teal-light); font-size: 0.78rem; line-height: 1.5; }
.notice-panel p { margin: 5px 0 12px; color: #486878; }
.inline-details { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; gap: 18px; }
.inline-details > div { display: grid; gap: 4px; padding: 0; border-bottom: 0; }
.inline-details span:last-child { text-align: left; }
.journal-card { margin-bottom: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); }
.panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 7px 20px rgba(14,36,54,0.03); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 19px; }
.panel-heading h3 { margin: 0 0 4px; font-size: 0.95rem; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 0.72rem; }
.insight-panel { color: white; background: linear-gradient(145deg, var(--navy-2), var(--navy)); }
.insight-panel .panel-heading h3 { color: white; }.insight-panel .panel-heading p { color: #a9bfd0; }
.agent-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #a9e6cb; background: rgba(97,214,162,0.1); font-size: 0.63rem; font-weight: 800; }
.insight-block { display: grid; gap: 12px; }
.insight-block > div { padding-left: 12px; border-left: 2px solid var(--gold); }
.insight-block .label { display: block; margin-bottom: 3px; color: #89a6b8; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; }
.insight-block p { margin: 0; color: #e3edf2; font-size: 0.79rem; line-height: 1.5; }
.chart { display: grid; gap: 12px; }
.chart-row { display: grid; grid-template-columns: 54px minmax(0,1fr) 92px; align-items: center; gap: 10px; font-size: 0.72rem; }
.chart-label { color: var(--muted); font-weight: 800; }.bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: #eef2f5; }.bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #72cfc5); }.bar.profit { background: linear-gradient(90deg, var(--gold), #f2d68b); }.chart-value { color: var(--ink); text-align: right; font-weight: 800; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
th { padding: 11px 13px; color: var(--muted); background: #f8fafb; text-align: left; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.62rem; white-space: nowrap; }
td { padding: 12px 13px; border-top: 1px solid var(--line); vertical-align: top; }
td.amount, th.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: #f7fbfb; }
.account-cell strong { display: block; color: var(--ink); }.account-cell span { color: var(--muted); font-size: 0.68rem; }
.pill { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; font-size: 0.63rem; font-weight: 850; text-transform: capitalize; }.pill.met { color: #167d64; background: #e2f5ee; }.pill.not_met { color: #aa4a43; background: #fff0ee; }.pill.partially_met { color: #8b671b; background: #fff6df; }.pill.reported { color: #476c86; background: #eaf3f8; }.pill.source-approved, .pill.posted-demo, .pill.completed { color: #167d64; background: #e2f5ee; }
.muted { color: var(--muted); }.small { font-size: 0.72rem; }.source-link { color: var(--teal); font-weight: 750; }
.report-grid { display: grid; gap: 18px; }.report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }.report-summary > div { padding: 15px; border-radius: 11px; background: var(--canvas); }.report-summary span { display: block; color: var(--muted); font-size: 0.68rem; }.report-summary strong { display: block; margin-top: 5px; color: var(--navy); font-size: 1.05rem; }
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }.agent-card { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }.agent-card h3 { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }.agent-card p { margin: 0; min-height: 52px; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }.agent-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.66rem; }
.quick-actions { display: grid; gap: 9px; }.compact-button { padding: 7px 10px; font-size: 0.68rem; }.automation-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }.automation-strip > div { display: grid; gap: 6px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); }.automation-strip strong { font-size: 0.72rem; }.automation-strip small { color: var(--muted); font-size: 0.65rem; }.automation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }.automation-card { display: grid; gap: 11px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }.automation-card .panel-heading { margin-bottom: 0; }.automation-card h3 { margin: 3px 0 0; font-size: 0.9rem; }.automation-card p { margin: 0; min-height: 38px; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }.automation-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.66rem; }.automation-result { padding: 10px; border-radius: 9px; background: var(--canvas); }.automation-result strong { display: block; margin-bottom: 5px; font-size: 0.7rem; }.automation-result pre { max-height: 130px; overflow: auto; margin: 0; color: var(--ink); white-space: pre-wrap; font-size: 0.65rem; }.operation-form { display: grid; gap: 13px; }.operation-form label { display: grid; gap: 6px; color: var(--muted); font-size: 0.72rem; font-weight: 750; }.operation-form textarea { min-height: 92px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; }.journal-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); }.ai-recommendation { display: grid; gap: 7px; padding: 13px; border-left: 3px solid var(--purple); border-radius: 9px; background: #f6f4ff; }.ai-recommendation strong { font-size: 0.76rem; }.ai-recommendation p { margin: 0; color: var(--ink); font-size: 0.74rem; line-height: 1.5; }.ai-recommendation small { color: var(--muted); font-size: 0.65rem; }
.detail-drawer { position: fixed; z-index: 20; top: 0; right: -620px; width: min(600px, 100%); height: 100vh; overflow-y: auto; padding: 28px; background: white; box-shadow: -20px 0 60px rgba(11,31,51,0.2); transition: right 0.25s ease; }.detail-drawer.open { right: 0; }.drawer-backdrop { position: fixed; z-index: 19; inset: 0; background: rgba(11,31,51,0.42); }.drawer-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 25px; }.drawer-header h2 { margin: 3px 0 0; font-size: 1.3rem; }.close-drawer { border: 0; color: var(--muted); background: transparent; font-size: 1.25rem; }.trace-path { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 23px; }.trace-step { padding: 7px 9px; border-radius: 8px; color: var(--navy); background: var(--teal-light); font-size: 0.67rem; font-weight: 800; }.trace-step:not(:last-child)::after { content: " ->"; margin-left: 7px; color: var(--teal); }.drawer-section { margin-top: 24px; }.drawer-section h3 { margin-bottom: 10px; font-size: 0.82rem; }.detail-list { display: grid; gap: 8px; }.detail-list > div { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 0.74rem; }.detail-list span:first-child { color: var(--muted); }.detail-list span:last-child { text-align: right; font-weight: 750; }
.toast { position: fixed; z-index: 40; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 15px; border-radius: 10px; color: white; background: var(--navy); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.2s ease; font-size: 0.78rem; }.toast.show { opacity: 1; transform: translateY(0); }
.empty-state { padding: 32px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 0.8rem; }.locked { padding: 30px; border-radius: 12px; color: #7a5a1b; background: var(--gold-light); font-size: 0.8rem; }

@media (max-width: 1180px) { .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.workflow-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.dashboard-grid { grid-template-columns: 1fr; }.agent-grid { grid-template-columns: 1fr; }.automation-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 840px) { .login-screen { grid-template-columns: 1fr; }.login-rail { display: none; }.app-shell { display: block; }.sidebar { min-height: auto; padding: 14px 16px; }.sidebar-context, .sidebar-footer { display: none; }.main-nav { display: flex; overflow-x: auto; margin-top: 14px; }.nav-item { white-space: nowrap; }.topbar { align-items: start; flex-direction: column; padding: 18px 18px 14px; }.topbar-actions { width: 100%; flex-wrap: wrap; align-items: end; }.user-chip { margin-left: 0; }.content-area { padding: 20px 18px 35px; } }
@media (max-width: 560px) { .login-panel { width: calc(100% - 28px); padding: 26px 22px; }.cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }.workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }.workflow-card { min-height: 130px; padding: 13px; }.metric-card { padding: 13px; }.metric-card::before { left: 13px; right: 13px; }.metric-card .metric-value { font-size: 1rem; }.report-summary { grid-template-columns: 1fr; }.inline-details { grid-template-columns: 1fr; }.section-heading { align-items: start; flex-direction: column; }.detail-drawer { padding: 22px 18px; }.automation-grid { grid-template-columns: 1fr; }.automation-strip { grid-template-columns: 1fr; }.journal-input-grid { grid-template-columns: 1fr; } }
.is-loading { opacity: .62; transition: opacity .16s ease; pointer-events: none; }
.translate-link { color: #0b5bd3; font-size: 11px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.translate-link:hover { text-decoration: underline; }
.report-statement { min-width: 0; }
.positive { color: #087f5b; }
.negative { color: #c22536; }
.comparison-chart { display: grid; gap: 16px; padding: 8px 0 2px; }
.comparison-row { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: center; }
.comparison-label { display: grid; gap: 3px; font-size: 12px; }
.comparison-label span { color: #6b7a8c; font-size: 10px; }
.comparison-bars { display: grid; gap: 5px; }
.comparison-bar { min-width: 8%; border-radius: 3px; color: #fff; font-size: 10px; line-height: 19px; padding: 0 8px; white-space: nowrap; overflow: hidden; }
.comparison-bar.current { background: linear-gradient(90deg, #0b5bd3, #39a0ff); }
.comparison-bar.prior { background: #8793a1; }
.monthly-chart { height: 250px; display: flex; gap: 8px; align-items: end; padding: 26px 6px 0; border-bottom: 1px solid #d6dee8; }
.monthly-column { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 4px; min-width: 32px; }
.monthly-value { font-size: 9px; color: #516273; white-space: nowrap; }
.monthly-bars { height: 170px; width: 100%; display: flex; gap: 2px; align-items: end; justify-content: center; }
.monthly-bar { width: 27%; min-height: 2px; border-radius: 3px 3px 0 0; }
.monthly-bar.revenue { background: #0b5bd3; }
.monthly-bar.expense { background: #e7a33d; }
.monthly-bar.prior { background: #aab4c1; }
.monthly-column strong { font-size: 10px; }
.monthly-column small { color: #6b7a8c; font-size: 9px; }
.chart-legend { position: absolute; margin-top: -26px; display: flex; gap: 16px; font-size: 10px; color: #516273; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.legend-dot.revenue { background: #0b5bd3; }.legend-dot.expense { background: #e7a33d; }.legend-dot.prior { background: #aab4c1; }
.decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.decision-card { border: 1px solid #dbe3ec; border-top: 3px solid #0b5bd3; border-radius: 6px; padding: 14px; background: #fbfcfe; }
.decision-card h3 { margin: 10px 0 7px; font-size: 14px; }.decision-card p { color: #4d5e70; line-height: 1.5; }.decision-card strong { font-size: 11px; line-height: 1.45; display: block; }
.artifact-links { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 1080px) { .comparison-row { grid-template-columns: 150px 1fr; } .decision-grid { grid-template-columns: 1fr; } .monthly-chart { overflow-x: auto; } .monthly-column { min-width: 48px; } }
