/* ============================================================
   TreasuryOS — Ramp-derived design system
   Warm neutral canvas · bold black display · lime + green accents
   ============================================================ */

:root {
  /* surfaces */
  --bg:            #F6F5F0;
  --surface:       #FFFFFF;
  --surface-2:     #FBFAF6;
  --sidebar-bg:    #F1F0EA;
  --sidebar-hover: #E8E7DF;
  --sidebar-active:#E2E1D7;

  /* lines */
  --border:        #E6E4DB;
  --border-strong: #D6D3C8;
  --border-dark:   #C6C3B7;

  /* text */
  --ink:           #17150F;
  --ink-2:         #56544B;
  --ink-3:         #8A8779;
  --ink-4:         #AEAB9D;

  /* brand accents */
  --lime:          #DCFB52;
  --lime-deep:     #C7E83A;
  --lime-soft:     #F0FBC4;

  --green:         #138A47;
  --green-ink:     #0F7A3E;
  --green-soft:    #E4F4E8;
  --green-line:    #BFE4C9;

  --amber:         #B5750C;
  --amber-soft:    #FAF0D7;
  --amber-line:    #ECD79E;

  --red:           #C23A28;
  --red-soft:      #FAE9E5;
  --red-line:      #EEC8BF;

  --indigo:        #4F4DD0;
  --indigo-soft:   #ECEBFB;
  --indigo-line:   #CFCEF3;

  --slate:         #5A6472;
  --slate-soft:    #EDEFF2;

  /* geometry */
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(30,28,20,.05);
  --shadow-md: 0 4px 16px rgba(30,28,20,.08);
  --shadow-lg: 0 18px 50px rgba(30,28,20,.16);
  --shadow-drawer: -18px 0 50px rgba(30,28,20,.12);

  --sidebar-w: 244px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", Consolas, "Liberation Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--lime); color: var(--ink); }

/* tabular numbers everywhere figures live */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D5D2C6; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #C0BCAE; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; height: 100%; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100%;
  user-select: none;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 12px;
}
.sb-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--lime);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  flex: 0 0 auto;
}
.sb-brand .name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
.sb-brand .name b { color: var(--ink); }

.sb-context {
  margin: 4px 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 11px;
  cursor: pointer;
}
.sb-context:hover { border-color: var(--border-dark); }
.sb-context .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-context .ent { font-weight: 700; font-size: 13.5px; letter-spacing: -.01em; white-space: nowrap; }
.sb-context .cyc { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }

.sb-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.sb-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-4); padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  cursor: pointer; position: relative; margin-bottom: 1px;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--ink); }
.nav-item.active { background: var(--sidebar-active); color: var(--ink); font-weight: 600; }
.nav-item > span:not(.count):not(.av) { white-space: nowrap; }
.nav-item .ic { width: 17px; height: 17px; flex: 0 0 17px; color: currentColor; opacity: .85; }
.nav-item .count {
  margin-left: auto; background: var(--lime); color: var(--ink);
  font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.nav-item .count.muted { background: var(--sidebar-hover); color: var(--ink-2); }
.nav-item .count.red { background: var(--red-soft); color: var(--red); }

.sb-foot { border-top: 1px solid var(--border); padding: 8px 10px; }

/* ============================================================
   MAIN COLUMN
   ============================================================ */
.main { flex: 1; height: 100%; overflow-y: auto; position: relative; }
.main-inner { max-width: 1320px; margin: 0 auto; padding: 26px 38px 90px; }
.main-inner.wide { max-width: none; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(420px, .95fr) minmax(460px, 1.05fr);
  background: var(--bg);
}
.login-brand {
  min-height: 100vh;
  padding: 54px 58px;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
}
.login-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 21px;
}
.login-kicker {
  color: var(--lime);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 24px;
}
.login-brand h1 {
  font-size: clamp(36px, 5vw, 62px);
  line-height: .98;
  margin: 12px 0 0;
  max-width: 680px;
  letter-spacing: 0;
}
.login-proof {
  border-top: 1px solid rgba(255,255,255,.16);
  border-bottom: 1px solid rgba(255,255,255,.16);
  padding: 22px 0;
}
.login-brand .section-label { color: rgba(255,255,255,.55); }
.login-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.login-proof-grid div {
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--r-sm);
  padding: 13px 14px;
  background: rgba(255,255,255,.05);
}
.login-proof-grid b {
  display: block;
  font-size: 12.5px;
}
.login-proof-grid span {
  display: block;
  color: rgba(255,255,255,.66);
  font-size: 11.5px;
  margin-top: 4px;
  line-height: 1.35;
}
.login-address {
  color: rgba(255,255,255,.78);
  font-size: 13px;
  line-height: 1.7;
}
.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px;
  background: var(--bg);
}
.login-card {
  width: min(100%, 500px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}
.login-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.login-card h2 {
  margin: 5px 0 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}
.login-form {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}
.login-form label span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.login-form input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  font-size: 14px;
}
.login-form input:focus {
  outline: 2px solid var(--lime-deep);
  outline-offset: -1px;
  border-color: var(--lime-deep);
}
.login-form .btn {
  width: 100%;
  margin-top: 4px;
  padding: 11px 14px;
}
.login-error {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  border-radius: var(--r-sm);
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 600;
}
.login-foot {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-3);
  font-size: 12px;
}

@media (max-width: 980px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand {
    min-height: auto;
    padding: 34px 28px;
  }
  .login-brand h1 { font-size: 36px; }
  .login-proof-grid { grid-template-columns: 1fr; }
  .login-panel {
    min-height: auto;
    padding: 28px;
  }
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 11px 38px;
}
.crumb { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.topbar .search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 12px; color: var(--ink-3); font-size: 12.5px; width: 260px; cursor: text;
}
.topbar .search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .search .kbd { margin-left: auto; font-size: 10.5px; color: var(--ink-4); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }

.page-eyebrow { color: var(--ink-3); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 3px 0 0; }
.page-title h1 { font-size: 34px; font-weight: 800; letter-spacing: -.025em; margin: 0; white-space: nowrap; }
.page-title { flex: 0 0 auto; }
.info-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong);
  display: grid; place-items: center; color: var(--ink-3); cursor: pointer; flex: 0 0 auto;
}
.info-dot:hover { background: var(--surface); color: var(--ink); border-color: var(--border-dark); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 13px; padding: 8px 14px; line-height: 1;
  transition: background .12s, border-color .12s, transform .04s;
  white-space: nowrap;
}
.btn:active { transform: translateY(.5px); }
.btn .ic { width: 15px; height: 15px; }
.btn-primary { background: var(--lime); color: var(--ink); border-color: var(--lime-deep); }
.btn-primary:hover { background: var(--lime-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2c2920; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-dark); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--sidebar-hover); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============================================================
   CHIPS / STATUS
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; border-radius: 20px;
  padding: 2.5px 9px; border: 1px solid transparent; white-space: nowrap; line-height: 1.3;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-green  { background: var(--green-soft);  color: var(--green-ink); border-color: var(--green-line); }
.chip-amber  { background: var(--amber-soft);  color: var(--amber);     border-color: var(--amber-line); }
.chip-red    { background: var(--red-soft);    color: var(--red);       border-color: var(--red-line); }
.chip-indigo { background: var(--indigo-soft); color: var(--indigo);    border-color: var(--indigo-line); }
.chip-slate  { background: var(--slate-soft);  color: var(--slate);     border-color: #DCDFE4; }
.chip-neutral{ background: var(--surface-2);   color: var(--ink-2);     border-color: var(--border-strong); }
.chip-lime   { background: var(--lime-soft);   color: #5b6b13;          border-color: var(--lime-deep); }
.chip-ink    { background: var(--ink);         color: #fff; }

.chip-lg { font-size: 12.5px; padding: 4px 11px; }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.panel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-h h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 0; white-space: nowrap; }
.panel-h .sub { color: var(--ink-3); font-size: 12.5px; }
.panel-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.section-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }

.kv-grid { display: grid; gap: 14px 26px; }
.kv .k { color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.kv .v { font-size: 15px; font-weight: 600; margin-top: 2px; letter-spacing: -.01em; }

/* divider */
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ============================================================
   TABLES / WORKPAPER GRID
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--surface-2); }
.tbl tbody tr.sel { background: var(--lime-soft); }
.tbl tbody tr.sel:hover { background: var(--lime-soft); }

