/* ============================================================
   GBSOAPS ORDER — Wholesale Draft Order Entry
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg: #f4f4f0;
  --clr-surface: #ffffff;
  --clr-border: #d0cfc8;
  --clr-border-focus: #2a6496;
  --clr-primary: #2a6496;
  --clr-primary-hover: #1e4d74;
  --clr-danger: #c0392b;
  --clr-success: #27ae60;
  --clr-warning: #e67e22;
  --clr-text: #1a1a1a;
  --clr-text-muted: #666;
  --clr-header-bg: #1a3a5c;
  --clr-header-text: #ffffff;
  --clr-row-alt: #f9f9f6;
  --clr-selected: #d6e8f7;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
}

/* ── Header ── */
#app-header {
  background: var(--clr-header-bg);
  color: var(--clr-header-text);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
#app-header h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
#app-header .subtitle { font-size: 11px; opacity: 0.7; margin-top: 2px; }

/* ── Nav tabs ── */
#nav-tabs {
  display: flex;
  background: var(--clr-surface);
  border-bottom: 2px solid var(--clr-border);
  padding: 0 16px;
}
.nav-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.nav-tab:hover { color: var(--clr-primary); }
.nav-tab.active { color: var(--clr-primary); border-bottom-color: var(--clr-primary); }

/* ── Status bar ── */
#status-bar {
  padding: 8px 20px;
  font-size: 13px;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#status-bar.info { background: #e8f0fe; color: #1a5276; border-bottom: 1px solid #aed6f1; }
#status-bar.success { background: #eafaf1; color: #1e8449; border-bottom: 1px solid #a9dfbf; }
#status-bar.error { background: #fdedec; color: #a93226; border-bottom: 1px solid #f1948a; }
#status-bar.warning { background: #fef9e7; color: #9a7d0a; border-bottom: 1px solid #f9e79f; }
#status-bar:empty { display: none; }

/* ── Main layout ── */
#main {
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

#shipping-main {
  flex: 1;
  padding: 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  overflow-y: auto;
  width: 100%;
}
#shipping-main #shipping-search-detail { width: 100%; }
#screen-shipping .screen-footer { padding: 10px 20px; }

/* ── Views ── */
.view { display: none; }
.view.active { display: block; }

/* ── Form rows ── */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.form-group.wide { flex: 2; }
.form-group.narrow { flex: 0 0 120px; min-width: 100px; }

label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--clr-text-muted);
}

input[type="text"], input[type="number"], textarea, select {
  padding: 7px 10px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--clr-surface);
  color: var(--clr-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--clr-border-focus);
  box-shadow: 0 0 0 3px rgba(42,100,150,0.15);
}
input.populated { background: #f0f6ff; border-color: #a0c4e8; }
textarea { resize: vertical; min-height: 60px; }

/* ── Section headers ── */
.section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--clr-text-muted);
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header .badge {
  background: var(--clr-primary);
  color: white;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 10px;
}

/* ── Hint chips ── */
.hint {
  font-size: 11px;
  color: var(--clr-text-muted);
  margin-bottom: 6px;
}
.hint kbd {
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: monospace;
}

/* ── SKU entry row ── */
#sku-entry-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: #f0f6ff;
  border: 1px solid #a0c4e8;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
#sku-entry-row .form-group { margin: 0; }
#sku-entry-row .btn-add {
  flex-shrink: 0;
  height: 36px;
  align-self: flex-end;
}

/* ── Items table ── */
#items-section { margin-bottom: 14px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  background: var(--clr-header-bg);
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 10px;
  text-align: left;
}
.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--clr-row-alt); }
.data-table tr.selected td { background: var(--clr-selected); }
.data-table tr:hover td { background: #eef4fb; cursor: pointer; }
.data-table .num { text-align: right; }
.data-table .center { text-align: center; }

.btn-remove {
  background: none;
  border: none;
  color: var(--clr-danger);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
  border-radius: 3px;
}
.btn-remove:hover { background: #fdecea; }

.empty-table {
  text-align: center;
  color: var(--clr-text-muted);
  font-style: italic;
  padding: 20px;
}

/* ── Totals row ── */
#order-totals {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.totals-box {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 12px 20px;
  min-width: 220px;
  box-shadow: var(--shadow);
}
.totals-box .total-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 3px 0;
  font-size: 13px;
}
.totals-box .total-row.grand {
  border-top: 2px solid var(--clr-text);
  margin-top: 6px;
  padding-top: 6px;
  font-weight: 700;
  font-size: 15px;
}
.totals-box .total-label { color: var(--clr-text-muted); }
.totals-box .total-val { font-variant-numeric: tabular-nums; }

