:root {
  --navy: #08151f;
  --navy-2: #0d202d;
  --navy-3: #132b39;
  --paper: #f4f6f3;
  --surface: #ffffff;
  --ink: #14212a;
  --muted: #687780;
  --line: #dfe5e1;
  --mint: #25d69b;
  --mint-dark: #087c5c;
  --mint-soft: #e7faf3;
  --amber: #f5b84b;
  --amber-soft: #fff5df;
  --red: #d7594e;
  --red-soft: #fff0ee;
  --sidebar: 264px;
  --shadow: 0 18px 50px rgba(15, 37, 48, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid rgba(37, 214, 155, .4); outline-offset: 2px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -.02em; font-size: 17px; }
.brand--light { color: #fff; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  background: var(--mint); color: var(--navy); border-radius: 10px;
  font-weight: 900; box-shadow: 0 8px 22px rgba(37, 214, 155, .22);
}
.eyebrow { color: var(--mint-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.eyebrow--light { color: var(--mint); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(37, 214, 155, .11); }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(420px, .92fr); }
.login-story {
  position: relative; overflow: hidden; padding: 48px 60px 38px;
  color: #fff; background:
    radial-gradient(circle at 82% 15%, rgba(37, 214, 155, .18), transparent 26%),
    linear-gradient(145deg, var(--navy), #0b1f2c 62%, #102c35);
  display: flex; flex-direction: column;
}
.login-story::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000);
}
.login-story::after {
  content: ""; position: absolute; width: 430px; height: 430px; border: 1px solid rgba(37,214,155,.15);
  border-radius: 50%; right: -170px; bottom: -190px; box-shadow: 0 0 0 72px rgba(37,214,155,.025), 0 0 0 145px rgba(37,214,155,.02);
}
.login-story > * { position: relative; z-index: 1; }
.story-copy { margin: auto 0 68px; max-width: 720px; }
.story-copy h1 { margin: 18px 0 22px; font-size: clamp(42px, 5vw, 70px); line-height: 1.01; letter-spacing: -.055em; font-weight: 720; }
.story-copy p { max-width: 590px; color: rgba(255,255,255,.67); font-size: 19px; line-height: 1.65; }
.story-proof { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.13); border-bottom: 1px solid rgba(255,255,255,.13); }
.story-proof article { padding: 22px 20px 22px 0; display: flex; flex-direction: column; gap: 4px; }
.story-proof strong { font-size: 25px; letter-spacing: -.035em; }
.story-proof span { color: rgba(255,255,255,.52); font-size: 13px; }
.story-footer { margin-top: 28px; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.62); font-size: 13px; }
.login-panel { background: #f8faf8; display: grid; place-items: center; padding: 48px; }
.login-card { width: min(420px, 100%); }
.mobile-brand { display: none; }
.login-card h2 { margin: 12px 0 4px; font-size: 35px; letter-spacing: -.04em; line-height: 1.2; }
.login-card > p { margin: 0; }
.login-card form { margin-top: 34px; }
.login-card label, .period-control label { display: block; margin: 18px 0 7px; color: #455761; font-size: 13px; font-weight: 700; }
.login-card input, .period-control input {
  width: 100%; height: 50px; border: 1px solid #d8e0dc; border-radius: 10px; background: #fff;
  color: var(--ink); padding: 0 14px; transition: border .2s, box-shadow .2s;
}
.login-card input:focus, .period-control input:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 4px rgba(37, 214, 155, .1); outline: none; }
.password-field { position: relative; }
.password-field input { padding-right: 85px; }
.reveal { position: absolute; right: 7px; top: 7px; bottom: 7px; border: 0; border-radius: 7px; background: transparent; color: var(--mint-dark); font-size: 12px; font-weight: 700; }
.button {
  border: 0; border-radius: 10px; min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font-weight: 750; transition: transform .16s, background .16s, box-shadow .16s, opacity .16s; text-decoration: none;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }
.button--primary { color: #061710; background: var(--mint); box-shadow: 0 10px 25px rgba(37, 214, 155, .19); }
.button--primary:hover { background: #36dfa9; box-shadow: 0 13px 28px rgba(37, 214, 155, .27); }
.button--wide { width: 100%; margin-top: 24px; justify-content: space-between; padding: 0 20px; }
.button--demo { background: #fff; color: var(--ink); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 10px 30px rgba(0,0,0,.13); }
.button-spark { color: var(--mint-dark); font-size: 18px; }
.button--quiet { color: var(--ink); background: #fff; border: 1px solid var(--line); box-shadow: none; }
.button--quiet:hover { border-color: #bcc9c2; }
.form-error { color: var(--red); font-size: 13px; min-height: 20px; margin: 10px 0 0 !important; }
.demo-access { margin-top: 26px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.demo-access__label { color: var(--muted); font-size: 13px; }
.demo-access button { border: 0; padding: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 700; }
.demo-access button span { color: #9aa6a0; margin: 0 4px; }
.security-note { display: flex; gap: 8px; color: #819087 !important; margin-top: 17px !important; font-size: 12px; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 26px 20px 22px; z-index: 30;
  display: flex; flex-direction: column; background: var(--navy); color: #fff;
}
.workspace-card { margin: 27px 0 24px; padding: 15px; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035); border-radius: 12px; }
.workspace-card span, .workspace-card small { display: block; color: rgba(255,255,255,.42); font-size: 11px; }
.workspace-card strong { display: block; margin: 5px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 46px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 0 11px; border: 0; border-radius: 9px; color: rgba(255,255,255,.58); background: transparent; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(37,214,155,.11); }
.nav-item.active .nav-icon { color: var(--mint); }
.nav-icon { font-size: 17px; }
.nav-count { min-width: 24px; padding: 2px 6px; text-align: center; border-radius: 20px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); font-size: 11px; }
.sidebar-spacer { flex: 1; }
.sidebar-status { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.09); border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-status div { display: flex; align-items: center; gap: 9px; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status small { color: rgba(255,255,255,.38); margin-left: 17px; font-size: 10px; }
.logout-button { margin-top: 11px; padding: 10px 12px; border: 0; background: none; color: rgba(255,255,255,.48); text-align: left; font-size: 12px; }
.logout-button:hover { color: #fff; }
.main-shell { grid-column: 2; min-width: 0; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 20; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; background: rgba(244,246,243,.9); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(207,216,211,.8); }
.topbar > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.topbar strong { font-size: 13px; }
.topbar-label { color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.secure-badge { display: flex; gap: 7px; color: #66776e; font-size: 12px; }
.secure-badge span { color: var(--mint-dark); }
.icon-button { display: none; border: 0; background: transparent; font-size: 20px; }
.content-shell { max-width: 1440px; margin: 0 auto; padding: 40px 42px 80px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 7px 0 7px; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; letter-spacing: -.05em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.page-date { min-width: 145px; padding-left: 18px; border-left: 2px solid var(--mint); display: flex; flex-direction: column; }
.page-date span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.page-date strong { margin-top: 3px; font-size: 14px; }

/* Upload */
.import-card { padding: 28px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--navy-2), #0d2633); box-shadow: 0 24px 60px rgba(10, 29, 39, .14); }
.import-card__top { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.import-card h2, .surface-card h2 { margin: 2px 0 4px; font-size: 20px; letter-spacing: -.025em; }
.import-card p { margin: 0; color: rgba(255,255,255,.52); font-size: 13px; }
.section-index { color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.upload-tile { position: relative; min-height: 148px; display: grid; grid-template-columns: 38px 1fr auto; grid-template-rows: 1fr auto; gap: 10px 12px; padding: 17px; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: rgba(255,255,255,.04); transition: transform .18s, border .18s, background .18s; cursor: pointer; }
.upload-tile:hover { transform: translateY(-2px); border-color: rgba(37,214,155,.45); background: rgba(255,255,255,.065); }
.upload-tile input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-tile__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.65); font-size: 11px; font-weight: 800; }
.upload-tile__copy { display: flex; flex-direction: column; padding-top: 1px; }
.upload-tile__copy strong { font-size: 13px; }
.upload-tile__copy small { margin-top: 2px; color: rgba(255,255,255,.42); font-size: 11px; }
.upload-tile__action { align-self: start; padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.68); font-size: 10px; font-weight: 700; }
.upload-status { grid-column: 1 / -1; align-self: end; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07); color: rgba(255,255,255,.38); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-tile.ok { border-color: rgba(37,214,155,.38); background: rgba(37,214,155,.075); }
.upload-tile.ok .upload-tile__icon { color: var(--navy); background: var(--mint); }
.upload-tile.ok .upload-status { color: var(--mint); }
.upload-tile.has-error { border-color: rgba(215,89,78,.5); }
.upload-tile.has-error .upload-status { color: #ff9d94; }
.unmapped-panel { margin-top: 18px; padding: 18px; border-radius: 12px; color: var(--ink); background: var(--amber-soft); border: 1px solid rgba(245,184,75,.35); }
.unmapped-panel__head { display: flex; gap: 11px; margin-bottom: 12px; }
.unmapped-panel__head span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); font-weight: 900; }
.unmapped-panel__head strong { display: block; font-size: 13px; }
.unmapped-panel__head small { display: block; color: #7d6a46; font-size: 11px; }
.unmapped-row { display: grid; grid-template-columns: 1fr 260px; align-items: center; gap: 18px; padding: 10px 0; border-top: 1px solid rgba(135,104,43,.15); }
.unmapped-row span { font-size: 12px; }
.unmapped-row select { height: 39px; border: 1px solid #e5cd9d; border-radius: 8px; background: #fff; padding: 0 9px; font-size: 12px; }
.mapping-save { margin-top: 8px; }
.generate-card { margin-top: 16px; padding: 18px 22px; display: flex; align-items: center; gap: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.generate-card__copy { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.generate-card__copy strong, .generate-card__copy small { display: block; }
.generate-card__copy small { color: var(--muted); font-size: 11px; }
.ready-check { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--mint-soft); color: var(--mint-dark); font-weight: 900; }
.period-control { width: 220px; }
.period-control label { margin: 0 0 5px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.period-control input { height: 42px; font-size: 13px; }

/* Report */
.report-shell { margin-top: 50px; }
.report-hero { position: relative; overflow: hidden; padding: 30px; border-radius: 18px; color: #fff; background: var(--navy); }
.report-hero::after { content: ""; position: absolute; width: 330px; height: 330px; right: -140px; top: -190px; border-radius: 50%; border: 1px solid rgba(37,214,155,.18); box-shadow: 0 0 0 52px rgba(37,214,155,.03), 0 0 0 105px rgba(37,214,155,.02); }
.report-hero__top { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 20px; }
.report-hero h2 { margin: 7px 0 4px; font-size: 31px; letter-spacing: -.04em; }
.report-hero p { margin: 0; color: rgba(255,255,255,.5); }
.report-actions { display: flex; align-items: start; gap: 9px; }
.report-actions .button--quiet { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); color: #fff; }
.kpi-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 30px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.09); border-radius: 13px; overflow: hidden; }
.kpi-card { min-height: 132px; padding: 18px; background: #0b1b26; }
.kpi-card__label { display: flex; justify-content: space-between; color: rgba(255,255,255,.5); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.kpi-card__value { display: block; margin: 15px 0 8px; font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -.05em; white-space: nowrap; }
.kpi-card__meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255,255,255,.38); }
.delta { padding: 3px 7px; border-radius: 20px; font-weight: 750; }
.delta.good { color: var(--mint); background: rgba(37,214,155,.1); }
.delta.bad { color: #ff938b; background: rgba(215,89,78,.12); }
.insight-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 1px; border-radius: 0 0 13px 13px; overflow: hidden; }
.margin-stat { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; background: rgba(255,255,255,.045); color: rgba(255,255,255,.55); font-size: 12px; }
.margin-stat strong { color: #fff; font-size: 16px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 16px; margin-top: 16px; }
.surface-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 34px rgba(15,37,48,.05); }
.surface-card__inner { padding: 23px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading > div:first-child { display: flex; align-items: center; gap: 12px; }
.panel-heading .section-index { color: var(--mint-dark); }
.panel-heading h2 { margin: 0; font-size: 17px; }
.panel-note { color: var(--muted); font-size: 11px; }
.ledger { width: 100%; border-collapse: collapse; }
.ledger th { padding: 9px 10px; color: #7b8982; border-bottom: 1px solid var(--line); text-align: right; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.ledger th:first-child { text-align: left; }
.ledger td { padding: 11px 10px; border-bottom: 1px solid #eef1ee; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.ledger td:first-child { text-align: left; font-weight: 600; }
.ledger tr.subtotal td { background: #f4f8f5; font-weight: 800; }
.ledger tr.total td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 850; font-size: 13px; }
.cell-delta.good { color: var(--mint-dark); }
.cell-delta.bad { color: var(--red); }
.visual-card { min-height: 280px; }
.comparison-chart { display: flex; flex-direction: column; gap: 16px; }
.chart-row { display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 12px; }
.chart-row__label { color: #5d6d65; font-size: 11px; }
.chart-bars { display: grid; gap: 5px; }
.chart-bar { min-width: 3px; height: 9px; border-radius: 0 6px 6px 0; transition: width .5s ease; }
.chart-bar.current { background: var(--navy-3); }
.chart-bar.previous { background: #d4ddd8; }
.chart-scale { display: flex; justify-content: space-between; margin: 8px 0 0 117px; color: #98a39d; font-size: 9px; }
.cash-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 17px; }
.cash-summary div { padding: 12px; border-radius: 9px; background: #f4f7f5; }
.cash-summary span, .cash-summary strong { display: block; }
.cash-summary span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.cash-summary strong { margin-top: 4px; font-size: 12px; }
.cash-list-title { margin: 16px 0 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.cash-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid #eef1ee; font-size: 11px; }
.cash-row span:last-child { white-space: nowrap; font-weight: 700; }
.ai-card { grid-column: 1 / -1; overflow: hidden; border-color: #bfe9da; background: linear-gradient(135deg, #effbf6, #fff); }
.ai-layout { display: grid; grid-template-columns: 250px 1fr; }
.ai-intro { padding: 25px; color: #fff; background: var(--mint-dark); }
.ai-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.13); font-size: 20px; }
.ai-intro h2 { margin: 20px 0 7px; font-size: 20px; }
.ai-intro p { margin: 0 0 22px; color: rgba(255,255,255,.66); font-size: 12px; }
.ai-intro .button { width: 100%; background: #fff; color: var(--mint-dark); }
.ai-content { min-height: 210px; padding: 25px 28px; display: flex; flex-direction: column; justify-content: center; }
.ai-placeholder { display: flex; gap: 12px; color: var(--muted); }
.ai-placeholder span { color: var(--mint-dark); }
.ai-text { color: #284238; white-space: pre-wrap; font-size: 14px; line-height: 1.75; }
.ai-meta { margin-top: 15px; color: var(--muted); font-size: 10px; }
.scenario-card { grid-column: 1 / -1; }
.scenario-layout { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: stretch; }
.scenario-controls { display: grid; gap: 20px; align-content: center; }
.scenario-control > span { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.scenario-control b { color: var(--ink); }
.scenario-range { width: 100%; accent-color: var(--mint-dark); }
.scenario-result { min-height: 190px; padding: 25px; display: flex; flex-direction: column; justify-content: center; border-radius: 13px; color: #fff; background: var(--navy-2); }
.scenario-result > span { color: rgba(255,255,255,.48); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.scenario-result > strong { margin: 10px 0 18px; font-size: 30px; letter-spacing: -.04em; }
.scenario-result div { display: flex; justify-content: space-between; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.11); font-size: 12px; }
.scenario-result small { margin-top: 11px; color: rgba(255,255,255,.45); }
.scenario-result small.good { color: var(--mint); }
.scenario-result small.bad { color: #ff938b; }
.quality-card, .note-card { min-height: 275px; }
.quality-pill { padding: 5px 9px; border-radius: 20px; color: var(--mint-dark); background: var(--mint-soft); font-size: 11px; font-weight: 800; }
.quality-list { display: grid; }
.quality-list > div { min-height: 45px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid #edf1ee; }
.quality-list strong { font-size: 12px; }
.quality-list small { color: var(--muted); font-size: 10px; }
.quality-check { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #8d9993; background: #eef1ef; font-size: 10px; }
.quality-check.ok { color: var(--mint-dark); background: var(--mint-soft); }
.note-card textarea { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; color: var(--ink); font: inherit; font-size: 13px; line-height: 1.6; }
.note-card textarea:focus { outline: 0; border-color: var(--mint-dark); box-shadow: 0 0 0 4px rgba(37,214,155,.1); }
.note-actions { margin-top: 11px; display: flex; align-items: center; justify-content: space-between; }
.note-actions > span { color: var(--muted); font-size: 10px; }

/* History */
.trend-card, .history-card { padding: 24px; margin-bottom: 16px; }
.chart-legend { display: flex; gap: 20px; color: var(--muted); font-size: 11px; }
.chart-legend span::before { content: ""; width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; }
.legend-revenue::before { background: var(--navy-3); }
.legend-profit::before { background: var(--mint); }
.trend-chart { min-height: 230px; }
.trend-svg { width: 100%; height: 230px; display: block; }
.trend-grid { stroke: #e7ece8; stroke-width: 1; }
.trend-line-revenue { stroke: var(--navy-3); }
.trend-line-profit { stroke: var(--mint-dark); }
.trend-line-revenue, .trend-line-profit { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-point { stroke: #fff; stroke-width: 2; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { padding: 10px 12px; color: var(--muted); text-align: right; border-bottom: 1px solid var(--line); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.history-table th:first-child, .history-table th:nth-child(2) { text-align: left; }
.history-table td { padding: 15px 12px; text-align: right; border-bottom: 1px solid #edf1ee; font-size: 12px; }
.history-table td:first-child, .history-table td:nth-child(2) { text-align: left; }
.history-table tr[data-report] { cursor: pointer; }
.history-table tr[data-report]:hover td { background: #f5f8f6; }
.period-name { font-weight: 800; }
.empty-state { min-height: 260px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-state__mark { width: 55px; height: 55px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 16px; background: var(--mint-soft); color: var(--mint-dark); font-size: 22px; }
.empty-state strong { display: block; color: var(--ink); font-size: 16px; }
.empty-state p { max-width: 360px; margin: 5px auto 0; font-size: 12px; }
.activity-card { padding: 24px; }
.activity-list article { min-height: 70px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 13px; border-bottom: 1px solid #edf1ee; }
.activity-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--mint-dark); background: var(--mint-soft); font-weight: 800; }
.activity-list strong,.activity-list small { display: block; }
.activity-list strong { font-size: 13px; }
.activity-list small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.activity-list em { color: #91a099; font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .08em; }

/* Toast */
.toast-stack { position: fixed; right: 22px; top: 22px; z-index: 9999; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 390px; padding: 13px 15px; border-radius: 10px; color: #fff; background: var(--navy); box-shadow: 0 15px 40px rgba(0,0,0,.2); animation: toast-in .25s ease-out; font-size: 12px; }
.toast.error { background: #8e3029; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1100px) {
  .upload-grid { grid-template-columns: 1fr; }
  .upload-tile { min-height: 112px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .ai-card, .scenario-card { grid-column: 1; }
  .story-proof { grid-template-columns: 1fr; }
  .story-proof article { padding: 10px 0; flex-direction: row; align-items: baseline; gap: 10px; }
  .story-proof strong { font-size: 18px; }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 30px 22px; }
  .mobile-brand { display: flex; margin-bottom: 55px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .app-shell { grid-template-columns: 1fr; }
  .main-shell { grid-column: 1; }
  .icon-button { display: block; }
  .topbar { padding: 0 20px; }
  .content-shell { padding: 28px 18px 60px; }
  .page-date, .secure-badge { display: none; }
  .import-card__top, .generate-card, .report-hero__top { align-items: stretch; flex-direction: column; }
  .period-control { width: 100%; }
  .kpi-grid { grid-template-columns: 1fr; }
  .insight-strip { grid-template-columns: 1fr; }
  .ai-layout { grid-template-columns: 1fr; }
  .scenario-layout { grid-template-columns: 1fr; }
  .unmapped-row { grid-template-columns: 1fr; }
  .history-card { overflow-x: auto; }
  .history-table { min-width: 720px; }
  .toast-stack { top: 82px; right: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
}
@media print {
  .sidebar, .topbar, #upload-panel, #gen-panel, .report-actions, .ai-intro .button { display: none !important; }
  .main-shell { grid-column: 1; }
  .content-shell { padding: 0; }
  body { background: #fff; }
  .report-shell { margin: 0; }
}
