/* Tagiora — a small theme over Bootstrap 5.3. */
:root {
  --tg-ink: #1d1838;
  --tg-muted: #5f5a78;
  --tg-brand: #5b3fd6;
  --tg-brand-deep: #4429b8;
  --tg-night: #2b1d5c;
  --tg-tag: #f5a524;
  --tg-paper: #f7f5fd;
  --tg-surface: #fff;
  --tg-line: #e6e1f5;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --bs-body-color: var(--tg-ink);
  --bs-link-color: var(--tg-brand);
  --bs-link-hover-color: var(--tg-brand-deep);
}

.tg-body { background: var(--tg-paper); color: var(--tg-ink); min-height: 100vh; }

/* Brand */
.tg-brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--tg-brand);
  font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; text-decoration: none; }
.tg-brand span { color: var(--tg-ink); }
.tg-brand-lg { font-size: 1.5rem; margin-bottom: 1.25rem; }
.tg-brand-lg .tg-mark { width: 36px; height: 36px; }

/* Buttons */
.tg-btn { background: var(--tg-brand); border-color: var(--tg-brand); color: #fff; font-weight: 600; }
.tg-btn:hover, .tg-btn:focus-visible { background: var(--tg-brand-deep); border-color: var(--tg-brand-deep); color: #fff; }
.tg-btn-ghost { border: 1px solid var(--tg-line); background: var(--tg-surface); color: var(--tg-ink); font-weight: 600; }
.tg-btn-ghost:hover { border-color: var(--tg-brand); color: var(--tg-brand); }

/* Public site */
.tg-top { background: var(--tg-surface); border-bottom: 1px solid var(--tg-line); }
.tg-hero { background: linear-gradient(135deg, var(--tg-night) 0%, var(--tg-brand) 100%); color: #fff; padding: 4.5rem 0 5rem; }
.tg-hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: -.02em; max-width: 18ch; }
.tg-lead { font-size: 1.15rem; max-width: 46ch; opacity: .92; margin: 1rem 0 2rem; }
.tg-hero .tg-btn { background: var(--tg-tag); border-color: var(--tg-tag); color: var(--tg-night); }
.tg-hero .tg-btn:hover { background: #ffb840; border-color: #ffb840; color: var(--tg-night); }
.tg-kicker { display: inline-block; background: rgba(255,255,255,.14); border-radius: 999px;
  padding: .25rem .75rem; font-size: .85rem; font-weight: 600; margin-bottom: 1rem; }
.tg-steps { margin-top: -2.5rem; padding-bottom: 3rem; }
.tg-step { background: var(--tg-surface); border: 1px solid var(--tg-line); border-radius: 1rem;
  padding: 1.5rem; height: 100%; box-shadow: 0 6px 24px rgba(43,29,92,.06); }
.tg-step h2 { font-size: 1.15rem; font-weight: 700; margin: .75rem 0 .5rem; }
.tg-step p { color: var(--tg-muted); margin: 0; }
.tg-step-no { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--tg-paper); color: var(--tg-brand); font-weight: 800; }
.tg-footer { color: var(--tg-muted); font-size: .9rem; padding: 2rem 0; }

/* Sign-in and simple pages */
.tg-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 2rem 1rem; }
.tg-auth .tg-card { width: 100%; max-width: 400px; }
.tg-auth h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.25rem; }
.tg-note { color: var(--tg-muted); font-size: .9rem; margin-top: 1rem; }

/* Vendor app */
.tg-appbar { background: var(--tg-surface); border-bottom: 1px solid var(--tg-line); }
.tg-shop-name { font-weight: 600; color: var(--tg-muted); border-left: 1px solid var(--tg-line); padding-left: 1rem; }
.tg-card { background: var(--tg-surface); border: 1px solid var(--tg-line); border-radius: 1rem; padding: 1.5rem; }
.tg-h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.tg-h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.tg-facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.tg-facts dt { color: var(--tg-muted); font-weight: 500; }
.tg-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tg-list { margin: 0; padding-left: 1.1rem; color: var(--tg-muted); }
.tg-list li + li { margin-top: .35rem; }