/* ── Bottom form ── */
#bottom-form {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

/* ── Draft order result ── */
#draft-result {
  background: #eafaf1;
  border: 1px solid #a9dfbf;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: none;
}
#draft-result h3 { color: #1e8449; font-size: 14px; margin-bottom: 6px; }
#draft-result .order-detail { font-size: 13px; color: var(--clr-text); }

/* ── Action buttons ── */
#action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--clr-primary); color: white; }
.btn-primary:not(:disabled):hover { background: var(--clr-primary-hover); }
.btn-success { background: var(--clr-success); color: white; }
.btn-success:not(:disabled):hover { background: #219a52; }
.btn-warning { background: var(--clr-warning); color: white; }
.btn-warning:not(:disabled):hover { background: #ca6f1e; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:not(:disabled):hover { background: #5a6268; }
.btn-danger { background: var(--clr-danger); color: white; }
.btn-danger:not(:disabled):hover { background: #a93226; }
.btn-outline { background: white; color: var(--clr-primary); border: 1px solid var(--clr-primary); }
.btn-outline:not(:disabled):hover { background: #eef4fb; }
.btn .shortcut {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: monospace;
}

/* ── Paid Orders view ── */
#paid-search-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}
#paid-search-bar .form-group { margin: 0; flex: 1; max-width: 320px; }
#paid-orders-list { margin-bottom: 14px; }
#paid-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ── Keyboard hint bar ── */
#kbd-hints {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--clr-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
#kbd-hints kbd {
  background: #eee;
  border: 1px solid #bbb;
  border-bottom: 2px solid #bbb;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: monospace;
  color: var(--clr-text);
}

/* ============================================================
   PACKING SLIP — Print Styles
   ============================================================ */

#packing-slip-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}
#packing-slip-overlay.open { display: flex; align-items: flex-start; justify-content: center; }

#packing-slip-wrapper {
  background: white;
  border-radius: 4px;
  padding: 20px;
  max-width: 860px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: relative;
}

#slip-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ddd;
}

#packing-slip {
  font-family: Arial, sans-serif;
  font-size: 11px;
  color: #000;
}

.slip-company-name {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1a3a5c;
  margin-bottom: 2px;
}
.slip-company-address { font-size: 10px; color: #333; line-height: 1.5; }

.slip-title {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-top: 2px solid #1a3a5c;
  border-bottom: 2px solid #1a3a5c;
  padding: 4px 0;
  margin: 8px 0;
}

.slip-info-grid {
  display: grid;
  gap: 0;
  border: 1px solid #999;
  margin-bottom: 6px;
}
.slip-info-row {
  display: flex;
  border-bottom: 1px solid #ccc;
}
.slip-info-row:last-child { border-bottom: none; }
.slip-info-cell {
  flex: 1;
  padding: 4px 6px;
  border-right: 1px solid #ccc;
}
.slip-info-cell:last-child { border-right: none; }
.slip-info-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  display: block;
}
.slip-info-value {
  font-size: 11px;
  font-weight: 600;
  color: #000;
  min-height: 16px;
  display: block;
}

