/* ============================================================
   Avery 48660 / 48860 Label Sheet
   1" x 2-5/8" — 30 labels (3 x 10)
   ============================================================ */

.label-empty-message {
  color: #ffffff !important;
}

/* ===== Batch Print Queue: collapsible date groups ===== */
.batch-group {
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--tb-border);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.batch-group + .batch-group { margin-top: 6px; }

.batch-group-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--tb-text);
}
.batch-group-summary::-webkit-details-marker { display: none; }
.batch-group-summary::after {
  content: '+';
  color: var(--tb-accent);
  font-weight: 1000;
  font-size: 20px;
  line-height: 1;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.batch-group[open] > .batch-group-summary::after { content: '–'; }

.batch-group-checkbox {
  width: 18px !important;
  height: 18px;
  margin: 0 4px 0 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--tb-primary);
}

.batch-group-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.batch-group-date {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  font-weight: 1000;
}
.batch-group-iso {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 700;
}
.batch-group-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--tb-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

.batch-group-rows {
  display: grid;
  gap: 6px;
  padding: 4px 10px 12px;
}
.batch-group-rows .batch-print-row { margin: 0; }

/* ===== SHEET LAYOUT ===== */
.label-sheet {
  display: grid;
  grid-template-columns: repeat(3, 2.625in);
  grid-auto-rows: 1in;
  column-gap: 0.125in;
  row-gap: 0;
  padding-top: 0.5in;
  padding-left: 0.1875in;
  padding-right: 0.1875in;
  width: 8.5in;
  box-sizing: border-box;
}

/* ===== INDIVIDUAL LABEL ===== */
.print-label,
.farm-label {
  width: 2.625in;
  height: 1in;
  box-sizing: border-box;
  padding: 0.05in 0.07in;
  overflow: hidden;
  background: #ffffff !important;
  color: #111111 !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  line-height: 1.05;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ===== FARM LOGO ===== */
.farm-label-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.02in;
}

.farm-label-logo img {
  max-height: 0.28in;
  max-width: 2.3in;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ===== STRAIN ===== */
.farm-label-strain {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 10pt;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

/* ===== FOOTER (DATE + BAG) ===== */
.farm-label-footer {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 10pt;
  white-space: nowrap;
  margin-top: 0.02in;
}

/* ===== PRINT GUARANTEES =====
   Avery 48660 layout reference (US Letter, 8.5" x 11"):
     top margin     = 0.5"
     bottom margin  = 0.5"
     left margin    = 0.1875"   right margin = 0.1875"
     label size     = 2.625" wide x 1" tall
     row pitch      = 1"  (no vertical gap)
     col pitch      = 2.75" (2.625 label + 0.125 gap)
     30 labels: 3 columns x 10 rows

   Strategy: @page declares the physical margins, so the browser
   reserves them on every page (important when printing >30
   labels). The label sheet itself has zero padding in print mode
   and just lays out the grid inside the printable area. On screen,
   the sheet keeps its own padding so the user previews where the
   labels will land. */
@page {
  size: letter;
  margin: 0.5in 0.1875in;
}

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  /* Strip every wrapper around #labelSheet so the @page margins
     are the only spacing between the page edge and the first
     label. Without this, .container's auto margins or stray
     section paddings shift the grid sideways. */
  body > *,
  body main,
  body main > *,
  .container,
  .print-layout,
  .print-layout > section,
  .print-layout > section > * {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    width: auto !important;
    max-width: none !important;
  }

  /* In print: drop the on-screen sheet padding so @page margins are
     authoritative. Width drops to the printable area (8.5 - 2*0.1875). */
  .label-sheet {
    width: 8.125in !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: 0 !important;
    outline: 0 !important;
  }

  .print-label,
  .farm-label,
  .label-sheet .print-label {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}
``