@font-face{font-family:"Inter Tight";src:url("fonts/inter-tight.woff2") format("woff2");font-weight:100 900;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url("fonts/jetbrains-mono.woff2") format("woff2");font-weight:400;font-display:swap}
:root {
  /* Cardinal Hall shared palette. Token NAMES are unchanged from the original build (every
     inline var(--cardinal), var(--red) etc. across every page keeps working) — only the
     VALUES moved to the cool slate-dark system Hall, Verified and the assessment all use.
     --cardinal is Owe's own brand accent (violet), reserved from the red/amber/green that
     this app uses to mean "the status of a promise", the same separation Verified's CRM needed. */
  --ink: #0A0C10; --ink-2: #151922; --ink-3: #1B212C; --line: #1D2330; --line-2: #262D3B;
  --paper: #EDEFF3; --paper-2: #AEB5C2; --muted: #767E8D;
  --cardinal: #9E8FD6; --cardinal-2: #B7ABE3;
  --amber: #E9B949; --amber-bg: rgba(233,185,73,0.14);
  --red: #F2555A; --red-bg: rgba(242,85,90,0.14);
  --ok: #3FCF8E; --ok-bg: rgba(63,207,142,0.14);
  --radius: 12px;
  --font: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: var(--font);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; font-feature-settings:"cv11" 1; }
a { color: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cardinal); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
.display { font-family: var(--display); font-weight: 650; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.narrow { max-width: 440px; margin: 0 auto; padding: 28px 20px; }
.wide { max-width: 1280px; margin: 0 auto; padding: 20px; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--ink); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 650; font-size: 18px; letter-spacing:-.02em; white-space: nowrap; display:flex; align-items:center; gap:8px; }
.brand::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--cardinal); flex:none; }
.brand b { color: var(--cardinal-2); font-weight: 650; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--paper-2); padding: 6px 10px; border-radius: 7px; font-size: 14px; transition:background .12s,color .12s; }
.nav a:hover { background: var(--ink-3); color: var(--paper); }
.nav a.on { background: var(--ink-3); color: var(--paper); }

/* controls */
.btn { appearance: none; border: 1px solid var(--line-2); background: var(--ink-3); color: var(--paper); padding: 9px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 15px; line-height: 1.2; transition:border-color .12s,background .12s,color .12s; }
.btn:hover { border-color: var(--paper-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--paper); border-color: var(--paper); color: var(--ink); box-shadow:0 1px 0 rgba(255,255,255,.4) inset; }
.btn.primary:hover { background: var(--cardinal); border-color: var(--cardinal); color: #fff; box-shadow:none; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: var(--line-2); }
.btn.danger:hover { border-color: var(--red); background:var(--red-bg); }
.btn.big { padding: 15px 18px; font-size: 17px; width: 100%; }
.btn.sm { padding: 5px 9px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 9px 14px; cursor: pointer; color: var(--paper-2); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--paper); color: var(--ink); }
label.field { display: block; margin: 0 0 12px; }
label.field > span { display: block; font-size: 12.5px; font-weight:600; letter-spacing:.02em; color: var(--paper-2); margin-bottom: 5px; }
input:not([type]), input[type=text], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; color: var(--paper);
}
input::placeholder,textarea::placeholder{color:var(--muted)}
input[type=date]{color-scheme:dark}
textarea { min-height: 90px; resize: vertical; }
.panel { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 16px; font-weight:600; margin-bottom: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing:.05em; text-transform:uppercase; }
.scroll-x { overflow-x: auto; }

/* status */
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--ink-3); color: var(--paper-2); letter-spacing: 0.02em; }
.tag.new { color: var(--cardinal-2); background: rgba(158,143,214,0.16); }
.tag.warn { color: var(--amber); background: var(--amber-bg); }
.tag.bad { color: var(--red); background: var(--red-bg); }
.tag.good { color: var(--ok); background: var(--ok-bg); }
.lvl-amber { border-color: var(--amber) !important; box-shadow: inset 4px 0 0 var(--amber); }
.lvl-red { border-color: var(--red) !important; box-shadow: inset 4px 0 0 var(--red); }
.clock-amber { color: var(--amber); }
.clock-red { color: var(--red); }

