:root { font-family: Arial, Helvetica, sans-serif; color: #111827; background: #f8fafc; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #f8fafc; }
.app-shell { min-height: 100vh; padding: 32px 24px 24px; background: #f8fafc; }
.app-main { max-width: 1100px; margin: 0 auto; }
.app-header { width: 100%; max-width: 768px; min-height: 126px; margin: 0 auto 18px; padding: 20px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 24px; background: linear-gradient(to right, #e7e7f1 0%, #f2f3f9 48%, #ffefef 100%) padding-box, linear-gradient(to right, #2736aa, #ff2236) border-box; box-shadow: 0 18px 36px rgba(15,23,42,.13); }
.app-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.app-logo { width: 104px; height: 88px; object-fit: contain; flex: 0 0 auto; }
h1 { margin: 0 0 5px; font-size: clamp(28px, 3.1vw, 36px); line-height: 1.15; color: #050505; }
h2 { margin: 0; font-size: 22px; }
p { margin: 0; color: #64748b; }
.file-button, button { border-radius: 14px; padding: 10px 16px; font-weight: 600; cursor: pointer; font-size: 14px; }
.file-button, button:not(.secondary) { border: 1px solid #111827; background: #111827; color: #fff; }
.file-button:hover, button:not(.secondary):hover { background: #273244; }
.file-button input { display: none; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.operator-card { width: 100%; max-width: 1100px; margin: 0 auto 18px; padding: 24px; border: 1px solid transparent; border-radius: 24px; background: linear-gradient(to right, #e9eaf3 0%, #f9f7fa 48%, #fefafa 100%) padding-box, linear-gradient(to right, #2736aa, #ff2236) border-box; box-shadow: 0 18px 36px rgba(15,23,42,.13); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 28px; line-height: 1.2; }
.section-heading p { margin-top: 4px; color: #64748b; font-size: 16px; }
.badge { border: 1px solid #ff2236; border-radius: 9999px; padding: 6px 12px; font-size: 14px; background: #fff; color: #ff2236; white-space: nowrap; }
.toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 0; flex-wrap: wrap; }
.upload-help { margin: 18px 0 30px; color: #64748b; font-size: 15px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
button.secondary { border: 1px solid #cbd5e1; background: #fff; color: #111827; }
button.secondary:hover { background: #f8fafc; }
.danger-button { border: 1px solid #dc2626; background: #fff; color: #dc2626; }
.danger-button:hover { background: #fef2f2; }
button:disabled { cursor: not-allowed; opacity: .5; }
.labels { width: 100%; margin-top: 22px; position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.label { min-height: 170px; background: #fff; border: 1px solid #cbd5e1; border-radius: 14px; padding: 18px 14px 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: 0 5px 18px rgba(15, 23, 42, .04); page-break-inside: avoid; content-visibility: auto; contain-intrinsic-size: 170px; }
.selection-mode .label { cursor: pointer; position: relative; }
.selection-mode .label.selected { border: 2px solid #dc2626; background: #fff7f7; }
.description { width: 100%; min-height: 34px; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; margin-bottom: 9px; }
.barcode { width: 100%; max-width: 250px; height: 62px; }
.code { margin-top: 7px; font-family: "Courier New", monospace; font-size: 13px; overflow-wrap: anywhere; }
.barcode-error { color: #dc2626; font-size: 13px; }
@media (max-width: 760px) {
  .app-shell { padding: 18px 12px; }
  .app-header { flex-wrap: wrap; justify-content: center; }
  .app-brand { width: 100%; justify-content: center; gap: 10px; }
  .app-logo { width: 68px; height: 68px; }
  h1 { font-size: clamp(22px, 7vw, 30px); }
  .file-button { width: 100%; text-align: center; }
  .operator-card { padding: 18px; border-radius: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .badge { white-space: normal; }
  .toolbar { width: 100%; }
}
@media print {
  body { background: #fff; }
  .app-shell { padding: 0; }
  .app-header { display: none; }
  .operator-card { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .section-heading, .upload-help, .toolbar { display: none; }
  .labels { margin-top: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5mm; }
  .print-selected-only .label:not(.selected) { display: none; }
  .label { border: 1px solid #111; border-radius: 0; box-shadow: none; min-height: 38mm; padding: 4mm 3mm; }
  .description { font-size: 10pt; }
  .barcode { height: 17mm; }
  .code { font-size: 9pt; }
}