.slip-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 11px;
}
.slip-table th {
  background: #1a3a5c;
  color: white;
  padding: 5px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.slip-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e0e0e0;
}
.slip-table tr:nth-child(even) td { background: #f7f7f7; }
.slip-table .num { text-align: right; }

.slip-totals { margin-top: 8px; display: flex; justify-content: flex-end; }
.slip-totals-box { min-width: 240px; border: 1px solid #ccc; }
.slip-total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 11px;
}
.slip-total-row:last-child { border-bottom: none; font-weight: 700; font-size: 12px; background: #f0f0f0; }
.slip-total-label { color: #444; }
.slip-total-val { font-variant-numeric: tabular-nums; }

/* Box weights */
.slip-box-weights {
  margin-top: 10px;
  border: 1px solid #ccc;
  padding: 8px;
}
.slip-box-weights h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 6px;
}
.box-weight-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.box-weight-cell {
  text-align: center;
}
.box-weight-cell label {
  display: block;
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.box-weight-cell input {
  width: 100%;
  padding: 3px 4px;
  font-size: 11px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 2px;
}

/* ── Print media ── */
/* ── Shipping fee AUTO/MANUAL badge ── */
#shipping-fee-mode {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 4px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: #2e7d32;
  vertical-align: middle;
  cursor: help;
}

#customer-print-overlay { display: none; }
#customer-print { font-family: Georgia, "Times New Roman", serif; color: #000; }
.cp-company { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.cp-title { font-size: 12px; letter-spacing: 3px; color: #333; margin: 2px 0 10px; }
.cp-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.cp-date { font-size: 10px; color: #555; margin-bottom: 12px; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cp-table td { border: 1px solid #999; padding: 6px 8px; vertical-align: top; }
.cp-label { width: 220px; font-weight: 700; background: #f0f0f0; }

@media print {
  /* Zero page margin removes the browser's URL/date header & footer;
     padding below re-creates the page margin inside the printable area. */
  @page { margin: 0; }
  body * { visibility: hidden; }
  /* Fully collapse the app UI while a print overlay is open — hidden-but-
     still-laid-out content otherwise pushes the printout to a blank page 2. */
  body:has(#customer-print-overlay.open) > *:not(#customer-print-overlay),
  body:has(#packing-slip-overlay.open) > *:not(#packing-slip-overlay) {
    display: none !important;
  }
  #packing-slip-overlay.open #packing-slip-wrapper,
  #customer-print-overlay.open { padding: 14mm !important; }
  #packing-slip-overlay.open, #packing-slip-overlay.open * { visibility: visible; }
  #packing-slip-overlay.open {
    position: static;
    background: none;
    padding: 0;
    display: block !important;
  }
  #packing-slip-wrapper {
    box-shadow: none;
    padding: 0;
    max-width: none;
    border-radius: 0;
  }
  #slip-actions { display: none !important; }
  .box-weight-cell input { border: 1px solid #999; }

  #customer-print-overlay.open,
  #customer-print-overlay.open * { visibility: visible; }
  #customer-print-overlay.open {
    display: block !important;
    position: static;
  }
}

.fkey-action { cursor: pointer; }
.fkey-action:hover { background: #ffd400; color: #00007a; }

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Customer info badge ── */
#customer-badge {
  background: #eef4fb;
  border: 1px solid #a0c4e8;
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--clr-primary-hover);
  display: none;
  margin-bottom: 10px;
}
#customer-badge.visible { display: flex; align-items: center; gap: 8px; }
#customer-badge strong { font-weight: 700; }

/* ── Shopify connect banner ── */
#shopify-connect-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff4e5;
  border: 1px solid #f0b27a;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0 0 12px;
  font-size: 13px;
  color: #8a4b08;
}
#shopify-connect-banner .btn { flex: none; }

/* ── Corner REAUTHORIZE button (always visible after login) ── */
#btn-start-corner {
  position: fixed;
  bottom: 8px;
  right: 12px;
  z-index: 500;
  background: transparent;
  border: 1px solid #e8e8e8;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

/* ── Screens (home / placeholder / work) ── */
.screen { display: none; }
.screen.active { display: block; }

#screen-home, #screen-placeholder {
  min-height: 100vh;
  background: #fdfdfb;
  display: none;
  flex-direction: column;
  padding: 10px 14px 14px;
}
#screen-home.active, #screen-placeholder.active { display: flex; }

.fkey-page-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--clr-text);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.fkey-row { display: flex; gap: 0; }
.fkey {
  flex: 1;
  border: 1px solid #444;
  border-right: none;
  padding: 8px 4px 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--clr-text);
  background: #fff;
  min-width: 0;
}
.fkey:last-child { border-right: 1px solid #444; }
.fkey-blank { flex: 0 0 34px; }

.home-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 26px;
  padding-bottom: 60px;
}
.home-menu-item {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--clr-text);
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 340px; /* fixed width so all items start on the same vertical line */
}
.home-menu-item .menu-key {
  width: 48px;
  text-align: center;
  flex: 0 0 auto;
}
.menu-key {
  font-weight: 800;
  border: 2px solid var(--clr-primary);
  color: var(--clr-primary);
  border-radius: var(--radius);
  padding: 0 10px;
  line-height: 1.4;
}
.menu-dash { color: var(--clr-text-muted); }

.placeholder-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding-bottom: 60px;
}
.placeholder-msg { font-size: 20px; font-weight: 600; }
.placeholder-hint { font-size: 14px; color: var(--clr-text-muted); }
.placeholder-hint kbd {
  border: 1px solid var(--clr-border);
  border-radius: 3px;
  padding: 1px 6px;
  background: #fff;
  font-family: inherit;
}