.wp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.wp-scroll { overflow-x: auto; }
.wp table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wp th {
  position: sticky; top: 0; background: var(--surface-2); z-index: 2;
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.wp th.num, .wp td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wp td { padding: 9px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.wp tbody tr.click { cursor: pointer; }
.wp tbody tr.click:hover td { background: var(--surface-2); }
.wp tr.sel td { background: var(--lime-soft) !important; }
.wp tr.section td { background: #F3F2EC; font-weight: 700; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.wp tr.subtotal td { font-weight: 700; background: var(--surface-2); }
.wp tr.total td { font-weight: 800; background: #F0EFE7; border-top: 1.5px solid var(--border-dark); font-size: 14px; }
.wp .stress-col { background: rgba(79,77,208,.045); }
.wp th.stress-col { background: var(--indigo-soft); color: var(--indigo); }

.cell-evi { cursor: pointer; border-bottom: 1px dashed var(--ink-4); }
.cell-evi:hover { background: var(--lime-soft); }

/* ============================================================
   DRAWER / INSPECTOR
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(28,26,18,.32); z-index: 80; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 480px; max-width: 94vw;
  background: var(--surface); box-shadow: var(--shadow-drawer); z-index: 90;
  display: flex; flex-direction: column; animation: slidein .22s cubic-bezier(.2,.8,.2,1);
}
.drawer.wide { width: 620px; }
@keyframes slidein { from { transform: translateX(40px); } }
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.drawer-h .x { margin-left: auto; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); flex: 0 0 auto; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-dark); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 14px 20px; display: flex; gap: 10px; align-items: center; background: var(--surface-2); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 20px; overflow-x: auto; }
.tab { padding: 11px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }

/* evidence rows */
.evi-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.evi-row .ic-wrap { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--ink-2); flex: 0 0 auto; }
.evi-row .t { font-weight: 600; font-size: 13px; }
.evi-row .d { color: var(--ink-3); font-size: 12px; margin-top: 1px; }

/* meta list */
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 9px 14px; font-size: 13px; }
.meta dt { color: var(--ink-3); font-weight: 500; }
.meta dd { margin: 0; font-weight: 600; }

/* callout banners */
.banner { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r-md); font-size: 13px; border: 1px solid; }
.banner .ic { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; }
.banner-red    { background: var(--red-soft);    border-color: var(--red-line);    color: #7e2519; }
.banner-amber  { background: var(--amber-soft);  border-color: var(--amber-line);  color: #6f4a09; }
.banner-indigo { background: var(--indigo-soft); border-color: var(--indigo-line); color: #34338a; }
.banner-green  { background: var(--green-soft);  border-color: var(--green-line);  color: #0c5e30; }
.banner b { font-weight: 700; }

/* progress */
.bar { height: 7px; border-radius: 6px; background: #E7E5DC; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; background: var(--green); }
.bar.amber > span { background: var(--amber); }
.bar.red > span { background: var(--red); }

/* gate checklist */
.gate { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.gate .g-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.gate .g-ic.pass { background: var(--green-soft); color: var(--green-ink); }
.gate .g-ic.fail { background: var(--red-soft); color: var(--red); }
.gate .g-ic.wait { background: var(--amber-soft); color: var(--amber); }
.gate .g-t { font-weight: 600; }
.gate .g-d { color: var(--ink-3); font-size: 12px; }

/* approval footer */
.approval { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.approval .seg { flex: 1; padding: 13px 16px; border-right: 1px solid var(--border); }
.approval .seg:last-child { border-right: 0; }
.approval .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.approval .who { font-weight: 700; margin-top: 4px; font-size: 13.5px; }
.approval .when { color: var(--ink-3); font-size: 11.5px; margin-top: 1px; }

/* avatars */
.av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; flex: 0 0 auto; }

/* misc */
.muted { color: var(--ink-3); }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}.mt24{margin-top:24px}
.mb4{margin-bottom:4px}.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}.mb20{margin-bottom:20px}.mb24{margin-bottom:24px}

.grid { display: grid; }
.g4 { grid-template-columns: repeat(4,1fr); gap: 16px; }
.g3 { grid-template-columns: repeat(3,1fr); gap: 16px; }
.g2 { grid-template-columns: repeat(2,1fr); gap: 16px; }

.big-num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.big-num .cents { font-size: 18px; color: var(--ink-3); }

.link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--lime-deep); cursor: pointer; }
.link:hover { border-bottom-color: var(--ink); }
.jump { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.jump:hover { color: var(--ink); }
.jump .ic { width: 14px; height: 14px; }

/* tile */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s, transform .08s; }
.tile:hover { border-color: var(--border-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tile .th { display: flex; align-items: center; gap: 9px; }
.tile .tname { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }

/* owner queue row */
.q-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.q-row:hover { background: var(--surface-2); }
.q-row:last-child { border-bottom: 0; }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 30px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center; animation: slideup .25s ease; }
@keyframes slideup { from { transform: translate(-50%, 16px); opacity: 0; } }
.toast .ic { width: 16px; height: 16px; color: var(--lime); }

/* segmented */
.seg-ctl { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg-ctl button { border: 0; background: transparent; padding: 6px 13px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--ink-3); }
.seg-ctl button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.stress-dock .seg-ctl button.on {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79,77,208,.22);
}

/* onboarding */
.ob-wrap { min-height: 100%; display: flex; }
.ob-rail { width: 320px; flex: 0 0 320px; background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 32px 28px; height: 100vh; position: sticky; top: 0; }
.ob-step { display: flex; gap: 13px; padding: 12px 0; }
.ob-step .num { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-dark); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-3); flex: 0 0 auto; }
.ob-step.done .num { background: var(--green); border-color: var(--green); color: #fff; }
.ob-step.active .num { background: var(--ink); border-color: var(--ink); color: var(--lime); }
.ob-step .st { font-weight: 700; font-size: 13.5px; }
.ob-step.active .st { color: var(--ink); }
.ob-step .sd { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.ob-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 56px 40px; overflow-y: auto; height: 100vh; }
.ob-card { width: 100%; max-width: 680px; }

.opt-card { border: 1.5px solid var(--border-strong); border-radius: var(--r-lg); padding: 16px 18px; cursor: pointer; display: flex; gap: 13px; align-items: flex-start; background: var(--surface); }
.opt-card:hover { border-color: var(--border-dark); }
.opt-card.on { border-color: var(--green); background: var(--green-soft); }
.opt-card .ck { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-dark); flex: 0 0 auto; display: grid; place-items: center; }
.opt-card.on .ck { background: var(--green); border-color: var(--green); color: #fff; }

.field { display: block; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: 14px; background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--lime-deep); outline-offset: -1px; border-color: var(--lime-deep); }

/* checklist item */
.cl { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 8px; }
.cl .cl-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.spark span { flex: 1; background: var(--lime-deep); border-radius: 2px 2px 0 0; min-height: 3px; }

.help-list li { margin-bottom: 9px; padding-left: 2px; }
.help-list { padding-left: 18px; margin: 8px 0; }

.dim { opacity: .55; }

/* state view spinner */
.sv-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--ink); animation: sv-rot .7s linear infinite; }
@keyframes sv-rot { to { transform: rotate(360deg); } }
.sv-skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sv-shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes sv-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================================================
   EXCEL-FAITHFUL NBE TEMPLATE GRID
   ============================================================ */
