@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
/* Shared look for every platform module (orders, review, pick, invoicing, ...). Company colour comes from config.js. */
:root { --accent: #b4441c; --ink: #0F172A; --ink2: #334155; --mute: #64748B; --faint: #94A3B8; --line: #E6E8EC; --line2: #F1F3F5; --bg: #F6F7F9; --ok: #16A34A; --warn: #B45309; --bad: #DC2626; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body { margin: 0; font: 13px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #E2E8F0; background: #fff; border-radius: 8px; padding: 6px 12px; color: var(--ink2); }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
button.ghost { border-color: transparent; background: transparent; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid #E2E8F0; border-radius: 8px; padding: 6px 10px; background: #fff; color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: 2px solid #BFDBFE; border-color: #93C5FD; }
.hidden { display: none !important; }

/* platform bar: company, modules, user, QuickBooks agent */
#pbar { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
#pbar .brand { font-weight: 700; color: var(--accent); text-decoration: none; }
#pbar .mods { display: flex; gap: 4px; flex-wrap: wrap; }
#pbar .mods a { padding: 8px 12px; border-radius: 6px; color: var(--mute); text-decoration: none; }
#pbar .mods a.on { background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); font-weight: 600; }
.subnav { display: flex; gap: 4px; max-width: 1200px; margin: 12px auto 0; padding: 0 16px; flex-wrap: wrap; }
.subnav button { border: 1px solid transparent; background: none; padding: 6px 12px; border-radius: 6px; color: var(--mute); }
.subnav button.on { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 600; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }
.spacer { flex: 1; }
.who { color: var(--mute); font-size: 13px; text-align: right; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
main { max-width: 1200px; margin: 12px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mute); }

/* typeahead */
.typeahead { position: relative; }
.menu { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.08); max-height: 360px; overflow: auto; z-index: 10; }
.menu div { padding: 6px 10px; cursor: pointer; display: flex; gap: 10px; justify-content: space-between; }
.menu div.on, .menu div:hover { background: color-mix(in srgb, var(--accent) 10%, #fff); }
.menu small { color: var(--mute); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--mute); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover { background: #fafbfc; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef1f4; color: var(--mute); white-space: nowrap; }
.warn { color: var(--warn); } .bad { color: var(--bad); } .mute { color: var(--mute); } .kbd { font-size: 11px; color: var(--mute); }
.hold { background: #fde8e8; color: var(--bad); padding: 8px 10px; border-radius: 6px; margin-top: 8px; }
.note { background: #fff8e1; padding: 8px 10px; border-radius: 6px; margin-top: 8px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; color: var(--mute); padding: 30px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; }
#toast.err { background: var(--bad); }
dialog { border: none; border-radius: 10px; padding: 0; width: min(980px, 96vw); max-height: 90vh; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog .hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
dialog .bd { padding: 14px 16px; }

/* sign-in */
#plogin { max-width: 360px; margin: 12vh auto; }
#plogin h1 { color: var(--accent); font-size: 22px; }
#plogin input { width: 100%; margin-bottom: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tiles a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; color: var(--ink); text-decoration: none; }
.tiles a:hover { border-color: var(--accent); }
.tiles a b { display: block; font-size: 16px; margin-bottom: 4px; color: var(--accent); }
.tiles a.soon { opacity: .55; pointer-events: none; }
@media (max-width: 600px) {
  #pbar { gap: 8px; padding: 6px 12px; }
  #pbar .who { font-size: 12px; } #pbar .who br, #pbar #agentState { display: none; }
}

#wnLink { color: var(--mute); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 6px; position: relative; white-space: nowrap; }
#wnLink.on { background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); font-weight: 600; }
#wnLink .wndot { position: absolute; top: 4px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
#wnLink .wnshort { display: none; }
@media (max-width: 600px) { #wnLink { font-size: 12px; padding: 4px 6px; } #wnLink .wnfull { display: none; } #wnLink .wnshort { display: inline; }
  #pbar .who { display: none; } #pbar { gap: 6px; } #pbar .mods a { padding: 6px 7px; font-size: 12.5px; } #pbar button.ghost { padding: 4px 6px; font-size: 12px; } }