.screen-footer { display: flex; gap: 8px; }
.footer-key {
  border: 1px solid #444;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  min-width: 64px;
  text-align: center;
}

/* ── Retro Q&A color scheme for home & placeholder screens ── */
#screen-home, #screen-placeholder {
  background: #0000ad;
  color: #fff;
  font-family: 'Courier New', 'Consolas', monospace;
}
#screen-home .fkey-page-title,
#screen-placeholder .fkey-page-title { color: #fff; }
#screen-home .fkey-row,
#screen-placeholder .fkey-row {
  background: #00a2a2;
  border: 1px dashed #fff;
  padding: 8px 12px;
  gap: 14px;
  align-items: center;
}
#screen-home .fkey,
#screen-placeholder .fkey {
  flex: 0 0 auto;
  background: #0000ad;
  border: 1px solid #fff;
  border-right: 1px solid #fff;
  color: #fff;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Courier New', 'Consolas', monospace;
}
#screen-home .fkey-blank,
#screen-placeholder .fkey-blank { display: none; }

.menu-panel {
  background: #00a2a2;
  box-shadow: 16px 16px 0 #000;
  padding: 56px 90px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: flex-start;
}
#screen-home .home-menu-item { color: #fff; }
#screen-home .menu-key {
  border-color: #fff;
  color: #fff;
  background: transparent;
}
#screen-home .menu-dash { color: #e0f5f5; }

#screen-placeholder .placeholder-msg { color: #fff; }
#screen-placeholder .placeholder-hint { color: #cfe3ff; }
#screen-placeholder .placeholder-hint kbd {
  background: transparent;
  border-color: #fff;
  color: #fff;
}

#screen-home .footer-key,
#screen-placeholder .footer-key {
  background: transparent;
  border-color: #e8e8e8;
  color: #fff;
}

/* ── Menu panel title (Q&A MAIN MENU) ── */
.menu-panel-title {
  align-self: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}
.menu-panel-rule {
  align-self: stretch;
  border: none;
  border-top: 1px solid #e0f5f5;
  margin: 2px -40px 14px;
}

/* ── Retro Q&A / MS-DOS theme for the ORDER interface ── */
#screen-work {
  background: #0000ad;
  color: #fff;
  font-family: 'Courier New', 'Consolas', monospace;
  padding: 18px 24px;
}
#screen-work #app-header {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #fff;
  padding: 6px 0 10px;
}
#screen-work #app-header h1 { color: #fff; letter-spacing: 2px; }
#screen-work #app-header .subtitle { color: #cfe3ff; }

#screen-work #nav-tabs { border-bottom: 1px solid #e8e8e8; background: transparent; }
#screen-work .nav-tab {
  background: transparent;
  color: #cfe3ff;
  border: 1px solid #e8e8e8;
  border-bottom: none;
  border-radius: 0;
  font-family: inherit;
}
#screen-work .nav-tab.active {
  background: #00a2a2;
  color: #fff;
  border-color: #e8e8e8;
}

#screen-work #main,
#screen-work .view {
  background: transparent;
  box-shadow: none;
  border: none;
}
#screen-work #view-order,
#screen-work #view-paid {
  background: #00a2a2;
  box-shadow: 12px 12px 0 #000;
  border-radius: 0;
  padding: 20px 24px;
  margin-top: 16px;
}

#screen-work .section-header {
  color: #fff;
  border-bottom: 1px solid #e0f5f5;
  background: transparent;
}
#screen-work label { color: #fff; }
/* The SKU entry row sits on a light card, so its labels must be dark. */
#screen-work #sku-entry-row label { color: #0000ad; }
#screen-work .hint, #screen-work #kbd-hints { color: #eafafa; }
#screen-work #kbd-hints { background: transparent; border: 1px dashed #e0f5f5; border-radius: 0; }
#screen-work kbd {
  background: #0000ad;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 0;
  font-family: inherit;
}

#screen-work input,
#screen-work textarea {
  background: #ffffff;
  color: #000;
  border: 1px solid #000;
  border-radius: 0;
  font-family: inherit;
}
#screen-work input:focus,
#screen-work textarea:focus {
  outline: 2px solid #ffd400;
  border-color: #000;
  box-shadow: none;
}

