body { margin:0; font-family:system-ui,-apple-system,Segoe UI,sans-serif; background:#e2e8f0; color:#0f172a; }
.page { max-width:1100px; margin:0 auto; padding:16px 20px; }
.back-bar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.back-bar a:hover {
  border-color: #0ea5e9;
  color: #0369a1;
}
.back-bar a, button {
  text-decoration:none; border:1px solid #334155; border-radius:8px; background:#fff; color:#0f172a;
  padding:7px 12px; font-size:13px; font-weight:600; cursor:pointer;
}
h1 { margin:0 0 6px; }
.sub { margin:0 0 10px; color:#334155; }
.panel { border:1px solid #94a3b8; border-radius:10px; padding:12px; background:#fff; margin-bottom:12px; }
.lookup-grid { display:grid; grid-template-columns:repeat(3, minmax(180px, 1fr)); gap:10px; }
label { display:flex; flex-direction:column; gap:5px; font-size:12px; color:#475569; }
input { border:1px solid #94a3b8; border-radius:8px; padding:8px; font-size:13px; }
.row { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.err { color:#b91c1c; border:1px solid #ef4444; background:#fee2e2; border-radius:8px; padding:8px 10px; margin-top:10px; }
.provision-row { margin-top:12px; padding-top:10px; border-top:1px dashed #cbd5e1; }
.provision-row .provision-hint { margin:6px 0 0; font-size:12px; max-width:720px; }

.labels-host { display:grid; grid-template-columns:repeat(auto-fill, minmax(360px, 1fr)); gap:14px; padding:14px; }
.label-card {
  background:#fff; border:1px solid #94a3b8; border-radius:10px; padding:10px;
  break-inside: avoid; page-break-inside: avoid;
}
.label-header { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:8px; }
.label-title { font-size:16px; font-weight:800; letter-spacing:.02em; margin:0; }
.label-code { font-family:ui-monospace,Consolas,monospace; font-size:17px; font-weight:700; }
.label-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; font-size:12px; }
.label-grid .k { color:#475569; font-size:11px; }
.scan-zone {
  margin-top:8px; border:1px dashed #64748b; border-radius:8px; padding:8px; display:grid; grid-template-columns:110px 1fr; gap:10px; align-items:center;
}
.qr-box { width:100px; height:100px; border:1px solid #334155; border-radius:4px; background:#fff; display:flex; align-items:center; justify-content:center; }
.barcode-area { min-height:60px; border:1px solid #334155; border-radius:6px; padding:8px; background:#f8fafc; }
.barcode-text { font-family:ui-monospace,Consolas,monospace; font-size:18px; letter-spacing:.08em; font-weight:700; }
.barcode-note { font-size:11px; color:#64748b; margin-top:4px; }
.wms-linear-svg { max-width: 100%; height: auto; display: block; background: #fff; }
.halal { display:inline-block; border:1px solid #065f46; color:#065f46; border-radius:999px; padding:2px 8px; font-size:10px; font-weight:700; }

/* Batch rack labels — sticker-like preview on screen */
html.rack-label-print-batch .label-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
html.rack-label-print-batch .scan-zone {
  border: 1px solid #e5e7eb;
  background: #fff;
}
html.rack-label-print-batch .barcode-area {
  background: #fff;
  border: 1px solid #e5e7eb;
}
html.rack-label-print-batch .qr-box {
  border: 1px solid #e5e7eb;
}

@media print {
  body { background:#fff; }
  .screen-only { display:none !important; }
  .labels-host { display:block; padding:0; }
  .label-card {
    width:95mm;
    min-height:60mm;
    margin:0 0 6mm 0;
    border:1px solid #000;
    border-radius:0;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  html.rack-label-print-batch .label-card {
    background: #fff !important;
    border: 0.35pt solid #94a3b8 !important;
    box-shadow: none !important;
  }
  html.rack-label-print-batch .scan-zone,
  html.rack-label-print-batch .barcode-area,
  html.rack-label-print-batch .qr-box {
    border: 0.25pt solid #cbd5e1 !important;
    background: #fff !important;
  }
  html.rack-label-print-batch a[href],
  html.rack-label-print-batch .rack-print-batch-actions,
  html.rack-label-print-batch .rack-print-batch-clear {
    display: none !important;
  }
  @page { size: auto; margin: 8mm; }
}

/* Batch panel — dark glass accent (screen only; panel uses .screen-only) */
.rack-print-batch-clear {
  margin-top: 12px;
  width: 100%;
  max-width: 560px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
  color: #fecaca;
  box-shadow: 0 8px 28px rgba(2, 6, 23, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.rack-print-batch-clear:hover {
  border-color: rgba(252, 165, 165, 0.65);
  color: #fff;
}
