/* DIY Printz Admin — Outside Orders
   Black & white base, CMYK accents, Bebas Neue display, squared athletic controls */
:root {
  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --ink: #111111;
  --ink-2: #2a2a2a;
  --muted: #6b6b66;
  --faint: #9a9a94;
  --line: #e2e2dd;
  --line-strong: #111111;
  --cyan: #00AEEF;
  --magenta: #FF009D;
  --yellow: #FFE600;
  --lime: #B8FF00;
  --green: #12A150;
  --red: #E5243B;
  --wa: #1FAF54;
  --fb: #1877F2;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 22px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 50px rgba(0,0,0,.22);
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 2px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--body); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: .03em; }
.cmyk-strip { height: 6px; background: linear-gradient(90deg, var(--cyan) 0 25%, var(--magenta) 25% 50%, var(--yellow) 50% 75%, #111 75% 100%); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; border-radius: var(--radius); transition: background .15s, color .15s, transform .1s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; box-shadow: 4px 4px 0 var(--magenta); }
.btn-confirm { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.btn-confirm:hover { background: #d90086; border-color: #d90086; color: #fff; }
.btn-ready { background: var(--yellow); border-color: var(--ink); color: var(--ink); }
.btn-ready:hover { background: var(--ink); color: var(--yellow); }
.btn-done { background: var(--ink); color: #fff; }
.btn-done:hover { background: var(--green); border-color: var(--green); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 11.5px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1.5px solid transparent; background: transparent; border-radius: var(--radius); position: relative; color: inherit; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--magenta); border: 2px solid var(--ink); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: #fff; }
.topbar-inner { height: var(--topbar-h); display: flex; align-items: center; gap: 18px; padding: 0 20px; max-width: 1680px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { height: 26px; filter: invert(1) hue-rotate(180deg) saturate(1.4); }
.brand .tag { font-family: var(--display); font-size: 17px; letter-spacing: .08em; color: #000; background: var(--lime); padding: 2px 7px 0; line-height: 1.2; }
.tabs { display: flex; gap: 2px; height: 100%; margin-left: 10px; }
.tab { position: relative; display: flex; align-items: center; gap: 9px; height: 100%; padding: 0 16px; border: 0; background: transparent; color: #a9a9a3; font-family: var(--display); font-size: 21px; letter-spacing: .05em; padding-top: 3px; white-space: nowrap; }
.tab:hover { color: #fff; }
.tab .count { font-family: var(--body); font-size: 11.5px; font-weight: 700; min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; background: #2b2b2b; color: #fff; margin-top: -3px; }
.tab::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 5px; background: transparent; transition: background .2s; }
.tab[aria-selected="true"] { color: #fff; }
.tab[data-board="production"][aria-selected="true"]::after { background: var(--cyan); }
.tab[data-board="ready"][aria-selected="true"]::after { background: var(--yellow); }
.tab[data-board="completed"][aria-selected="true"]::after { background: #fff; }
.tab[data-board="production"][aria-selected="true"] .count { background: var(--cyan); color: #000; }
.tab[data-board="ready"][aria-selected="true"] .count { background: var(--yellow); color: #000; }
.tab[data-board="completed"][aria-selected="true"] .count { background: #fff; color: #000; }
.topbar .spacer { flex: 1; }
.search { position: relative; width: min(320px, 28vw); }
.search input { width: 100%; height: 40px; padding: 0 12px 0 38px; background: #222; border: 1.5px solid #333; color: #fff; border-radius: var(--radius); }
.search input::placeholder { color: #8a8a85; }
.search input:focus { border-color: #fff; outline: none; background: #1a1a1a; }
.search svg { position: absolute; left: 12px; top: 11px; width: 17px; height: 17px; color: #8a8a85; }
.topbar .btn-new { background: var(--lime); border-color: var(--lime); color: #000; }
.topbar .btn-new:hover { background: #fff; border-color: #fff; color: #000; box-shadow: 4px 4px 0 var(--magenta); }
.top-actions { display: flex; gap: 2px; align-items: center; }

/* ---------- alert banner ---------- */
.alert-bar { background: var(--magenta); color: #fff; overflow: hidden; }
.alert-bar-inner { max-width: 1680px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 20px; }
.alert-bar .pulse { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; animation: pulse 1.4s infinite; }
.alert-bar strong { font-family: var(--display); font-size: 22px; letter-spacing: .05em; font-weight: 400; padding-top: 2px; }
.alert-bar .btn { border-color: #fff; background: #fff; color: var(--magenta); }
.alert-bar .btn:hover { background: #000; border-color: #000; color: #fff; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.8); } 70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

/* ---------- layout ---------- */
main.board-wrap { max-width: 1680px; margin: 0 auto; padding: 24px 20px 120px; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.board-title { font-family: var(--display); font-size: 46px; line-height: .9; margin: 0; letter-spacing: .02em; font-weight: 400; display: flex; align-items: center; gap: 14px; }
.board-title .sw { width: 14px; height: 38px; display: inline-block; }
.board-sub { color: var(--muted); margin-top: 6px; font-size: 13.5px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filter { height: 34px; padding: 0 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 12.5px; border-radius: var(--radius); display: inline-flex; align-items: center; gap: 7px; }
.chip-filter:hover { border-color: var(--ink); }
.chip-filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-filter .ch-dot { width: 8px; height: 8px; border-radius: 50%; }

.section-label { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-family: var(--display); font-size: 22px; letter-spacing: .06em; }
.section-label:first-child { margin-top: 0; }
.section-label .ln { flex: 1; height: 1.5px; background: var(--line); }
.section-label .n { font-family: var(--body); font-size: 12px; font-weight: 700; background: var(--ink); color: #fff; padding: 2px 7px; }
.section-label.urgent { color: var(--magenta); }
.section-label.urgent .n { background: var(--magenta); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }

/* ---------- order cards ---------- */
.card { position: relative; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); cursor: pointer; overflow: hidden; }
.card:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cyan); }
.card.status-ready::before { background: var(--yellow); }
.card.status-completed::before { background: var(--ink); }
.card.unconfirmed { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(255,0,157,.12); }
.card.unconfirmed::before { background: var(--magenta); }
.card.flash { animation: flash 1.2s 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px rgba(255,0,157,.35); } }
.card-body { padding: 14px 16px 12px 20px; display: flex; gap: 12px; flex: 1; }
.card-main { flex: 1; min-width: 0; }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-no { font-family: var(--display); font-size: 26px; line-height: 1; letter-spacing: .03em; padding-top: 2px; }
.cust { font-weight: 700; font-size: 15px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.items-sum { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { width: 74px; height: 74px; flex: none; border: 1px solid var(--line); background: repeating-conic-gradient(#f0f0ec 0 25%, #fff 0 50%) 0 0/12px 12px; display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb svg { width: 26px; height: 26px; color: var(--faint); }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px 20px; }
.card-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px 10px 20px; border-top: 1.5px solid var(--line); background: var(--surface-2); }
.card-foot .grow { flex: 1; }
.card-foot .btn { min-height: 36px; }
.card-foot .btn-ghost { padding: 0 8px; }
.card.unconfirmed .card-foot { background: #fff0f8; border-top-color: #ffc6e6; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--radius); white-space: nowrap; }
.pill svg { width: 12px; height: 12px; }
.pill.ch-whatsapp { border-color: var(--wa); color: #0b7a37; background: #effbf3; }
.pill.ch-facebook { border-color: var(--fb); color: #0d5bc4; background: #eef5ff; }
.pill.ch-instore { border-color: var(--ink); color: #fff; background: var(--ink); }
.pill.paid { border-color: var(--green); color: var(--green); background: #effaf3; }
.pill.unpaid { border-color: var(--red); color: var(--red); background: #fff2f3; }
.pill.partial { border-color: #c88a00; color: #8a5f00; background: #fff8e0; }
.pill.rush { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.pill.overdue { background: var(--red); border-color: var(--red); color: #fff; }
.pill.soon { background: var(--yellow); border-color: var(--ink); color: var(--ink); }
.pill.new { background: var(--magenta); border-color: var(--magenta); color: #fff; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .55; } }

/* completed table */
.table-wrap { background: var(--surface); border: 1.5px solid var(--line); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; min-width: 760px; }
table.list th { text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1.5px solid var(--ink); background: var(--surface-2); }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr { cursor: pointer; }
table.list tbody tr:hover td { background: #fbfbf4; }
table.list .order-no { font-size: 21px; }

/* empty state */
.empty { text-align: center; padding: 70px 20px; border: 1.5px dashed #cfcfca; background: var(--surface); }
.empty h3 { font-family: var(--display); font-size: 32px; letter-spacing: .04em; margin: 12px 0 4px; font-weight: 400; }
.empty p { color: var(--muted); margin: 0 0 18px; }
.empty .big-ico { width: 64px; height: 64px; margin: 0 auto; display: grid; place-items: center; background: var(--ink); color: var(--lime); }
.empty .big-ico svg { width: 30px; height: 30px; }

.skeleton { background: linear-gradient(90deg, #ececE8 25%, #f6f6f3 50%, #ececE8 75%); background-size: 200% 100%; animation: sk 1.2s infinite; height: 196px; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- drawer / panels ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,10,10,.5); z-index: 60; opacity: 0; transition: opacity .2s; }
.overlay.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 61; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
.drawer.show { transform: none; }
.drawer.wide { width: min(980px, 100vw); }
.drawer-head { background: var(--ink); color: #fff; padding: 16px 20px 14px; display: flex; align-items: flex-start; gap: 14px; }
.drawer-head .t { flex: 1; min-width: 0; }
.drawer-head .order-no { font-size: 40px; }
.drawer-head .kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #a9a9a3; font-weight: 700; }
.drawer-head h2 { font-family: var(--display); font-weight: 400; font-size: 36px; letter-spacing: .03em; margin: 0; line-height: 1; }
.drawer-head .icon-btn { color: #fff; }
.drawer-actions { display: flex; gap: 8px; padding: 12px 20px; background: var(--surface); border-bottom: 1.5px solid var(--line); flex-wrap: wrap; align-items: center; }
.drawer-actions .grow { flex: 1; }
.drawer-tabs { display: flex; gap: 0; background: var(--surface); border-bottom: 1.5px solid var(--line); padding: 0 12px; overflow-x: auto; }
.drawer-tabs button { border: 0; background: transparent; padding: 12px 14px 10px; font-weight: 700; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.drawer-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.drawer > * { flex-shrink: 0; }
.drawer > .drawer-body, .drawer > .settings-layout { flex: 1 1 auto; min-height: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch; }
.drawer-foot { padding: 12px 20px; background: var(--surface); border-top: 1.5px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.drawer-foot .grow { flex: 1; }

.panel { background: var(--surface); border: 1.5px solid var(--line); margin-bottom: 14px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1.5px solid var(--line); }
.panel-h h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 21px; letter-spacing: .06em; padding-top: 2px; }
.panel-b { padding: 14px 16px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px 18px; }
.kv .k { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.kv .v { font-weight: 600; word-break: break-word; }
.kv .v a { text-decoration: none; border-bottom: 1.5px solid var(--cyan); }
.contact-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

table.items { width: 100%; border-collapse: collapse; }
table.items th { text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--ink); }
table.items td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.items .r { text-align: right; white-space: nowrap; }
.totals { margin-left: auto; width: min(300px, 100%); margin-top: 10px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 10px; }
.totals .g { border-top: 2px solid var(--ink); font-weight: 800; font-size: 17px; padding-top: 8px; margin-top: 4px; }
.totals .bal { color: var(--red); font-weight: 700; }

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file-tile { border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.file-tile .prev { aspect-ratio: 1; background: repeating-conic-gradient(#f0f0ec 0 25%, #fff 0 50%) 0 0/14px 14px; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.file-tile .prev.dark { background: repeating-conic-gradient(#222 0 25%, #2c2c2c 0 50%) 0 0/14px 14px; }
.file-tile .prev img { width: 100%; height: 100%; object-fit: contain; }
.file-tile .prev .ext { font-family: var(--display); font-size: 30px; letter-spacing: .05em; color: var(--muted); }
.file-tile .meta { padding: 8px 9px; font-size: 12px; border-top: 1px solid var(--line); }
.file-tile .meta .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-tile .meta .sz { color: var(--muted); font-size: 11px; }
.file-tile .fa { display: flex; border-top: 1px solid var(--line); }
.file-tile .fa a, .file-tile .fa button { flex: 1; border: 0; background: transparent; padding: 7px 0; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; text-align: center; color: var(--ink); }
.file-tile .fa > * + * { border-left: 1px solid var(--line); }
.file-tile .fa a:hover, .file-tile .fa button:hover { background: var(--ink); color: #fff; }
.drop { border: 2px dashed #c9c9c3; padding: 20px; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--cyan); background: #effaff; }
.drop p { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.drop .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.link-row { display: flex; gap: 8px; margin-top: 12px; }
.link-row input { flex: 1; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1.5px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .tdot { width: 13px; height: 13px; border: 2.5px solid var(--ink); background: var(--surface); margin-top: 3px; border-radius: 50%; }
.timeline .tdot.created { background: var(--cyan); border-color: var(--cyan); }
.timeline .tdot.confirmed { background: var(--magenta); border-color: var(--magenta); }
.timeline .tdot.status { background: var(--yellow); }
.timeline .tdot.note { background: var(--lime); }
.timeline .when { font-size: 11.5px; color: var(--muted); }

/* ---------- forms ---------- */
.form-sec { background: var(--surface); border: 1.5px solid var(--line); margin-bottom: 14px; }
.form-sec > h3 { margin: 0; padding: 11px 16px; border-bottom: 1.5px solid var(--line); font-family: var(--display); font-weight: 400; font-size: 21px; letter-spacing: .06em; display: flex; align-items: center; gap: 10px; }
.form-sec > h3 .num { font-family: var(--body); font-size: 11px; font-weight: 800; background: var(--ink); color: #fff; width: 22px; height: 22px; display: grid; place-items: center; }
.form-sec .fb { padding: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row2 > .field, .row3 > .field, .row4 > .field { margin-top: 0 !important; }
.field + .field, .row2 + .field, .field + .row2, .row2 + .row2, .row3 + .field, .field + .row3, .row2 + .row3, .row3 + .row2 { margin-top: 12px; }
.field label, .lbl { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea, .link-row input {
  height: 42px; padding: 0 12px; border: 1.5px solid #d6d6d0; background: #fff; border-radius: var(--radius); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .link-row input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(0,174,239,.18); }
.field.err input, .field.err select { border-color: var(--red); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { min-height: 64px; border: 1.5px solid #d6d6d0; background: #fff; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-weight: 700; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; padding: 8px; transition: all .15s; }
.seg button svg { width: 22px; height: 22px; }
.seg button:hover { border-color: var(--ink); }
.seg button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--cyan); }
.seg button[data-v="whatsapp"][aria-pressed="true"] { box-shadow: 4px 4px 0 var(--wa); }
.seg button[data-v="facebook"][aria-pressed="true"] { box-shadow: 4px 4px 0 var(--fb); }
.seg button[data-v="instore"][aria-pressed="true"] { box-shadow: 4px 4px 0 var(--lime); }
.seg.small button { min-height: 44px; flex-direction: row; }
.seg button[disabled] { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.pay-note { margin-top: 10px; font-size: 12.5px; padding: 9px 12px; background: #fff8d6; border-left: 4px solid var(--yellow); }
.item-row { display: grid; grid-template-columns: 150px 1fr 110px 70px 96px 92px 36px; gap: 8px; align-items: end; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.item-row:first-child { padding-top: 0; }
.item-row .extra { grid-column: 2 / span 5; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item-row .line-total { height: 42px; display: flex; align-items: center; justify-content: flex-end; font-weight: 800; }
.item-row .rm { height: 42px; width: 36px; border: 1.5px solid transparent; background: transparent; display: grid; place-items: center; color: var(--muted); }
.item-row .rm:hover { color: var(--red); border-color: var(--red); }
.form-totals { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.form-totals .sum { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; }
.form-totals .sum b { font-size: 22px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .tr { width: 44px; height: 24px; background: #cfcfca; position: relative; transition: background .15s; flex: none; }
.toggle .tr::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; transition: transform .18s var(--ease); }
.toggle input:checked + .tr { background: var(--ink); }
.toggle input:checked + .tr::after { transform: translateX(20px); background: var(--lime); }
.toggle input:focus-visible + .tr { outline: 2px solid var(--cyan); outline-offset: 2px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #111; }
input[type=range] { width: 100%; accent-color: #111; }
.pending-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pending-files .pill { height: 26px; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; }
.pending-files .pill button { border: 0; background: transparent; padding: 0 0 0 4px; font-weight: 800; }

/* ---------- settings ---------- */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 0; height: 100%; }
.settings-nav { background: var(--surface); border-right: 1.5px solid var(--line); padding: 12px 0; overflow-y: auto; }
.settings-nav button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 11px 18px; font-weight: 600; text-align: left; border-left: 4px solid transparent; }
.settings-nav button svg { width: 17px; height: 17px; }
.settings-nav button:hover { background: var(--surface-2); }
.settings-nav button[aria-selected="true"] { border-left-color: var(--magenta); background: var(--bg); font-weight: 800; }
.settings-main { overflow-y: auto; padding: 20px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .st { font-weight: 700; }
.set-row .sd { color: var(--muted); font-size: 12.5px; margin-top: 2px; max-width: 460px; }
.set-row .ctrl { display: flex; align-items: center; gap: 8px; flex: none; }
.set-row .ctrl select, .set-row .ctrl input[type=number], .set-row .ctrl input[type=time] { height: 38px; border: 1.5px solid #d6d6d0; padding: 0 10px; background: #fff; border-radius: var(--radius); }
.set-row .ctrl input[type=number] { width: 84px; }
.staff-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.staff-list .pill { height: 32px; font-size: 12.5px; text-transform: none; letter-spacing: 0; padding: 0 6px 0 12px; }
.staff-list .pill button { border: 0; background: transparent; width: 22px; height: 22px; font-size: 15px; line-height: 1; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #111; color: #e6ffb3; padding: 12px; overflow-x: auto; white-space: pre; border-radius: var(--radius); }
.status-line { display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 600; }
.status-line .d { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.status-line .d.ok { background: var(--green); }
.status-line .d.warn { background: #e0a800; }
.status-line .d.bad { background: var(--red); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--ink); }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background:
  radial-gradient(circle at 18% 22%, rgba(0,174,239,.55), transparent 42%),
  radial-gradient(circle at 82% 30%, rgba(255,0,157,.5), transparent 40%),
  radial-gradient(circle at 60% 85%, rgba(255,230,0,.38), transparent 45%), #0b0b0b; }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.18) 1.2px, transparent 1.3px); background-size: 12px 12px; mix-blend-mode: overlay; pointer-events: none; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art img { height: 34px; width: auto; align-self: flex-start; filter: invert(1) hue-rotate(180deg) saturate(1.4); }
.auth-art h1 { font-family: var(--display); font-weight: 400; font-size: clamp(56px, 7.5vw, 112px); line-height: .86; margin: 0; letter-spacing: .01em; }
.auth-art h1 span { color: var(--lime); }
.auth-art p { max-width: 420px; color: #d0d0ca; font-size: 15px; }
.auth-art .chs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.auth-art .chs span { border: 1.5px solid rgba(255,255,255,.5); padding: 6px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.auth-card { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-box { width: min(380px, 100%); text-align: center; }
.auth-box h2 { font-family: var(--display); font-weight: 400; font-size: 40px; letter-spacing: .03em; margin: 0; line-height: 1; }
.auth-box .sub { color: var(--muted); margin: 8px 0 22px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 0 0 22px; height: 22px; }
.pin-dots span { width: 18px; height: 18px; border: 2.5px solid var(--ink); transition: background .1s, transform .1s; }
.pin-dots span.on { background: var(--ink); transform: scale(1.08); }
.pin-dots.shake { animation: shake .4s; }
.pin-dots.shake span { border-color: var(--red); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { height: 64px; border: 1.5px solid #d6d6d0; background: #fff; font-family: var(--display); font-size: 32px; padding-top: 4px; border-radius: var(--radius); transition: background .1s, border-color .1s; }
.pinpad button:hover { border-color: var(--ink); }
.pinpad button:active { background: var(--ink); color: #fff; }
.pinpad button[data-k="ok"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pinpad button[data-k="ok"]:hover { box-shadow: 4px 4px 0 var(--magenta); }
.pinpad button.fn { font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding-top: 0; }
.auth-msg { min-height: 22px; margin: 12px 0 0; font-weight: 600; font-size: 13px; }
.auth-msg.err { color: var(--red); }
.auth-msg.ok { color: var(--green); }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 13px; }
.linkish { border: 0; background: none; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--magenta); text-decoration-thickness: 2px; }
.step-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; background: var(--magenta); color: #fff; padding: 4px 9px; margin-bottom: 12px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow-lg); border-left: 6px solid var(--cyan); animation: tin .25s var(--ease); }
.toast.alert { border-left-color: var(--magenta); }
.toast.ok { border-left-color: var(--lime); }
.toast.err { border-left-color: var(--red); }
.toast .tt { font-family: var(--display); font-size: 21px; letter-spacing: .04em; line-height: 1.05; }
.toast .tb { font-size: 13px; color: #d4d4ce; margin-top: 2px; }
.toast .ta { display: flex; gap: 6px; margin-top: 10px; }
.toast .ta .btn { min-height: 32px; font-size: 11px; padding: 0 10px; border-color: #fff; background: #fff; color: #000; }
.toast .ta .btn.btn-confirm { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.toast .x { margin-left: auto; border: 0; background: none; color: #999; font-size: 18px; line-height: 1; padding: 0 0 0 6px; }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 30px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0/16px 16px; }
.lightbox .icon-btn { position: absolute; top: 14px; right: 14px; color: #fff; }

/* modal (confirm dialogs) */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.5); }
.modal-box { background: var(--surface); width: min(440px, 100%); border-top: 6px solid var(--ink); box-shadow: var(--shadow-lg); }
.modal-box .mb { padding: 20px; }
.modal-box h3 { margin: 0 0 6px; font-family: var(--display); font-size: 30px; font-weight: 400; letter-spacing: .03em; }
.modal-box .mf { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; background: var(--surface-2); border-top: 1.5px solid var(--line); }

/* FAB + bottom nav (mobile) */
.fab { display: none; }
.bottom-nav { display: none; }

/* sound unlock prompt */
.unlock { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; background: var(--yellow); color: #000; border: 2px solid #000; padding: 10px 14px; display: flex; gap: 12px; align-items: center; font-weight: 700; box-shadow: 5px 5px 0 #000; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .tab { padding: 0 11px; font-size: 19px; }
  .search { width: 220px; }
  .item-row { grid-template-columns: 1fr 1fr 90px 60px; }
  .item-row .f-desc { grid-column: 1 / -1; order: -1; }
  .item-row .line-total { grid-column: span 3; justify-content: flex-start; }
  .item-row .extra { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  :root { --topbar-h: 56px; }
  .topbar-inner { gap: 8px; padding: 0 12px; }
  .brand img { height: 22px; }
  .brand .tag { display: none; }
  .tabs { display: none; }
  .search { width: auto; flex: 1; }
  .topbar .spacer { display: none; }
  .topbar .btn-new { display: none; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 45; width: 60px; height: 60px; border: 2px solid #000; background: var(--lime); color: #000; box-shadow: 4px 4px 0 #000; }
  .fab svg { width: 26px; height: 26px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; background: var(--ink); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav button { border: 0; background: transparent; color: #a9a9a3; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: var(--display); font-size: 17px; letter-spacing: .05em; position: relative; padding-top: 4px; }
  .bottom-nav button .count { font-family: var(--body); font-size: 11px; font-weight: 800; background: #2b2b2b; color: #fff; padding: 1px 7px; }
  .bottom-nav button[aria-selected="true"] { color: #fff; }
  .bottom-nav button[aria-selected="true"]::before { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 4px; background: var(--cyan); }
  .bottom-nav button[data-board="ready"][aria-selected="true"]::before { background: var(--yellow); }
  .bottom-nav button[data-board="completed"][aria-selected="true"]::before { background: #fff; }
  main.board-wrap { padding: 16px 12px 150px; }
  .board-title { font-size: 36px; }
  .board-title .sw { height: 28px; width: 10px; }
  .grid { grid-template-columns: 1fr; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; min-height: 0; gap: 16px; }
  .auth-art h1 { font-size: 58px; }
  .auth-art p, .auth-art .chs { display: none; }
  .settings-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1.5px solid var(--line); padding: 0; }
  .settings-nav button { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 12px 14px; width: auto; }
  .settings-nav button[aria-selected="true"] { border-bottom-color: var(--magenta); }
  .set-row { flex-direction: column; align-items: flex-start; }
  .row3, .row4 { grid-template-columns: 1fr 1fr; }
  .drawer-body { padding: 14px 12px; }
  .drawer-actions { padding: 10px 12px; }
  .drawer-actions .btn { flex: 1 1 auto; }
  .drawer-head { padding: 14px 12px 12px; }
  .alert-bar-inner { padding: 9px 12px; }
  .alert-bar strong { font-size: 18px; }
  .unlock { bottom: calc(90px + env(safe-area-inset-bottom)); width: calc(100% - 24px); justify-content: space-between; }
}
@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; }
  .seg button { min-height: 58px; font-size: 11px; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row .line-total { grid-column: 1; }
  .item-row .extra { grid-template-columns: 1fr; }
  .card-foot { flex-wrap: wrap; }
  .card-foot .grow { display: none; }
  .card-foot .btn-main { flex: 1 1 100%; order: -1; }
  .card-foot .btn:not(.btn-main) { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
