:root {
  color-scheme: dark;
  --bg: #070809; --card: #141516; --card2: #101112; --hover: #1b1c1e; --line: #232427; --line2: #1b1c1e; --ink: #f2f2f2; --ink2: #c8c8cc; --muted: #9a9aa0; --faint: #8a8a90;
  --blue: #4c8dff; --blue-d: #3a78e8; --bluebg: rgba(76,141,255,.14);
  --orange: #ff9f45; --orangebg: rgba(255,159,69,.14); --green: #34c759; --greenbg: rgba(52,199,89,.12);
  --red: #ff5a50; --redbg: rgba(255,59,48,.14); --purple: #b58cff; --purplebg: rgba(181,140,255,.14); --grey: #9a9aa0; --greybg: #1b1c1e;
  --side: 224px; --top: 56px; --nav: 60px; --r: 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.4; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .pad { padding: 16px; }
.mono, .tagtxt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tagtxt { color: var(--muted); word-break: break-all; }
/* sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 8px; padding: 14px 16px; color: var(--ink); text-decoration: none !important; }
.mark { font-weight: 900; letter-spacing: -0.04em; font-size: 17px; background: #111; color: #fff; padding: 3px 7px; border-radius: 6px; }
.brand-text { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.new-order { margin: 2px 12px 10px; background: var(--blue); color: var(--on-accent); border-radius: var(--r); padding: 9px 12px; font-weight: 700; text-align: center; }
.new-order:hover { background: var(--blue-d); text-decoration: none; }
.side-nav { display: flex; flex-direction: column; padding: 0 8px; overflow-y: auto; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink2); font-weight: 600; }
.side-nav a:hover { background: var(--bg); text-decoration: none; }
.side-nav a.on { background: var(--bluebg); color: var(--blue); }
.side-nav .i { width: 18px; text-align: center; color: var(--faint); }
.side-nav a.on .i { color: var(--blue); }
.side-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); padding: 14px 10px 4px; font-weight: 700; }
.side-foot { font-size: 11px; color: var(--faint); padding: 12px 16px; border-top: 1px solid var(--line2); }
.app { margin-left: var(--side); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.top-search { flex: 1; max-width: 520px; }
.top-search input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r); padding: 8px 12px; font: inherit; }
#staff { border: 1px solid var(--line); border-radius: var(--r); padding: 7px 10px; font: inherit; background: var(--card); margin-left: auto; max-width: 160px; }
#staff.unset { border-color: var(--orange); color: var(--orange); }
.hamburger, .brand-sm, .show-sm-only { display: none; }
.hamburger { border: 0; background: none; font-size: 20px; padding: 6px; cursor: pointer; }
#banner .example { background: var(--card); color: var(--ink2); font-size: 12px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
main { padding: 20px 24px 40px; max-width: 1280px; outline: none; }
nav.bottom { display: none; }
/* headings / layout */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; margin: 0; font-weight: 700; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 15px; margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.card-head .right { margin-left: auto; }
.card-body { padding: 12px 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
/* tables */
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: var(--card); }
.t tr.click { cursor: pointer; }
.t .num { text-align: right; white-space: nowrap; }
.t tr.bundle-row td { background: var(--card); font-weight: 700; }
.t tr.child td:first-child { padding-left: 28px; }
.empty { padding: 18px 14px; color: var(--muted); }
/* pills / chips */
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; border: 1px solid transparent; }
.pill.reserved { background: var(--bluebg); color: var(--blue); }
.pill.started { background: var(--orangebg); color: var(--orange); }
.pill.returned, .pill.in { background: var(--greenbg); color: var(--green); }
.pill.late, .pill.missing { background: var(--redbg); color: var(--red); }
.pill.short { background: var(--purplebg); color: var(--purple); }
.pill.canceled, .pill.service { background: var(--greybg); color: var(--grey); }
.pill.out { background: var(--orangebg); color: var(--orange); }
.idchip { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); background: var(--card); margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tabs a, .tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 10px; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tabs a.on, .tabs button.on { color: var(--blue); border-bottom-color: var(--blue); text-decoration: none; }
.tabs .count { font-size: 11px; background: var(--greybg); color: var(--muted); border-radius: 10px; padding: 0 6px; margin-left: 4px; }
/* buttons / forms */
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; cursor: pointer; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none !important; white-space: nowrap; }
button:hover, .btn:hover { background: var(--card); }
.btn.blue, button.blue { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.btn.orange, button.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.green, button.green { background: var(--green); border-color: var(--green); color: #fff; }
button.danger { color: var(--red); }
.btn.sm, button.sm { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.field input, .field select, .field textarea, input.search { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font: inherit; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 12px; }
.check { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--line2); }
.check input { width: 17px; height: 17px; flex: none; }
.dim { opacity: 0.6; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.toggle input { width: 17px; height: 17px; }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meta-grid > div { padding: 12px 14px; border-right: 1px solid var(--line2); }
.meta-grid > div:last-child { border-right: 0; }
.meta-grid .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.meta-grid .v { font-weight: 600; margin-top: 2px; }
/* stats */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; color: var(--ink); text-decoration: none !important; }
.stat .n { font-size: 22px; font-weight: 800; }
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.stat.red .n { color: var(--red); } .stat.orange .n { color: var(--orange); } .stat.green .n { color: var(--green); }
/* scan dialog */
.dialog { max-width: 1100px; }
.dialog .card-head h2 { font-size: 18px; }
.scanbox { padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.scanbox input#scan { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 15px; padding: 10px 12px; border-radius: var(--r); border: 2px solid var(--line); }
.scanbox.live input#scan { border-color: var(--blue); }
.scanstate { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.scanbox.live .scanstate { color: var(--blue); }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line2); }
.summary div { padding: 8px; text-align: center; }
.summary .n { font-size: 22px; font-weight: 800; }
.summary .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.s-present { color: var(--green); background: var(--greenbg); } .s-missing { color: var(--red); background: var(--redbg); } .s-extra { color: var(--ink2); background: var(--card); }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col { border-right: 1px solid var(--line2); min-height: 120px; }
.col:last-child { border-right: 0; }
.col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin: 0; padding: 8px 14px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line2); }
.col.present h3 { color: var(--green); } .col.missing h3 { color: var(--red); } .col.extra h3 { color: var(--ink2); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--line2); }
.list li:last-child { border-bottom: 0; }
.dialog-foot { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--card); position: sticky; bottom: 0; border-radius: 0 0 var(--r) var(--r); }
.dialog-foot .grow { flex: 1; }
.flash { animation: flash 0.6s ease-out; }
@keyframes flash { from { background: var(--card2); } to { background: transparent; } }
/* calendar */
.cal { display: grid; min-width: 760px; }
.cal .hd { font-size: 11px; color: var(--muted); text-align: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.cal .hd.today { color: var(--blue); }
.cal .lbl { padding: 6px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.cal .cell { border-bottom: 1px solid var(--line2); border-left: 1px solid var(--line2); }
.cal .cell.today { background: var(--card); }
.cal .bar { margin: 5px 2px; border-radius: 4px; font-size: 11px; font-weight: 700; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.scroll-x { overflow-x: auto; }
table.preview { width: 100%; border-collapse: collapse; font-size: 12px; }
table.preview th, table.preview td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line2); }
.cam { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; }
.cam video, .cam #qr-reader { flex: 1; width: 100%; object-fit: cover; }
.cam .bar2 { display: flex; justify-content: space-between; align-items: center; padding: 12px; color: #fff; }
.menu-pop { position: relative; display: inline-block; }
.menu-pop .pop { display: none; position: absolute; right: 0; top: 110%; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(16,24,40,.12); min-width: 180px; z-index: 20; }
.menu-pop.open .pop { display: block; }
.menu-pop .pop button { width: 100%; border: 0; justify-content: flex-start; border-radius: 0; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); top: 66px; z-index: 90; background: #1d2433; color: #fff; padding: 9px 16px; border-radius: var(--r); font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 92vw; }
#toast.show { opacity: 1; } #toast.err { background: var(--red); }
/* tablet / phone */
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 35; }
  body.menu-open .scrim { display: block; }
  .app { margin-left: 0; }
  .hamburger, .brand-sm { display: inline-flex; }
  .brand-sm { padding: 0; }
  .topbar { padding: 0 10px; gap: 6px; }
  .top-search input { font-size: 15px; padding: 7px 10px; }
  #staff { max-width: 116px; font-size: 13px; padding: 6px; }
  main { padding: 12px 10px calc(var(--nav) + 24px); }
  .page-head h1 { font-size: 19px; }
  .two, .grid3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 8px 10px; } .stat .n { font-size: 19px; }
  .hide-sm { display: none !important; }
  .show-sm-only { display: block; }
  .t th, .t td { padding: 8px 8px; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .meta-grid > div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line2); }
  .cols { grid-template-columns: 1fr; }
  .col { border-right: 0; border-bottom: 1px solid var(--line2); min-height: 0; }
  .dialog-foot { bottom: calc(var(--nav) + env(safe-area-inset-bottom)); }
  .dialog-foot .primary-act { flex: 1; }
  nav.bottom { display: grid; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); height: calc(var(--nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  nav.bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
  nav.bottom a .i { font-size: 17px; line-height: 1.3; }
  nav.bottom a.on { color: var(--blue); }
  nav.bottom a.nav-new .i { background: var(--blue); color: var(--on-accent); border-radius: 8px; width: 30px; text-align: center; }
}

/* ---- v3: login ---- */
.login-page { display: grid; place-items: center; min-height: 100vh; background: var(--bg, var(--card2)); padding: 16px; }
.login-card { width: 100%; max-width: 380px; border-radius: 22px; }
.login-brand { padding: 0; margin: 0; }
.login-err { color: var(--red); min-height: 1.2em; font-size: 13px; margin: 2px 0 10px; }
.me-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.me-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.secret-once { font-family: ui-monospace, monospace; background: var(--orangebg); padding: 8px 10px; border-radius: 6px; user-select: all; }

/* ---- v3: tasks ---- */
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: var(--on-accent); display: inline-grid; place-items: center; font-weight: 700; font-size: 11px; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; margin-left: -4px; border: 2px solid var(--card); }
.avatars { white-space: nowrap; }
.dept { font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; }
.dept-cam { background: var(--bluebg); color: var(--blue); } .dept-lg { background: var(--orangebg); color: var(--orange); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 11px; background: var(--greybg); color: var(--ink2); border-radius: 999px; padding: 1px 8px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
a.chip:hover { background: var(--bluebg); text-decoration: none; }
.overdue { color: var(--red); font-weight: 700; }
.group-head { padding: 10px 14px 4px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg a { padding: 6px 10px; color: var(--ink2); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--bluebg); color: var(--blue); }
.seg a:hover { text-decoration: none; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 10px; padding: 12px; overflow-x: auto; background: var(--bg); }
.board-col { background: var(--card2); border-radius: 8px; padding: 8px; min-height: 160px; }
.board-col.over { outline: 2px dashed var(--blue); }
.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.board-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.board-card:hover { text-decoration: none; border-color: var(--blue); }
.bc-title { display: block; font-weight: 600; font-size: 13px; color: var(--ink); }
.board-card { cursor: pointer; }
.bc-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.board-empty { color: var(--faint); text-align: center; padding: 10px; }
.assignees { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0; }
.nav-count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.nav-count:empty { display: none; }
#comments li.sys { color: var(--muted); }

/* ---- v3: photos ---- */
.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--card2); flex: none; border: 1px solid var(--line2); }
.thumb.sm { width: 32px; height: 32px; }
.thumb.lg { width: 100%; height: 220px; border-radius: 0; border: 0; object-fit: contain; background: var(--card); }
.thumb.xl { width: 100%; height: 260px; border-radius: 0; border: 0; object-fit: contain; background: var(--card); }
td.with-thumb { display: flex; align-items: center; gap: 10px; }
.list li .thumb { margin-right: 8px; }
.product-photo-card { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; overflow: hidden; }
.product-photo { border-right: 1px solid var(--line2); }
@media (max-width: 720px) { .product-photo-card { grid-template-columns: 1fr; } .product-photo { border-right: 0; } }
label.btn input[hidden] { display: none; }

