/* EZ Home POS: black + dark green product branding. The store's own logo never
   changes these colors; it's only used on printouts (tags, invoices, receipts, POs). */
:root {
  --bg: #f1f4f2;
  --surface: #ffffff;
  --surface-2: #f6f8f6;
  --border: #dbe2dd;
  --text: #101512;
  --muted: #5b665e;
  --accent: #14532d;
  --accent-hover: #0e3f21;
  --accent-soft: #e2eee5;
  --on-accent: #ffffff;
  --nav-bg: #0a0d0b;
  --nav-text: #f1f5f2;
  --nav-muted: #95a198;
  --nav-line: rgba(255, 255, 255, .14);
  --brand-green: #1a7a43;
  --brand-green-bright: #4cc47b;
  --warn: #9a5800;
  --warn-soft: #fcefd9;
  --danger: #b42318;
  --danger-soft: #fde6e3;
  --success: #157a3c;
  --success-soft: #e0f3e7;
  /* Menu icon tones: greens and black only */
  --tone-1: #14532d; --tone-1-soft: #e2eee5;
  --tone-2: #101512; --tone-2-soft: #e7eae8;
  --tone-3: #1f7a45; --tone-3-soft: #e4f1e8;
  --tone-4: #34403a; --tone-4-soft: #eaedeb;
  --heat-start: #f2a114; --heat-end: #d42a1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .06);
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d0b;
    --surface: #141915;
    --surface-2: #0f1310;
    --border: #253029;
    --text: #e8eee9;
    --muted: #96a29a;
    --accent: #4cb871;
    --accent-hover: #63cb87;
    --accent-soft: #15291c;
    --on-accent: #06120a;
    --nav-bg: #040605;
    --nav-text: #eef3ef;
    --nav-muted: #8e9a92;
    --nav-line: rgba(255, 255, 255, .12);
    --warn: #f0a640;
    --warn-soft: #3a2a12;
    --danger: #f27166;
    --danger-soft: #3d1c19;
    --success: #4cc77a;
    --success-soft: #16301f;
    --tone-1: #4cb871; --tone-1-soft: #15291c;
    --tone-2: #e8eee9; --tone-2-soft: #1c231e;
    --tone-3: #7fd09c; --tone-3-soft: #172c1f;
    --tone-4: #b6c2ba; --tone-4-soft: #1c231e;
    --heat-start: #f5b03c; --heat-end: #f0553f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); }
h1 { font-size: 26px; margin: 0; line-height: 1.2; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 14px; }
.muted { color: var(--muted); margin-top: 0; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.panel > .hint:first-of-type { margin: -6px 0 14px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 10px 20px; background: var(--nav-bg); color: var(--nav-text); border-bottom: 3px solid var(--brand-green);
  position: sticky; top: 0; z-index: 10;
}
/* EZ Home POS logo: green house mark + wordmark */
.brand { display: flex; align-items: center; gap: 10px; color: var(--nav-text); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-word { display: flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.brand-word .ez { color: var(--brand-green-bright); }
.brand-word .pos {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; padding: 3px 6px 2px; border-radius: 5px;
  background: var(--brand-green); color: #fff;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.clock { color: var(--nav-muted); font-size: 14px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.topbar .btn.ghost { background: transparent; color: var(--nav-text); border-color: var(--nav-line); }
.topbar .btn.ghost:hover:not(:disabled) { border-color: var(--brand-green-bright); color: #fff; }
.topbar .btn:focus-visible, .brand:focus-visible { outline: 2px solid var(--brand-green-bright); outline-offset: 2px; }

main { padding: 24px 20px 48px; max-width: 1280px; margin: 0 auto; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 16px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.small { padding: 5px 10px; font-size: 13px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; min-width: 0; width: 100%;
}
textarea { resize: vertical; }
input[type="radio"] { width: auto; }
input:focus, select:focus, textarea:focus,
.btn:focus-visible, .tile:focus-visible, .stat:focus-visible, tr[data-href]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.narrow { max-width: 760px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}

/* ---------- Page frame ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.back-link { display: inline-block; font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: 4px; }
.back-link:hover { text-decoration: underline; }
.page-actions { display: flex; gap: 8px; }

/* ---------- Home ---------- */
.home-hero { margin-bottom: 20px; }
.home-hero .muted { margin-bottom: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 150px;
  padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.tile:hover { border-color: var(--tone); box-shadow: var(--shadow); }
.tile:active { transform: scale(.98); }
.tile[data-tone="1"] { --tone: var(--tone-1); --tone-soft: var(--tone-1-soft); }
.tile[data-tone="2"] { --tone: var(--tone-2); --tone-soft: var(--tone-2-soft); }
.tile[data-tone="3"] { --tone: var(--tone-3); --tone-soft: var(--tone-3-soft); }
.tile[data-tone="4"] { --tone: var(--tone-4); --tone-soft: var(--tone-4-soft); }
.tile-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--tone-soft, var(--accent-soft)); color: var(--tone, var(--accent));
}
/* Home: menu on the left, sales goals on the right */
.home-layout { display: grid; grid-template-columns: minmax(260px, 560px) minmax(280px, 400px); justify-content: start; gap: 20px; align-items: start; }
.home-layout .tiles.stacked { max-width: none; }
.goals { display: flex; flex-direction: column; gap: 16px; }
.goals-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goals-head h2 { font-size: 17px; }
.goals-title { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.goals-flame {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(160deg, var(--heat-start), var(--heat-end)); color: #fff;
}
.goals-flame svg { stroke: #fff; }
.goals-head .muted { margin: 2px 0 0; font-size: 13px; }
.goals-nav { display: flex; gap: 6px; }
.goals-nav .icon-btn { width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.goals-team { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.goals-team-value { font-size: 26px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.goals-team .muted { margin: 0; font-size: 13px; }
.goal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.goal-row { position: relative; display: flex; flex-direction: column; gap: 6px; border-radius: 8px; outline-offset: 4px; }
.goal-row:focus-visible { outline: 2px solid var(--accent); }
.goal-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.goal-name { font-weight: 700; }
.goal-pct { font-weight: 700; }
.goal-line.sub { font-size: 13px; align-items: center; }
.goal-line.sub .muted { margin: 0; }
.goal-track { position: relative; height: 10px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.goal-track.no-goal { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--border) 6px 7px); }
/* The heat gradient spans the whole track, so a bar gets redder the further it fills. */
.goal-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 4px; min-width: 4px; transition: width .4s ease;
  background: linear-gradient(90deg, var(--heat-start), var(--heat-end)) left / calc(100% * 100 / var(--fill, 100)) 100% no-repeat;
}
.goal-pace { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.goal-chip { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.goal-chip.good { background: var(--success-soft); color: var(--success); }
.goal-chip.warn { background: var(--warn-soft); color: var(--warn); }
.goal-chip.bad { background: var(--danger-soft); color: var(--danger); }
.goal-tip {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 2; pointer-events: none;
  padding: 7px 10px; border-radius: 8px; font-size: 12px; line-height: 1.35;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.goal-row:hover .goal-tip, .goal-row:focus-visible .goal-tip { opacity: 1; transform: none; }
.goals-foot { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.goal-pace-key { display: inline-block; width: 2px; height: 11px; vertical-align: -1px; margin-right: 3px; background: var(--text); border-radius: 1px; }
/* Narrower screens: keep the chart beside the menu, with compact menu rows */
@media (max-width: 900px) {
  .home-layout .tiles.stacked .tile { padding: 12px 14px; gap: 12px; }
  .home-layout .tiles.stacked .tile-icon { width: 44px; height: 44px; }
  .home-layout .tiles.stacked .tile-desc { display: none; }
  .home-layout .tile-arrow { display: none; }
}
@media (max-width: 600px) { .home-layout { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .goal-fill, .goal-tip { transition: none; } }

.tile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tiles.stacked { grid-template-columns: minmax(0, 1fr); max-width: 760px; gap: 10px; }
.tiles.stacked .tile { flex-direction: row; align-items: center; gap: 18px; min-height: 0; padding: 16px 20px; }
.tiles.stacked .tile-icon { margin: 0; flex: none; }
.tiles.stacked .tile-title { font-size: 19px; }
.tiles.stacked .tile-desc { display: block; font-size: 14px; }
.tile-arrow { margin-left: auto; font-size: 30px; line-height: 1; color: var(--muted); transition: transform .15s, color .15s; }
.tiles.stacked .tile:hover .tile-arrow { color: var(--tone); transform: translateX(3px); }
.tiles.stacked .tile:active { transform: scale(.99); }
.tile-title { font-size: 17px; font-weight: 700; }
.tile-desc { font-size: 13px; color: var(--muted); }
.tile-badge {
  position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.section-title { margin: 32px 0 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.stat:hover { border-color: var(--muted); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.warn .stat-value { color: var(--warn); }

/* ---------- Toolbar & tables ---------- */
.toolbar { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.search { padding: 10px 14px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap.flat { border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--surface-2); }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.table-summary { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
.empty { color: var(--muted); text-align: center; padding: 32px 12px; margin: 0; white-space: normal; }
.stock { display: inline-block; min-width: 32px; text-align: center; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.stock.low { background: var(--warn-soft); color: var(--warn); }
.stock.out { background: var(--danger-soft); color: var(--danger); }
.change { font-weight: 700; }
.change.up { color: var(--success); }
.change.down { color: var(--danger); }

/* ---------- Panels & forms ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid label, .readout { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form-grid label small { font-weight: 400; }
.form-grid input, .form-grid select, .form-grid textarea { font-weight: 400; }
.table .qty-input { width: 64px; padding: 5px 8px; text-align: right; }
.cell-sub.wrap { white-space: normal; max-width: 420px; }
.piece-search { position: relative; margin-bottom: 14px; }
.piece-search .pick-list { margin: 6px 0 0; max-height: 300px; }
.readout strong { font-size: 20px; color: var(--text); padding: 4px 0; }
.readout .btn { align-self: flex-start; }
.input-pair { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(0, 1.2fr); gap: 6px; }
.input-suffix { align-self: center; font-weight: 400; color: var(--muted); }
.pricing-example {
  margin-top: 14px; padding: 10px 14px; border-radius: 9px; font-size: 14px;
  background: var(--accent-soft); color: var(--text);
}
.pricing-example.error { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.panel .form-actions { margin-top: 16px; }
.form-grid .form-actions { margin-top: 0; flex-wrap: wrap; }
.form-actions .hint { margin: 0; }
.spacer { flex: 1; }

.segmented { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; }
.segmented legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; text-align: center; padding: 9px; border: 1px solid var(--border);
  border-radius: 9px; font-weight: 600; color: var(--text); cursor: pointer;
}
.segmented input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.preview { margin: 0; font-weight: 600; min-height: 1.4em; }

/* ---------- Settings list editor ---------- */
.list-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.list-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.list-row .list-name { flex: 1 1 200px; width: auto; }
.list-row select { width: auto; }
label.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
label.mini input { width: 88px; }
.tier-summary { font-size: 13px; color: var(--muted); }
.tier-head, .tier-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 36px; gap: 8px; align-items: center; }
.tier-head { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-bottom: 6px; }
.tier-row { margin-bottom: 8px; }
#tiers-form .preview { margin: 12px 0 6px; }
.list-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 36px; height: 38px; border-radius: 8px; font-size: 16px; cursor: pointer;
}
.icon-btn:hover:not(:disabled) { border-color: var(--muted); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Photos & logo ---------- */
.thumb {
  width: 40px; height: 40px; flex: none; border-radius: 8px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border);
}
.thumb.placeholder { display: grid; place-items: center; color: var(--muted); }
.cell-thumb { display: flex; align-items: center; gap: 10px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo-grid > .muted { grid-column: 1 / -1; margin: 0; }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-main, .photo-btn {
  position: absolute; left: 8px; bottom: 8px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; border: 0;
}
.photo-main { background: var(--accent); color: var(--on-accent); }
.photo-btn { background: rgba(255, 255, 255, .92); color: #1f1d1a; cursor: pointer; }
.photo-remove {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}
.photo-remove:hover { background: var(--danger); }

.logo-field { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: center; }
.logo-field .hint { margin-top: 10px; }
.logo-preview {
  height: 96px; padding: 10px; display: grid; place-items: center;
  border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2);
}
.logo-preview img { max-width: 100%; max-height: 76px; object-fit: contain; }

/* ---------- Price tags screen ---------- */
.tags-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.toolbar.tight { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pick-list {
  max-height: 330px; overflow: auto; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 10px;
}
.pick-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.pick-row:last-child { border-bottom: 0; }
.pick-info { min-width: 0; }
.pick-info .cell-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-head, .queue-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 110px 36px; gap: 8px; align-items: center; }
.queue-head { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.queue-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.queue-row input { padding: 7px 9px; }
.segmented.tall span { padding: 10px 6px; }
.segmented.tall small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.tag-settings { margin-top: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.tag-preview {
  display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px;
  max-height: 70vh; overflow: auto; background: var(--surface-2); border-radius: 10px;
}
.tag-preview .empty { padding: 40px 12px; }
.pt-frame { flex: none; overflow: hidden; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .25); }
.pt-scale { transform-origin: top left; width: max-content; }

/* ---------- Printed price tags (sized in inches) ---------- */
.pt-page { position: relative; overflow: hidden; background: #fff; color: #111; font-family: "Segoe UI", system-ui, Arial, sans-serif; line-height: 1.2; }
.ptag { overflow: hidden; }
.pt-head { display: flex; justify-content: center; }
.pt-logo { max-height: .9in; max-width: 3.5in; object-fit: contain; display: block; }
.pt-store { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #444; }
.pt-photo { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pt-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pt-body { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pt-name { font-weight: 800; }
.pt-details { color: #444; }
.pt-notes { color: #555; }
.pt-spacer { flex: 1; }
.pt-price { display: flex; flex-direction: column; }
.pt-was { color: #555; }
.pt-was s { text-decoration-thickness: .08em; text-decoration-color: #c0121b; }
.pt-save { font-weight: 700; color: #c0121b; }
.pt-now { font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.on-sale .pt-now, .pt-now.sale { color: #c0121b; }
.pt-code { display: flex; flex-direction: column; align-items: center; gap: .04in; }
.pt-barcode { display: block; }
.pt-sku { font-family: Consolas, "Courier New", monospace; color: #333; }

/* Full page */
.pt-full .ptag-full {
  width: 100%; height: 100%; padding: .5in; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .22in;
}
.ptag-full .pt-logo { max-height: 2.1in; max-width: 7in; }
.ptag-full .pt-store { font-size: 34pt; }
.ptag-full .pt-photo { width: 100%; height: 3.8in; flex: none; }
.ptag-full .pt-body { flex: 1; width: 100%; align-items: center; gap: .12in; }
.ptag-full .pt-name { font-size: 32pt; }
.ptag-full.no-photo .pt-name { font-size: 46pt; margin-top: .6in; }
.ptag-full .pt-details { font-size: 15pt; }
.ptag-full .pt-notes { font-size: 13pt; max-width: 6in; }
.ptag-full .pt-price { align-items: center; gap: .05in; }
.ptag-full .pt-was { font-size: 24pt; }
.ptag-full .pt-now { font-size: 88pt; }
.ptag-full .pt-save { font-size: 20pt; }
.ptag-full.no-photo .pt-now { font-size: 120pt; }
.ptag-full .pt-barcode { width: 3in; height: .55in; }
.ptag-full .pt-sku { font-size: 11pt; }

/* Half page: landscape sheet folded down the middle into a standing card
   (left half = back with piece breakdown / note, right half = front price tag) */
.pt-fold { display: grid; grid-template-columns: 1fr 1fr; }
.pt-fold.cut .ptag-back { border-right: 1px dashed #999; }
.ptag-front {
  min-height: 0; padding: .45in .4in; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15in;
}
.ptag-front .pt-logo { max-height: 1.5in; max-width: 4.6in; }
.ptag-front .pt-store { font-size: 26pt; }
.ptag-front .pt-photo { width: 100%; height: 2.5in; flex: none; }
.ptag-front .pt-body { flex: 1; width: 100%; align-items: center; gap: .07in; }
.ptag-front .pt-name { font-size: 22pt; }
.ptag-front.no-photo .pt-name { font-size: 30pt; margin-top: .3in; }
.ptag-front .pt-details { font-size: 10.5pt; }
.ptag-front .pt-notes { font-size: 10pt; }
.ptag-front .pt-price { align-items: center; gap: .03in; }
.ptag-front .pt-was { font-size: 16pt; }
.ptag-front .pt-now { font-size: 58pt; }
.ptag-front.no-photo .pt-now { font-size: 78pt; }
.ptag-front .pt-save { font-size: 14pt; }
.ptag-front .pt-barcode { width: 2.4in; height: .42in; }
.ptag-front .pt-sku { font-size: 9pt; }

.ptag-back { min-height: 0; padding: .5in .45in; display: flex; flex-direction: column; gap: .1in; }
.ptag-back.note-only { justify-content: center; }
.ptag-back .pt-logo { max-height: .85in; max-width: 3.6in; }
.ptag-back .pt-store { font-size: 17pt; }
.pt-back-title { font-size: 17pt; font-weight: 800; text-align: center; }
.pt-back-sub { font-size: 9pt; text-transform: uppercase; letter-spacing: .1em; color: #666; text-align: center; margin-bottom: .05in; }
.pt-pieces { width: 100%; border-collapse: collapse; font-size: 11pt; }
.pt-pieces th {
  font-size: 8.5pt; text-transform: uppercase; letter-spacing: .06em; color: #555; text-align: left;
  padding: 0 0 .04in; border-bottom: 1.5px solid #111;
}
.pt-pieces td { padding: .06in 0; border-bottom: 1px solid #ddd; vertical-align: top; }
.pt-pieces th:nth-child(n+2), .pt-pieces td:nth-child(n+2) { text-align: right; padding-left: .15in; white-space: nowrap; }
.pt-piece-sku { display: block; font-family: Consolas, "Courier New", monospace; font-size: 8pt; color: #666; }
.pt-totals { display: flex; flex-direction: column; gap: .04in; margin-top: .06in; font-size: 12pt; }
.pt-totals > div { display: flex; justify-content: space-between; gap: .2in; }
.pt-total-pkg { font-size: 16pt; font-weight: 800; border-top: 1.5px solid #111; padding-top: .06in; }
.pt-total-pkg.on-sale span:last-child { color: #c0121b; }
.pt-total-save { font-weight: 700; color: #c0121b; }
.pt-note {
  margin-top: auto; padding: .14in .16in; border: 1.5px solid #111; border-radius: .08in;
  font-size: 13pt; font-weight: 600; text-align: center; white-space: pre-line;
}
.note-only .pt-note { margin-top: 0; font-size: 20pt; border: 0; }

/* Small tags (1" × 3" and 1" × 2.4"): on a sheet or one per label. Sizes are set inline. */
.pt-sheet { display: grid; grid-template-columns: repeat(2, 3in); grid-auto-rows: 1in; align-content: start; }
.ptag-small {
  width: 3in; height: 1in; padding: .07in .12in; display: grid; gap: .1in; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}
.ptag-small.cut { outline: 1px dashed #aaa; outline-offset: -.5px; }
.ptag-small .pt-left { display: flex; flex-direction: column; gap: .03in; min-width: 0; }
.ptag-small .pt-name {
  font-size: 9pt; line-height: 1.15; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}
.ptag-small .pt-head { justify-content: flex-start; }
.ptag-small .pt-logo { max-height: .25in; max-width: 1.6in; }
.ptag-small .pt-store { font-size: 8pt; }
.ptag-small.has-logo .pt-name { -webkit-line-clamp: 1; line-clamp: 1; }
.ptag-small.has-logo .pt-left { gap: .02in; }
.ptag-small .pt-code { align-items: flex-start; gap: .02in; }
.ptag-small .pt-barcode { width: 1.6in; height: .26in; }
.ptag-small .pt-sku { font-size: 7pt; }
.ptag-small .pt-right { display: flex; flex-direction: column; align-items: flex-end; }
.ptag-small .pt-was { font-size: 7pt; }
.ptag-small .pt-now { font-size: 19pt; }

/* Compact 1" × 2.4" tags: same layout, scaled to the narrower label */
.ptag-small.size-small24 { padding: .06in .09in; gap: .07in; }
.size-small24 .pt-name { font-size: 8pt; }
.size-small24 .pt-logo { max-height: .22in; max-width: 1.25in; }
.size-small24 .pt-store { font-size: 7pt; }
.size-small24 .pt-barcode { width: 1.2in; height: .24in; }
.size-small24 .pt-sku { font-size: 6.5pt; }
.size-small24 .pt-was { font-size: 6.5pt; }
.size-small24 .pt-now { font-size: 16pt; }

/* Brother QL-1110NWB label: 2.4" × 1.1" cut from a 62 mm DK-2205 continuous roll.
   Fixed size + clipping everywhere: content can never make the label taller than 1",
   which would feed a second, blank label. Pure black only (thermal paper). */
.ptag-brother {
  box-sizing: border-box; width: 2.4in; height: 1.1in; overflow: hidden; contain: strict;
  /* side padding keeps everything inside the roll's printable width */
  padding: .06in .1in; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .08in;
  background: #fff; color: #000; font-family: Arial, "Segoe UI", sans-serif; line-height: 1.1;
}
.ptag-brother * { color: #000; }
.bq-left { display: flex; flex-direction: column; justify-content: space-between; gap: .02in; min-width: 0; overflow: hidden; }
.bq-top { display: flex; align-items: center; gap: .06in; height: .27in; min-width: 0; overflow: hidden; }
.bq-logo { flex: none; display: flex; }
.bq-logo .pt-logo { max-height: .26in; max-width: 1.1in; object-fit: contain; filter: grayscale(1) contrast(1.3); }
.bq-logo .pt-store { font-size: 7.5pt; letter-spacing: .06em; }
.bq-sku { min-width: 0; font: 700 6.5pt/1 Consolas, "Courier New", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-name { font-size: 8pt; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-name.two-lines { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.bq-barcode { display: block; flex: none; width: 100%; max-width: 1.35in; height: .36in; }
.bq-right {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  min-width: 0; max-width: 1.05in; overflow: hidden; text-align: right;
}
.bq-was { font-size: 6.5pt; white-space: nowrap; }
.bq-was s { text-decoration-thickness: 1px; text-decoration-color: #000; }
.bq-now { font-weight: 900; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.bq-now.lg { font-size: 22pt; }
.bq-now.md { font-size: 18pt; }
.bq-now.sm { font-size: 14pt; }
.bq-sale { margin-top: .02in; padding: 0 .03in; border: 1px solid #000; font-size: 6pt; font-weight: 800; letter-spacing: .12em; }

.brother-note {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: 13px;
  background: var(--warn-soft); color: var(--text);
}
.brother-note ul { margin: 6px 0; padding-left: 18px; }
.brother-note li { margin-bottom: 3px; }
.brother-note p { margin: 0; color: var(--muted); }
.segmented.tall { flex-wrap: wrap; }
.segmented.tall label { min-width: 118px; }

/* ---------- Reports ---------- */
.report-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.report-card {
  display: flex; gap: 14px; align-items: center; padding: 18px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.report-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.report-card .tile-icon { margin: 0; flex: none; }
.report-card .tile-title, .report-card .tile-desc { display: block; }
.planned { list-style: none; margin: 0; padding: 0; }
.planned li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.planned li:last-child { border-bottom: 0; }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 28px 0 12px; }
.segmented.compact span { padding: 6px 14px; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; background: var(--surface-2); }
.report-print-head { display: none; }
.report-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.report-controls:empty { display: none; }
.report-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.report-controls input { width: auto; }
.report-controls .muted { align-self: center; margin: 0 0 0 6px; font-weight: 600; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 800px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Invoices ---------- */
.badge {
  display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
h1 .badge { font-size: 13px; margin-left: 6px; }
.badge.open, .badge.owing { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.paid, .badge.layaway { background: var(--tone-3-soft); color: var(--tone-3); border-color: transparent; }
.badge.done { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.void { background: var(--danger-soft); color: var(--danger); border-color: transparent; text-decoration: line-through; }
.badge.so { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-size: 11px; margin-left: 4px; }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); font-weight: 600; }
.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--accent-soft); font-weight: 600; }
.notice.danger { background: var(--danger-soft); color: var(--danger); }

.sale-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.sale-layout > .stack { margin-bottom: 0; }
.sale-side { position: sticky; top: 76px; }
.sale-actions { margin: 16px 0 0; }
.panel > #type-hint { margin: 10px 0 0; }
.pay-status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.pay-status .muted { margin: 0; font-size: 13px; flex: 1 1 220px; }
.lines-table .tag.cat { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.input-row .btn { flex: none; }
.cust-card { display: flex; flex-direction: column; gap: 2px; }
.cust-card a { font-size: 17px; text-decoration: none; color: var(--text); }
.cust-card a:hover { text-decoration: underline; }
.pick-row.no-thumb { grid-template-columns: minmax(0, 1fr) auto; }
.input-row { display: flex; gap: 8px; align-items: center; }
.form-grid label.check { flex-direction: row; align-items: center; font-weight: 400; color: var(--text); font-size: 14px; }
.form-grid label.check input { width: 16px; }

.lines-table td { vertical-align: top; }
.lines-table td.num { padding-top: 9px; }
.lines-table .line-item { white-space: normal; min-width: 200px; }
.lines-table .cell-main .tag { font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.lines-table td[data-total] { font-weight: 600; padding-top: 16px; }
.table .price-input { width: 96px; padding: 5px 8px; text-align: right; }
.table .qty-input { padding: 5px 8px; }
.disc-pair { display: inline-flex; gap: 4px; }
.disc-pair .price-input { width: 76px; }
.disc-pair select { width: auto; padding: 5px 6px; }
.lines-table input:disabled, .lines-table select:disabled { border-color: transparent; background: transparent; opacity: 1; color: var(--text); }

.totals { display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { font-size: 20px; font-weight: 800; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
.totals .balance { font-weight: 700; }
.totals .balance.owing { color: var(--warn); }
.totals-inputs { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); align-items: end; }

.split-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.input-suffix-wrap { display: flex; align-items: center; gap: 4px; }
.input-suffix-wrap > span { color: var(--muted); font-size: 14px; }
.input-suffix-wrap input { padding: 7px 9px; text-align: right; }
.add-sp { margin-top: 4px; }

.pay-list { display: flex; flex-direction: column; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px 36px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: 0; }
.pay-row .cell-sub { white-space: normal; }
.pay-row .icon-btn { display: grid; place-items: center; }
.badge.void-tag { background: var(--danger-soft); color: var(--danger); border-color: transparent; font-size: 11px; margin-left: 4px; }
.ret-head, .ret-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 10px; align-items: center; }
.ret-head { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 0 6px; border-bottom: 1px solid var(--border); }
.ret-line { padding: 8px 0; border-bottom: 1px solid var(--border); }
.ret-line input { padding: 7px 9px; text-align: right; }
.ret-options { margin-top: 14px; }
.ret-summary { margin: 16px 0 8px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.ret-summary .muted { margin: 0; }
.ret-row { grid-template-columns: minmax(0, 1fr) auto; }
a.badge { text-decoration: none; margin-left: 4px; font-size: 11px; }
.lines-table .badge.done { font-size: 11px; margin-left: 4px; }
.special-list { max-height: 50vh; }
.special-row { cursor: pointer; }
.special-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.readout a.cell-sub { font-weight: 400; }
/* Quote print options: vertical option cards */
.quote-print > .muted { margin: 2px 0 18px; }
.choice-group { border: 0; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.choice-group legend {
  padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.choice {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--muted); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-text strong { font-size: 15px; }
.choice-text small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.choice-sample {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; font-weight: 600;
  padding: 4px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text); white-space: nowrap;
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:checked) .choice-sample { background: var(--surface); }
.choice input:checked + .choice-dot { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--accent); }
.choice input:focus-visible + .choice-dot { outline: 2px solid var(--accent); outline-offset: 2px; }
.quote-print .modal-actions { margin-top: 4px; }
@media (max-width: 420px) { .choice-sample { display: none; } }
.big-change { font-size: 22px; margin: 10px 0; }
.big-change strong { color: var(--success); }

/* ---------- Printed invoices, quotes & receipts ---------- */
.doc { color: #111; background: #fff; font: 10pt/1.4 "Segoe UI", system-ui, Arial, sans-serif; }
.doc h4 { margin: 0 0 4px; font-size: 8pt; text-transform: uppercase; letter-spacing: .08em; color: #666; }
.doc p { margin: 0 0 8px; white-space: pre-line; }
.doc-strong { font-weight: 700; }
.doc-muted { color: #555; font-size: 9pt; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 14px; border-bottom: 2px solid #111; }
.doc-store { display: flex; flex-direction: column; gap: 1px; }
.doc-logo { max-height: .9in; max-width: 2.8in; object-fit: contain; object-position: left; margin-bottom: 6px; }
.doc-store-name { font-size: 14pt; font-weight: 800; }
.doc-meta { text-align: right; }
.doc-title { font-size: 22pt; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; line-height: 1.1; margin-bottom: 6px; }
.doc-meta table { margin-left: auto; border-collapse: collapse; }
.doc-meta td { padding: 1px 0 1px 14px; }
.doc-meta td:first-child { color: #666; }
.doc-meta td:last-child { font-weight: 700; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 14px 0; }
.doc-lines { width: 100%; border-collapse: collapse; margin-top: 4px; }
.doc-lines th {
  font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; color: #555; text-align: left;
  padding: 6px 6px; border-bottom: 1.5px solid #111;
}
.doc-lines td { padding: 7px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
.doc-lines tr { break-inside: avoid; }
.doc .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-sku { font-family: Consolas, "Courier New", monospace; font-size: 9pt; white-space: nowrap; }
.doc-flag { font-size: 7.5pt; font-weight: 700; text-transform: uppercase; border: 1px solid #111; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.doc-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 2.9in; gap: 24px; padding-top: 12px; break-inside: avoid; }
.doc-payments { border-collapse: collapse; font-size: 9pt; }
.doc-payments td { padding: 2px 12px 2px 0; }
.doc-totals { width: 100%; border-collapse: collapse; align-self: start; font-variant-numeric: tabular-nums; }
.doc-totals td { padding: 3px 0; }
.doc-totals td:last-child { text-align: right; }
.doc-grand td { font-size: 13pt; font-weight: 800; border-top: 1.5px solid #111; padding-top: 6px; }
.doc-balance td { font-weight: 800; border-top: 1px solid #ccc; }
.doc-terms { margin-top: 18px; font-size: 8.5pt; color: #333; break-inside: avoid; }
.doc-sign { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; margin-top: 36px; font-size: 8.5pt; color: #555; break-inside: avoid; }
.doc-sign span { display: block; border-bottom: 1px solid #111; height: 28px; margin-bottom: 4px; }
.doc-footer { margin-top: 20px; text-align: center; font-weight: 600; color: #333; }
.doc-receipt { max-width: 5.5in; }
.doc-receipt-table { margin-top: 16px; font-size: 11pt; }

/* ---------- Coming soon ---------- */
.coming { max-width: 560px; margin: 0 auto; text-align: center; padding: 40px 28px; }
.coming .tile-icon { margin: 0 auto 14px; }
.coming ul { text-align: left; color: var(--muted); margin: 16px auto 24px; max-width: 420px; padding-left: 20px; }
.coming li { margin-bottom: 6px; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(20, 18, 15, .55);
}
.modal.hidden { display: none; }
.modal-card {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.modal-card h2 { margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 10px;
  font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .tags-layout, .sale-layout { grid-template-columns: minmax(0, 1fr); }
  .sale-side { position: static; }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .logo-field { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-3 .span-3 { grid-column: span 2; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: span 2; }
  .clock { display: none; }
}
@media (max-width: 520px) {
  main { padding: 16px 16px 40px; }
  .topbar { padding: 10px 16px; }
  .tile { min-height: 0; padding: 16px; }
  .tile-desc { display: none; }
  .tile-badge { top: 10px; right: 10px; }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .span-2, .span-3, .form-grid.cols-3 .span-3 { grid-column: auto; }
  .toolbar, .toolbar.tight { grid-template-columns: 1fr; }
  .toolbar .search { grid-column: auto; }
  .queue-head, .queue-row { grid-template-columns: minmax(0, 1fr) 60px 90px 36px; }
}

/* ---------- Printing: only the price tag pages ---------- */
#print-area { display: none; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; min-height: 0; }
  /* Only the print area prints: top bar, menus, buttons, inputs, modals and toasts are all hidden. */
  body > *:not(#print-area) { display: none !important; }
  html, body { margin: 0 !important; padding: 0 !important; }
  #print-area { display: block; margin: 0; padding: 0; }
  /* Brother QL roll: exactly one 2.4" × 1.1" page per tag (the @page size is set when printing:
     @page { size: 2.4in 1.1in; margin: 0; }) and nothing that could add length. */
  #print-area .pt-brother { width: 2.4in !important; height: 1.1in !important; margin: 0; padding: 0; overflow: hidden; break-inside: avoid; }
  #print-area .pt-page { break-after: page; }
  #print-area .pt-page:last-child { break-after: auto; }

  .report-print { color: #000; font-size: 11pt; }
  .report-print .report-print-head { display: block; margin-bottom: 16px; }
  .report-print .report-print-head h1 { font-size: 18pt; }
  .report-print .report-print-head p { margin: 4px 0 0; color: #444; }
  .report-print .no-print { display: none; }
  .report-print .stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .report-print .stat, .report-print .table-wrap { border-color: #bbb; background: #fff; color: #000; }
  .report-print .stat-label, .report-print .table th, .report-print .table-summary { color: #444; }
  .report-print .stat-value { font-size: 16pt; }
  .report-print .table-wrap { overflow: visible; }
  .report-print .table th, .report-print .table td { padding: 6px 8px; border-color: #ccc; background: #fff; }
  .report-print .table tfoot td { background: #f0f0f0; }
}