/* Navigation */
.tg-nav { display: flex; gap: .25rem; }
.tg-nav a { color: var(--tg-muted); text-decoration: none; font-weight: 600; padding: .35rem .7rem; border-radius: .5rem; }
.tg-nav a:hover { background: var(--tg-paper); color: var(--tg-ink); }
.tg-nav a[aria-current="page"] { background: var(--tg-paper); color: var(--tg-brand); }
.tg-crumbs { font-size: .9rem; color: var(--tg-muted); margin-bottom: .25rem; }
.tg-crumbs a { color: var(--tg-muted); }
.tg-count { font-size: .9rem; font-weight: 700; color: var(--tg-muted); background: var(--tg-surface);
  border: 1px solid var(--tg-line); border-radius: 999px; padding: .1rem .55rem; vertical-align: middle; }

/* Dashboard */
.tg-stat { background: var(--tg-surface); border: 1px solid var(--tg-line); border-radius: 1rem; padding: 1rem 1.25rem;
  display: flex; flex-direction: column; color: var(--tg-muted); }
.tg-stat-n { font-size: 1.9rem; font-weight: 800; color: var(--tg-ink); line-height: 1.1; }
.tg-timeline { list-style: none; margin: 0; padding: 0; }
.tg-timeline li { display: flex; flex-direction: column; gap: .15rem; padding: .6rem 0; border-top: 1px solid var(--tg-line); }
.tg-timeline li:first-child { border-top: 0; padding-top: 0; }
.tg-timeline small { color: var(--tg-muted); }
.tg-changes { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .88rem; color: var(--tg-muted); }
.tg-changes b { color: var(--tg-ink); font-weight: 600; }

/* Prices */
.tg-price { font-weight: 700; }
.tg-was { color: var(--tg-muted); font-size: .9em; }
.tg-badge { display: inline-block; font-size: .75rem; font-weight: 700; color: #7a4a00; background: #fff1d6;
  border-radius: 999px; padding: .1rem .5rem; vertical-align: middle; }
.tg-badge-muted { color: var(--tg-muted); background: var(--tg-paper); }

