/* Idaho Premier platform. Light mode (his rule), tokens from the /demo v1 light redesign (Geist, violet, zinc). */
:root {
  --z50:#fafafa; --z100:#f4f4f5; --z200:#e4e4e7; --z300:#d4d4d8; --z400:#a1a1aa; --z500:#71717a; --z600:#52525b; --z700:#3f3f46; --z800:#27272a; --z900:#18181b; --z950:#09090b;
  --bg: var(--z50); --surface:#fff; --fg: var(--z950); --text: var(--z900); --muted: var(--z500); --border: var(--z200); --hover: var(--z100);
  --p:#6246ea; --p-hover:#5234de; --p-ink:#3d22c3; --p-tint:#f3f0ff; --p-bd:#ddd6fe; --p-ring: rgb(98 70 234 / .18);
  --em:#10b981; --em-ink:#047857; --em-tint:#ecfdf5; --em-bd:#a7f3d0;
  --sky:#0ea5e9; --sky-ink:#0369a1; --sky-tint:#f0f9ff; --sky-bd:#bae6fd;
  --amb:#f59e0b; --amb-ink:#b45309; --amb-tint:#fffbeb; --amb-bd:#fde68a;
  --rose:#f43f5e; --rose-ink:#be123c; --rose-tint:#fff1f2; --rose-bd:#fecdd3;
  --radius:12px; --shadow: 0 1px 2px rgb(0 0 0 / .04); --shadow-lg: 0 12px 32px -12px rgb(0 0 0 / .18), 0 2px 6px -2px rgb(0 0 0 / .05);
  --ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --dur:160ms; --ease: cubic-bezier(.22,1,.36,1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin:0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: var(--p-ink); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1,h2,h3,h4 { margin:0; color: var(--fg); font-weight:600; letter-spacing:-.01em; }
h2 { font-size:16px; } h3 { font-size:14px; }
.i { width:16px; height:16px; fill:none; stroke: currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.muted { color: var(--muted); } .mono { font-family: var(--mono); font-size:12.5px; } .num { font-variant-numeric: tabular-nums; }
.small { font-size:12.5px; } .nowrap { white-space:nowrap; }

/* shell */
.shell { display:grid; grid-template-columns: 236px minmax(0,1fr); min-height:100vh; }
.side { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; border-right:1px solid var(--border); background: var(--surface); padding:14px 10px; gap:10px; overflow:hidden; }
.side-brand img { display:block; height:18px; width:auto; margin:2px 8px 4px; }
.acct { display:flex; gap:10px; align-items:center; padding:8px; border:1px solid var(--border); border-radius:10px; }
.acct svg { width:32px; height:32px; flex:none; } .acct b { display:block; color:var(--fg); font-weight:600; font-size:13px; } .acct span { font-size:12px; color:var(--muted); }
.side-scroll { overflow:auto; flex:1; min-height:0; }
.side-label { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color: var(--muted); padding:10px 10px 4px; font-weight:500; }
.side-nav a { display:flex; align-items:center; gap:9px; padding:7px 10px; border-radius:8px; color: var(--text); font-weight:500; }
.side-nav a:hover { background: var(--hover); text-decoration:none; }
.side-nav a.on { background: var(--p-tint); color: var(--p-ink); }
.side-nav .badge { margin-left:auto; }
.side-foot { border-top:1px solid var(--border); padding-top:8px; font-size:12.5px; }
.side-foot a { display:flex; gap:8px; align-items:center; padding:6px 10px; color: var(--muted); }
.main { min-width:0; display:flex; flex-direction:column; }
.top { position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:10px; padding:12px 24px; background: rgb(250 250 250 / .9); backdrop-filter: blur(8px); border-bottom:1px solid var(--border); }
.top h1 { font-size:17px; }
.top .crumb { color: var(--muted); }
.top-right { margin-left:auto; display:flex; gap:8px; align-items:center; }
#view { padding:20px 24px 60px; max-width:1240px; width:100%; outline:none; }
.side-toggle { display:none; }
.scrim { display:none; }

/* pieces */
.btn { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--border); background: var(--surface); border-radius:9px; padding:7px 12px; font-weight:500; cursor:pointer; color: var(--fg); box-shadow: var(--shadow); transition: background var(--dur), border-color var(--dur); white-space:nowrap; }
.btn:hover { background: var(--hover); }
.btn.pri { background: var(--p); border-color: var(--p); color:#fff; } .btn.pri:hover { background: var(--p-hover); }
.btn.sm { padding:4px 9px; font-size:12.5px; border-radius:8px; }
.btn.ghost { box-shadow:none; border-color: transparent; background: transparent; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline:2px solid var(--p); outline-offset:2px; }
.pill { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:1px 9px; font-size:12px; font-weight:500; border:1px solid var(--border); background: var(--z100); color: var(--z700); white-space:nowrap; }
.pill.ok { background: var(--em-tint); border-color: var(--em-bd); color: var(--em-ink); }
.pill.warn { background: var(--amb-tint); border-color: var(--amb-bd); color: var(--amb-ink); }
.pill.bad { background: var(--rose-tint); border-color: var(--rose-bd); color: var(--rose-ink); }
.pill.info { background: var(--sky-tint); border-color: var(--sky-bd); color: var(--sky-ink); }
.pill.pri { background: var(--p-tint); border-color: var(--p-bd); color: var(--p-ink); }
.dot { width:7px; height:7px; border-radius:50%; background: currentColor; display:inline-block; }
.badge { min-width:18px; height:18px; border-radius:9px; background: var(--rose); color:#fff; font-size:11px; font-weight:600; display:inline-grid; place-items:center; padding:0 5px; }
.card { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding:16px; min-width:0; }
.card + .card { margin-top:14px; }
.card-h { display:flex; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.card-h .right { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }
.grid { display:grid; gap:14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpi { padding:14px 16px; } .kpi .v { font-size:24px; font-weight:600; color: var(--fg); font-variant-numeric: tabular-nums; } .kpi .l { color: var(--muted); font-size:12.5px; }
.note-bar { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--amb-bd); background: var(--amb-tint); color: var(--amb-ink); border-radius:10px; padding:10px 12px; font-size:13px; margin-bottom:14px; }
.note-bar.info { border-color: var(--sky-bd); background: var(--sky-tint); color: var(--sky-ink); }
.note-bar.bad { border-color: var(--rose-bd); background: var(--rose-tint); color: var(--rose-ink); }
.empty { text-align:center; padding:28px 16px; color: var(--muted); border:1px dashed var(--border); border-radius:10px; background: var(--surface); }
.empty b { display:block; color: var(--fg); font-weight:600; margin-bottom:4px; }
.list { display:flex; flex-direction:column; }
.row { display:flex; align-items:center; gap:12px; padding:10px 4px; border-bottom:1px solid var(--border); cursor:pointer; min-width:0; }
.row:last-child { border-bottom:0; } .row:hover { background: var(--hover); }
.row .main-t { min-width:0; flex:1; } .row .main-t b { color: var(--fg); font-weight:500; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.row .main-t span { color: var(--muted); font-size:12.5px; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tbl-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:10px; background: var(--surface); }
table.tbl { border-collapse:collapse; width:100%; font-size:13px; }
.tbl th { text-align:left; font-weight:500; color: var(--muted); font-size:12px; padding:8px 10px; border-bottom:1px solid var(--border); background: var(--z50); white-space:nowrap; position:sticky; top:0; }
.tbl td { padding:8px 10px; border-bottom:1px solid var(--border); vertical-align:top; }
.tbl tr:last-child td { border-bottom:0; } .tbl tr.click { cursor:pointer; } .tbl tr.click:hover td { background: var(--hover); }
.tbl td.r, .tbl th.r { text-align:right; }
.toolbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
.toolbar .grow { flex:1; min-width:160px; }
.seg { display:inline-flex; border:1px solid var(--border); border-radius:9px; overflow:hidden; background: var(--surface); }
.seg button { border:0; background:transparent; padding:6px 11px; cursor:pointer; font-weight:500; color: var(--muted); }
.seg button.on { background: var(--p-tint); color: var(--p-ink); }
input.in, select.in, textarea.in { width:100%; border:1px solid var(--border); border-radius:8px; padding:7px 10px; background: var(--surface); min-width:0; }
textarea.in { min-height:72px; resize:vertical; }
.form { display:grid; gap:12px; }
.form .f2 { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.form label { display:grid; gap:4px; font-size:12.5px; color: var(--muted); font-weight:500; }
.form .actions { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.checks { display:flex; flex-wrap:wrap; gap:6px; }
.checks label { display:inline-flex; gap:6px; align-items:center; border:1px solid var(--border); border-radius:8px; padding:5px 9px; color: var(--text); font-weight:500; cursor:pointer; }
.checks input { accent-color: var(--p); }
.kv { display:grid; grid-template-columns: 140px minmax(0,1fr); gap:6px 12px; font-size:13px; }
.kv dt { color: var(--muted); } .kv dd { margin:0; color: var(--fg); overflow-wrap:anywhere; }
.timeline { display:flex; flex-direction:column; gap:8px; font-size:13px; }
.timeline div { border-left:2px solid var(--border); padding-left:10px; } .timeline small { color: var(--muted); display:block; }

/* pipeline */
.stages { display:grid; grid-auto-flow:column; grid-auto-columns: minmax(220px, 1fr); gap:12px; overflow-x:auto; padding-bottom:6px; }
.stage { background: var(--z100); border-radius:12px; padding:10px; min-height:120px; }
.stage h3 { font-size:12.5px; display:flex; justify-content:space-between; margin:2px 4px 8px; color: var(--z700); }
.jcard { background: var(--surface); border:1px solid var(--border); border-radius:10px; padding:9px 10px; margin-bottom:8px; cursor:pointer; box-shadow: var(--shadow); }
.jcard:hover { border-color: var(--p-bd); } .jcard b { color: var(--fg); font-weight:500; display:block; } .jcard span { color: var(--muted); font-size:12px; display:block; }

/* schedule */
.week { display:grid; grid-template-columns: 110px repeat(7, minmax(120px,1fr)); border:1px solid var(--border); border-radius:12px; overflow:hidden; background: var(--surface); min-width: 980px; }
.week-wrap { overflow-x:auto; }
.week .hd { background: var(--z50); padding:8px; font-size:12px; font-weight:500; color: var(--muted); border-bottom:1px solid var(--border); border-left:1px solid var(--border); }
.week .hd.today { color: var(--p-ink); background: var(--p-tint); }
.week .lane { padding:8px; font-weight:500; font-size:12.5px; border-bottom:1px solid var(--border); background: var(--z50); color: var(--fg); }
.week .cell { padding:6px; border-bottom:1px solid var(--border); border-left:1px solid var(--border); min-height:84px; display:flex; flex-direction:column; gap:6px; }
.wd { --tone: var(--sky); border:1px solid var(--border); border-left:3px solid var(--tone); border-radius:8px; padding:5px 7px; font-size:12px; cursor:pointer; background: var(--surface); text-align:left; width:100%; }
.wd b { display:block; color: var(--fg); font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .wd span { color: var(--muted); display:block; }
.wd.ld { --tone: var(--p); } .wd.com { --tone: var(--amb); } .wd.warn { --tone: var(--rose); }
.daylist .day { margin-bottom:14px; } .daylist h3 { margin-bottom:6px; }

/* automations */
.lane-map { position:relative; }
.lane-map svg.edges { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
.lane-map svg.edges path { fill:none; stroke: var(--z300); stroke-width:1.5; }
.lane-map svg.edges path.gates { stroke-dasharray:4 4; }
.dept { border:1px solid var(--border); border-radius:12px; background: var(--surface); margin-bottom:12px; position:relative; z-index:1; }
.dept-h { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color: var(--muted); padding:8px 12px; border-bottom:1px solid var(--border); background: var(--z50); border-radius:12px 12px 0 0; }
.dept-b { display:flex; flex-wrap:wrap; gap:14px; padding:14px; }
.node { position:relative; width:210px; text-align:left; border:1px solid var(--border); border-left:3px solid var(--tone, var(--z300)); border-radius:10px; padding:9px 10px; background: var(--surface); cursor:pointer; box-shadow: var(--shadow); }
.node:hover { border-color: var(--p-bd); }
.node b { display:block; font-weight:500; color: var(--fg); font-size:13px; } .node span { display:block; color: var(--muted); font-size:12px; margin-top:4px; }
.node.s-ok { --tone: var(--em); } .node.s-late, .node.s-blocked { --tone: var(--amb); } .node.s-down { --tone: var(--rose); } .node.s-off, .node.s-never, .node.s-not_built { --tone: var(--z300); }
.node.s-not_built { background: repeating-linear-gradient(135deg, var(--surface) 0 8px, var(--z50) 8px 16px); }
.bars { display:flex; align-items:flex-end; gap:3px; height:110px; padding-top:6px; border-bottom:1px solid var(--border); }
.bars div { flex:1; background: var(--p); border-radius:3px 3px 0 0; min-height:1px; position:relative; }
.bars div.err { background: var(--rose); }
.bars div.zero { background: var(--z200); }
.bar-x { display:flex; justify-content:space-between; font-size:11px; color: var(--muted); margin-top:4px; }
.hbar { display:grid; grid-template-columns: 150px minmax(0,1fr) 44px; gap:8px; align-items:center; font-size:12.5px; margin:5px 0; }
.hbar .t { height:8px; border-radius:4px; background: var(--z100); overflow:hidden; } .hbar .t i { display:block; height:100%; background: var(--p); border-radius:4px; }
.caption { font-size:11.5px; color: var(--muted); margin-top:8px; }

/* drawer, toast */
.drawer[hidden] { display:none; }
.drawer { position:fixed; inset:0; z-index:40; }
.drawer-scrim { position:absolute; inset:0; background: rgb(9 9 11 / .35); }
.drawer-panel { position:absolute; top:0; right:0; bottom:0; width:min(560px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); overflow:auto; padding:20px 20px 40px; }
.drawer-panel.wide { width:min(920px, 100%); }
.drawer-x { position:sticky; top:0; float:right; border:1px solid var(--border); background: var(--surface); border-radius:8px; width:32px; height:32px; display:grid; place-items:center; cursor:pointer; z-index:2; }
.drawer h2 { font-size:18px; margin:4px 40px 4px 0; }
.drawer .sub { color: var(--muted); margin-bottom:14px; }
.drawer section { margin-top:18px; } .drawer section > h3 { margin-bottom:8px; display:flex; align-items:center; gap:8px; }
.toast { position:fixed; left:50%; bottom:20px; transform: translateX(-50%) translateY(20px); opacity:0; background: var(--z900); color:#fff; padding:9px 14px; border-radius:10px; font-size:13px; transition: all var(--dur) var(--ease); z-index:60; pointer-events:none; max-width:calc(100% - 32px); }
.toast.on { opacity:1; transform: translateX(-50%) translateY(0); }
.transcript p { margin:0 0 8px; } .transcript b { color: var(--fg); font-weight:500; }
.bubble { max-width:80%; padding:8px 11px; border-radius:12px; margin:6px 0; font-size:13.5px; white-space:pre-wrap; overflow-wrap:anywhere; }
.bubble.in { background: var(--z100); } .bubble.out { background: var(--p-tint); margin-left:auto; }
.bubble small { display:block; color: var(--muted); font-size:11px; margin-top:3px; }

@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .side { position:fixed; left:0; top:0; bottom:0; width:260px; z-index:30; transform: translateX(-100%); transition: transform var(--dur) var(--ease); }
  .side.open { transform:none; box-shadow: var(--shadow-lg); }
  .scrim.open { display:block; position:fixed; inset:0; background: rgb(9 9 11 / .3); z-index:20; }
  .side-toggle { display:inline-flex; }
  .top { padding:10px 16px; } #view { padding:16px 16px 60px; }
  .top .crumb { display:none; }
  .g2 { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 560px) {
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form .f2 { grid-template-columns: minmax(0,1fr); }
  .kv { grid-template-columns: 110px minmax(0,1fr); }
  .node { width:100%; }
  .hbar { grid-template-columns: 110px minmax(0,1fr) 40px; }
  .stages { grid-auto-flow: row; grid-auto-columns: auto; }
  .drawer-panel { padding:16px 16px 40px; }
}
@media print {
  .side, .top, .no-print { display:none !important; } .shell { display:block; }
}

/* QA fixes 2026-10-11 */
.badge[hidden] { display:none; }
.grid > .card + .card { margin-top:0; }
.node .pill { display:inline-flex; margin-top:5px; }
.lane-map .dept { background: transparent; z-index:auto; }
.lane-map .dept-h { background: rgb(250 250 250 / .85); position:relative; z-index:2; }
.lane-map .node { z-index:2; }
.lane-map svg.edges { z-index:1; }
.lane-map svg.edges path { stroke: var(--z400); stroke-opacity:.55; }
/* 2026-10-15 onboarding build: capacity per day, Brandon's red-pen notes, balance review */
.week .hd { display:flex; flex-direction:column; gap:3px; align-items:flex-start; }
.hd-btn { background:none; border:0; padding:0; font:inherit; color:inherit; cursor:pointer; text-align:left; text-decoration: underline dotted; text-underline-offset:3px; }
.cap { font-size:11px; font-weight:500; color: var(--em-ink); background: var(--em-tint); border:1px solid var(--em-bd); border-radius:999px; padding:0 7px; }
.cap.full { color: var(--amb-ink); background: var(--amb-tint); border-color: var(--amb-bd); }
.cap.closed { color: var(--muted); background: var(--z100); border-color: var(--border); }
.redpen { display:block; width:100%; text-align:left; background:none; border:0; padding:0; font:inherit; font-size:11.5px; line-height:1.35; color: var(--rose-ink); cursor:pointer; white-space:normal; overflow-wrap:anywhere; }
.bal-row { display:grid; grid-template-columns: minmax(0,1fr) auto; gap:6px 12px; padding:10px 0; border-bottom:1px solid var(--border); align-items:center; }
.bal-row .main-t span { display:block; color: var(--muted); font-size:12.5px; }
.bal-row form { grid-column: 1 / -1; display:flex; gap:8px; flex-wrap:wrap; }
.bal-row form select { flex: 1 1 200px; } .bal-row form input { flex: 2 1 220px; }
.amt-owed { color: var(--rose-ink); font-weight:600; font-variant-numeric: tabular-nums; } .amt-credit { color: var(--em-ink); font-weight:600; font-variant-numeric: tabular-nums; }

/* 2026-10-22 night (speed + ease of use): loading skeleton, phone tap targets, no iOS zoom on focus */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.sk { display:block; border-radius:6px; background: linear-gradient(90deg, var(--z100) 25%, var(--z200) 50%, var(--z100) 75%); background-size:200% 100%; animation: sk 1.3s ease-in-out infinite; }
.sk-v { width:44px; height:26px; margin-bottom:8px; } .sk-l { width:70%; height:11px; }
.sk-h { width:40%; height:14px; margin-bottom:14px; }
.sk-row { padding:10px 0; border-bottom:1px solid var(--border); } .sk-row:last-child { border-bottom:0; }
.sk-t { width:62%; height:13px; margin-bottom:7px; } .sk-s { width:42%; height:10px; }
@keyframes sk { from { background-position:100% 0; } to { background-position:-100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation:none; } }
@media (max-width: 860px) { /* owner app only (body.office): the crew and sign pages keep their own tested sizes */
  .office .btn, .office .btn.sm, .office .seg button { min-height:44px; }
  .office .btn.sm { padding:6px 12px; font-size:13px; }
  .office .seg button { padding:8px 13px; }
  .office input.in, .office select.in, .office textarea.in { min-height:44px; font-size:16px; } /* 16px: iPhone Safari zooms into smaller inputs */
  .office .side-nav a { padding:11px 10px; }
  .office .side-foot a { padding:11px 10px; }
  .office .drawer-x { width:44px; height:44px; }
  .office .checks label { min-height:44px; }
  .office .row { padding:12px 4px; min-height:48px; }
  .office #riley-pill { min-height:44px; padding:0 12px; }
  .office .tbl tr.click td, .office .tbl tr[data-act] td { padding-top:12px; padding-bottom:12px; }
  /* Save stays in reach while a long drawer form is on screen */
  .office .drawer .form > .actions { position:sticky; bottom:0; background: var(--surface); padding:10px 0 12px; border-top:1px solid var(--border); z-index:1; }
}
@media (max-width: 560px) {
  /* search on its own full row, the two dates side by side under it */
  .office .finder #find-q { flex:1 1 100%; }
  .office .finder > label { flex:1 1 calc(50% - 4px); min-width:0; }
  .office .finder > .btn.pri { flex:1 1 100%; justify-content:center; }
  .office .finder > label input.in { width:100% !important; min-width:0; }
}
/* Schedule, Days view (phones): one list per day, cards full width */
.agenda .day { margin-bottom:14px; }
.agenda .day-h { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 8px; }
.agenda .day-h.today h3 { color: var(--p-ink); }
.agenda .lane-l { font-size:12px; font-weight:500; color: var(--muted); margin:8px 0 4px; }
.agenda .wd { padding:9px 11px; font-size:13px; margin-bottom:6px; }
