/* Small ERP theme: ledger green, paper background, serif headings, tabular figures. Loaded after the base styles. */
:root {
  --bg: #f6f3ec; --panel: #fffdf8; --panel-2: #f3efe5; --line: #e4dccb; --ink: #1c1917; --ink-2: #57534e; --muted: #8a8378;
  --accent: #166534; --accent-ink: #ffffff; --accent-soft: #e3efe4; --ok: #15803d; --ok-soft: #dcfce7;
  --shadow: 0 1px 0 rgba(28, 25, 23, .04), 0 10px 26px -18px rgba(28, 25, 23, .35);
  --radius: 10px; --sidebar: 240px;
  --side-bg: #14532d; --side-ink: #e7efe8; --side-dim: #a7c4ad; --side-hover: #1a6337; --side-active: #fbf8f1;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11140f; --panel: #181c15; --panel-2: #141811; --line: #2b3326; --ink: #ece8df; --ink-2: #b9b3a6; --muted: #8b8577;
    --accent: #4ade80; --accent-ink: #0b1a10; --accent-soft: #19301f; --ok: #4ade80; --ok-soft: #122a1c;
    --side-bg: #0c2416; --side-ink: #dfe9e1; --side-dim: #8fb099; --side-hover: #123520; --side-active: #ece8df; }
}
body { font-variant-numeric: tabular-nums; }
h1 { font-family: var(--serif); font-weight: 700; font-size: 28px; letter-spacing: -.01em; }
.card h2, section.card > h2 { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 0; }
.kpi .v { font-family: var(--serif); font-size: 26px; }
.kpi { border-top: 3px solid var(--accent); }
/* Sidebar */
.side { background: var(--side-bg); border-right: 0; color: var(--side-ink); }
.side .brand strong { font-family: var(--serif); font-size: 19px; color: #fff; letter-spacing: 0; }
.side .brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.side a.nav { color: var(--side-ink); font-weight: 500; }
.side a.nav:hover { background: var(--side-hover); color: #fff; }
.side a.nav.active { background: var(--side-active); color: var(--side-bg); font-weight: 650; }
.side .navhead { color: var(--side-dim); }
.side .foot .who strong { color: #fff; } .side .foot .who small { color: var(--side-dim); }
.side .foot button { background: transparent; border-color: rgba(255,255,255,.18); color: var(--side-ink); }
.side .foot button:hover { background: var(--side-hover); }
/* Buttons and tables */
button.primary, a.btn.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
table.fin tr.total td { border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); }
table.fin tr.sec td { font-family: var(--serif); }
/* Sign-in page */
.auth { background: linear-gradient(160deg, #14532d 0%, #14532d 38%, var(--bg) 38%); }
.auth .box { border-radius: 14px; border-top: 4px solid var(--accent); }
.auth .brand strong { font-family: var(--serif); font-size: 22px; }
.auth h2 { font-family: var(--serif); font-size: 22px; }
.toast { background: #1c1917; color: #fbf8f1; }
@media (prefers-color-scheme: dark) { .auth { background: linear-gradient(160deg, #0c2416 0%, #0c2416 38%, var(--bg) 38%); } .toast { background: #ece8df; color: #11140f; } }
@media (max-width: 860px) { .side { background: var(--side-bg); border-top: 0; } }
/* Data & security notice */
.sec-bar { display: flex; align-items: center; gap: 10px; margin: -8px 0 16px; padding: 9px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 13px; line-height: 1.45; border: 1px solid transparent; }
.sec-bar > span:nth-child(2) { flex: 1; }
.sec-bar a { white-space: nowrap; font-weight: 650; }
.sec-warn { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; font-size: 13.5px; }
.sec-warn > span { flex: 1; }
@media (prefers-color-scheme: dark) { .sec-warn { background: #2a1a0b; border-color: #5a3410; color: #fdba74; } }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.sec-list { margin: 0; padding-left: 18px; } .sec-list li { margin: 6px 0; font-size: 14px; line-height: 1.55; }
@media (max-width: 860px) { .sec-bar { flex-wrap: wrap; font-size: 12.5px; } .sec-warn { flex-wrap: wrap; } }
@media (max-width: 860px) { .sec-bar > span:nth-child(2) { flex-basis: calc(100% - 34px); } .sec-bar a { margin-left: 26px; } }
/* Treasury & risk charts */
.fc-chart .fx-open { stroke: #a8a29e; stroke-width: 2; stroke-dasharray: 5 4; }
.fc-chart .fx-fwd { stroke: var(--accent); stroke-width: 2.5; }
.fc-chart .fx-opt { stroke: #2563eb; stroke-width: 2; }
.fc-chart .fx-col { stroke: #d97706; stroke-width: 2; }
.legend .sw.fx-open { border-top: 2px dashed #a8a29e; } .legend .sw.fx-fwd { border-top: 2.5px solid var(--accent); } .legend .sw.fx-opt { border-top: 2px solid #2563eb; } .legend .sw.fx-col { border-top: 2px solid #d97706; }
.mc-hist { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 6px; }
.mc-hist i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.mc-hist i.neg { background: #dc2626; }
.mc-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.nw { white-space: nowrap; }
/* ---------- Launchpad (Fiori-style My Home) ---------- */
.lp-head { align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.lp-search input { width: min(340px, 80vw); padding: 9px 14px 9px 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2378716c' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lp-sec { margin-bottom: 22px; }
.lp-sechead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.lp-sechead h2 { margin: 0; font-size: 19px; }
.lp-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.lp-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 6px 10px; color: var(--ink-2, #57534e); font-weight: 500; box-shadow: none; }
.lp-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.lp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 10px; background: var(--paper, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.lp-tile { display: flex; align-items: center; border-radius: 8px; }
.lp-tile:hover { background: var(--hover, rgba(20, 83, 45, .06)); }
.lp-tile a { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px; color: inherit; text-decoration: none; min-width: 0; }
.lp-tile a strong { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.lp-tile a small { display: block; color: var(--muted, #78716c); font-size: 11.5px; }
.lp-ic { flex: none; width: 30px; height: 30px; border-radius: 7px; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.lp-star { background: none; border: 0; box-shadow: none; padding: 4px 8px; color: #a8a29e; font-size: 16px; line-height: 1; }
.lp-star.on { color: #d97706; }
.lp-ins { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.ins-card { flex: 0 0 268px; scroll-snap-align: start; background: var(--paper, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: inherit; text-decoration: none; display: block; }
a.ins-card:hover { border-color: var(--accent); }
.ins-t { font-weight: 600; font-size: 14px; }
.ins-s { color: var(--muted, #78716c); font-size: 12px; }
.ins-k { display: flex; align-items: flex-end; gap: 10px; margin: 8px 0 4px; min-height: 40px; }
.ins-big { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ins-dev { font-size: 13px; font-weight: 600; }
.ins-dev small { display: block; font-weight: 400; color: var(--muted, #78716c); font-size: 11px; }
.ins-chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.ins-chart .base { stroke: var(--line); stroke-width: 1; }
.ins-chart .bar { fill: var(--accent); }
.ins-chart .bar.negbar { fill: #a8a29e; }
.ins-chart .tick { stroke: var(--ink, #1c1917); stroke-width: 2; }
.ins-chart .lbl { font-size: 10px; fill: var(--muted, #78716c); text-anchor: middle; }
.ins-chart g:hover .bar { opacity: .8; }
.ins-leg { font-size: 11.5px; color: var(--muted, #78716c); display: flex; align-items: center; gap: 6px; }
.ins-leg .sw-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); display: inline-block; }
.ins-leg .sw-tick { width: 12px; height: 0; border-top: 2px solid var(--ink, #1c1917); display: inline-block; margin-left: 8px; }
.ins-hbars { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.ins-hbars li { display: grid; grid-template-columns: 1fr 70px auto; align-items: center; gap: 8px; font-size: 12.5px; }
.ins-hbars li[data-href] { cursor: pointer; }
.ins-hbars li[data-href]:hover .t { text-decoration: underline; }
.ins-hbars .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-hbars .track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.ins-hbars .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.ins-hbars b { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 22px; text-align: right; }
/* Document flow */
.flowlist { list-style: none; margin: 0; padding: 0; }
.flowlist li { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px calc(6px + var(--lv) * 26px); border-bottom: 1px solid var(--line); position: relative; }
.flowlist li:last-child { border-bottom: 0; }
.flowlist li.cur { background: rgba(20, 83, 45, .07); border-radius: 8px; }
.flowlist .fl-ic { flex: none; min-width: 38px; height: 24px; padding: 0 4px; border-radius: 6px; background: var(--line); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; color: var(--ink-2, #44403c); }
.flowlist li.cur .fl-ic { background: var(--accent); color: #fff; }
@media print { .noprint { display: none !important; } .letter { break-after: page; } }
/* Credit meter, progress */
.meter { display: inline-block; width: 70px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter.near i { background: #d97706; } .meter.over i { background: #dc2626; }
.progress { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 10px 0 4px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
h3.phase { font-size: 14px; margin: 18px 0 4px; color: var(--ink-2, #44403c); text-transform: none; }
.letter p { max-width: 70ch; }
@media (min-width: 900px) { .lp-ins { flex-wrap: wrap; overflow: visible; } .ins-card { flex: 1 1 260px; max-width: 420px; } }
.invite { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; } .invite h3 { font-size: 15px; margin: 0 0 6px; } .code-lg { font: 600 16px ui-monospace, Menlo, monospace; letter-spacing: .08em; padding: 6px 10px; background: var(--paper, #fff); border: 1px solid var(--line); }