#screen-work .btn {
  border-radius: 0;
  font-family: inherit;
  border: 1px solid #fff;
}
#screen-work .btn-primary { background: #0000ad; color: #fff; }
#screen-work .btn-primary:hover { background: #2323c8; }
#screen-work .btn-outline { background: transparent; color: #fff; border-color: #fff; }
#screen-work .btn-secondary { background: #007a7a; color: #fff; }
#screen-work .btn-success { background: #008a3e; color: #fff; }
#screen-work .btn-warning { background: #b06a00; color: #fff; }

#screen-work .data-table {
  background: transparent;
  border: 1px solid #e0f5f5;
  border-radius: 0;
  color: #fff;
}
#screen-work .data-table th {
  background: #0000ad;
  color: #fff;
  border-bottom: 1px solid #e0f5f5;
}
#screen-work .data-table td { border-bottom: 1px solid rgba(224,245,245,0.4); color: #fff; }
#screen-work .data-table tr:nth-child(even) td { background: rgba(0,0,173,0.18); }
#screen-work .data-table tr:hover td,
#screen-work .data-table tr.selected td { background: rgba(0,0,173,0.35); }
#screen-work .empty-table { color: #eafafa; }

#screen-work .totals-box {
  background: #0000ad;
  border: 1px solid #e0f5f5;
  border-radius: 0;
  color: #fff;
  box-shadow: none;
}
#screen-work .total-label, #screen-work .total-val { color: #fff; }
#screen-work .total-row.grand { border-top: 1px solid #e0f5f5; }

#screen-work .badge {
  background: #0000ad;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 0;
}

#screen-work #draft-result {
  background: #0000ad;
  border: 1px solid #e0f5f5;
  border-radius: 0;
  color: #fff;
}
#screen-work #draft-result h3 { color: #7dffb0; }
#screen-work .order-detail { color: #fff; }

#screen-work #customer-badge .customer-card,
#screen-work #customer-badge > div {
  background: #0000ad;
  border: 1px solid #e0f5f5;
  border-radius: 0;
  color: #fff;
}

#screen-work .btn:focus-visible {
  outline: 2px solid #ffd400;
  outline-offset: 1px;
}

/* ── Customers screen (DOS theme) ── */
#screen-customers,
#screen-shipping {
  background: #0000ad;
  color: #fff;
  font-family: 'Courier New', 'Consolas', monospace;
  display: none;
  flex-direction: column;
  min-height: 100vh;
}
#screen-customers.active,
#screen-shipping.active { display: flex; }
#screen-customers .fkey-page-title,
#screen-shipping .fkey-page-title,
#screen-work .fkey-page-title { color: #fff; }
#screen-customers .fkey-row,
#screen-shipping .fkey-row,
#screen-work .fkey-row {
  background: #00a2a2;
  border: 1px dashed #fff;
  padding: 8px 12px;
  gap: 14px;
  align-items: center;
}
#screen-customers .fkey,
#screen-shipping .fkey,
#screen-work .fkey {
  flex: 0 0 auto;
  background: #0000ad;
  border: 1px solid #fff;
  border-right: 1px solid #fff;
  color: #fff;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
}
#screen-customers .footer-key,
#screen-shipping .footer-key {
  background: transparent;
  border: 1px solid #e8e8e8;
  color: #fff;
}

