/* Shared screen layouts: auth (login, lock), print previews and A4 / thermal documents, generic page grids.
   Area-specific screens live in views-*.css. */
.auth-bg { min-height: 100vh; background: var(--carbon-800); background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 24px 24px; display: grid; place-items: center; align-content: center; gap: var(--sp-4); padding: var(--sp-4); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: var(--sp-6); display: grid; gap: var(--sp-4); }
.auth-brand { display: flex; align-items: center; gap: var(--sp-3); }
.auth-logo { width: 56px; height: 56px; border-radius: var(--r-lg); object-fit: contain; }
.auth-logo--init { background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-20); }
.auth-shop { font-size: var(--fs-18); font-weight: 700; }
.auth-title { font-size: var(--fs-20); font-weight: 700; display: flex; align-items: center; gap: var(--sp-2); }
.auth-title:focus { outline: none; }
.input--lg { height: var(--h-lg); }
.form-msg { color: var(--negative); min-height: 1.2em; font-size: var(--fs-13); }
.auth-or { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-3); font-size: var(--fs-12); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-block-start: 1px solid var(--line); }
.user-tiles { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; }
.user-tile { width: 96px; min-height: 112px; display: grid; justify-items: center; align-content: center; gap: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-13); padding: var(--sp-2); text-align: center; }
.user-tile:hover { border-color: var(--primary); }
.avatar--lg { width: 56px; height: 56px; font-size: var(--fs-18); }
.auth-langs { display: flex; gap: var(--sp-4); justify-content: center; }
.link-btn { background: none; border: 0; color: var(--text-on-dark); font: inherit; padding: var(--sp-2); text-decoration: underline; text-underline-offset: 3px; }
.link-btn[aria-current="true"] { font-weight: 700; text-decoration: none; }
.lock-clock { font: 700 var(--fs-32) var(--font-num); color: #fff; text-align: center; }
.lock-title { color: #fff; font-size: var(--fs-20); font-weight: 700; text-align: center; }
.lock-users { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; max-width: 720px; }

/* generic page grids */
.grid-2 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.grid-main-side { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 1023px) { .grid-main-side { grid-template-columns: minmax(0, 1fr); } }
.section-gap { margin-block-start: var(--sp-5); }
.sticky-actions { position: sticky; inset-block-end: 0; background: var(--surface); border-block-start: 1px solid var(--line); padding: var(--sp-3) var(--sp-4); display: flex; gap: var(--sp-2); justify-content: flex-end; z-index: var(--z-sticky); margin-block-start: var(--sp-4); flex-wrap: wrap; }
@media (max-width: 639px) { .sticky-actions { inset-block-end: var(--bottomnav-h); } }
.toolbar { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; margin-block-end: var(--sp-3); }
.totals-box { display: grid; gap: var(--sp-1); justify-self: end; min-width: min(320px, 100%); }
.totals-box .kv-row:last-child { font-weight: 700; font-size: var(--fs-16); border-block-start: 1px solid var(--line); padding-block-start: var(--sp-1); }

/* print previews (#/print/*) */
.print-preview { min-height: 100vh; background: var(--surface-3); }
.print-toolbar { position: sticky; inset-block-start: 0; display: flex; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-3); background: var(--surface); border-block-end: 1px solid var(--line); z-index: var(--z-sticky); }
.print-stage { padding: var(--sp-4); display: grid; justify-items: center; overflow-x: auto; }
.sheet { background: #fff; color: #000; box-shadow: var(--shadow-2); }
.sheet--a4 { width: 210mm; max-width: 100%; min-height: 297mm; padding: 12mm; font-size: 10pt; }
@media (max-width: 860px) { .sheet--a4 { width: 100%; min-height: 0; padding: 6mm; } }
.doc-head { display: flex; justify-content: space-between; gap: 8mm; align-items: flex-start; }
.doc-shop { display: flex; gap: 4mm; align-items: center; }
.doc-logo { max-height: 18mm; max-width: 50mm; }
.doc-shop-name { font-size: 14pt; font-weight: 700; }
.doc-shop-sub { font-size: 8.5pt; color: #333; }
.doc-meta { text-align: end; }
.doc-title { font-size: 16pt; font-weight: 700; color: var(--brand-text); }
.doc-head-rule { border: 0; border-block-start: 2pt solid var(--brand); margin: 3mm 0 4mm; }
.doc-lines { width: 100%; border-collapse: collapse; margin-block: 4mm; }
.doc-lines th { font-size: 9pt; text-align: start; color: var(--brand-text); border-block-end: .5pt solid #999; padding: 1.5mm 2mm; }
.doc-lines td { border-block-end: .5pt solid #ccc; padding: 1.5mm 2mm; vertical-align: top; }
.doc-lines .num { text-align: end; }
.doc-box { border: .5pt solid #999; padding: 3mm; border-radius: 1mm; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-block: 3mm; }
.doc-totals { margin-inline-start: auto; width: min(80mm, 100%); display: grid; gap: 1mm; }
.doc-totals > div { display: flex; justify-content: space-between; gap: 4mm; }
.doc-totals .grand { font-weight: 700; font-size: 12pt; border-block-start: 1pt solid #000; padding-block-start: 1mm; }
.doc-sign { display: flex; justify-content: space-between; gap: 10mm; margin-block-start: 14mm; }
.doc-sign span { flex: 1; border-block-start: .5pt solid #000; padding-block-start: 1mm; font-size: 8.5pt; }
.doc-foot { margin-block-start: 6mm; font-size: 8.5pt; color: #333; }

/* thermal receipt (screen preview) */
.rcpt { background: var(--paper); color: #000; width: 72mm; padding: 4mm; font-family: var(--font-receipt); font-weight: 500; font-size: 10pt; line-height: 1.35; box-shadow: var(--shadow-2); }
.rcpt--58 { width: 48mm; font-size: 9pt; }
.rcpt hr { border: 0; border-block-start: .3mm dashed #000; margin: 1.5mm 0; }
.rcpt-c { text-align: center; }
.rcpt-shop { font-size: 13pt; font-weight: 700; text-align: center; }
.rcpt-small { font-size: 8.5pt; }
.rcpt-row { display: flex; justify-content: space-between; gap: 2mm; }
.rcpt-row > :last-child { text-align: end; white-space: nowrap; }
.rcpt-item { margin-block: 1mm; }
.rcpt-item-name { font-weight: 600; overflow-wrap: anywhere; }
.rcpt-sub { padding-inline-start: 2mm; }
.rcpt .total { font-size: 14pt; font-weight: 700; }
.rcpt .qr { display: block; margin: 2mm auto; padding: 0; width: max-content; }
.rcpt .qr svg { width: 28mm; height: 28mm; }
.rcpt-logo { display: block; margin: 0 auto 2mm; max-width: 48mm; max-height: 20mm; }
.rcpt-title { text-align: center; font-weight: 700; font-size: 12pt; }
.rcpt-mono { font-family: var(--font-mono); font-size: 8pt; }

/* labels (screen preview) */
.lbl-sheet { background: #fff; color: #000; box-shadow: var(--shadow-2); display: grid; }
.lbl-sheet--a4-3x8 { width: 210mm; height: 297mm; grid-template-columns: repeat(3, 70mm); grid-template-rows: repeat(8, 37.125mm); }
.lbl-sheet--a4-4x10 { width: 210mm; height: 297mm; grid-template-columns: repeat(4, 52.5mm); grid-template-rows: repeat(10, 29.7mm); }
.lbl-sheet--a4-2x7 { width: 210mm; height: 297mm; padding: 15.15mm 4.65mm; grid-template-columns: repeat(2, 99.1mm); grid-template-rows: repeat(7, 38.1mm); column-gap: 2.5mm; }
.lbl { overflow: hidden; padding: 3mm; display: flex; flex-direction: column; justify-content: space-between; text-align: center; }
.lbl--roll { width: 50mm; height: 30mm; padding: 1.5mm; background: #fff; color: #000; box-shadow: var(--shadow-1); margin-block-end: 2mm; }
.lbl-name { font-size: 8.5pt; font-weight: 700; line-height: 1.15; overflow: hidden; max-height: 2.4em; }
.lbl-var { font-size: 7pt; }
.lbl-price { font-size: 14pt; font-weight: 700; font-family: var(--font-num); }
.lbl-sheet--a4-4x10 .lbl-price { font-size: 11pt; }
.lbl--roll .lbl-price { font-size: 13pt; }
.lbl-usd, .lbl-meta { font-size: 7pt; }
.lbl .barcode svg { width: 100%; height: 11mm; }
.lbl-sheet--a4-4x10 .lbl .barcode svg { height: 8mm; }
.lbl--roll .barcode svg { height: 12mm; }
