:root {
  --bg: #0f0e0c; --panel: #181613; --panel-2: #201d19; --line: #2e2a24; --line-2: #3d382f;
  --text: #ece6da; --muted: #9b9283; --faint: #6f675b;
  --brass: #c9a66b; --brass-dim: #8a7248; --green: #7fae86; --red: #d0705f; --amber: #d9a441; --blue: #7fa3c4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 8px;
}
* { box-sizing: border-box; }
#app { height: 100%; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
a { color: var(--brass); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brass-dim); outline-offset: 1px; }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.btn { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brass-dim); }
.btn.primary { background: var(--brass); border-color: var(--brass); color: #1a150c; font-weight: 600; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack > * + * { margin-top: 12px; }

/* shell */
.shell { display: flex; flex-direction: column; height: 100%; }
.brand { font-family: var(--serif); font-size: 19px; padding: 0 10px 2px; }
.brand small { display: block; font: 10px var(--sans); letter-spacing: .22em; color: var(--brass); text-transform: uppercase; margin-top: 2px; }
.nav { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.nav button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.nav button:hover { color: var(--text); background: var(--panel-2); }
.nav button.on { color: var(--text); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--brass); }
.side .who { margin-top: auto; padding: 10px; font-size: 12px; border-top: 1px solid var(--line); }
.main { overflow: auto; padding: 24px 28px 60px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { margin-right: auto; }
.head input[type=search] { width: 220px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile .v { font-family: var(--serif); font-size: 28px; margin-top: 4px; }
.tile.warn .v { color: var(--amber); } .tile.bad .v { color: var(--red); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

/* tabs & pills */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--brass); }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.brass { color: var(--brass); border-color: var(--brass-dim); } .pill.green { color: var(--green); border-color: #3e5a43; }
.pill.red { color: var(--red); border-color: #6a3a31; } .pill.amber { color: var(--amber); border-color: #6b5220; } .pill.blue { color: var(--blue); border-color: #3b5167; }

/* board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 250px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col.over { border-color: var(--brass); }
.col-h { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.col-h b { font-weight: 600; font-size: 13px; } .col-h span { font-size: 11px; color: var(--muted); }
.col-b { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.lead { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; cursor: pointer; }
.lead:hover { border-color: var(--line-2); } .lead.fresh { box-shadow: inset 3px 0 0 var(--brass); }
.lead .t { font-weight: 600; overflow-wrap: anywhere; } .lead .s { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.lead .f { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--faint); align-items: center; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; } tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: var(--panel-2); }
td.r, th.r { text-align: right; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); border-left: 1px solid var(--line-2); z-index: 11; overflow-y: auto; padding: 22px 24px 60px; }
.drawer .x { position: absolute; top: 14px; right: 14px; }
.drawer h2 { padding-right: 40px; overflow-wrap: anywhere; }
.sec { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sec > h3 { margin-bottom: 10px; color: var(--brass); font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.act { padding: 8px 0; border-bottom: 1px dashed var(--line); } .act:last-child { border: 0; }
.act .m { font-size: 11px; color: var(--faint); } .act .b { white-space: pre-wrap; overflow-wrap: anywhere; }
.act.inbound .b { border-left: 2px solid var(--brass-dim); padding-left: 8px; }
.draft { background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border: 0; } .item input[type=checkbox] { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--brass); }
.item.done .grow { text-decoration: line-through; color: var(--faint); }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 50% 0, #241f17, var(--bg)); }
.login form { width: min(360px, 100%); } .login .brand { font-size: 28px; padding: 0; margin-bottom: 24px; text-align: center; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 90vw; }
#toast.show { opacity: 1; } #toast.err { background: var(--red); color: #fff; }
.empty { color: var(--faint); padding: 18px; text-align: center; }

@media (max-width: 820px) {
  .main { padding: 16px 16px 40px; } .cols, .grid2 { grid-template-columns: 1fr; }
  .head input[type=search] { width: 100%; } .col { flex-basis: 78vw; max-height: none; }
  .drawer { padding: 18px 16px 60px; }
}

/* delivery tracking */
.lead.unopened { border-color: #6a3a31; background: color-mix(in srgb, var(--red) 9%, var(--panel-2)); box-shadow: inset 3px 0 0 var(--red); }
.lead .trail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
.lead.unopened .trail b { color: var(--red); font-weight: 600; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; }
.steps div { border-top: 2px solid var(--line-2); padding-top: 6px; font-size: 11px; color: var(--faint); }
.steps div.on { border-color: var(--brass); color: var(--muted); } .steps span { display: block; text-transform: uppercase; letter-spacing: .08em; }
.steps b { font-weight: 500; font-size: 13px; color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; } .dot.live { background: var(--green); }
.maincol { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; } .maincol .main { flex: 1; }
.nudge { background: var(--red); color: #fff; border: 0; padding: 10px 16px; font-weight: 600; cursor: pointer; text-align: left; }
.maincol .main { min-height: 0; }

.card.report { margin-bottom: 24px; }
.card.report .tile .v { font-size: 22px; }
.reptext { white-space: pre-wrap; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-top: 10px; max-height: 420px; overflow: auto; }

/* 16:00 rundown (13 Oct 2026) */
.rundown ul.rd { list-style: none; margin: 0; padding: 0; }
.rundown ul.rd li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); line-height: 1.4; }
.rundown ul.rd li:first-child { border-top: 0; }
.rundown ul.rd li a { color: var(--text); }
.rundown .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); display: inline-block; transform: translateY(-1px); }
.rundown .dot.amber { background: var(--amber); } .rundown .dot.green { background: var(--green); } .rundown .dot.blue { background: var(--blue); }

.orow { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 4px 0; font-size: 14px; }
.ochat { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.omsg { border-left: 2px solid var(--line-2); padding: 4px 10px; white-space: pre-wrap; word-break: break-word; }
.omsg.team { border-left-color: var(--faint); background: var(--panel-2); border-radius: 0 6px 6px 0; }
@media (max-width: 560px) { .orow { grid-template-columns: 1fr; gap: 2px; } }

.othumb { display: block; max-width: 220px; max-height: 220px; border-radius: 6px; margin: 4px 0; object-fit: cover; background: var(--panel-2); }
.oaudio { width: 100%; max-width: 300px; margin: 4px 0; }

/* pipeline stage tabs */
.stagetabs button .n { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: var(--panel-2); font-size: 11px; color: var(--muted); text-align: center; }
.stagetabs button.on .n { background: var(--brass); color: var(--bg); }
.stagesum { font-size: 12px; margin: -6px 0 10px; }
.stagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; align-items: start; }
.lead .moveto { margin-top: 8px; width: 100%; font-size: 12px; padding: 4px 6px; }

/* complaints tab (15 Oct 2026) */
.cbreak { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.complaint.sev { box-shadow: inset 3px 0 0 var(--red); }
.complaint.done { opacity: .78; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 20px; }
.cline { display: flex; gap: 10px; font-size: 13px; padding: 3px 0; }
.cline .ck { flex: 0 0 120px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.cline .cv { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cmsgs { margin-top: 10px; } .cmsgs > summary { cursor: pointer; color: var(--brass); font-size: 12px; }
@media (max-width: 600px) { .cline { flex-direction: column; gap: 0; } .cline .ck { flex: none; } }

.note-open{cursor:pointer;border-radius:6px}
.note-open:hover,.note-open:focus-visible{background:rgba(255,255,255,.04);outline:none}
.note-more{color:var(--brass, #c9a45c)}

/* ---- top bar + hamburger menu (17 Oct 2026) ---- */
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.topbar .brand { cursor: pointer; padding: 0 4px; font-size: 18px; line-height: 1.15; }
.topbar .brand small { font-size: 9px; }
.ibtn { position: relative; width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; padding: 0; }
.ibtn:hover { border-color: var(--brass-dim); }
.ibtn.primary { background: var(--brass); border-color: var(--brass); color: #1a150c; }
.mbadge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--amber); color: #1a150c; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mbadge[hidden] { display: none; }
.ibtn .mbadge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; }
.menu-root[hidden] { display: none; }
.menu-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; animation: mfade .15s ease; }
.menu-panel { position: fixed; top: 0; left: 0; bottom: 0; width: min(310px, 86vw); z-index: 41; background: var(--panel); border-right: 1px solid var(--line-2); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); animation: mslide .18s ease; box-shadow: 8px 0 30px rgba(0,0,0,.4); }
@keyframes mslide { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.menu-top { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.menu-top .brand { padding: 0; }
.menu-nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.menu-h { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 4px; }
.menu-nav a { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.menu-nav a:hover { background: var(--panel-2); text-decoration: none; }
.menu-nav a.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--brass); }
.menu-who { display: flex; align-items: center; gap: 10px; padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brass-dim); color: #1a150c; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }

/* ---- Today page ---- */
.hero { margin: -24px -28px 18px; padding: 26px 28px 20px; background: linear-gradient(180deg, #1c1915 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.hero-date { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: 34px; margin-top: 6px; }
.waitbar { margin-top: 16px; max-width: 560px; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid #6b5220; background: #2a2114; }
.waitbar .wn { font-family: var(--serif); font-size: 34px; color: var(--amber); line-height: 1; }
.waitbar .btn { background: var(--amber); border-color: var(--amber); color: #1a150c; font-weight: 600; min-height: 44px; padding: 0 18px; }
.waitbar.ok { border-color: #3e5a43; background: color-mix(in srgb, var(--green) 10%, var(--panel)); color: var(--green); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; max-width: 640px; }
.qbtn { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 12px; }
.qbtn svg { color: var(--brass); } .qbtn:hover { border-color: var(--brass-dim); }
.tile.tap { text-align: left; cursor: pointer; color: inherit; font: inherit; }
.tile.tap:hover { border-color: var(--brass-dim); }
.tile .v.small { font-size: 20px; padding-top: 8px; }
.floor { margin-bottom: 20px; }
.floor-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.carcard { scroll-snap-align: start; text-align: left; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); overflow: hidden; cursor: pointer; font: inherit; }
.carcard:hover { border-color: var(--brass-dim); }
.carcard img { display: block; width: 100%; height: 132px; object-fit: cover; background: var(--panel-2); }
.cc-body { padding: 10px 12px; } .cc-name { font-size: 13px; } .cc-price { color: var(--brass); font-size: 13px; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chips button { min-height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.chips button.on { background: var(--brass); border-color: var(--brass); color: #1a150c; font-weight: 600; }

@media (max-width: 820px) {
  .topbar { padding-left: 10px; padding-right: 10px; }
  .hero { margin: -16px -16px 14px; padding: 20px 16px 16px; }
  .hero h1 { font-size: 28px; }
  .quick { gap: 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px 14px; } .tile .v { font-size: 24px; }
  .floor-strip { grid-auto-columns: 200px; margin-right: -16px; padding-right: 16px; }
  .main { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .tabs button { padding: 10px 12px; }
}
.shell > .maincol { flex: 1; }
.carcard { display: flex; flex-direction: column; justify-content: flex-start; } .carcard img { flex: none; }
