/* SPARC Suite — app styles (no external downloads, works offline) */
:root {
  --ink: #14202e;
  --ink-2: #4a5a6c;
  --muted: #7b8a9a;
  --line: #e2e8ef;
  --bg: #F5F6FB;
  --card: #ffffff;
  --brand: #4338CA;
  --brand-2: #6366F1;
  --accent: #10B981;
  --good: #2f855a;
  --bad: #c53030;
  --warn: #b7791f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 46, .06), 0 4px 14px rgba(20, 32, 46, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--bad); }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.shell > .main { flex: 1; }
.side { background: var(--brand); color: #d8e6ea; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
        overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #34D399);
              display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: -.04em; }
.brand b { display: block; font-size: 15px; letter-spacing: .04em; }
.brand small { color: #9fc0c8; font-size: 11px; }
.nav-h { text-transform: uppercase; font-size: 10.5px; letter-spacing: .1em; color: #8fb3bc; margin: 16px 8px 6px; }
.side a { display: block; color: #e5f0f2; padding: 7px 10px; border-radius: 7px; font-size: 13.5px; }
.side a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.side a.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.side a.pos-link { background: var(--accent); color: #fff; font-weight: 700; text-align: center; margin: 4px 0 6px; }
.side a.pos-link:hover { filter: brightness(1.08); }
.main { padding: 22px 28px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.who { color: var(--muted); font-size: 13px; }
.who form { display: inline; }
.who button { background: none; border: 0; color: var(--brand-2); cursor: pointer; font: inherit; padding: 0; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
        padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.two { grid-template-columns: 1.4fr 1fr; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.kpi.alert .value { color: var(--bad); }

/* Tables */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
             border-bottom: 1px solid var(--line); padding: 8px 8px; font-weight: 600; background: #fafbfc; }
table.t td { padding: 7px 8px; border-bottom: 1px solid #eef2f6; vertical-align: top; }
table.t tr:hover td { background: #f8fafc; }
table.t tr.group td { font-weight: 700; background: #f3f6f9; }
table.t tr.total td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); }
table.t tr.sub td { font-weight: 600; border-top: 1px solid #c9d3de; }
.indent-1 { padding-left: 22px !important; }
.indent-2 { padding-left: 38px !important; }

/* Forms / filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #cbd5e0; border-radius: 7px; background: #fff;
                          color: var(--ink); }
input:focus, select:focus { outline: 2px solid rgba(99, 102, 241, .3); border-color: var(--brand-2); }
.btn { display: inline-block; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--brand); background: var(--brand);
       color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.orange { background: var(--accent); border-color: var(--accent); }
.btn.red { background: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.badge.posted { background: #e6f4ec; color: var(--good); }
.badge.draft { background: #fdf3e1; color: var(--warn); }
.badge.cancelled { background: #fde8e8; color: var(--bad); }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.msg.warning { background: #fdf3e1; color: #7a4b00; }
.msg.error { background: #fde8e8; color: var(--bad); }
.msg.success { background: #e6f4ec; color: var(--good); }

/* Bars (tiny charts) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 5px 5px 0 0;
         min-height: 2px; }
.bar span { font-size: 10.5px; color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1E1B4B, #2E2A6B); }
.login { width: 360px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login .brand { color: var(--ink); padding: 0 0 18px; }
.login .brand small { color: var(--muted); }
.login label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.login input { width: 100%; }
.login .btn { width: 100%; margin-top: 18px; padding: 10px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; }
  .two { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}
@media print {
  .side, .topbar, .filters, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
.btn.good { background: var(--good); border-color: var(--good); }
tr.late td { background: #fff5f5; }
.side .count { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 11.5px; margin-left: 6px; }
.remind { border-left: 4px solid var(--accent); }