/* Item list */
.tg-filters { display: grid; grid-template-columns: 1fr auto auto auto; gap: .5rem; margin-bottom: 1rem; }
@media (max-width: 640px) { .tg-filters { grid-template-columns: 1fr 1fr; } .tg-filters input { grid-column: 1 / -1; } }
.tg-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--tg-line); }
.tg-table { --bs-table-bg: transparent; }
.tg-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tg-muted); font-weight: 600; }
.tg-table td, .tg-table th { padding: .7rem 1rem; }
.tg-check { width: 2.5rem; }
.tg-item-link { color: var(--tg-ink); font-weight: 600; text-decoration: none; }
.tg-item-link:hover { color: var(--tg-brand); text-decoration: underline; }
.tg-sub { font-size: .85rem; color: var(--tg-muted); }
.tg-code { color: var(--tg-ink); background: var(--tg-paper); border-radius: .35rem; padding: .1rem .35rem; font-size: .85rem; }
.tg-row-bad td { background: #fdecec; }

/* Forms */
.tg-form .form-label { font-weight: 600; }
.tg-optional { font-weight: 400; color: var(--tg-muted); font-size: .85em; }
.tg-error { color: #b42318; font-size: .875rem; margin-top: .25rem; }
.tg-field.has-error .form-control, .tg-field.has-error .form-select, .has-error input { border-color: #d92d20; }
.tg-more { border-top: 1px solid var(--tg-line); padding-top: .75rem; margin-top: .25rem; }
.tg-more > summary { cursor: pointer; font-weight: 600; color: var(--tg-brand); }
.tg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; border-top: 1px solid var(--tg-line);
  padding-top: 1rem; margin-top: 1rem; }
.tg-labels-count { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.tg-labels-count input { width: 5.5rem; }
.tg-adjust { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.tg-adjust .form-select { width: auto; }
.tg-adjust input[type="number"] { width: 8rem; }

/* Photos */
.tg-photo { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: .75rem; background: var(--tg-paper); }
.tg-item-cell { display: flex; align-items: center; gap: .75rem; }
.tg-thumb { flex: none; width: 44px; height: 44px; object-fit: cover; border-radius: .5rem; background: var(--tg-paper); }
.tg-pp-photo { display: block; width: calc(100% + 3.5rem); max-width: none; margin: -1.75rem -1.75rem 1.25rem; height: 300px;
  object-fit: contain; background: var(--tg-paper); border-radius: 1rem 1rem 0 0; }

/* QR card on the item page */
.tg-qr-card { text-align: center; }
.tg-qr { width: 168px; height: 168px; margin: 0 auto .5rem; }
.tg-qr svg { width: 100%; height: 100%; display: block; }
.tg-code-lg { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700; font-size: 1.15rem; letter-spacing: .08em; }

/* Customer price page (tagiora.in/<code>) */
.tg-pricepage { max-width: 480px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.tg-pp-shop { text-align: center; font-weight: 700; color: var(--tg-muted); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.tg-pp-card { padding: 1.75rem; }
.tg-pp-cat { color: var(--tg-brand); font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.tg-pp-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.tg-pp-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; margin-top: 1rem; }
.tg-pp-now { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; color: var(--tg-ink); }
.tg-pp-unit { color: var(--tg-muted); margin: 0 0 .75rem; }
.tg-pp-mrp { margin: 0 0 .25rem; }
.tg-pp-updated { color: var(--tg-muted); font-size: .85rem; margin: 0; }
.tg-pp-note { text-align: center; color: var(--tg-muted); font-size: .9rem; margin-top: 1rem; }
.tg-pp-foot { text-align: center; color: var(--tg-muted); font-size: .85rem; }

/* Label printing */
.tg-print-bar { background: var(--tg-surface); border-bottom: 1px solid var(--tg-line); margin-bottom: 1.5rem; }
.tg-print-form label { flex-wrap: wrap; max-width: 100%; }
.tg-print-form select { width: auto; max-width: 100%; }
.tg-copies { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem 1rem; padding-top: .5rem; }
.tg-copies label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.tg-copies input { width: 4.5rem; flex: none; }
.tg-labels { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 0 1rem 3rem; }
.tg-roll { display: flex; flex-wrap: wrap; gap: 4mm; justify-content: center; max-width: 1100px; }
.tg-sheet-a4 { display: grid; grid-auto-rows: var(--h); align-content: start; width: 210mm; height: 297mm;
  box-sizing: border-box; background: #fff; box-shadow: 0 4px 24px rgba(43,29,92,.12); }
.tg-lbl { box-sizing: border-box; width: var(--w); height: var(--h); padding: 1.5mm; display: flex; align-items: center;
  gap: 1.2mm; overflow: hidden; background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; line-height: 1.1; }
.is-roll .tg-lbl { outline: 1px dashed #c9c2e3; }
.is-sheet .tg-lbl { outline: 1px dashed #ebe7f6; outline-offset: -1px; }
.tg-lbl-qr { flex: 0 0 var(--qr); width: var(--qr); height: var(--qr); }
.tg-lbl-qr svg { width: 100%; height: 100%; display: block; }
.tg-lbl-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .6mm; }
.tg-lbl-shop { font-size: 5.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-lbl-name { font-size: 7pt; font-weight: 700; overflow-wrap: anywhere; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tg-lbl-price { font-size: 10pt; font-weight: 800; }
.tg-lbl-code { font-family: "Courier New", Courier, monospace; font-size: 7pt; font-weight: 700; letter-spacing: .04em; }
.tg-lbl-hint { font-size: 4.8pt; }

@media print {
  .no-print { display: none !important; }
  html, body, .tg-body { background: #fff !important; margin: 0; padding: 0; min-height: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tg-labels { display: block; padding: 0; }
  .tg-lbl { outline: none !important; }
  .tg-roll { display: block; max-width: none; }
  /* One label per page on a roll: each page holds one label, and breaks after it. */
  .tg-lbl { break-inside: avoid; page-break-inside: avoid; }
  .tg-roll, .tg-sheet-a4 { break-after: page; page-break-after: always; }
  .tg-sheet-a4 { box-shadow: none; }
  .tg-roll:last-child, .tg-sheet-a4:last-child { break-after: auto; page-break-after: auto; }
}

/* Billing counter */
.tg-counter { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .tg-counter { grid-template-columns: 1fr; } }
.tg-counter-scan { background: var(--tg-surface); border: 1px solid var(--tg-line); border-radius: 1rem; padding: 1.25rem; }
@media (min-width: 901px) { .tg-counter-scan { position: sticky; top: 1rem; } }
.tg-scan-form { display: flex; gap: .5rem; margin-bottom: .75rem; }
.tg-camera-tools { margin-bottom: .5rem; }
.tg-camera video { width: 100%; max-height: 260px; object-fit: cover; border-radius: .75rem; background: #000; display: block; margin-bottom: .5rem; }
.tg-cart { background: var(--tg-surface); border: 1px solid var(--tg-line); border-radius: 1rem; padding: 1.25rem; min-height: 12rem; }
.tg-cart-empty { text-align: center; padding: 2.5rem 1rem; }
.tg-added { display: flex; align-items: center; gap: 1rem; background: var(--tg-paper); border-radius: .75rem; padding: .75rem; margin-bottom: 1rem; }
.tg-added img, .tg-added-blank { width: 72px; height: 72px; object-fit: cover; border-radius: .6rem; flex: none; background: #fff; }
.tg-added-blank { display: grid; place-items: center; color: var(--tg-brand); }
.tg-added-name { font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.tg-choices { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.tg-choice { width: 100%; display: flex; justify-content: space-between; gap: 1rem; text-align: left; background: var(--tg-paper);
  border: 1px solid var(--tg-line); border-radius: .6rem; padding: .6rem .8rem; font-weight: 600; color: var(--tg-ink); }
.tg-choice:hover { border-color: var(--tg-brand); }
.tg-lines { list-style: none; margin: 0 0 1rem; padding: 0; }
.tg-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--tg-line); }
.tg-line-name { font-weight: 600; line-height: 1.25; }
.tg-line-unit { font-size: .85rem; color: var(--tg-muted); }
.tg-line-total { font-weight: 700; min-width: 5rem; text-align: right; }
.tg-qty { display: flex; align-items: center; gap: .35rem; }
.tg-qty-btn { width: 2.1rem; height: 2.1rem; border-radius: .5rem; border: 1px solid var(--tg-line); background: var(--tg-surface); font-weight: 700; font-size: 1.1rem; line-height: 1; color: var(--tg-ink); }
.tg-qty-btn:hover { border-color: var(--tg-brand); color: var(--tg-brand); }
.tg-qty-n { min-width: 1.8rem; text-align: center; font-weight: 700; }
.tg-qty-set input { width: 4.8rem; }
.tg-remove { border: 0; background: none; color: var(--tg-muted); font-size: 1.4rem; line-height: 1; padding: 0 .25rem; }
.tg-remove:hover { color: #b42318; }
@media (max-width: 520px) {
  .tg-line { grid-template-columns: minmax(0, 1fr) auto auto; }
  .tg-line-main { grid-column: 1 / -1; }
}
.tg-totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; margin: 0 0 1rem; }
.tg-totals dt { font-weight: 500; color: var(--tg-muted); }
.tg-totals dd { margin: 0; text-align: right; }
.tg-totals .tg-total-label { color: var(--tg-ink); font-weight: 800; font-size: 1.2rem; }
.tg-total { font-weight: 800; font-size: 1.6rem; color: var(--tg-ink); }
.tg-inline-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.tg-inline-form .form-select { width: auto; }
.tg-inline-form input { width: 7rem; }
.tg-cart-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tg-pay { flex: 1 1 12rem; }
.tg-held { border-top: 1px solid var(--tg-line); margin-top: 1.25rem; padding-top: 1rem; }
.tg-held-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem 0; }

/* Payment */
.tg-pay-total { color: var(--tg-brand); }
.tg-pay-card { display: flex; flex-direction: column; }
.tg-quick-cash { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.tg-change { font-size: 1.1rem; margin: .5rem 0 1rem; }
.tg-upi-qr { width: 200px; height: 200px; margin: 0 auto .5rem; }
.tg-upi-qr svg { width: 100%; height: 100%; display: block; }
.tg-paid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; background: #e7f8ef;
  border: 1px solid #b7e6cb; border-radius: 1rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.tg-paid-title { font-weight: 800; font-size: 1.4rem; color: #0b6b3a; }
.tg-stat-link { text-decoration: none; }
.tg-stat-link:hover { border-color: var(--tg-brand); }
.tg-stat-sm .tg-stat-n { font-size: 1.25rem; }
.tg-bill-filters { grid-template-columns: auto auto 1fr auto; }
@media (max-width: 640px) { .tg-bill-filters { grid-template-columns: 1fr 1fr; } .tg-bill-filters input[type="search"] { grid-column: 1 / -1; } }

/* Receipts: on screen in a card, and printed on 80 / 58 mm rolls */
.tg-receipt { font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.35; color: #000; }
.tg-receipt-card { padding: 1.25rem; }
.tg-receipt .r-center { text-align: center; }
.tg-receipt .r-shop { font-weight: 800; font-size: 1.15em; }
.tg-receipt .r-type { font-weight: 700; margin-top: .3em; text-transform: uppercase; letter-spacing: .05em; }
.tg-receipt .r-dup { font-weight: 800; border: 1px dashed #000; display: inline-block; padding: 0 .4em; margin-top: .2em; }
.tg-receipt .r-row { display: flex; justify-content: space-between; gap: .75em; }
.tg-receipt .r-row span:last-child { text-align: right; white-space: nowrap; }
.tg-receipt .r-item { font-weight: 700; margin-top: .3em; }
.tg-receipt .r-rule { border-top: 1px dashed #000; margin: .45em 0; }
.tg-receipt .r-total { font-weight: 800; font-size: 1.2em; margin-top: .2em; }
.tg-receipt .r-small { font-size: .85em; }
.tg-receipt .r-gst { width: 100%; font-size: .85em; border-collapse: collapse; }
.tg-receipt .r-gst th, .tg-receipt .r-gst td { text-align: right; padding: 0 0 0 .3em; font-weight: 400; }
.tg-receipt .r-gst th:first-child, .tg-receipt .r-gst td:first-child { text-align: left; padding-left: 0; }
.tg-receipt .r-qr { width: 30mm; height: 30mm; margin: .5em auto .2em; }
.tg-receipt .r-qr svg { width: 100%; height: 100%; display: block; }
.tg-receipt-sheet { background: #fff; margin: 0 auto 3rem; padding: 3mm 4mm; box-shadow: 0 4px 24px rgba(43,29,92,.12); }
.tg-receipt-80 { width: 80mm; }
.tg-receipt-80 .tg-receipt { font-size: 12px; }
.tg-receipt-58 { width: 58mm; padding: 2mm 3mm; }
.tg-receipt-58 .tg-receipt { font-size: 10px; }
.tg-receipt-58 .r-qr { width: 24mm; height: 24mm; }
@media print {
  .tg-receipt-sheet { box-shadow: none; margin: 0; }
  .tg-pricepage .tg-card { border: 0; padding: 0; }
}

/* Small screens: the nav gets its own row and scrolls sideways instead of widening the page. */
@media (max-width: 640px) {
  .tg-shop-name { border-left: 0; padding-left: 0; }
}
/* Batch code, EXP and PKD wrap onto their own lines rather than being cut: the
   expiry date must always print whole. */
.tg-lbl-batch { font-size: 6pt; font-weight: 700; display: flex; flex-wrap: wrap; column-gap: 1.2mm; line-height: 1.15; }
.tg-lbl-batch span { white-space: nowrap; }

/* Stock and batches */
.tg-h3 { font-size: .95rem; font-weight: 700; }
.tg-onhand { font-weight: 800; font-size: 1.15rem; }
.tg-onhand.is-low, .tg-low { color: #8a5a00; font-weight: 700; }
.tg-onhand.is-negative { color: #b42318; }
.tg-badge-bad { color: #a1261f; background: #fde2e1; }
.tg-row-muted td { opacity: .6; }
.tg-batch-tools td { border-top: 0; padding-top: 0; }
.tg-batch-tools summary { font-size: .85rem; color: var(--tg-brand); cursor: pointer; }
.tg-batch-forms { display: grid; gap: .5rem; padding: .5rem 0 .25rem; }
.tg-batch-forms .tg-inline-form input[type="date"] { width: auto; }
.tg-batch-forms .tg-inline-form input[name="reason"] { width: 14rem; max-width: 100%; }
.tg-stock-forms { display: grid; gap: .5rem; border-top: 1px solid var(--tg-line); padding-top: .75rem; }
.tg-stock-forms summary { font-weight: 600; color: var(--tg-brand); cursor: pointer; }
.tg-moves { list-style: none; padding: 0; margin: 0; }
.tg-moves li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0 .75rem; padding: .35rem 0; border-top: 1px solid var(--tg-line); }
.tg-moves small { grid-column: 2; color: var(--tg-muted); }
.tg-move-qty { font-weight: 800; color: #0b6b3a; text-align: right; }
.tg-move-qty.is-out { color: #a1261f; }
.tg-alerts { list-style: none; padding: 0; margin: 0; }
.tg-alerts li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .6rem 0; border-top: 1px solid var(--tg-line); }
.tg-alerts li:first-child { border-top: 0; }
.tg-alerts li > span { color: var(--tg-muted); flex: 1 1 14rem; }
.tg-line-batch { font-size: .8rem; color: var(--tg-muted); }
.tg-stat-alert { border-color: #f3d48b; background: #fff8e6; }
.tg-pp-batch { color: var(--tg-muted); font-size: .9rem; margin: .5rem 0; }

/* Offers */
.tg-offer-note { background: #fff8e6; border: 1px solid #f3d48b; border-radius: .6rem; padding: .5rem .75rem; font-size: .92rem; }
.tg-category-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .25rem .75rem; }
.tg-category-picks .form-check { display: flex; align-items: center; gap: .4rem; margin: 0; }
.tg-category-picks input { margin: 0; }
.tg-pp-sale { font-weight: 700; color: #8a5a00; margin: 0 0 .5rem; }

/* A small menu of links behind a button (e.g. the CSV exports). */
.tg-menu { position: relative; }
.tg-menu > summary { list-style: none; }
.tg-menu > summary::-webkit-details-marker { display: none; }
.tg-menu-list { position: absolute; right: 0; z-index: 20; margin-top: .25rem; min-width: 16rem; display: flex;
  flex-direction: column; background: var(--tg-surface); border: 1px solid var(--tg-line);
  border-radius: .6rem; box-shadow: 0 8px 24px rgba(30, 20, 60, .12); padding: .35rem; }
.tg-menu-list a { padding: .45rem .65rem; border-radius: .4rem; text-decoration: none; color: inherit; }
.tg-menu-list a:hover, .tg-menu-list a:focus { background: var(--tg-paper); }
.tg-split > summary { cursor: pointer; }

/* Help, privacy and terms pages. */
.tg-doc { max-width: 54rem; }
.tg-doc h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.01em; }
.tg-doc h2 { font-size: 1.3rem; font-weight: 750; margin-top: 2rem; }
.tg-doc h3 { font-size: 1.08rem; font-weight: 700; margin-top: 1.5rem; }
.tg-lead-sm { font-size: 1.1rem; color: var(--tg-muted); }
.tg-note { background: var(--tg-paper); border-left: 4px solid var(--tg-tag); padding: .75rem 1rem; border-radius: .4rem; }
.tg-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; }
.tg-contact-card { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; border: 1px solid var(--tg-line);
  border-radius: .8rem; background: var(--tg-surface); color: var(--tg-ink); text-decoration: none; }
.tg-contact-card:hover, .tg-contact-card:focus { border-color: var(--tg-brand); }
.tg-contact-card strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.tg-contact-kind { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tg-brand); }
.tg-contact-card span:last-child { color: var(--tg-muted); font-size: .9rem; }
.tg-faq { border-bottom: 1px solid var(--tg-line); padding: .6rem 0; }
.tg-faq > summary { cursor: pointer; font-weight: 600; }
.tg-faq > p { margin: .5rem 0 .25rem; }
.tg-hw td, .tg-hw th { font-size: .92rem; }
.tg-printers { min-width: 52rem; }  /* 9 columns: fits a computer, scrolls sideways on phones */
.tg-printers td:first-child { color: var(--tg-muted); }
.tg-footer-links { display: flex; gap: 1rem; }
.tg-footer-links a { color: inherit; }

/* ------------------------------------------------------------------ phones: app layout
   ☰ and the shop name on top, a menu that slides out, a tab bar at the bottom.
   Safe-area insets keep clear of the notch and the home bar when opened from the
   home screen (full screen). Computers (768px and up) keep the full header. */
.tg-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  border: 0; border-radius: .6rem; background: none; color: var(--tg-ink); }
.tg-icon-btn:hover, .tg-icon-btn:focus-visible { background: var(--tg-paper); }
.tg-icon-btn svg { width: 24px; height: 24px; }

@media (max-width: 767.98px) {
  .tg-appbar { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
  .tg-appbar .container { gap: .5rem !important; flex-wrap: nowrap !important; }
  .tg-shop-name { color: var(--tg-ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tg-main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)) !important; }
}

.tg-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid;
  grid-template-columns: repeat(4, 1fr); background: var(--tg-surface); border-top: 1px solid var(--tg-line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-shadow: 0 -4px 16px rgba(30, 20, 60, .06); }
.tg-tab { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem 0 .45rem;
  font-size: .72rem; font-weight: 650; color: var(--tg-muted); text-decoration: none; }
.tg-tab svg { width: 24px; height: 24px; }
.tg-tab[aria-current="page"] { color: var(--tg-brand); }

.tg-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(19rem, 86vw); max-width: none; height: 100%;
  max-height: none; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border: 0;
  border-radius: 0 1rem 1rem 0; background: var(--tg-surface); color: var(--tg-ink);
  box-shadow: 0 0 40px rgba(20, 12, 50, .25); }
.tg-drawer[open] { display: flex; flex-direction: column; animation: tg-drawer-in .18s ease-out; }
.tg-drawer::backdrop { background: rgba(20, 12, 50, .45); }
@keyframes tg-drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tg-drawer[open] { animation: none; } }
.tg-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem;
  padding: 1rem 1rem .75rem 1.25rem; border-bottom: 1px solid var(--tg-line); }
.tg-drawer-shop { font-weight: 800; font-size: 1.1rem; }
.tg-drawer-who { font-size: .85rem; color: var(--tg-muted); overflow-wrap: anywhere; }
.tg-drawer-nav, .tg-drawer-foot { display: flex; flex-direction: column; padding: .5rem; }
.tg-drawer-nav { flex: 1 1 auto; overflow-y: auto; }
.tg-drawer-foot { border-top: 1px solid var(--tg-line); }
.tg-drawer-link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .7rem .8rem;
  border-radius: .6rem; color: var(--tg-ink); font-weight: 600; text-decoration: none; font-size: 1rem; }
.tg-drawer-link:hover, .tg-drawer-link:focus-visible { background: var(--tg-paper); color: var(--tg-ink); }
.tg-drawer-link[aria-current="page"] { background: var(--tg-paper); color: var(--tg-brand); }
.tg-drawer-switch { padding: .5rem .8rem; }
.tg-install-tip { margin: 0 .8rem .5rem; font-size: .85rem; color: var(--tg-muted); }
