:root {
  --canvas: #0B0C0E;
  --panel: #16191D;
  --panel-2: #1C2026;
  --line: #2A2F36;
  --orange: #FF6B00;
  --orange-ink: #1A0D04;
  --steel: #9CA3AF;
  --text: #E7E8EA;
  --red: #D64545;
  --green: #3DDC84;
  --amber: #E0A106;
  --blue: #5B8DEF;
  --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-size: 14px;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
.num, .vin, .sku, .timer, .mono {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-family: Inter, ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 228px; z-index: 30;
  display: flex; flex-direction: column;
  background: #0E1013; border-right: 1px solid var(--line);
}
.workspace { margin-left: 228px; min-width: 0; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.shell.is-rail .sidebar { width: 64px; }
.shell.is-rail .workspace { margin-left: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 64px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 40px; height: 40px; object-fit: cover; object-position: 18% 50%; border-radius: 6px; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-text strong { letter-spacing: .12em; font-size: 13px; }
.brand-text span { color: var(--steel); letter-spacing: .18em; font-size: 10px; }
.side-nav { display: flex; flex-direction: column; padding: 8px 0; overflow: auto; }
.nav-row { display: flex; align-items: center; min-height: 48px; }
.nav-row .nav-link { flex: 1; min-width: 0; padding-right: 12px; }
.nav-grip {
  flex: 0 0 auto; width: 28px; min-height: 48px; border: 0; background: transparent; color: var(--orange);
  font-weight: 700; cursor: grab; padding: 0; letter-spacing: -2px; font-size: 16px;
}
.nav-label { white-space: nowrap; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 8px 0 10px; }
.side-pin { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  color: var(--steel); text-decoration: none; border-left: 2px solid transparent;
  font-size: 13px; font-weight: 600; background: transparent;
}
.nav-link:hover { color: var(--text); background: #121418; }
.nav-link.active { color: var(--text); background: #14181d; border-left-color: var(--orange); }
.nav-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-link { position: relative; }
.nav-count { margin-left: auto; min-width: 18px; padding: 0 4px; border: 1px solid var(--line); color: var(--text); font-size: 11px; line-height: 16px; text-align: center; }
.shell.is-rail .nav-count { position: absolute; right: 4px; top: 4px; margin: 0; font-size: 9px; background: var(--canvas); }
.user-line { padding: 4px 14px 8px; }
.user-name { display: block; font-weight: 600; font-size: 13px; }
.side-signout { width: calc(100% - 16px); margin: 0 8px; justify-content: flex-start; gap: 10px; }
.app-header {
  position: sticky; top: 0; height: 56px; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: var(--canvas); border-bottom: 1px solid var(--line);
  padding: 0 12px;
}
.icon-btn { width: 48px; padding: 0; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-wrap { position: relative; flex: 1; max-width: 420px; }
.search-wrap input, .tools .btn, .icon-btn { height: 48px; }
.search-wrap input {
  width: 100%; background: #0E1013; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px;
}
.search-pop {
  position: absolute; top: 52px; right: 0; width: 360px; max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); z-index: 50;
}
.search-pop a { display: block; padding: 10px 12px; text-decoration: none; border-bottom: 1px solid var(--line); }
.search-pop a:hover { background: var(--panel-2); }
.search-pop small { color: var(--steel); display: block; }
.clock-pill { color: var(--steel); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.clock-pill:has(.dot.run) { color: var(--green); }
.dot { width: 8px; height: 8px; background: #4b5563; display: inline-block; flex: 0 0 auto; }
.dot.run { background: var(--green); animation: live 1.6s steps(2, end) infinite; }
.app-main { padding: 16px 16px 40px; max-width: 1440px; }
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--steel); font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--orange); text-decoration: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.btn {
  min-height: 48px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line);
  background: #121418; color: var(--text); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: .01em;
}
.btn:hover { border-color: #4b5563; background: #1a1e24; }
.btn:focus-visible { outline: 1px solid var(--orange); outline-offset: 2px; }
.btn.primary { background: var(--orange); color: #1A0D04; border-color: var(--orange); }
.btn.primary:hover { background: #ff7d26; }
.btn.on { background: #1a1e24; border-color: #6b7280; color: var(--text); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: #14171c; }
.btn.danger { background: transparent; border-color: #7f2d2d; color: #f0b4b4; }
.btn.danger:hover { background: #2a1212; }
.btn.good { background: transparent; border-color: #1f6b40; color: #b7f0cf; }
.btn.warn { background: transparent; border-color: #8a6a12; color: #f3dd9a; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn.full { width: 100%; }
label.btn input { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field > span, .lbl { color: var(--steel); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
input, select, textarea {
  background: #0E1013; border: 1px solid var(--line); border-radius: 6px; min-height: 48px; padding: 10px 12px; width: 100%;
}
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  max-width: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  background: #0E1013;
  border: 1px solid #5c6570;
  border-radius: 4px;
  cursor: pointer;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked {
  border-color: var(--orange);
  background-color: #0E1013;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 9.2 7.2 12.4 14 5.6' fill='none' stroke='%23FF6B00' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}
input[type="radio"]:checked {
  border-color: var(--orange);
  background-image: radial-gradient(circle, #FF6B00 42%, transparent 46%);
  background-repeat: no-repeat;
  background-position: center;
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }
input[type="checkbox"]:focus,
input[type="radio"]:focus { outline: 2px solid var(--orange); outline-offset: 2px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"] {
  color-scheme: light only;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 18px;
  height: 18px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FF6B00' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
}
input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FF6B00' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 8v5l3 2'/%3E%3C/svg%3E");
}
.inline { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; }
.check input[type="checkbox"],
.check input[type="radio"] { width: 18px; height: 18px; min-height: 18px; max-width: 18px; }
.flag-btn { position: fixed; top: 12px; left: 12px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--orange); padding: 0; overflow: hidden; background: var(--canvas); }
.flag-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login { position: relative; }
.login .btn { text-decoration: none; margin-top: 8px; }
.report-photo { width: 180px; max-width: 100%; height: auto; border-radius: 6px; margin: 8px 8px 0 0; }
.qr-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 16px; }
.qr-row img { background: #fff; border-radius: 6px; }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
#scan-session.flash { box-shadow: 0 0 0 3px var(--green); }
.scan-row.known td { background: rgba(61, 220, 132, .12); }
.scan-row.unknown td { background: rgba(214, 69, 69, .16); color: #f0b4b4; }
.cal-group { display: flex; gap: 6px; align-items: center; }
.cal-toolbar strong { margin-right: 8px; }
.cal-toolbar [data-action="open-event-form"] { margin-left: auto; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.panel h2, .panel h3 { margin: 0 0 10px; font-size: 16px; }
.kpi-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; min-height: 88px; }
.kpi:hover { border-color: #3d4450; }
.kpi b { display: block; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.kpi span { color: var(--steel); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; font-weight: 600; }
.kpi.down b { color: var(--red); }
.kpi.low b { color: var(--amber); }
.kpi.open b { color: var(--orange); }
.kpi.done b { color: var(--green); }

.cal-toolbar, .legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.legend button { min-height: 40px; }
.cal-grid, .pm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pm-dow { color: var(--steel); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 0 4px; }
.pm-day { min-height: 88px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.pm-chip { display: block; width: 100%; margin-top: 4px; text-align: left; border: 1px solid var(--line); border-left-width: 3px; background: #1a1f27; color: var(--text); border-radius: 2px; padding: 4px 6px; font-size: 12px; }
.pm-chip.pm-scheduled { border-left-color: var(--blue); }
.pm-chip.pm-coming_due { border-left-color: var(--amber); }
.pm-chip.pm-overdue { border-left-color: var(--red); }
.pm-chip.pm-locked { border-left-color: #7c6ad6; }
.pm-chip.pm-wo { border-left-color: var(--orange); }
.pm-chip .grip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 4px; cursor: grab; touch-action: none; }
@media (max-width: 720px) {
  .pm-cal { grid-template-columns: 1fr; }
  .pm-dow { display: none; }
  .pm-day { min-height: 0; }
}
.cal-dow { color: var(--steel); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 0 4px; }
.cal-cell { min-height: 108px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.cal-cell.off { opacity: .45; }
.cal-cell.today { border-color: var(--orange); }
.cal-cell .d { font-variant-numeric: tabular-nums; color: var(--steel); font-size: 12px; }
.evt.done { opacity: 0.45; text-decoration: line-through; color: #9ca3af; }
.evt, .job-card {
  display: block; margin-top: 4px; padding: 4px 6px; border-radius: 2px; background: #1a1f27; color: var(--text);
  font-size: 12px; text-decoration: none; border: 1px solid var(--line); border-left-width: 3px;
}
.evt.pm, .job-card.pm { border-left-color: var(--orange); }
.evt.wo { border-left-color: var(--blue); }
.evt.po, .evt.wait { border-left-color: var(--amber); }
.evt.inv { border-left-color: var(--blue); }
.evt.down, .job-card.down { border-left-color: var(--red); }
.evt.report { border-left-color: #d1d5db; }
.evt { cursor: grab; }
.bay-grid { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 8px; overflow-x: auto; }
.bay-col, .kanban-col { background: #101216; border: 1px solid var(--line); border-radius: 6px; min-height: 140px; padding: 8px; }
.bay-col h3, .kanban-col h3 { margin: 0 0 8px; font-size: 13px; color: var(--steel); letter-spacing: .08em; text-transform: uppercase; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 8px; overflow-x: auto; }
.job-card { background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 10px; }
.job-card .grip, .evt .grip {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px;
  background: #0E1013; color: var(--steel); cursor: grab; touch-action: none; margin-right: 4px;
}
.drop-hover { outline: 2px solid var(--orange); }
.drag-ghost {
  position: fixed; z-index: 80; pointer-events: none; background: var(--orange); color: #1A0D04;
  padding: 8px 10px; border-radius: 6px; font-weight: 800;
}

.badge, .badge-select { display: inline-flex; align-items: center; min-height: 28px; padding: 0 6px; border-radius: 0; background: #14181d; border: 1px solid #3a4048; color: var(--text); font-size: 11px; font-weight: 650; letter-spacing: .04em; }
.badge-select { width: 100%; max-width: 180px; }
.wo-inline { min-width: 140px; }
.label-miss { margin-top: 12px; padding: 16px; background: #3a1010; color: #f0a8a8; font-size: 22px; font-weight: 700; }
.badge.ok { border-color: #1f6b40; color: #9ddead; }
.badge.low, .badge.wait { border-color: #8a6a12; color: #e6cc7a; }
.badge.out, .badge.down { border-color: #8a3030; color: #f0a8a8; }
.badge.run { border-color: #1f6b40; color: #9ddead; }
.badge.inv { border-color: #2c5288; color: #b9d2f5; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
th { color: var(--steel); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap; }
th:hover { color: var(--text); }
th.sort-asc::after { content: " ↑"; color: var(--orange); }
th.sort-desc::after { content: " ↓"; color: var(--orange); }
tbody tr:hover td { background: #14181d; }
tr.click:hover td { background: #14181d; }
.table-wrap { overflow-x: auto; }

.cockpit { display: grid; grid-template-columns: 25% 50% 25%; gap: 12px; align-items: start; }
.seg { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 12px; background: #12151A; }
.seg.is-active { border-color: #4b5563; }
.seg.missing { border-color: var(--red); }
.seg.missing .need { color: #ffb4b4; font-weight: 700; }
.clock-btn.running { background: #102418; border-color: var(--green); color: #d7ffe8; animation: live 1.6s steps(2, end) infinite; }
.labor-ribbon { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--steel); }
.totals strong { color: var(--text); }
.block-reason { color: #ffb4b4; font-weight: 700; margin: 8px 0; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-grid figure { margin: 0; width: 120px; }
.photo-grid img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; background: #000; }
.ta { position: relative; }
.ta-list { position: absolute; z-index: 20; left: 0; right: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; max-height: 240px; overflow: auto; }
.ta-list button { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); min-height: 48px; padding: 8px 10px; }
.matrix td .status { white-space: nowrap; }
.notes-panel textarea { min-height: 140px; }

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--canvas);
}
.login-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px; }
.login-card img { width: min(100%, 280px); display: block; margin: 0 auto 2px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.totals-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 720px) { .summary-grid { grid-template-columns: 1fr; } }
.login-card h1 { font-size: 22px; margin: 10px 0 4px; }
.license-meta { margin: 0 0 8px; font-weight: 650; }
.login-version { margin: 0 0 14px; text-align: center; color: #9CA3AF; font-size: 11px; }
.login-links { position: absolute; right: 12px; bottom: 8px; display: flex; gap: 14px; }
.new-user-link { color: rgba(156, 163, 175, 0.45); font-size: 11px; text-decoration: none; }
.new-user-link:hover { color: rgba(156, 163, 175, 0.7); }
.day-checks { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.day-checks legend { width: 100%; font-size: 13px; color: var(--steel); }
.vendor-screen .login-card { width: min(920px, 100%); }
.vendor-sheet table { width: 100%; }
@media print {
  .vendor-screen .no-print { display: none !important; }
}
.side-version { margin: 2px 14px 8px; color: #9CA3AF; font-size: 11px; }
.shell.is-rail .side-version { display: none; }
.more-version { margin-top: auto; padding: 16px; color: #9CA3AF; font-size: 11px; }
.idle-warn { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 80; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #1a120c; border: 1px solid var(--orange); padding: 12px 14px; }
.idle-warn[hidden] { display: none; }
.subnav { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.subnav a { min-height: 48px; padding: 0 12px; display: inline-flex; align-items: center; color: var(--steel); text-decoration: none; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 600; }
.subnav a.active { color: var(--text); border-bottom-color: var(--orange); }
.req-table td { padding-top: 4px; padding-bottom: 4px; }
.hint { color: var(--steel); font-size: 13px; }

.empty { padding: 28px; text-align: center; color: var(--steel); }
.toast-root, #toast-root { position: fixed; right: 12px; bottom: 12px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: 2px; padding: 12px 14px; min-width: 220px; box-shadow: var(--shadow); }
.toast.bad { border-color: var(--red); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.span-2 { grid-column: 1 / -1; }
.picker-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.picker-row > .field { flex: 1 1 220px; margin-bottom: 0; }
.picker-row > .btn { margin-bottom: 10px; }
.video-wrap video { width: 100%; background: #000; border-radius: 6px; }
.dropzone { border: 2px dashed var(--line); border-radius: 6px; padding: 22px; text-align: center; color: var(--steel); }
.dropzone.hot { border-color: var(--orange); color: var(--text); }
.pdf-stage { overflow: auto; background: #07080a; border-radius: 6px; min-height: 480px; display: grid; justify-content: center; padding: 12px; }
#pdf-canvas { background: white; }

@keyframes live {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
kbd { border: 1px solid var(--line); padding: 1px 5px; font-family: Inter, monospace; font-size: 11px; color: var(--steel); }

.shell.is-rail .brand { justify-content: center; padding: 8px 0; }
.shell.is-rail .brand-text,
.shell.is-rail .nav-label,
.shell.is-rail .user-line,
.shell.is-rail .clock-label,
.shell.is-rail .side-signout span { display: none; }
.shell.is-rail .nav-link { justify-content: center; padding: 0; }
.shell.is-rail .nav-grip { display: none; }
.shell.is-rail .side-signout { width: 48px; margin: 0 auto; justify-content: center; padding: 0; }
.shell.is-rail .clock-pill { justify-content: center; }

.tabbar, .more-drawer, .mobile-jobbar { display: none; }
.install-banner { border: 1px solid var(--line); background: var(--panel); padding: 12px; margin-bottom: 12px; }
.install-banner p { margin: 6px 0 10px; }

@media (max-width: 1100px) {
  .cockpit, .grid-3, .kpi-strip { grid-template-columns: 1fr 1fr; }
  .cockpit { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .workspace, .shell.is-rail .workspace { margin-left: 0; }
  .app-main { padding: 12px 10px 84px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 40;
    background: #0E1013; border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    flex: 1; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--steel); text-decoration: none; background: transparent; border: 0; font-size: 10px; font-weight: 600;
  }
  .tabbar .active { color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
  .more-drawer:not([hidden]) {
    display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: 0; bottom: 64px; z-index: 35;
    background: #0E1013; border-top: 1px solid var(--line); overflow: auto;
  }
  .more-drawer > a, .more-drawer > button {
    min-height: 48px; display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--line);
    color: var(--text); text-decoration: none; background: transparent; text-align: left; font-weight: 600;
  }
  .more-drawer .nav-row { border-bottom: 1px solid var(--line); }
  .more-drawer .nav-grip { width: 48px; color: var(--text); }
  .mobile-jobbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .mobile-jobbar .btn, .mobile-jobbar label.btn { flex: 1; }
  .table-wrap thead { display: none; }
  .table-wrap tr { display: block; border: 1px solid var(--line); margin: 0 0 8px; padding: 8px 10px; background: #12151a; }
  .table-wrap td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 0; }
  .table-wrap td::before { content: attr(data-label); color: var(--steel); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  #toast-root { bottom: 76px; }
  .idle-warn { bottom: 76px; }
}
.part-line { display: grid; grid-template-columns: minmax(120px, 1.5fr) minmax(90px, 1fr) minmax(110px, 1.2fr) 72px 84px 84px auto; gap: 8px; align-items: end; }
.part-line .field { margin: 0; }
.part-line p { margin: 0 0 8px; }
.label-sheet { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.label-sheet .bin-label { container-type: size; display: flex; align-items: center; justify-content: center; gap: 3%; overflow: hidden; background: white; color: black; border: 1px dashed #999; box-sizing: border-box; padding: 4%; }
.label-sheet .bin-label img.code { object-fit: contain; flex: 1 1 auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.label-sheet .label-copy { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; }
.label-sheet .sku-text, .label-sheet .restock-line, .label-sheet .loc-line, .label-sheet .label-copy div { overflow-wrap: anywhere; word-break: break-word; line-height: 1.05; max-width: 100%; }
.label-sheet .sku-text { font-weight: 800; font-size: clamp(8px, 18cqh, 28px); }
.label-sheet .restock-line, .label-sheet .loc-line, .label-sheet .label-copy div { font-size: clamp(7px, 12cqh, 16px); }
.label-sheet.size-2x1 .bin-label, .label-sheet.size-225x125 .bin-label, .label-sheet.size-5160 .bin-label { flex-direction: row; }
.label-sheet.size-2x1 .bin-label img.code, .label-sheet.size-225x125 .bin-label img.code, .label-sheet.size-5160 .bin-label img.code { max-width: 48%; max-height: 92%; }
.label-sheet.size-4x6 .bin-label, .label-sheet.size-5163 .bin-label { flex-direction: column; text-align: center; }
.label-sheet.size-4x6 .bin-label img.code { max-height: 68%; max-width: 86%; }
.label-sheet.size-5163 .bin-label img.code { max-height: 58%; max-width: 70%; }
.label-sheet.size-2x1 .bin-label { width: 2in; height: 1in; }
.label-sheet.size-225x125 .bin-label { width: 2.25in; height: 1.25in; }
.label-sheet.size-4x6 .bin-label { width: 4in; height: 6in; }
.label-sheet.size-5160 { width: 8.5in; display: grid; grid-template-columns: repeat(3, 2.625in); }
.label-sheet.size-5160 .bin-label { width: 2.625in; height: 1in; }
.label-sheet.size-5163 { width: 8.5in; display: grid; grid-template-columns: repeat(2, 4in); }
.label-sheet.size-5163 .bin-label { width: 4in; height: 2in; }
.sku-text { font-weight: 800; letter-spacing: 0.02em; }
.restock-line { font-weight: 650; }
.label-preview { background: #f4f1ea; padding: 12px; overflow: auto; max-height: 42vh; }
.size-gallery { display: flex; gap: 14px; align-items: flex-end; overflow: auto; padding: 8px 4px 12px; }
.size-gallery figure { margin: 0; flex: 0 0 auto; }
.size-gallery figcaption { color: #222; font-size: 12px; font-weight: 700; margin: 0 0 4px; }
.size-gallery .size-4x6 { zoom: 0.34; }
.size-gallery .size-5160 { zoom: 0.42; }
.size-gallery .size-5163 { zoom: 0.36; }
#part-barcode img, #epson-sample img, #asset-qr img { background: white; max-width: 280px; }
@media (max-width: 720px) {
  .part-line { grid-template-columns: 1fr 1fr; }
  .kpi-strip, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .modal-back { padding: 0; place-items: stretch; }
  .modal.sheet { width: 100%; max-height: none; min-height: 100%; border-radius: 0; border-left: 0; border-right: 0; }
  .print-label { display: none; }
  .app-header [data-action="do-print"]::after { content: "Print"; }
}

@media print {
  body { background: white !important; color: black !important; }
  .app-header, #app, #toast-root, #modal-root, .no-print { display: none !important; }
  #print-root { display: block !important; }
  .sheet { color: black; background: white; font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; }
  .sheet h1, .sheet h2, .sheet h3 { color: black; margin: 0 0 6px; }
  .sheet table { width: 100%; border-collapse: collapse; }
  .sheet th, .sheet td { border: 1px solid #222; padding: 4px 6px; color: black; vertical-align: top; }
  .sheet .sheet-head { display: flex; justify-content: space-between; border-bottom: 3px solid #111; margin-bottom: 10px; padding-bottom: 8px; }
  .sheet .word { font-weight: 900; letter-spacing: .14em; font-size: 20px; }
  .sheet .doc-title { font-size: 18px; font-weight: 800; text-align: right; }
  .init { width: 42px; height: 22px; }
  .sign { margin-top: 16px; }
  .remit { margin-top: 18px; border-top: 2px dashed #111; padding-top: 10px; break-inside: avoid; }
  .label-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .bin-label { border: 1px solid #111; padding: 8px; break-inside: avoid; }
  .label-sheet .bin-label { break-inside: avoid; border-style: solid; }
  .label-preview { background: #f4f1ea; padding: 12px; overflow: auto; max-height: 52vh; }
  #part-barcode img, #epson-sample img, #asset-qr img { background: white; }
  .pdf-page { width: 100%; break-after: page; }
  .barcode { height: 48px; }
  .barcode rect { fill: black; }
}
#print-root { display: none; }