/* turn card */
.tcard { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tcard .who { font-weight: 650; font-size: 17px; }
.tcard .stage { color: var(--paper-2); font-size: 14px; }
.tcard .clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 650; font-size: 22px; }
.progress { display: flex; gap: 3px; margin-top: 8px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--ink-3); }
.progress i.done { background: var(--paper-2); }
.progress i.cur { background: var(--cardinal); }
.checklist { list-style: none; padding: 0; margin: 6px 0 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--cardinal); flex: none; }
.checklist .lbl { flex: 1; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.timeline li { padding: 5px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.timeline .t { color: var(--muted); font-family: var(--mono); min-width: 64px; }

/* alerts + toast */
.alertbar { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: var(--ink-2); }
.alertbar.amber { border-color: var(--amber); background: var(--amber-bg); }
.alertbar.red, .alertbar.escalation { border-color: var(--red); background: var(--red-bg); }
.alertbar .ttl { font-weight: 650; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 100; max-width: 92vw; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
#toast.err { background: var(--red); color: #fff; }
.banner { padding: 8px 20px; font-weight: 650; font-size: 14px; text-align: center; }
.banner.test { background: var(--amber); color: var(--ink); }
.banner.off { background: var(--ink-3); color: var(--paper-2); }

/* drawer + modal */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--ink); border-left: 1px solid var(--line-2); z-index: 51; overflow-y: auto; padding: 18px; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 94vw); background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 14px; z-index: 61; padding: 18px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 60; }

/* PIN pad */
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pinpad button { padding: 18px 0; font-size: 22px; font-weight: 650; border-radius: 11px; border: 1px solid var(--line-2); background: var(--ink-2); color:var(--paper); cursor: pointer; transition:border-color .12s,background .12s; }
.pinpad button:hover { border-color: var(--paper-2); background: var(--ink-3); }
.pindots { display: flex; gap: 12px; justify-content: center; margin: 18px 0 4px; height: 16px; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--paper-2); }
.pindots i.on { background: var(--cardinal); border-color: var(--cardinal); }

@media (max-width: 640px) {
  html, body { font-size: 18px; }
  .topbar { padding: 10px 14px; }
  .wide { padding: 14px; }
  .small { font-size: 16px; }
  .tag { font-size: 14px; padding: 3px 8px; }
  .btn { font-size: 18px; padding: 12px 16px; min-height: 48px; }
  .btn.sm { font-size: 16px; padding: 9px 13px; min-height: 42px; }
  .btn.big { font-size: 20px; padding: 17px 18px; }
  .tcard { padding: 16px; }
  .tcard .who { font-size: 24px !important; }
  .tcard .stage { font-size: 17px; }
  .tcard .clock { font-size: 30px; }
  .progress i { height: 6px; }
  input:not([type]), input[type=text], input[type=number], input[type=password], input[type=date], select, textarea { font-size: 18px; padding: 13px 14px; }
  label.field > span { font-size: 16px; }
  .checklist li { padding: 13px 0; font-size: 18px; }
  .checklist input[type=checkbox] { width: 28px; height: 28px; }
  .alertbar { font-size: 17px; padding: 14px 16px; }
  .alertbar .ttl { font-size: 18px; }
  .timeline { font-size: 16px; }
  .modal { padding: 20px; }
  .modal h2 { font-size: 22px !important; }
  .drawer { padding: 18px 16px 40px; }
  .seg button { font-size: 17px; padding: 12px 16px; }
  #toast { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media print {
  :root { --ink: #fff; --ink-2: #fff; --ink-3: #fff; --paper: #111; --paper-2: #333; --muted: #555; --line: #ccc; --line-2: #999; }
  html, body { background: #fff; color: #111; font-size: 12px; }
  .topbar, .nav, #filters, #modebanner, #toast, .btn, .drawer, .drawer-bg, #exports, #reportActions { display: none !important; }
  .panel, .kpi { border: 1px solid #bbb !important; box-shadow: none; break-inside: avoid; }
  .two { grid-template-columns: 1fr 1fr !important; }
  .bar { background: #888 !important; }
  .hidden#printhead { display: block !important; }
  a[href]:after { content: ''; }
}

/* Cardinal Owe additions */
.promise { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.dealcard { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition:border-color .12s; }
.dealcard:hover { border-color: var(--line-2); }
.lanes3 { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .lanes3 { grid-template-columns: 1fr; } }
