﻿:root {
  --navy: #12294b;
  --navy-light: #1d3f6e;
  --accent: #b8933f;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #d9dfe7;
  --text: #1c2733;
  --muted: #66738a;
  --low: #1e7d46;
  --medium: #b07d1d;
  --high: #b3261e;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

/* ---------- Topbar ---------- */
header.topbar {
  background: var(--navy);
  color: #fff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
header.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: 0.02em; }
header.topbar img.logo { height: 30px; }
header.topbar .brand { color: var(--accent); font-weight: 700; }
header.topbar a { color: #cdd8ea; text-decoration: none; font-size: 13px; }
header.topbar a:hover { color: #fff; }

/* use the full screen width when available (small horizontal padding only) */
main { max-width: none; margin: 24px auto; padding: 0 24px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.card .hint { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.tabs button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tabs button.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- Buttons ---------- */
button, .btn {
  background: var(--navy);
  border: 1px solid var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
a.btn { text-decoration: none; display: inline-block; }
button.secondary, .btn.secondary { background: #fff; color: var(--navy); }
button.danger { background: #fff; color: var(--high); border-color: var(--high); }
button.small { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: default; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.toolbar { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .field { min-width: 140px; }
.spacer { flex: 1; }

/* ---------- Segmented pill control ---------- */
.segmented { display: inline-flex; gap: 6px; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
}
.segmented input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { max-height: 62vh; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.list th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  position: sticky;
  top: 0;
  background: #f4f6f9;
  z-index: 2;
  white-space: nowrap;
}
table.list th.sortable { cursor: pointer; user-select: none; }
table.list tbody tr:hover { background: #eef2f8; }
table.list tbody tr.clickable { cursor: pointer; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.group-row td { font-weight: 600; background: #f6f9fd; }
tr.group-row .twisty { display: inline-block; width: 12px; color: var(--muted); transition: transform .15s; }
tr.group-row.open .twisty { transform: rotate(90deg); }
tr.child-row td { background: #fbfcfd; font-weight: 400; }
tr.child-row td:first-child { padding-left: 32px; }
table.list td.wrap, .hint.wrap { white-space: normal; min-width: 180px; max-width: 360px; font-size: 12px; color: var(--muted); line-height: 1.35; }
tr.group-row:hover td { background: #eef2f8; }
.empty-note { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.low { background: #e2f3e9; color: var(--low); }
.badge.medium { background: #f9efd9; color: var(--medium); }
.badge.high { background: #fbe4e2; color: var(--high); }
.badge.neutral { background: #e8ecf2; color: var(--muted); }
.badge.navy { background: #dfe7f3; color: var(--navy); }
.badge.gold { background: #f3ead3; color: #8a6d2a; }

/* ---------- KPI stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }
.stat .stat-value { font-size: 24px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat .stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.alert .stat-value { color: var(--high); }

/* ---------- sortable + filterable grids ---------- */
table.list thead th { cursor: pointer; user-select: none; }
table.list thead th.sorted-asc::after { content: " â–²"; font-size: 9px; color: var(--accent); }
table.list thead th.sorted-desc::after { content: " â–¼"; font-size: 9px; color: var(--accent); }
/* the filter row sticks just below the header â€” its offset is measured from
   the header row's real rendered height (set per table as --grid-head-h by
   the grid enhancer), same approach as the Client Onboarding app */
table.list thead .grid-filter-row th { padding: 2px 6px 6px; cursor: default; top: var(--grid-head-h, 33px); }
table.list thead .grid-filter-row input {
  width: 100%;
  min-width: 40px;
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}
table.list thead .grid-filter-row input::placeholder { color: #b6bfcc; }

/* ---------- guide permission matrix (plain doc table â€” no sort/filter) ---------- */
.guide-matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
.guide-matrix th {
  background: var(--navy); color: #fff; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 7px 9px; text-align: left;
}
.guide-matrix th:not(:first-child) { text-align: center; }
.guide-matrix td { padding: 6px 9px; border-bottom: 1px solid var(--border); }
.guide-matrix tbody tr:nth-child(even) { background: #f6f9fd; }
.guide-matrix.guide-cols th:not(:first-child) { text-align: left; }
.guide-matrix.guide-cols td { font-size: 12.5px; vertical-align: top; }
.guide-matrix .guide-code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; color: var(--navy); white-space: nowrap; }

/* ---------- workflow ribbon ---------- */
.ribbon { display: flex; align-items: flex-start; overflow-x: auto; padding: 2px 0 6px; margin-bottom: 4px; }
.rstep { flex: 1; min-width: 96px; text-align: center; }
.rstep .dot {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1;
}
.rstep .dot svg { width: 16px; height: 16px; stroke-width: 2.25; }
.waiting > svg { width: 18px; height: 18px; flex: 0 0 18px; }
.rstep.done .dot { background: #dff0e5; color: var(--low); }
.rstep.blocked .dot { background: #f8ecd8; color: var(--medium); }
.rstep.stop .dot { background: #f9e3e1; color: var(--high); }
/* current = solid desk colour, white icon; upcoming = desk tint, desk icon */
.rstep.current.lane-trading .dot { background: var(--navy); color: #fff; }
.rstep.current.lane-logistics .dot { background: #8a6d2a; color: #fff; }
.rstep.current.lane-treasury .dot { background: #6b3f7d; color: #fff; }
.rstep.current.lane-cs .dot { background: #1e6b52; color: #fff; }
.rstep.todo.lane-trading .dot { background: #dfe7f3; color: var(--navy); }
.rstep.todo.lane-logistics .dot { background: #f3ead3; color: #8a6d2a; }
.rstep.todo.lane-treasury .dot { background: #efe6f2; color: #6b3f7d; }
.rstep.todo.lane-cs .dot { background: #e4f0ec; color: #1e6b52; }
.rstep .rt { font-size: 12px; font-weight: 600; margin-top: 5px; color: var(--text); }
.rstep.todo .rt { color: var(--muted); font-weight: 400; }
.rstep .rwho { font-size: 11px; color: var(--muted); margin-top: 2px; }
.rstep .rwho .jlane { margin-left: 0; }
.rstep.todo .rwho .jlane { opacity: 0.55; }
.rstep .rnote { font-size: 11px; margin-top: 1px; }
.rstep.done .rnote { color: var(--low); }
.rstep.current .rnote { color: var(--navy); }
.rstep.blocked .rnote { color: var(--medium); }
.rstep.stop .rnote { color: var(--high); }
.rstep.todo .rnote { color: var(--muted); }
.rlink { flex: 0 0 14px; height: 2px; background: var(--border); margin-top: 12px; }
.waiting {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 13px;
  background: #eef3fa; color: var(--navy);
}
.waiting.ok { background: #dff0e5; color: var(--low); }
.waiting.warn { background: #f8ecd8; color: var(--medium); }
.waiting strong { font-weight: 700; }
.waiting .spacer { flex: 1; }
.waiting button { margin: -2px 0; }

/* ---------- operations map ---------- */
.oplane { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.oplane:first-child { border-top: none; }
.oplane .olabel {
  flex: 0 0 118px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12.5px; font-weight: 700; padding: 10px 8px; line-height: 1.3;
}
.oplane:nth-child(odd) .ostages { background: #f6f8fb; }
.oplane .ostages { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 16px 14px; }
.ostage {
  background: var(--card); border: 1.5px solid var(--navy); border-radius: 8px;
  padding: 9px 14px; min-width: 132px; cursor: pointer; text-align: center;
  transition: box-shadow 0.15s;
}
.ostage:hover { box-shadow: 0 3px 10px rgba(18, 41, 75, 0.18); }
.ostage.gate { border-color: var(--accent); background: #fbf6ea; }
.ostage.side { border-style: dashed; border-width: 1.5px; border-color: var(--muted); }
.ostage .oc { font-size: 22px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ostage.gate .oc { color: #8a6d2a; }
.ostage.hot .oc { color: var(--high); }
.ostage .ot { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 2px; }
.ostage .os { font-size: 11px; color: var(--muted); }
.oarrow { color: var(--muted); font-size: 15px; flex: 0 0 auto; padding: 0 1px; }
@media (max-width: 900px) { .oplane { flex-direction: column; } .oplane .olabel { flex: none; } }

/* ---------- journey timeline ---------- */
.journey { border-left: 2px solid var(--border); margin: 6px 0 0 8px; padding-left: 18px; }
.jevent { position: relative; padding-bottom: 14px; }
.jevent::before {
  content: ''; position: absolute; left: -24px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--navy);
}
.jevent .jwhen { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.jevent .jtitle { font-size: 13.5px; font-weight: 600; color: var(--text); }
.jevent .jdetail { font-size: 12.5px; color: var(--muted); max-width: 60ch; }
.jlane {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px;
}
.jlane.cs { background: #e4f0ec; color: #1e6b52; }
.jlane.trading { background: #dfe7f3; color: var(--navy); }
.jlane.logistics { background: #f3ead3; color: #8a6d2a; }
.jlane.treasury { background: #efe6f2; color: #6b3f7d; }

/* ---------- dashboard: your queue ---------- */
#dash-queue-body .qtag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: #dfe7f3; color: var(--navy); white-space: nowrap;
}
#dash-queue-body .qtag svg { width: 13px; height: 13px; flex: 0 0 13px; }
#dash-queue-body .qtag.cs { background: #e4f0ec; color: #1e6b52; }
#dash-queue-body .qtag.logistics { background: #f3ead3; color: #8a6d2a; }
#dash-queue-body .qtag.treasury { background: #efe6f2; color: #6b3f7d; }

/* lane colouring shared by the ops map */
.lane-cs .olabel { background: #1e6b52; }
.lane-trading .olabel { background: var(--navy); }
.lane-logistics .olabel { background: #8a6d2a; }
.lane-treasury .olabel { background: #6b3f7d; }
.lane-cs .ostage:not(.gate):not(.side) { border-color: #1e6b52; }
.lane-cs .ostage:not(.gate):not(.side) .oc { color: #1e6b52; }
.lane-logistics .ostage:not(.gate):not(.side) { border-color: #8a6d2a; }
.lane-logistics .ostage:not(.gate):not(.side) .oc { color: #8a6d2a; }
.lane-treasury .ostage:not(.gate):not(.side) { border-color: #6b3f7d; }
.lane-treasury .ostage:not(.gate):not(.side) .oc { color: #6b3f7d; }
.ostage.hot .oc { color: var(--high) !important; }

/* ---------- report library cards ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.report-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.report-card:hover { box-shadow: 0 3px 10px rgba(18, 41, 75, 0.14); border-left-color: var(--accent); }
.report-card h3 { margin: 0; font-size: 15px; color: var(--navy); }
.report-card p { margin: 0; font-size: 13px; color: var(--muted); flex: 1; }
.report-card .report-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.report-card .report-meta .badge { font-weight: 500; }
.report-card .report-actions { display: flex; gap: 8px; margin-top: 8px; }
/* library sections (same pattern as Client Onboarding's report groups) */
h3.rgroup { margin: 22px 0 10px; color: var(--navy); font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--accent); padding-bottom: 4px; display: flex; align-items: baseline; gap: 8px; }
h3.rgroup:first-child { margin-top: 6px; }
h3.rgroup .hint { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.report-sections .report-grid { margin-bottom: 6px; }
.report-picker-bar { margin: 0 0 4px; gap: 10px; }
.report-picker-bar select { max-width: 460px; }

/* ---------- Workflow status steps (deal/shipment lifecycle) ---------- */
.flow { display: inline-flex; align-items: center; gap: 0; }
.flow .step {
  font-size: 11px;
  padding: 3px 10px;
  color: var(--muted);
  background: #eef1f6;
  border: 1px solid var(--border);
  position: relative;
}
.flow .step:first-child { border-radius: 999px 0 0 999px; }
.flow .step:last-child { border-radius: 0 999px 999px 0; }
.flow .step.done { background: #dfe7f3; color: var(--navy); }
.flow .step.current { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* ---------- Detail drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(18, 41, 75, 0.35);
  z-index: 50; display: none;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 24px rgba(18, 41, 75, 0.18);
  z-index: 51;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer.wide { width: min(1040px, 96vw); }

/* trade-history roll-up dimension toggles */
.gchips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.gchip:hover { border-color: var(--navy-light); color: var(--navy); }
.gchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.drawer tfoot td { border-top: 2px solid var(--border); background: var(--bg); }
.drawer .drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.drawer .drawer-head h2 { margin: 0; font-size: 16px; color: var(--navy); flex: 1; }
.drawer .drawer-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.drawer .drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }
.drawer .close-x { background: none; border: none; color: var(--muted); font-size: 20px; padding: 2px 8px; }
.drawer .close-x:hover { color: var(--navy); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* line editor rows in the new-deal form */
.line-row { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.line-row .field { flex: 1; min-width: 0; }

td.editing { padding: 3px; }
td.editing input { text-align: right; }
td.edited { background: #fffbe9 !important; font-weight: 600; }
tr:hover td.edited { background: #fffbe9 !important; }
.pencil { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 2px 6px; }
.pencil:hover { color: var(--navy); }

/* ---------- Sticky save bar ---------- */
.savebar {
  position: sticky;
  bottom: 0;
  background: #fffbe9;
  border: 1px solid #e7d99a;
  border-radius: 6px;
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 14px;
}
.savebar.dirty { display: flex; }
.savebar .msg { font-size: 13px; color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; }

/* ---------- User guide ---------- */
.guide-intro p, .guide-p { font-size: 14px; line-height: 1.55; color: var(--text); margin: 8px 0; max-width: 900px; }
.guide-heading {
  color: var(--navy);
  font-size: 16px;
  margin: 26px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.guide-figure {
  margin: 14px 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  max-width: 1000px;
}
.guide-figure img { display: block; width: 100%; height: auto; }
.guide-callouts { list-style: none; counter-reset: co; margin: 6px 0 18px; padding: 0; max-width: 900px; }
.guide-callouts li {
  counter-increment: co;
  position: relative;
  padding: 3px 0 3px 34px;
  font-size: 13.5px;
  line-height: 1.5;
}
.guide-callouts li::before {
  content: counter(co);
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  line-height: 20px;
}

@media (max-width: 800px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .kv { grid-template-columns: 110px 1fr; }
}

/* ---- per-user column customisation (gear on every named grid) ---- */
.colcfg-btn {
  position: absolute; top: 3px; right: 3px; z-index: 6;
  width: 22px; height: 22px; padding: 0; line-height: 20px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--muted); font-size: 12px; cursor: pointer;
}
.colcfg-btn:hover { color: var(--navy); border-color: var(--navy); }
.colcfg-panel {
  position: fixed; z-index: 300; min-width: 240px; max-height: 60vh; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(18, 41, 75, .25); padding: 10px 12px; font-size: 13px;
}
.colcfg-head { display: flex; align-items: center; margin-bottom: 6px; }
.colcfg-panel ul { list-style: none; margin: 0; padding: 0; }
.colcfg-panel li { display: flex; gap: 6px; align-items: center; padding: 3px 2px; border-radius: 6px; background: #fff; }
.colcfg-panel li:hover { background: var(--bg); }
.colcfg-grip { cursor: grab; color: var(--muted); font-size: 11px; letter-spacing: -2px; }
.colcfg-panel label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; cursor: pointer; }
.colcfg-panel input[type="checkbox"] { width: auto; }
.col-rz {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; user-select: none; z-index: 5;
}
.col-rz:hover { background: rgba(184, 147, 63, .35); }
/* optional grid columns stay hidden until a user enables them via the gear */
table.list .optcol { display: none; }
/* drag a column header to reorder it */
table.list thead th.col-dragging { opacity: 0.45; }
table.list thead th.col-drop-left { box-shadow: inset 3px 0 0 var(--gold); }
table.list thead th.col-drop-right { box-shadow: inset -3px 0 0 var(--gold); }
/* drag a report card to reorder the gallery */
.report-card.col-dragging { opacity: 0.45; }
.report-card.card-drop-left { box-shadow: inset 3px 0 0 var(--accent); }
.report-card.card-drop-right { box-shadow: inset -3px 0 0 var(--accent); }
.report-card { cursor: pointer; }

/* ---- Risk & Compliance ops-map lane (burgundy) ---- */
.jlane.compliance { background: #f3e6e9; color: #7d3f4a; }
.lane-compliance .olabel { background: #7d3f4a; }
.lane-compliance .ostage:not(.gate):not(.side) { border-color: #7d3f4a; }
.lane-compliance .ostage:not(.gate):not(.side) .oc { color: #7d3f4a; }

/* ---- pressed-button feedback: a busy shimmer until the UI re-renders ---- */
button.btn-busy { position: relative; opacity: 0.6; }
button.btn-busy::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  width: 10px; height: 10px; margin-top: -6px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: btnspin 0.7s linear infinite;
}
@keyframes btnspin { to { transform: rotate(360deg); } }

/* ---- Contract Management additions ---- */
.drawer-sub { font-size: 13px; color: var(--navy); margin: 18px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
ul.plain { list-style: none; padding: 0; margin: 0 0 10px; font-size: 13px; }
ul.plain li { padding: 3px 0; }
.guide-toc { background: #f4f6f9; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 14px 0 22px; }
.guide-toc strong { color: var(--navy); }
.guide-toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2; column-gap: 40px; }
.guide-toc li { font-size: 13px; padding: 2px 0; break-inside: avoid; }
.guide-toc a { text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }

/* Labelled filter groups (Contracts toolbar) */
.filter-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 12px 10px; background: #fbfcfe; }
.filter-group > label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 6px; }
.filter-group .filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.page-title { margin: 0; font-size: 20px; color: var(--navy); }
.segmented button {
  background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; margin: 0;
}
.segmented button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.sample-banner {
  background: #fdf6e3; border: 1px solid #ecd9a5; color: #6d5417; border-radius: var(--radius);
  padding: 9px 14px; font-size: 13px; margin-bottom: 14px;
}
.sample-banner a { color: var(--navy); font-weight: 600; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 10px; position: relative; overflow: hidden; border-top: 3px solid var(--border); }
.kpi.mini { padding: 8px 12px; }
.kpi.mini .kpi-value { font-size: 20px; }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--navy); margin: 4px 0 2px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.chart-host { margin: 6px 0 14px; min-height: 40px; }
.chart { display: block; max-width: 100%; font-family: inherit; }
.chart rect, .chart path, .chart circle { transition: opacity 0.1s; }
.chart [data-tip]:hover { opacity: 0.8; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text); margin: 4px 0 6px 48px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-legend b { color: var(--muted); font-weight: 500; }
.chart-tip {
  position: fixed; z-index: 400; display: none; pointer-events: none;
  background: var(--navy); color: #fff; font-size: 12px; line-height: 1.45; padding: 7px 10px; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(18, 41, 75, 0.3); max-width: 320px;
}
.chart-tip .hint { color: #cdd8ea; }
.donut-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.donut-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; min-width: 260px; }
.donut-legend li { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--border); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-legend b { font-variant-numeric: tabular-nums; }
.donut-legend em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.rv-filters { margin-bottom: 6px; }
.rv-filters:empty { display: none; }
.rv-meta { margin: 0 0 6px; }
#rv-table tfoot td { font-weight: 600; background: var(--bg); border-top: 2px solid var(--border); position: sticky; bottom: 0; }
.setup-steps { font-size: 13px; line-height: 1.5; padding-left: 20px; }
.setup-steps li { margin-bottom: 6px; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; background: #eef1f6; padding: 1px 6px; border-radius: 4px; }
.guide-bullets { font-size: 13.5px; line-height: 1.55; max-width: 900px; }
.guide-table-wrap { overflow: auto; max-width: 100%; margin: 8px 0 18px; }
.guide-matrix td:nth-child(2) .guide-code { white-space: nowrap; }

/* ======================= PTO Tracker additions ======================= */
/* progress indicator: top bar + label pill (reference counted, non-blocking) */
#progress { position: fixed; inset: 0 0 auto 0; pointer-events: none; z-index: 500; opacity: 0; transition: opacity 0.15s; }
#progress.show { opacity: 1; }
#progress .progress-bar { height: 3px; background: linear-gradient(90deg, var(--accent), #e7d39a, var(--accent)); background-size: 200% 100%; animation: progslide 1.1s linear infinite; }
#progress .progress-pill { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 999px; box-shadow: 0 4px 12px rgba(18,41,75,.3); }
@keyframes progslide { to { background-position: -200% 0; } }

/* balance tiles */
.bal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.bal {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px;
  border-top: 4px solid var(--navy); position: relative;
}
.bal .bal-type { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bal .bal-remaining { font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.bal .bal-remaining small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.bal .bal-sub { font-size: 12.5px; color: var(--muted); }
.bal .bal-meter { height: 6px; background: #e8ecf2; border-radius: 3px; margin: 10px 0 6px; overflow: hidden; display: flex; }
.bal .bal-meter i { display: block; height: 100%; }
.bal .bal-meter .m-used { background: var(--navy); }
.bal .bal-meter .m-pending { background: var(--accent); }
.bal.unlimited .bal-remaining { font-size: 24px; }
.bal.notset { border-top-color: var(--medium); }
.bal.low { border-top-color: var(--high); }
.bal .bal-legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.bal .bal-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rec-chips .chip { font-size: 12px; background: #eef1f6; border-radius: 999px; padding: 3px 10px; color: var(--text); }
.rec-chips .chip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* stat tiles row */
.stat.good .stat-value { color: var(--low); }
.stat.warn .stat-value { color: var(--medium); }
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { border-color: var(--navy-light); box-shadow: 0 3px 10px rgba(18,41,75,.12); }

/* request rows / status */
.status-pending { background: #f9efd9; color: var(--medium); }
.status-approved { background: #e2f3e9; color: var(--low); }
.status-declined { background: #fbe4e2; color: var(--high); }
.status-cancelled { background: #e8ecf2; color: var(--muted); }
.typedot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.req-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; display: flex; gap: 14px; align-items: center; background: #fff; }
.req-card .req-when { min-width: 150px; font-weight: 600; color: var(--navy); }
.req-card .req-meta { flex: 1; font-size: 13px; color: var(--muted); }
.req-card .req-actions { display: flex; gap: 6px; }

/* request form */
.req-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.req-form .field.wide { grid-column: 1 / -1; }
.req-preview { background: #f4f6f9; border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; font-size: 13px; margin: 12px 0; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.req-preview.bad { background: #fbe4e2; border-color: #f0b9b5; color: var(--high); }
.req-preview b { color: var(--navy); font-size: 15px; }

/* team calendar */
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-nav h3 { margin: 0; font-size: 16px; color: var(--navy); min-width: 170px; text-align: center; }
/* minmax(0, 1fr): a long entry must truncate inside its day, never widen the column and push the grid off the page */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; width: 100%; }
.cal .cal-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.cal .cal-day { min-height: 92px; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; background: #fff; font-size: 12px; position: relative; }
.cal .cal-num .hol { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 6px; }
.cal .cal-day.other { opacity: 0.45; }
.cal .cal-day.weekend { background: #f4f6f9; }
.cal .cal-day.holiday { background: #fbf6ea; border-color: #e7d39a; }
.cal .cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .cal-num { font-weight: 600; color: var(--navy); display: flex; justify-content: space-between; }
.cal .cal-num .hol { font-weight: 500; color: #8a6d2a; font-size: 11px; }
.cal .cal-ev { display: block; border-radius: 4px; padding: 1px 6px; margin-top: 3px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-size: 11.5px; }
.cal .cal-ev.pending { opacity: 0.6; border: 1px dashed #fff; }
.cal .cal-more { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* report library */
.report-card.sec-balances { border-left-color: #2a5fa8; }
.report-card.sec-usage { border-left-color: #1e8a6a; }
.report-card.sec-approvals { border-left-color: #b8933f; }
.report-card.sec-calendar { border-left-color: #6b3f7d; }
.report-card.sec-people { border-left-color: #7d3f4a; }
.rv-filters select { width: auto; min-width: 150px; }

/* people / config */
.pill-sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.kv.compact { grid-template-columns: 120px 1fr; gap: 3px 10px; margin: 4px 0; font-size: 12.5px; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; font-size: 13px; }
.inline-check input { width: auto; }
.drawer-sub { font-size: 13px; color: var(--navy); margin: 18px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.history { font-size: 12.5px; list-style: none; padding: 0; margin: 0; }
.history li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.history .when { color: var(--muted); margin-right: 8px; white-space: nowrap; }
.cal-status { font-size: 11.5px; }
/* company (Numisma Bank calendar) events on the team calendar */
.cal .cal-ev.company { background: #fff; color: var(--navy); border: 1.5px solid var(--accent); font-weight: 600; }
.cal .cal-ev.company:hover { background: #fbf6ea; }

/* ---- reporting hierarchy (Team page): nested, foldable tree ---- */
.org, .org ul { list-style: none; margin: 0; padding: 0; }
.org ul { margin-left: 15px; padding-left: 16px; border-left: 1px solid var(--border); }
.org li { margin: 3px 0; }
.org li.leaf { padding-left: 18px; }
.org summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px; }
.org summary::-webkit-details-marker { display: none; }
.org summary::before { content: '▸'; color: var(--muted); font-size: 13px; width: 14px; display: inline-block; transition: transform 0.15s; }
.org details[open] > summary::before { transform: rotate(90deg); }
.org-node { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.org-node:hover { background: #f1f4f9; }
.org-node.me { background: #fbf6ea; border: 1px solid #e7d39a; }
.org-count { font-size: 11px; color: var(--muted); }

/* ---- small editable rule tables (Policy → allowance by job title); not a
   grid, so the sort/filter/column enhancer leaves them alone ---- */
table.rules { width: 100%; border-collapse: collapse; margin-top: 6px; }
table.rules th, table.rules td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.rules th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.rules input { width: 100%; box-sizing: border-box; }
table.rules td.num input { text-align: right; }

/* ---------- Sales Blotter: people × days month grid ---------- */
.blotter-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 6px; max-height: 64vh; }
table.blotter { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
table.blotter th, table.blotter td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0; height: 30px; min-width: 30px; text-align: center; vertical-align: middle; background: #fff; }
table.blotter thead th { position: sticky; top: 0; z-index: 2; background: #f4f6f9; color: var(--navy); font-weight: 600; font-size: 11px; line-height: 1.1; padding: 3px 2px; }
table.blotter thead th .bl-wd { display: block; font-size: 9px; color: var(--muted); font-weight: 500; text-transform: uppercase; }
table.blotter th.bl-person, table.blotter td.bl-person { position: sticky; left: 0; z-index: 1; min-width: 150px; text-align: left; padding: 0 10px; font-weight: 600; color: var(--navy); white-space: nowrap; background: #fff; border-right: 2px solid var(--border); }
table.blotter thead th.bl-person { z-index: 3; background: #f4f6f9; }
table.blotter th.weekend, table.blotter td.weekend { background: #f4f6f9; }
table.blotter th.today, table.blotter td.today { box-shadow: inset 0 0 0 1px var(--accent); }
table.blotter td.band { background: #fbf6ea; }
table.blotter tr.bl-everyone td { background: #fcfaf3; }
table.blotter tr.bl-everyone td.bl-person { color: var(--muted); }
table.blotter td:not(.bl-person):empty { cursor: cell; }
table.blotter td:not(.bl-person):empty:hover { background: #eef3fb; }
.bl-ev { display: block; margin: 3px; padding: 2px 6px; border-radius: 4px; font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; cursor: pointer; }
.bl-ev.travel { background: var(--navy); color: #fff; }
.bl-ev.travel.pending { background: #fff; color: var(--navy); border: 2px dashed var(--gold); }
.bl-ev.ooo { background: #e6eaf1; color: var(--navy); border: 1px dashed #8fa3c0; }
.bl-ev.holiday { background: #f3e7c3; color: #5a4310; border: 1px solid #e7d39a; }
.bl-ev.other { background: #eef1f5; color: #44506a; border: 1px solid #d6dce6; }
.bl-ev b { font-weight: 700; opacity: 0.8; }

/* ---------- sign-in page ---------- */
.signin-card { max-width: 380px; margin: 110px auto; text-align: center; }
.signin-card h2 { color: var(--navy); margin: 0 0 6px; }
.signin-card p { color: var(--muted); margin: 0 0 22px; }
.signin-button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--navy); color: #fff; text-decoration: none;
  padding: 11px 20px; border-radius: 6px; font-size: 14px;
}