/* ---- v3: assistant ---- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 50%; background: #111; color: #fff; font-size: 22px; border: 0; box-shadow: 0 8px 24px rgba(16,24,40,.25); z-index: 60; padding: 0; }
.chat-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(16,24,40,.08); display: none; flex-direction: column; z-index: 70; }
body.chat-open .chat-panel { display: flex; }
body.chat-open .chat-fab { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.msg { max-width: 88%; padding: 8px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.msg.me { align-self: flex-end; background: var(--blue); color: var(--on-accent); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.err { border-color: var(--red); color: var(--red); }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line2); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; font: inherit; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; }
.confirm-card { margin-top: 8px; border: 1px solid var(--orange); background: var(--orangebg); border-radius: 8px; padding: 8px 10px; color: var(--ink); }
.confirm-card.confirmed { border-color: var(--green); background: var(--greenbg); }
.confirm-card.dismissed { opacity: .6; }
.cc-title { font-weight: 700; }
.confirm-card ul { margin: 4px 0; padding-left: 18px; font-size: 12.5px; }
.cc-actions { display: flex; gap: 6px; margin-top: 6px; }
.cc-state { font-size: 12.5px; margin-top: 4px; font-weight: 600; }
@media (max-width: 860px) { .chat-fab { bottom: calc(var(--nav) + 14px); } }
.chat-suggest[hidden] { display: none; }
.chat-link{display:inline-block;margin-top:8px;text-decoration:none}

/* ===== staff workspace (layout from the check-in template, 2117 colours) ===== */
:root { --gold: #c99a2e; --goldbg: rgba(233,196,106,.18); --goldline: rgba(201,154,46,.35); --ease: cubic-bezier(.2,.8,.2,1); }
.pill.tone-g { background: rgba(52,199,89,.14); color: var(--ink2); border-color: rgba(52,199,89,.25); }
.pill.tone-y { background: rgba(255,204,0,.18); color: var(--ink2); border-color: rgba(255,204,0,.35); }
.pill.tone-a { background: rgba(255,176,32,.16); color: var(--ink2); border-color: rgba(255,176,32,.35); }
.pill.tone-n { background: var(--card2); color: var(--ink2); border-color: var(--line); }
.pill.tone-r { background: rgba(255,59,48,.12); color: var(--ink2); border-color: rgba(255,59,48,.25); }
.pill[class*="tone-"] { border-radius: 999px; text-transform: none; letter-spacing: 0; font-size: 10.5px; font-weight: 600; padding: 3px 8px; margin-left: 4px; }
.gold-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--goldbg); color: var(--ink2); border: 1px solid var(--goldline); white-space: nowrap; }
.ghost, button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btnlike { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.danger-text { color: var(--red) !important; }
.badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; margin-left: 4px; line-height: 16px; text-align: center; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; align-items: end; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.filters select, .filters input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font: inherit; font-size: 13px; }
.chip.on { background: var(--bluebg); color: var(--blue); border-color: var(--blue); }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; border: 2px solid var(--card); }
.avs .avatar.xs + .avatar.xs { margin-left: -8px; }
.avs { display: inline-flex; align-items: center; gap: 4px; }
.group-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; cursor: pointer; }
.empty.small { padding: 12px 14px; }
/* bell */
#bell { margin-left: auto; }
.bell-btn { border: 0; background: transparent; font-size: 18px; padding: 6px 8px; position: relative; }
.bell-btn .badge { position: absolute; top: 0; right: 0; }
.bell-list { width: min(360px, 92vw); max-height: 70vh; overflow: auto; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line2); }
.bell-list .note { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--line2); color: var(--ink); text-decoration: none; }
.bell-list .note.unread { background: var(--card); }
.menu-pop .pop .bell-head button { width: auto; }
/* home */
.home-hero h1 { margin: 0; font-size: 24px; font-weight: 800; }
.home-hero { margin-bottom: 14px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.punch { background: var(--card); color: var(--ink); border-radius: 28px; padding: 22px 22px 24px; margin-bottom: 14px; box-shadow: 0 30px 60px -20px rgba(20,20,20,.18), 0 8px 20px -8px rgba(20,20,20,.08); }
.punch .muted, .punch .small.muted { color: #9a9aa0; }
.punch .punch-state { margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.punch .punch-state .pill { margin-left: 0; }
.punch .punch-label { font-size: 12px; font-weight: 700; color: var(--ink2); margin: 10px 0 6px; }
.punch .npf { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border: 1px solid rgba(0,0,0,.6); border-radius: 14px; background: #1b1c1e; margin-bottom: 6px; cursor: pointer; }
.punch .npf b { display: block; font-size: 15px; color: var(--ink); }
.punch .npf select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px; font: inherit; }
.punch .npf input[type=checkbox] { width: 20px; height: 20px; accent-color: #34c759; }
.punch .field > span { color: var(--ink2); }
.punch .field input, .punch .field textarea { background: var(--card2); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; }
.punch .seg { display: flex; gap: 8px; margin-bottom: 10px; }
.punch .seg label { flex: 1; }
.punch .seg input { position: absolute; opacity: 0; }
.punch .seg span { display: block; text-align: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); font-weight: 700; cursor: pointer; }
.punch .seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.punch .seg input:focus-visible + span { outline: 3px solid rgba(233,196,106,.5); }
.punch-btn { width: 100%; height: 58px; border-radius: 14px; background: var(--accent); color: var(--on-accent); border: 0; font-size: 17px; font-weight: 800; letter-spacing: .04em; }
.punch-btn:hover { background: #fff; }
.punch-btn.out { background: #e9c46a; }
.brief { display: flex; gap: 10px; align-items: flex-start; padding: 9px 14px; border-bottom: 1px solid var(--line2); }
.brief.done .grow { text-decoration: line-through; color: var(--muted); }
.brief.urgent { background: rgba(255,59,48,.05); }
.note-lock { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.note-lock input { width: 80px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.note-body { flex-basis: 100%; background: var(--card); border-radius: 10px; padding: 10px 12px; }
.check-line { display: flex; gap: 8px; padding: 4px 0; }
.help details { border-bottom: 1px solid var(--line2); padding: 8px 0; } .help summary { cursor: pointer; font-weight: 600; }
.pcards { display: grid; gap: 10px; padding: 12px; }
.pcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; color: var(--ink); text-decoration: none !important; }
.pcard.shoot { background: var(--card); }
.checklist { display: grid; gap: 2px; margin-top: 6px; }
/* progress bar */
.pbar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pbar .track { flex: 1; height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.pbar .fill { height: 100%; border-radius: 6px; background: #34c759; }
.pbar .pct { font-size: 11.5px; font-weight: 600; color: var(--muted); min-width: 32px; text-align: right; }
/* task cards */
.tcards { display: grid; gap: 8px; padding: 2px 0 6px; }
.card .tcards { padding: 10px 12px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.tc-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.tc-title { font-weight: 700; color: var(--ink); }
.tc-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 8px; }
.tc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill-pick { position: relative; }
.pill-btn { border: 0; background: none; padding: 0; }
.pill-btn .pill::after { content: ''; display: inline-block; margin-left: 5px; border: 4px solid transparent; border-top-color: currentColor; vertical-align: -2px; }
.pick-menu { position: absolute; right: 0; top: 110%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(16,24,40,.12); padding: 6px; z-index: 30; display: grid; gap: 4px; min-width: 150px; }
.pick-menu button { border: 0; justify-content: flex-start; padding: 4px; }
.pick-menu button.on { background: var(--card2); }
.overdue { color: var(--red); font-weight: 700; }
/* projects + timeline */
.projs { display: grid; gap: 10px; }
.proj { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.proj-head { display: block; padding: 16px 18px; color: var(--ink); text-decoration: none !important; }
.proj-body { padding: 0 18px 16px; animation: open .25s var(--ease); }
@keyframes open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.proj-meta { display: grid; gap: 6px; margin: 10px 0; }
.timeline-wrap { background: var(--card); border-radius: 14px; padding: 10px 12px; }
.tl-label { letter-spacing: .06em; font-weight: 700; margin-bottom: 6px; }
.tl-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); padding: 4px 4px 8px; }
.step { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; background: none; padding: 0 6px 0 0; text-align: left; white-space: normal; border-radius: 0; }
.step::before { content: ''; position: absolute; left: 16px; right: 0; top: 7px; height: 2px; background: var(--card2); }
.step:last-child::before { display: none; }
.step .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 2px solid #9a9aa0; position: relative; z-index: 1; margin-bottom: 4px; }
.step.done .dot { background: #8a8a90; border-color: #8a8a90; } .step.done::before { background: #b9bac0; }
.step.current .dot { background: #e9c46a; border-color: #e9c46a; box-shadow: 0 0 0 4px rgba(233,196,106,.25); }
.step.current::before { background: linear-gradient(90deg, #e9c46a 0%, var(--card2) 100%); }
.step .nm { font-size: 13px; font-weight: 650; color: var(--ink2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.current .nm { color: var(--ink); }
.step .dt { font-size: 11.5px; color: #8a8a90; border-bottom: 1px dotted #9a9aa0; cursor: pointer; }
.step .dl { font-size: 11px; font-weight: 650; color: #8a8a90; } .step.current .dl { color: var(--gold); }
.step.picked .nm { text-decoration: underline; }
.ms-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.ms-form input { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; min-width: 108px; }
.phase-group h4 { margin: 12px 0 6px; font-size: 13px; }
.loadbar { width: 90px; height: 6px; background: var(--card2); border-radius: 6px; overflow: hidden; } .loadbar span { display: block; height: 100%; background: var(--gold); }
/* comments sheet */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 70; display: flex; align-items: center; justify-content: center; }
.sheet { background: var(--card); width: min(560px, 94vw); max-height: 86vh; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
.sheet.small-sheet { max-width: 480px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.thread { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--card2); min-height: 160px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; cursor: pointer; }
.bubble-row.me { flex-direction: row-reverse; }
.bubble { max-width: 84%; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; }
.bubble-row.me .bubble { background: var(--card2); border-color: var(--line); border-radius: 16px 16px 4px 16px; }
.bubble .meta { font-size: 11px; color: #8a8a90; margin-bottom: 6px; line-height: 1.2; }
.quote { border-left: 3px solid var(--gold); padding: 2px 8px; margin-bottom: 4px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sys-line { text-align: center; font-size: 11px; color: #8a8a90; }
.composer { padding: 8px 12px 12px; border-top: 1px solid var(--line2); display: grid; gap: 8px; }
.composer input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; font: inherit; font-size: 15px; }
@media (min-width: 900px) {
  .sheet-wrap:not(:has(.small-sheet)) { justify-content: flex-end; align-items: stretch; background: rgba(0,0,0,.25); }
  .sheet-wrap:not(:has(.small-sheet)) .sheet { width: 372px; max-height: 100%; border-radius: 0; }
}
/* team calendar */
.month .mhead, .month .mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month .mhead div { font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--line); }
.mday { min-height: 96px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.mday.other { background: var(--card); color: var(--faint); } .mday.today { background: var(--card); } .mday.wkend { background: var(--card); }
.mday .dn { font-size: 12px; font-weight: 700; } .mday .hol { color: var(--red); font-weight: 600; font-size: 10px; }
.ev { display: block; font-size: 10.5px; line-height: 1.3; padding: 1px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-decoration: none !important; }
.ev-task { background: var(--card2); } .ev-task.tone-y { background: rgba(255,204,0,.2); } .ev-task.tone-a { background: rgba(255,176,32,.18); } .ev-task.tone-g { background: rgba(52,199,89,.15); } .ev-task.tone-r { background: rgba(255,59,48,.12); }
.ev-ms { background: var(--goldbg); } .ev-shoot { background: var(--card2); } .ev-leave { background: var(--card2); } .ev-order { background: var(--bluebg); color: var(--blue); }
/* admin */
.admin-tabs { margin-bottom: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.t.sticky thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.t tr.total td { border-top: 2px solid var(--line); font-weight: 700; }
.t td input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; width: 100%; }
.plan-item { padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.plan-notin { border-top: 2px dashed var(--line); }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .sheet-wrap { align-items: flex-end; }
  .sheet { width: 100vw; max-height: 88vh; border-radius: 24px 24px 0 0; }
  .punch { border-radius: 22px; padding: 16px; }
  .grid4, .grid2 { grid-template-columns: 1fr; }
  .mday { min-height: 70px; } .ev { font-size: 9.5px; }
  .tabs { padding: 0 2px; }
  .admin-tabs { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .proj-body { animation: none; } * { transition: none !important; } }
.side-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 12px 14px 4px; }

/* ---- v5.1 dark theme (Shaffuan's spec 5.2: #070809 page, #141516 cards, #F2F2F2 text) ---- */
:root { --gold: #e9c46a; --goldbg: rgba(233,196,106,.14); --goldline: rgba(233,196,106,.22); }
html, body { -webkit-font-smoothing: antialiased; }
.mark { background: #f2f2f2; color: #0b0b0c; }
.sidebar, .topbar, nav.bottom { background: var(--chrome); }
.side-nav a:hover, button:hover, .btn:hover, .t tbody tr:hover { background: var(--hover); }
button.blue:hover, .btn.blue:hover { background: var(--blue-d); }
.btn.blue, button.blue, .new-order { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.blue:hover, button.blue:hover, .new-order:hover { background: var(--accent-d); }
.chat-fab { background: var(--accent); color: var(--on-accent); }
#toast { background: var(--accent); color: var(--on-accent); }
.pill.tone-g { background: rgba(52,199,89,.12); color: #34c759; border-color: rgba(52,199,89,.28); }
.pill.tone-y { background: rgba(255,204,0,.12); color: #ffcc00; border-color: rgba(255,204,0,.28); }
.pill.tone-a { background: rgba(255,176,32,.12); color: #ffb020; border-color: rgba(255,176,32,.28); }
.pill.tone-n { background: var(--card2); color: var(--ink2); border-color: var(--line); }
.pill.tone-r { background: rgba(255,59,48,.14); color: #ff6b61; border-color: rgba(255,59,48,.3); }
.gold-pill { color: #e9c46a; }
.s-extra, .col.extra h3 { color: #ffb020 !important; } .s-extra { background: rgba(255,176,32,.12) !important; }
#banner .example { background: rgba(255,176,32,.12); color: #ffb020; border-bottom-color: rgba(255,176,32,.25); }
.bubble { background: #151618; border-color: #000; }
.bubble-row.me .bubble { background: #1f2a3d; border-color: #000; }
.thread { background: #0b0c0d; }
.pcard.shoot { background: #17140d; }
.ev-task { background: #1f2022; } .ev-shoot { background: rgba(255,159,69,.18); } .ev-leave { background: rgba(181,140,255,.18); }
.mday.today, .cal .cell.today, .bell-list .note.unread { background: var(--accentbg); }
.step::before { background: var(--line); } .step .nm { color: var(--ink2); } .step.done::before { background: #47484a; }
.step.current::before { background: linear-gradient(90deg, #e9c46a 0%, var(--line) 100%); }
.pbar .track, .loadbar { background: var(--line); }
input, select, textarea { color: var(--ink); background: var(--card2); }
input::placeholder, textarea::placeholder { color: var(--faint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scrim { background: rgba(0,0,0,.6); }
.login-page { background: #070809; }
.login-names { display: grid; gap: 8px; margin: 6px 0 12px; }
.login-names button { justify-content: flex-start; gap: 10px; min-height: 52px; border-radius: 14px; background: var(--card2); border-color: var(--line); font-size: 15px; text-align: left; }
.login-names button .avatar { width: 32px; height: 32px; font-size: 12px; background: #3a3b3d; }
.login-names button .who { display: flex; flex-direction: column; } .login-names button .who small { color: var(--muted); font-weight: 500; font-size: 12px; }
.faceid { width: 100%; min-height: 52px; border-radius: 14px; }
.hint { font-size: 12px; color: var(--muted); background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.thumb, .thumb.lg, .thumb.xl { background: var(--card2); }
/* v5.1 leave form */
.leave-form h3.sec { font-size: 12px; font-weight: 700; color: var(--gold); margin: 16px 0 8px; letter-spacing: .02em; }
.leave-form h3.sec:first-child { margin-top: 0; }
.leave-calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
.leave-calc > div { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.leave-calc b { font-size: 16px; }
.hint.warn { border-color: rgba(255,59,48,.35); background: rgba(255,59,48,.10); color: #ffb3ad; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg3 label { display: block; position: relative; } .seg3 input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; }
.seg3 span { display: block; text-align: center; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg3 input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg3 input:focus-visible + span { outline: 2px solid rgba(233,196,106,.6); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink2); line-height: 1.45; }
label.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: #34c759; }
ol.policy { padding-left: 18px; margin: 0 0 12px; display: grid; gap: 6px; color: var(--ink2); }
details.card > summary { cursor: pointer; list-style: none; } details.card > summary::-webkit-details-marker { display: none; }
.leave-row { align-items: flex-start; }
form.decide { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
form.decide select, form.decide input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; }
form.decide input[name=note] { flex: 1 1 180px; } form.decide input[name=balance] { width: 90px; }
.change-form { margin-top: 6px; } .change-form input { padding: 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* v5.2: official 2117 logo (white on dark). Sized by width; height follows the file's aspect ratio. */
.brand .logo { display: block; width: 84px; height: auto; }
.brand-sm .logo { width: 68px; }
.brand .brand-text { color: var(--muted); font-size: 11px; padding-top: 2px; }
.login-brand { margin: 0; line-height: 0; }
.login-logo { display: block; width: 220px; max-width: 100%; height: auto; }
.login-app { font-size: 20px; font-weight: 700; letter-spacing: .02em; margin: 14px 0 0; }

/* v5.3: PIN sign-in */
.login-names button.no-pin { opacity: .72; }
.warn-text { color: #ffb3ad !important; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 6px 0 12px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #5a5b5e; display: block; }
.pin-dots i.on { background: #F2F2F2; border-color: #F2F2F2; }
#pin-login #pin { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-keys button { min-height: 56px; font-size: 22px; border-radius: 14px; background: var(--card2); border-color: var(--line); justify-content: center; }
.pin-keys button.blue { font-size: 15px; background: var(--blue, #2f6df6); }

/* v5.3: leave balances */
.bal-card .card-body { padding-top: 4px; }
.bal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bal { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.bal .n { font-size: 28px; font-weight: 700; line-height: 1.1; }
.bal .n small { font-size: 13px; font-weight: 500; color: var(--muted); }
.bal .l { font-size: 12px; color: var(--muted); }
.bal .t { font-size: 11px; color: var(--muted); margin-top: 4px; }
.bal.low .n { color: #ffb3ad; }
.bal-after { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.bal-after b { font-size: 20px; } .bal-after .arrow { color: var(--muted); }
.bal-after.over { border-color: rgba(255,59,48,.45); }
.mc-box { border: 1px dashed #4a8cff; border-radius: 14px; padding: 12px; margin: 8px 0; background: rgba(74,140,255,.08); }
.mc-box .mc-title { font-weight: 700; margin-bottom: 4px; }
@media (min-width: 720px) { .bal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#att-field[hidden], #mc-box[hidden], #lv-after[hidden] { display: none; }
.pin-row input { background: var(--card2); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; min-height: 36px; }
.pin-row form { gap: 6px; }
/* v5.4 admin dashboard */
#admin-dash .dash-stats { padding: 10px 14px 0; margin-bottom: 4px; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#admin-dash .dash-stats .stat { padding: 8px 8px; }
#admin-dash .dash-stats .stat .n { font-size: 20px; }
#admin-dash .dash-stats .stat .l { font-size: 10px; letter-spacing: .03em; }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 14px; }
.table-scroll { overflow-x: auto; }
#dash-notes > summary { cursor: pointer; list-style: none; }
@media (max-width: 480px) { #admin-dash .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Booqable import draft */
.bq-chip { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pre-line { white-space: pre-line; }

/* ---- v5.5: three spaces + Account. One palette per space, set on <html data-space>; screens only use the variables. ---- */
:root { --chrome: #0b0c0d; --accent: #f2f2f2; --accent-d: #ffffff; --accentbg: rgba(242,242,242,.12); --on-accent: #0b0b0c; --accent2: #c8c8cc; }
html[data-space="workspace"] { /* cool and fresh: mint / teal / ice blue on cool slate */
  --bg: #0a1215; --chrome: #0d171b; --card: #111d22; --card2: #0c161a; --hover: #172830; --line: #1e3038; --line2: #16252b;
  --ink: #ecf6f7; --ink2: #c2d7da; --muted: #8eaab0; --faint: #7f9ca3; --accent: #5fe0c4; --accent-d: #49cdb0; --accentbg: rgba(95,224,196,.14); --on-accent: #04201a; --accent2: #9bd6ff;
  --blue: var(--accent); --blue-d: var(--accent-d); --bluebg: var(--accentbg); }
html[data-space="rentals"] { /* earthy: terracotta, olive, sand, warm brown */
  --bg: #14100c; --chrome: #18130e; --card: #1f1812; --card2: #19130e; --hover: #2a2018; --line: #352a1f; --line2: #2a2018;
  --ink: #f5ede3; --ink2: #dccdbb; --muted: #b29e88; --faint: #a38e78; --accent: #e07a52; --accent-d: #cc6a44; --accentbg: rgba(224,122,82,.15); --on-accent: #1c0b04; --accent2: #b5bb6a; --sand: #d9c29a;
  --blue: var(--accent); --blue-d: var(--accent-d); --bluebg: var(--accentbg); }
html[data-space="inventory"] { /* pastel earthy: sage, clay pink, oat, dusty peach */
  --bg: #141312; --chrome: #181716; --card: #1d1b19; --card2: #171614; --hover: #26231f; --line: #312d28; --line2: #26231f;
  --ink: #f4efe8; --ink2: #dcd3c8; --muted: #aea496; --faint: #9f9587; --accent: #a8c3a0; --accent-d: #93b18a; --accentbg: rgba(168,195,160,.15); --on-accent: #132011; --accent2: #e0aca6; --oat: #e3d5bf; --peach: #e8b998;
  --blue: var(--accent); --blue-d: var(--accent-d); --bluebg: var(--accentbg); }
html[data-space="account"] { /* black and white only */
  --bg: #000000; --chrome: #000000; --card: #0d0d0d; --card2: #080808; --hover: #1a1a1a; --line: #2a2a2a; --line2: #1c1c1c;
  --ink: #ffffff; --ink2: #d6d6d6; --muted: #a3a3a3; --faint: #949494; --accent: #ffffff; --accent-d: #e6e6e6; --accentbg: rgba(255,255,255,.12); --on-accent: #000000; --accent2: #d6d6d6;
  --blue: var(--accent); --blue-d: var(--accent-d); --bluebg: var(--accentbg); }
html[data-space="account"] .pill, html[data-space="account"] .gold-pill, html[data-space="account"] #banner .example { filter: grayscale(1); }
html[data-space="inventory"] .stat.red .n { color: var(--accent2); } html[data-space="inventory"] .stat.orange .n { color: var(--peach); }
html[data-space="rentals"] .stat.green .n { color: var(--accent2); } html[data-space="rentals"] .stat.orange .n { color: var(--sand); }
/* space switcher (all widths) */
.spaces { position: sticky; top: var(--top); z-index: 29; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 10px; background: var(--chrome); border-bottom: 1px solid var(--line); }
.spaces a { display: flex; align-items: center; justify-content: center; white-space: nowrap; padding: 7px 2px; border-radius: 999px; font-weight: 700; font-size: 12px; letter-spacing: -0.01em; color: var(--muted); border: 1px solid transparent; text-decoration: none !important; }
.spaces a .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.spaces a[data-space-link="workspace"] .dot { background: #5fe0c4; } .spaces a[data-space-link="rentals"] .dot { background: #e07a52; }
.spaces a[data-space-link="inventory"] .dot { background: #a8c3a0; } .spaces a[data-space-link="account"] .dot { background: #fff; box-shadow: inset 0 0 0 2px #000, 0 0 0 1px #fff; }
.spaces a.on { background: var(--accentbg); color: var(--ink); border-color: var(--accent); }
@media (min-width: 900px) { .spaces { grid-template-columns: repeat(4, auto); justify-content: start; padding: 8px 16px; } .spaces a { padding: 6px 14px; } }
/* each space shows only its own nav (sidebar and bottom bar) */
html[data-space] [data-space-only] { display: none !important; }
html[data-space="workspace"] [data-space-only~="workspace"], html[data-space="rentals"] [data-space-only~="rentals"],
html[data-space="inventory"] [data-space-only~="inventory"], html[data-space="account"] [data-space-only~="account"] { display: flex !important; }
html[data-space] .side-group[data-space-only] { display: none !important; }
html[data-space="workspace"] .side-group[data-space-only~="workspace"], html[data-space="rentals"] .side-group[data-space-only~="rentals"],
html[data-space="inventory"] .side-group[data-space-only~="inventory"], html[data-space="account"] .side-group[data-space-only~="account"] { display: block !important; }
html .role-hidden, html[data-space] [data-space-only].role-hidden { display: none !important; }
html[data-space] .new-order[data-space-only] { justify-content: center; }
nav.bottom a { color: var(--muted); }
.account-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.account-hero { display: flex; align-items: center; gap: 14px; }
.account-hero .avatar { width: 52px; height: 52px; font-size: 18px; }
.palette { display: flex; gap: 6px; flex-wrap: wrap; } .palette i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); display: inline-block; }
#dash-pin, .note-lock .pin-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); font: inherit; min-width: 0; }
