/* Genesis Management Platform — UI. Branded to the Genesis identity
   (dark ground, green accent, Inter, square corners, hairlines). */
:root {
  --gp: #3f8f63; --gp-dim: #2a5f43; --gp-lite: #7fc39a;
  --bg: #070808; --bg-1: #0c0e0e; --bg-2: #101312;
  --ink: #eceded; --ink-2: rgba(236,237,237,.62); --ink-3: rgba(236,237,237,.40);
  --hair: rgba(236,237,237,.12); --row-hover: rgba(236,237,237,.03);
  --red: #e0736a; --amber: #d9b06a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
a { color: var(--gp-lite); text-decoration: none; }
button { font: inherit; cursor: pointer; }
.tnum { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

/* Buttons / chips */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border: 1px solid var(--gp); background: rgba(63,143,99,.1); color: var(--ink);
  text-transform: uppercase; font-size: 11px; letter-spacing: .12em; font-weight: 600;
  transition: background .15s; }
.btn:hover { background: rgba(63,143,99,.22); }
.btn.ghost { border-color: var(--hair); background: none; }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border: 1px solid var(--hair); color: var(--ink-2); text-transform: uppercase;
  font-size: 10.5px; letter-spacing: .12em; font-weight: 600; background: none; }
.chip[data-on="1"] { color: var(--ink); border-color: var(--gp); background: rgba(63,143,99,.14); }

/* Layout */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--hair); background: var(--bg-1); padding: 20px 0; position: sticky; top: 0; height: 100vh; }
/* Marble hero on the brand block — matches the Genesis website (spec §10 visual). */
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 20px; border-bottom: 1px solid var(--hair);
  background:
    linear-gradient(rgba(11,12,12,.58), rgba(11,12,12,.86)),
    radial-gradient(120% 100% at 90% 0%, rgba(180,214,196,.16), transparent 60%),
    url('marble.webp') center/cover no-repeat, #0b0c0c; }
.brand svg { color: var(--gp-lite); }
.brand .w { font-weight: 800; text-transform: uppercase; font-size: 14px; letter-spacing: .02em; line-height: 1.05; }
.brand .t { font-size: 7.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; margin-top: 2px; }
.nav { padding: 14px 0; }
.nav a { display: block; padding: 10px 20px; color: var(--ink-2); text-transform: uppercase;
  font-size: 11.5px; letter-spacing: .1em; font-weight: 600; border-left: 2px solid transparent; }
.nav a:hover { color: var(--ink); background: var(--row-hover); }
.nav a.on { color: var(--ink); border-left-color: var(--gp); background: rgba(63,143,99,.08); }
.side-foot { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 20px; border-top: 1px solid var(--hair); font-size: 11px; color: var(--ink-3); }
.side-foot .u { color: var(--ink-2); }
.main { padding: 28px clamp(20px,3vw,44px); min-width: 0; }

/* Headings + kicker */
.kick { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gp-lite); font-weight: 700; }
h1.view { font-size: 26px; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; margin: 6px 0 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.muted { color: var(--ink-2); }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); margin-bottom: 26px; }
.kpi { background: var(--bg); padding: 20px; }
.kpi .l { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.kpi .v { font-size: clamp(26px,3vw,36px); font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.kpi .s { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.v.pos { color: var(--gp-lite); } .v.neg { color: var(--red); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--hair); }
.tbl tr:hover td { background: var(--row-hover); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .anchor { color: var(--gp-lite); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--hair); border-bottom: none; }
.bar { height: 6px; background: var(--bg-2); border: 1px solid var(--hair); position: relative; min-width: 80px; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--gp); }

/* Forms */
.field { display: block; margin-bottom: 14px; }
.field .fl { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.in { width: 100%; height: 40px; padding: 0 12px; background: var(--bg-1); border: 1px solid var(--hair); color: var(--ink); }
.in:focus { outline: none; border-color: var(--gp); }
select.in { height: 40px; }
/* Native dropdown options need an explicit background + color or they render
   washed-out (light text on the OS white popup). Works in both themes. */
select.in option, select.sel option { background: #141817; color: #eceded; }
.main.light select.in option, .main.light select.sel option { background: #ffffff; color: #16150f; }
.card { border: 1px solid var(--hair); background: var(--bg-1); padding: 22px; }

/* Light theme — inverts the MAIN content area only; the sidebar stays dark.
   Pure token swap: white where it was black, black where it was white. */
.main.light {
  background: #ffffff;
  --bg: #ffffff; --bg-1: #f7f7f5; --bg-2: #ececea;
  --ink: #16150f; --ink-2: rgba(22,21,15,.66); --ink-3: rgba(22,21,15,.46);
  --hair: rgba(22,21,15,.14); --row-hover: rgba(22,21,15,.04);
  --gp-lite: #2a6b47; --red: #c0392b; --amber: #8a6100;
  color: var(--ink);
}

/* Login */
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login { width: 100%; max-width: 380px; }
.login .brand { border: none; padding: 0 0 24px; justify-content: center; }
.err { color: var(--red); font-size: 12.5px; margin-top: 10px; min-height: 1em; }

/* Print profiles (Change 2). JS injects @page orientation + optional fit scaling. */
@media print {
  .side, .toolbar, .nav, .no-print { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  body { background: #fff; color: #111; }
  .tbl th { color: #333; border-color: #999; }
  .tbl td { border-color: #ccc; }
  .print-head { display: block !important; margin-bottom: 12px; }
  .print-foot { position: fixed; bottom: 8px; left: 0; right: 0; font-size: 10px; color: #444; text-align: center; }
  thead { display: table-header-group; } /* repeat headers each page */
  tr { page-break-inside: avoid; }
}
.print-head, .print-foot { display: none; }
.fit-1 { transform-origin: top left; }
