:root {
  --ink: #121b26;
  --ink-soft: #5f6d7c;
  --navy: #101923;
  --blue: #087bc1;
  --blue-pale: #e4f1ff;
  --green: #00a950;
  --green-pale: #e5f8ec;
  --amber: #e5aa08;
  --amber-pale: #fff5cd;
  --red: #d93436;
  --line: #e0e6ed;
  --panel: #ffffff;
  --surface: #f3f6fa;
  --shadow: 0 18px 50px rgba(15, 30, 45, .12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 12% 0%, #fff 0, transparent 35%), var(--surface); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.topbar {
  min-height: 86px; padding: 14px max(28px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; gap: 24px;
  color: white; background: linear-gradient(118deg, #111c27 0%, #101923 68%, #172738 100%); box-shadow: 0 5px 20px rgba(5, 14, 23, .24);
}
.brand { display: flex; align-items: center; gap: 11px; padding-right: 22px; border-right: 1px solid rgba(255,255,255,.42); min-width: 175px; }
.brand-globe { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #21a8ec; border: 3px solid #21a8ec; font-size: 24px; }
.brand b { display: block; font-size: 24px; line-height: .9; letter-spacing: .03em; }
.brand small { display: block; font-size: 10px; letter-spacing: .48em; margin-top: 7px; }
.product-title { display: flex; flex-direction: column; margin-right: auto; }
.product-title strong { font-size: 22px; letter-spacing: .02em; }
.product-title span { color: #c8d1da; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 18px; position: relative; }
.live { display: flex; gap: 7px; align-items: center; font-size: 12px; color: #b9f4d0; font-weight: 800; letter-spacing: .03em; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: #19d26a; box-shadow: 0 0 0 4px rgba(25,210,106,.14); }
.live time { color: #d3dce6; font-weight: 500; }
.date { font-size: 12px; color: #d3dce6; text-align: right; max-width: 85px; }
.user-button { display: flex; align-items: center; gap: 9px; padding: 7px 9px; color: white; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; }
.avatar, .mobile-user span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #31aaf0, #0973b4); font-weight: 900; }
.user-copy { display: flex; flex-direction: column; text-align: left; }
.user-copy small { color: #b9c5d1; }
.user-menu { position: absolute; right: 0; top: 58px; width: 230px; z-index: 10; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.user-menu div { padding: 9px 10px 12px; border-bottom: 1px solid var(--line); }
.user-menu small { display: block; color: var(--ink-soft); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; }
.user-menu a, .user-menu button { display: block; width: 100%; padding: 11px 10px; color: var(--ink); text-align: left; text-decoration: none; border: 0; background: transparent; border-radius: 8px; }
.user-menu a:hover, .user-menu button:hover { background: var(--surface); }

.workspace { width: min(1180px, calc(100% - 36px)); margin: 28px auto 60px; }
.mobile-titlebar { display: none; }
.queue-bar { display: flex; align-items: end; justify-content: space-between; margin: 0 2px 18px; }
.eyebrow { color: #6b7988; font-weight: 900; font-size: 11px; letter-spacing: .16em; }
.queue-bar h1 { margin: 5px 0 0; font-size: 25px; }
.queue-count { min-width: 84px; display: flex; justify-content: center; align-items: baseline; gap: 6px; padding: 11px 16px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.queue-count b { font-size: 22px; color: var(--green); }
.queue-count span { font-size: 12px; color: var(--ink-soft); }
.batch-switcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: -6px 0 16px; }
.batch-switcher button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; font-weight: 900; }
.batch-switcher button small { display: block; color: var(--ink-soft); font-weight: 700; }
.batch-switcher button.active { color: #075f9a; border-color: #249fe7; background: #eaf6ff; box-shadow: 0 0 0 2px rgba(36,159,231,.12); }
.batch-switcher .job-state { padding: 4px 7px; border-radius: 999px; background: #edf1f4; color: #5c6a76; font-size: 10px; }
.admin-lookup { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(420px,1.2fr); align-items: center; gap: 22px; margin: 0 0 16px; padding: 18px 20px; border: 1px solid #b9dff6; border-radius: 16px; background: linear-gradient(120deg,#f5fbff,#e9f6ff); }
.admin-lookup h2 { margin: 5px 0 0; font-size: 18px; }
.admin-lookup form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.admin-lookup input { min-width: 0; padding: 12px 14px; border: 1px solid #9ebbd0; border-radius: 10px; background: white; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; }
.admin-lookup button { min-height: 46px; padding: 0 15px; border-radius: 10px; font-size: 12px; font-weight: 900; }

.job-card { background: var(--panel); border: 1px solid #dfe5ec; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.file-row { min-height: 96px; display: flex; align-items: center; gap: 17px; padding: 17px 22px; }
.pdf-icon { width: 52px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; color: white; border-radius: 10px 10px 10px 4px; background: linear-gradient(145deg, #ef4136, #bf171e); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.pdf-icon b { font-size: 13px; }
.file-copy { min-width: 0; margin-right: auto; }
.file-copy h2 { margin: 0 0 5px; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.carrier-lockup { min-width: 86px; text-align: center; font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: -2px; }
.carrier-lockup .fed { color: #4d148c; }.carrier-lockup .ex { color: #ff6600; }
.batch-pill { color: #0869a7; background: var(--blue-pale); border: 1px solid #cde7fd; border-radius: 999px; padding: 7px 13px; font-weight: 900; font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfe; }
.stats > div { display: flex; align-items: center; gap: 11px; padding: 15px 20px; border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: 0; }
.stat-icon { width: 28px; color: #425465; font-size: 23px; }
.stats small, .stats b { display: block; }.stats small { color: var(--ink-soft); font-size: 11px; }.stats b { margin-top: 2px; font-size: 14px; }

.viewer { height: 540px; display: grid; grid-template: 44px 1fr / 155px 1fr; margin: 20px 22px 16px; overflow: hidden; color: #eff3f7; background: #272d33; border-radius: 13px; }
.viewer-toolbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 15px; padding: 0 14px; font-size: 12px; background: #20262b; border-bottom: 1px solid #3b4249; }
.viewer-toolbar b { background: #101419; padding: 4px 7px; border-radius: 3px; }.toolbar-spacer { flex: 1; }
.thumbnails { padding: 12px; overflow-y: auto; background: #252b30; border-right: 1px solid #3c444c; }
.thumbnail { width: 100%; height: 112px; position: relative; margin-bottom: 12px; padding: 9px 9px 22px; color: #111; background: white; border: 3px solid transparent; border-radius: 5px; }
.thumbnail.active { border-color: #209ee7; box-shadow: 0 0 0 1px #72c5f5; }
.thumbnail.selected { position: relative; border-color: #00b45a; box-shadow: 0 0 0 2px rgba(0,180,90,.35); }
.thumbnail.selected::after { content: "✓"; position: absolute; right: 3px; top: 3px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: white; background: #00a950; font-size: 14px; font-weight: 1000; }
.thumbnail.printed-page{background:#fff8dd}.thumbnail img{width:100%;height:100%;object-fit:contain;display:block}.page-badge{position:absolute;left:2px;right:2px;bottom:2px;padding:2px;color:#56616c;background:rgba(255,255,255,.92);font-size:8px;font-weight:900;text-align:center}.printed-page .page-badge{color:#7d5700}.real-preview{display:block;max-width:100%;max-height:100%;object-fit:contain;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.35)}.real-preview[hidden]{display:none}
.mini-label { height: 100%; display: grid; place-items: center; border: 1px solid #aeb4ba; background: repeating-linear-gradient(0deg,#fff 0 8px,#f2f2f2 8px 10px); font-size: 9px; font-weight: 900; }
.label-stage { display: grid; place-items: center; padding: 24px; overflow: auto; background: radial-gradient(circle at 50% 40%, #4b535a, #343b41 66%); }
.shipping-label { width: 440px; height: 430px; position: relative; padding: 22px 25px; color: #050505; background: white; box-shadow: 0 12px 24px rgba(0,0,0,.35); }
.label-top { display: flex; justify-content: space-between; align-items: start; height: 80px; }.service-letter { font-size: 72px; line-height: 1; }.matrix { width: 120px; height: 68px; background: repeating-conic-gradient(#000 0 25%,#fff 0 50%) 0/9px 9px; }
.shipping-label h3 { margin: 8px 0; padding: 7px 0; text-align: center; border-top: 4px solid #000; border-bottom: 4px solid #000; }
.label-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-family: Arial, sans-serif; font-size: 13px; }.label-grid p { margin: 7px 0; }.label-grid small { font-weight: 800; }
.tracking { position: absolute; bottom: 20px; left: 25px; right: 25px; text-align: center; border-top: 4px solid #000; padding-top: 7px; }.tracking small, .tracking b { display: block; }.barcode { height: 54px; margin: 7px 18px 5px; background: repeating-linear-gradient(90deg,#000 0 2px,#fff 2px 4px,#000 4px 5px,#fff 5px 9px); }
.preview-watermark { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(217,52,54,.13); transform: rotate(-30deg); font-weight: 1000; font-size: 54px; pointer-events: none; }

.selection-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 22px 14px; padding: 13px 15px; border: 1px solid #9dd7b8; border-radius: 12px; background: #edfff5; color: #08763a; }
.selection-bar small { display: block; margin-top: 3px; color: #4e6e5d; }
.selection-bar button { padding: 8px 11px; border: 0; border-radius: 8px; color: #08763a; background: white; font-weight: 900; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; padding: 0 22px 16px; }
.actions button, .dialog menu button, .camera-button { min-height: 62px; border: 0; border-radius: 13px; font-weight: 900; letter-spacing: .02em; }
.secondary { color: #0875bb; background: #e6f2ff; border: 1px solid #d3eaff !important; }
.primary { color: white; background: linear-gradient(135deg, #08b456, #008b41); box-shadow: 0 9px 18px rgba(0,169,80,.2); }
.primary:disabled, .actions button:disabled { color: #7e8993; background: #e2e6ea; box-shadow: none; cursor: not-allowed; }
.status { display: flex; align-items: center; gap: 17px; margin: 0 22px 22px; padding: 17px 20px; border-radius: 14px; }
.status h3, .status p { margin: 0; }.status h3 { font-size: 16px; }.status p { color: #5f6d7c; margin-top: 3px; font-size: 13px; }.status-dot { font-size: 27px; }
.status.ready { background: var(--green-pale); color: #08763a; }.status.partial { background: #eaf6ff; color: #076da9; }.status.printing { background: var(--blue-pale); color: #086ca9; }.status.printed { background: var(--amber-pale); color: #7d5700; }.status.failed,.status.error { background: #fee9e9; color: #a91f24; }

.dialog { width: min(560px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(4,14,25,.35); }
.dialog::backdrop { background: rgba(7,15,23,.62); backdrop-filter: blur(3px); }.dialog form { position: relative; padding: 30px; }.dialog .close { position: absolute; right: 16px; top: 12px; border: 0; background: transparent; font-size: 28px; color: #647280; }.dialog-icon { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 18px; font-size: 23px; font-weight: 900; }.dialog-icon.green { background: var(--green-pale); color: var(--green); }.dialog-icon.amber { background: var(--amber-pale); color: #b78100; }.dialog h2 { font-size: 27px; margin: 8px 0 10px; }.dialog p { color: var(--ink-soft); line-height: 1.55; }.dialog-job { display: flex; justify-content: space-between; gap: 10px; padding: 13px; background: var(--surface); border-radius: 10px; font-size: 13px; }.dialog-job b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.dialog-job span { flex: 0 0 auto; color: var(--ink-soft); }.dialog menu { display: grid; grid-template-columns: 1fr 1.25fr; gap: 11px; padding: 0; margin: 24px 0 0; }.dialog menu button { min-height: 51px; }.scan-field { display: block; margin: 20px 0 11px; padding: 11px 14px; border: 2px solid #cfd7df; border-radius: 12px; }.scan-field span { display: block; font-size: 10px; color: #657483; letter-spacing: .15em; font-weight: 900; }.scan-field input { width: 100%; border: 0; outline: 0; padding: 8px 0 2px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 17px; }.camera-button { width: 100%; min-height: 48px; color: #0a6ea9; background: #edf7ff; border: 1px solid #d2eafa; }.warning-button, .danger-button { color: white; background: #c93539; border: 0; }.danger-button:disabled { background: #d9dde1; color: #7b858e; cursor: not-allowed; }.warning-dialog { border-top: 7px solid var(--red); }.warning-dialog h2 { color: #b62429; font-size: 34px; line-height: 1.05; }.warning-mark { width: 55px; height: 55px; display: grid; place-items: center; float: right; color: white; background: var(--red); border-radius: 50%; font-size: 32px; font-weight: 900; }.check { display: flex; gap: 10px; align-items: start; padding: 13px; background: #fff4f4; border-radius: 10px; font-weight: 700; }.check input { width: 20px; height: 20px; }.form-error { color: #a91f24 !important; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 30px); padding: 13px 18px; color: white; background: #162330; border-radius: 12px; box-shadow: var(--shadow); z-index: 30; }
.scan-progress { display:flex; align-items:center; justify-content:space-between; margin:10px 0 13px; padding:10px 12px; color:#654700; background:#fff6d8; border-radius:9px; }
.scan-progress button { border:0; color:#8b6200; background:transparent; font-size:11px; font-weight:900; }
.user-list { display: grid; gap: 10px; margin-top: 18px; max-height: 52vh; overflow: auto; }.user-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }.user-row small { display: block; color: var(--ink-soft); margin-top: 3px; }.user-row .access { display: flex; align-items: center; gap: 7px; }.user-row select { padding: 8px; border: 1px solid #cbd4dd; border-radius: 8px; background: white; }.approve-button { padding: 9px 11px; border: 0; border-radius: 8px; color: white; background: var(--green); font-weight: 800; }.approved-mark { color: #08763a; font-size: 12px; font-weight: 900; }
.empty-state { padding: 70px 24px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 20px; }.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: auto; border-radius: 50%; color: white; background: var(--green); font-size: 28px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 75% 20%, rgba(27,154,223,.18),transparent 35%), linear-gradient(145deg,#0e1721,#16283a); }
.login-card { width: min(480px, 100%); padding: 34px; background: rgba(255,255,255,.98); border-radius: 24px; box-shadow: 0 28px 90px rgba(0,0,0,.35); }.brand-dark { display: inline-flex; color: var(--ink); border-right: 0; padding-right: 0; }.brand-dark small { color: #516171; }.login-copy { margin: 48px 0 28px; }.login-copy h1 { margin: 7px 0 10px; font-size: 42px; }.login-copy p { color: var(--ink-soft); line-height: 1.55; }.google-button { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 11px; color: #202124; text-decoration: none; font-weight: 800; border: 1px solid #cfd5dc; border-radius: 12px; }.google-button:hover { background: #f7f9fb; }.google-mark { color: #4285f4; font-size: 22px; }.domain-note { text-align: center; color: var(--ink-soft); font-size: 12px; }.demo-login { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); text-align: center; }.demo-login span { display: block; color: var(--ink-soft); font-size: 11px; margin-bottom: 9px; }.demo-login a { display: inline-block; margin: 3px; padding: 8px 10px; color: #0875bb; background: var(--blue-pale); border-radius: 8px; text-decoration: none; font-size: 12px; font-weight: 800; }

@media (max-width: 720px) {
  .topbar { min-height: 68px; padding: 11px 16px; }.topbar .brand { min-width: auto; border: 0; padding: 0; }.topbar .brand-globe { width: 31px; height: 31px; font-size: 18px; }.topbar .brand b { font-size: 18px; }.topbar .brand small { display: none; }.product-title { line-height: 1.05; }.product-title strong { font-size: 14px; }.product-title span { font-size: 10px; }.topbar-right { margin-left: auto; }.topbar-right .live, .topbar-right .date, .user-copy, .user-button > span:last-child { display: none; }.user-button { padding: 4px; border: 0; background: transparent; }.avatar { width: 35px; height: 35px; }
  .workspace { width: 100%; margin: 0; }.mobile-titlebar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: white; border-bottom: 1px solid var(--line); }.mobile-titlebar .live { color: #08763a; }.mobile-titlebar .live time { color: #5d6b78; }.mobile-user { display: flex; align-items: center; gap: 7px; border: 0; background: none; }.mobile-user span { width: 28px; height: 28px; color: white; }.queue-bar { padding: 18px 16px 12px; margin: 0; align-items: center; }.queue-bar h1 { font-size: 18px; }.queue-count { min-width: 70px; padding: 8px 11px; }
  .job-card { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }.file-row { min-height: 83px; padding: 13px 15px; gap: 11px; }.pdf-icon { width: 42px; height: 48px; }.file-copy h2 { font-size: 14px; }.file-copy p { font-size: 11px; }.carrier-lockup { display: none; }.batch-pill { padding: 6px 9px; font-size: 11px; }
  .batch-switcher { margin: 0 12px 12px; gap: 6px; }.batch-switcher button { min-height: 48px; padding: 8px 10px; font-size: 12px; }.batch-switcher button small { display: none; }.batch-switcher .job-state { display: none; }
  .admin-lookup { grid-template-columns:1fr; gap:12px; margin:0 12px 12px; padding:15px; }.admin-lookup h2{font-size:16px}.admin-lookup form{grid-template-columns:1fr 1fr}.admin-lookup input{grid-column:1/-1;min-height:48px}.admin-lookup button{min-height:46px}
  .stats { grid-template-columns: 1fr 1fr; }.stats > div { padding: 11px 14px; }.stats > div:nth-child(2) { border-right: 0; }.stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.stat-icon { font-size: 18px; }
  .viewer { height: 460px; grid-template: 40px 1fr / 68px 1fr; margin: 14px 12px; }.viewer-toolbar { gap: 9px; padding: 0 10px; }.viewer-toolbar > span:nth-of-type(3), .viewer-toolbar > span:nth-of-type(5), .viewer-toolbar > span:nth-last-of-type(2) { display: none; }.thumbnails { padding: 7px; }.thumbnail { height: 72px; padding: 5px; margin-bottom: 7px; }.label-stage { padding: 14px; place-items: start center; }.shipping-label { width: 292px; height: 354px; padding: 16px; }.label-top { height: 55px; }.service-letter { font-size: 52px; }.matrix { width: 86px; height: 48px; }.shipping-label h3 { font-size: 13px; }.label-grid { font-size: 10px; }.tracking { left: 16px; right: 16px; bottom: 14px; }.barcode { height: 42px; }.preview-watermark { font-size: 35px; }
  .selection-bar { margin: 0 12px 8px; }.selection-bar small{font-size:10px}.printer-picker{margin:12px;padding:12px}.actions { position: sticky; bottom: 0; z-index: 5; grid-template-columns: repeat(2,minmax(120px,1fr)); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }.actions button { min-height: 56px; font-size: 12px; }.status { margin: 12px 12px 20px; padding: 14px; }.status h3 { font-size: 14px; }.status p { font-size: 12px; }
  .dialog form { padding: 25px 20px calc(22px + env(safe-area-inset-bottom)); }.dialog { margin: auto 14px 14px; width: calc(100% - 28px); max-height: 92vh; }.dialog h2 { font-size: 24px; }.dialog menu { grid-template-columns: 1fr; }.warning-dialog h2 { font-size: 30px; }.login-card { padding: 27px 22px; }.login-copy { margin: 38px 0 24px; }.login-copy h1 { font-size: 36px; }
}

@media (prefers-reduced-motion: no-preference) {
  .live i { animation: pulse 1.8s infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(25,210,106,0); } }
}
.camera-panel{margin-top:12px;border-radius:14px;overflow:hidden;background:#101a29;color:#fff;text-align:center}.camera-panel video{display:block;width:100%;max-height:280px;object-fit:cover}.camera-panel p{margin:0;padding:10px;font-size:13px}
.printer-picker{display:grid;grid-template-columns:auto minmax(180px,1fr);align-items:center;gap:6px 14px;margin:16px 0;padding:14px 16px;border:1px solid #d9e1eb;border-radius:14px;background:#f8fafc}.printer-picker>span{font-size:11px;font-weight:900;letter-spacing:.16em;color:#66758a}.printer-picker select{min-width:0;padding:11px 36px 11px 12px;border:1px solid #aeb9c8;border-radius:9px;background:#fff;color:#142238;font-size:14px;font-weight:700}.printer-picker small{grid-column:2;color:#69778a}