.customers-body {
  flex: 1;
  padding: 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  overflow-y: auto;
}
.customer-search-panel {
  background: #00a2a2;
  box-shadow: 10px 10px 0 #000;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.customer-search-panel label {
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}
.customer-search-panel input {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 0;
  font-family: inherit;
  font-size: 15px;
  padding: 6px 10px;
  width: 240px;
}
.customer-search-panel input:focus { outline: 2px solid #ffd400; }
.cust-search-hint { color: #eafafa; font-size: 12px; }
.cust-search-hint kbd {
  background: #0000ad;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 0;
  font-family: inherit;
  padding: 1px 5px;
}

#customer-detail { width: 100%; max-width: 860px; }
.cust-loading, .cust-notfound, .cd-empty { color: #eafafa; padding: 10px 4px; }
.cd-card {
  background: #00a2a2;
  box-shadow: 12px 12px 0 #000;
  padding: 22px 28px;
  color: #fff;
}
.cd-heading {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  border-bottom: 1px solid #e0f5f5;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.cd-table { border-collapse: collapse; width: 100%; }
.cd-table td { padding: 4px 8px; border-bottom: 1px solid rgba(224,245,245,0.35); vertical-align: top; }
.cd-label { font-weight: 700; width: 170px; white-space: nowrap; }
.cd-section-title {
  margin-top: 18px;
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 1px;
  border-bottom: 1px solid #e0f5f5;
  padding-bottom: 4px;
}
.cd-address { padding: 6px 8px; border: 1px dashed #e0f5f5; margin-bottom: 8px; }
.cd-mf-table { width: 100%; border: 1px solid #e0f5f5; border-radius: 0; color: #fff; background: transparent; }
.cd-mf-table th { background: #0000ad; color: #fff; border-bottom: 1px solid #e0f5f5; padding: 5px 8px; text-align: left; }
.cd-mf-table td { border-bottom: 1px solid rgba(224,245,245,0.35); padding: 5px 8px; }
.cd-mf-value { word-break: break-word; }

.cd-blank { opacity: 0.55; }

/* ── Customer order search (F4) ── */
.co-table th {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 2px solid #e0f5f5;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}
.co-num { text-align: right !important; white-space: nowrap; }
.co-count { margin-top: 8px; font-size: 12px; color: #eafafa; }

/* ── Confirm modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: #0000ad;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
  max-width: 480px;
  width: calc(100% - 40px);
  padding: 20px 24px;
  font-family: inherit;
}
.modal-msg { font-size: 15px; line-height: 1.5; }
.modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  justify-content: center;
}
.modal-btn {
  background: #aaa;
  color: #000;
  border: 1px solid #fff;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 6px 22px;
  cursor: pointer;
}
.modal-btn:focus {
  outline: 2px solid #ffd400;
  background: #ffd400;
}
.modal-confirm { background: #00aa00; color: #fff; }
.modal-confirm:focus { background: #ffd400; color: #000; }
.modal-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.modal-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: #00aa00;
  flex-shrink: 0;
}
.modal-option-hint { color: #cfd8ff; font-size: 12px; }
.modal-option-hint kbd {
  background: #0000ad; color: #fff; border: 1px solid #fff;
  border-radius: 0; font-family: inherit; padding: 0 4px;
}

/* ── Order edit mode ── */
.oe-input {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  padding: 3px 8px;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}
.oe-input:focus { outline: 2px solid #ffd400; }
.oe-num { max-width: 90px; text-align: right; }
tr.oe-removed td { opacity: 0.45; text-decoration: line-through; }
tr.oe-removed td .oe-qty { text-decoration: none; }

/* ── Customer edit mode ── */
.ce-card input[type="text"], .ce-card textarea {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  padding: 4px 8px;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}
.ce-card input[type="text"]:focus, .ce-card textarea:focus { outline: 2px solid #ffd400; }
.ce-hint { color: #eafafa; font-size: 12px; margin-bottom: 10px; }
.ce-hint kbd {
  background: #0000ad; color: #fff; border: 1px solid #fff;
  border-radius: 0; font-family: inherit; padding: 1px 5px;
}
.ce-check { color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.ce-check input { width: 16px; height: 16px; accent-color: #0000ad; }
.ce-actions { margin-top: 16px; display: flex; gap: 12px; }
.ce-actions .btn { border-radius: 0; font-family: inherit; border: 1px solid #fff; }
.ce-actions .btn-primary { background: #0000ad; color: #fff; }
.ce-actions .btn-secondary { background: #007a7a; color: #fff; }
.ce-actions .btn:focus-visible { outline: 2px solid #ffd400; }

/* ── Login screen (password gate, DOS theme) ──────────────── */
#screen-login {
  background: #0000ad;
  color: #fff;
  font-family: 'Courier New', 'Consolas', monospace;
  display: none;
  flex-direction: column;
  min-height: 100vh;
}
#screen-login.active { display: flex; }
#screen-login kbd {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
}
.login-panel {
  min-width: 420px;
}
.login-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.login-label {
  font-weight: bold;
  white-space: nowrap;
  color: #fff;
}
#login-password {
  flex: 1;
  background: #000;
  color: #fff;
  border: 1px solid #fff;
  font-family: inherit;
  font-size: inherit;
  padding: 4px 8px;
}
#login-password:focus {
  outline: 2px solid #ffff00;
}
.login-hint {
  margin-top: 12px;
  font-size: 0.85em;
  opacity: 0.85;
}
.login-error {
  margin-top: 10px;
  color: #ffff00;
  font-weight: bold;
  min-height: 1.2em;
}