.xl-wrap { border: 1px solid var(--border-dark); border-radius: 8px; overflow: auto; background: var(--surface); box-shadow: var(--shadow-sm); }
.xl { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.xl.xl-scroll { min-width: 1120px; }
.xl th, .xl td { border: 1px solid #DAD7CC; padding: 5px 9px; vertical-align: middle; }
.xl thead th { position: sticky; top: 0; z-index: 2; background: #F0EFE8; color: var(--ink-2); font-weight: 700; font-size: 11px; text-align: right; }
.xl .xl-no { width: 46px; text-align: center; color: var(--ink-3); font-weight: 600; font-size: 11px; font-variant-numeric: tabular-nums; }
.xl .xl-label { text-align: left; line-height: 1.35; }
.xl .xl-amt { width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.xl .xl-stress { width: 120px; background: rgba(79,77,208,.05); }
.xl thead .xl-stress { background: var(--indigo-soft); color: var(--indigo); }
.xl .xl-stress.on {
  background: rgba(79,77,208,.18) !important;
  box-shadow: inset 0 0 0 2px var(--indigo);
  color: var(--indigo);
  font-weight: 800;
}
.xl thead .xl-stress.on {
  background: var(--indigo) !important;
  color: #fff;
}

/* row kinds — mirror NBE fills */
.xl tr.xl-green td { background: #E6EFD9; font-weight: 700; }
.xl tr.xl-green .xl-no { color: var(--ink-2); }
.xl tr.xl-orange td { background: #FBC65A; font-weight: 800; }
.xl tr.xl-orange .xl-no { color: #6b4e10; }
.xl tr.xl-sub td { background: #F6F5EF; font-weight: 700; }
.xl tr.xl-item td { background: var(--surface); }
.xl tr.xl-item:hover td { background: var(--surface-2); }

.xl-cell.hit { cursor: pointer; }
.xl-cell.hit.on { box-shadow: inset 0 0 0 2px var(--indigo); }
.xl-cell.hit:hover { outline: 2px solid var(--lime-deep); outline-offset: -2px; background: var(--lime-soft) !important; }
.xl-cell.bad { background: var(--red-soft) !important; }
.xl-cell.bad:hover { outline-color: var(--red); }
.prov-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }

/* stress lever library */
.lev-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.lev-row:hover { background: var(--surface-2); }
.lev-tog { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-dark); display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px; color: #fff; background: var(--surface); }
.lev-tog.on { background: var(--indigo); border-color: var(--indigo); }

/* in-cell stress lever stepper */
.lev-step { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--indigo-line); background: var(--indigo-soft); border-radius: 7px; padding: 1px; }
.lev-step button { width: 18px; height: 18px; border: 0; background: transparent; color: var(--indigo); font-weight: 800; font-size: 13px; line-height: 1; border-radius: 5px; display: grid; place-items: center; cursor: pointer; }
.lev-step button:hover { background: #fff; }
.lev-step .lev-val { font-size: 10.5px; font-weight: 700; color: var(--indigo); min-width: 32px; text-align: center; }

/* stress control dock (docked beside the sheet) */
.stress-dock { width: 296px; flex: 0 0 296px; position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--indigo-line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-md); }
.dock-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
.lev-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--indigo-soft); outline: none; cursor: pointer; }
.lev-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--indigo); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.lev-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--indigo); cursor: pointer; border: 2px solid #fff; }
.gauge { position: relative; height: 8px; border-radius: 6px; background: #E7E5DC; margin-top: 8px; }
.gauge-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 6px; transition: width .12s ease; }
.gauge-floor { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); border-radius: 1px; }
