/* Fragrance Gallery Lab ERP. Palette and type follow fragrancegallerylab.com and its logo. */

:root {
    --ink: #17150f;
    --ink-soft: #3d3a33;
    --muted: #7b7568;
    --line: #e7e2d7;
    --line-strong: #d4ccbb;
    --paper: #f8f7f3;
    --surface: #ffffff;
    --surface-warm: #fbf9f4;
    --gold: #b5832f;
    --gold-deep: #8a6020;
    --gold-soft: #f5eddc;
    --green: #1f6a43;
    --green-soft: #e6f1ea;
    --red: #a2352a;
    --red-soft: #f8e7e4;
    --amber: #92620f;
    --amber-soft: #f8efd8;
    --shadow: 0 1px 2px rgba(23, 21, 15, .06), 0 14px 32px -18px rgba(23, 21, 15, .28);
    --font-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 15px/1.5 var(--font-ui);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
code { font: 500 12.5px ui-monospace, Consolas, monospace; background: #f1eee7; padding: 2px 6px; border-radius: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Shell: sidebar and top bar ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--ink);
    color: #e9e4d8;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 18px 20px;
    flex: none;
    z-index: 60;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 6px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
}
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand-text strong { display: block; font: 500 16px/1.2 var(--font-display); color: #fff; letter-spacing: .01em; white-space: nowrap; }
.brand-text small { display: block; color: #a39c8f; font-size: 12px; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; flex: 1; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #3d3a33 transparent; }
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: #cfc8b8;
    border-radius: 3px;
    text-decoration: none;
    font-size: 14.5px;
    transition: background .2s, color .2s;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { color: #fff; background: rgba(181, 131, 47, .16); }
.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 14px; display: grid; gap: 4px; }
.who strong { display: block; font-weight: 500; color: #fff; font-size: 14px; }
.who small { display: block; color: #a39c8f; font-size: 12px; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 40px;
    background: rgba(248, 247, 243, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-spacer { flex: 1; }
.menu-toggle { display: none; }
.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    color: var(--ink);
}
.branch-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
}
.branch-pill .ico { color: var(--gold-deep); width: 16px; height: 16px; }
.scope-form { margin: 0; }
.scope-form label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.scope-form select { width: auto; min-width: 220px; height: 36px; font-weight: 500; color: var(--ink); }

.main { padding: 34px 40px 72px; width: 100%; max-width: 1440px; }
.main.rise { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Page heading ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font: 400 38px/1.08 var(--font-display); letter-spacing: -.02em; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lede { color: var(--muted); margin: 8px 0 0; max-width: 62ch; font-size: 15px; }
.muted { color: var(--muted); font-size: 13.5px; margin: 0; }
.neg { color: var(--red) !important; }
.pos-val { color: var(--green); }
.link-strong { color: var(--ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons and links ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 3px;
    border: 1px solid transparent;
    font: 500 14px/1 var(--font-ui);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--gold-deep); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover:not(:disabled) { background: var(--gold-deep); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #7d261e; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--gold-deep);
    font: 500 13px var(--font-ui);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.link-button.danger { color: var(--red); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); min-width: 0; }
.field > span { font-weight: 500; }
input, select, textarea {
    font: 400 14.5px var(--font-ui);
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    padding: 9px 11px;
    height: 40px;
    min-width: 0;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(181, 131, 47, .18); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--gold); }
input:disabled { background: #f3f1ec; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); padding: 16px 0; margin: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.input-small { width: 110px; height: 34px; }
.line-items { display: grid; gap: 10px; }
.line-item { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 10px; }
.line-item-3 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr); }
.search-field { position: relative; display: flex; align-items: center; min-width: 0; }
.search-field .ico { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 38px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 72px; }
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--gold-deep);
    font: 500 13px var(--font-ui);
    cursor: pointer;
    height: 30px;
    padding: 0 8px;
}
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-row img { width: 72px; height: 72px; object-fit: contain; border-radius: 50%; border: 1px solid var(--line); background: #fff; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.row-actions { white-space: nowrap; }
.row-actions .inline-form + .inline-form { margin-left: 6px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: #fff; border: 1px solid var(--line); padding: 16px; border-radius: 4px; margin-bottom: 20px; }
.filter-bar .field { min-width: 150px; }
.filter-bar .field-grow { flex: 1; min-width: 240px; }
.filter-bar .search-field { flex: 1 1 260px; }
.filter-bar-compact .search-field { flex: 1 1 280px; }
.filter-actions { display: flex; gap: 8px; }
.inline-search { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-search .search-field { flex: 1; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.presets-form { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.presets-form input { width: auto; height: 34px; font-size: 13.5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    font-weight: 500;
    font-size: 12.5px;
    color: var(--muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-warm);
    white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f1ede5; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfaf5; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table small { display: block; font-size: 12px; margin-top: 2px; color: var(--muted); }
.table td input, .table td select { height: 34px; padding: 6px 9px; font-size: 13.5px; }
.table td .check { white-space: nowrap; }
.table-compact td, .table-compact th { padding: 8px 10px; }
.table-stock td.stock-out { color: var(--red); font-weight: 600; }
.table-stock td.stock-low { color: var(--amber); font-weight: 600; }
.table tr.is-voided td { color: var(--muted); }
.table tr.is-voided td:first-child a { text-decoration: line-through; }
.table tr.row-new td { background: var(--gold-soft); }
.table tr.row-new:hover td { background: var(--gold-soft); }
.pos-val { font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--muted); gap: 12px; }
.pager .btn { margin: 0; }

/* ---------- Badges, flashes, empty states ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-bad { background: var(--red-soft); color: var(--red); }
.badge-gold { background: var(--gold-soft); color: var(--gold-deep); }
.badge-neutral { background: #efece5; color: var(--ink-soft); }
.pill-gold { display: inline-block; background: var(--gold); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.pill-muted { display: inline-block; background: #fff; color: var(--ink-soft); font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); }

.flash { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 12px 14px; border-radius: 3px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.flash-success { background: var(--green-soft); color: #174f32; border-color: #cfe5d8; }
.flash-error { background: var(--red-soft); color: #7d261e; border-color: #efcdc7; }
.flash-warning { background: var(--amber-soft); color: #6e4a0c; border-color: #efe0b8; }
.flash-info { background: #eef1f5; color: #2d3a4a; border-color: #dbe2ea; }
.flash-close { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 2px; }
.flash-close:hover { opacity: 1; }

.empty-state { text-align: center; padding: 52px 24px; background: #fff; border: 1px dashed var(--line-strong); border-radius: 4px; }
.empty-state h2 { font: 400 24px/1.2 var(--font-display); margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }

/* ---------- Panels and layout ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 22px 24px; margin-bottom: 20px; min-width: 0; }
.panel h2 { font: 500 20px/1.25 var(--font-display); letter-spacing: -.01em; margin: 0 0 14px; }
.panel-quiet { background: transparent; border-style: dashed; }
.panel-danger { border-color: #efcdc7; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-head p { margin: 4px 0 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.facts { margin: 0; display: grid; gap: 0; }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid #f1ede5; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 13.5px; }
.facts dd { margin: 0; text-align: right; font-weight: 500; }

/* ---------- Dashboard ---------- */
.hero-stats { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 32px; align-items: end; margin-bottom: 30px; padding: 6px 0 28px; border-bottom: 1px solid var(--line); }
.hero-figure { border-left: 3px solid var(--gold); padding-left: 22px; }
.figure-label { margin: 0; font-size: 14px; color: var(--muted); }
.figure { font: 300 clamp(40px, 5.2vw, 68px)/1 var(--font-display); letter-spacing: -.03em; margin: 12px 0 10px; font-variant-numeric: tabular-nums; }
.figure-sub { margin: 0; color: var(--ink-soft); font-size: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; }
.stat-row > div { padding: 4px 22px; border-left: 1px solid var(--line); }
.stat-row dt { font-size: 13px; color: var(--muted); }
.stat-row dd { margin: 6px 0 0; font: 400 26px/1.1 var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-row a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--gold); }
.panel-chart .chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-tick { font: 500 11px var(--font-ui); fill: var(--muted); }
.chart-label { font: 500 11px var(--font-ui); fill: var(--muted); text-anchor: middle; }
.chart-day:hover rect { opacity: .9; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1ede5; }
.feed li:last-child { border-bottom: 0; }
.feed-main { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.feed-main strong { font-weight: 500; }
.feed-main .muted { font-size: 13px; }
.feed-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-side .badge { margin-bottom: 2px; }
.thumb { width: 40px; height: 40px; border-radius: 3px; background: #f3f1ec; overflow: hidden; flex: none; display: inline-block; }
.thumb img, .feed-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 3px; }
.feed-thumb { display: inline-block; }
.product-cell { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.product-cell small { display: block; }

/* ---------- Products ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 18px; }
.product-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #e0d6c2; }
.product-card.is-hidden { opacity: .6; }
.product-card-media { position: relative; display: block; aspect-ratio: 1 / 1; background: #f5f3ee; }
.product-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 16px; transition: transform .45s ease; }
.product-card:hover .product-card-media img { transform: scale(1.04); }
.product-card-media .pill-gold, .product-card-media .pill-muted { position: absolute; left: 10px; top: 10px; }
.product-card-media .pill-muted { top: 40px; }
.product-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.product-card-cat { font-size: 12px; color: var(--gold-deep); margin: 0; font-weight: 500; }
.product-card-body h3 { font: 500 17px/1.25 var(--font-display); }
.product-card-body .btn { margin-top: auto; }
.product-card-body .muted { margin: 0; }
.price-row, .stock-row { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.price-row strong { font-variant-numeric: tabular-nums; }
.price-row s { color: var(--muted); font-size: 13px; }
.stock-row { align-items: center; }
.product-editor { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.toggles { display: flex; gap: 24px; flex-wrap: wrap; }
.photo-upload { background: var(--surface-warm); padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: #fff; }
.photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #f5f3ee; display: block; }
.photo figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px; font-size: 12.5px; flex-wrap: wrap; }
.photo figcaption form { margin: 0; }
.photo.is-main { border-color: var(--gold); }

/* ---------- Auth (sign-in) ---------- */
.is-standalone { background: var(--ink); }
.auth-page { min-height: 100vh; }
.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; background: var(--paper); }
.auth-art {
    position: relative;
    background-color: var(--ink);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.auth-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 21, 15, .15) 0%, rgba(23, 21, 15, .86) 100%); }
.auth-art-inner { position: relative; padding: 48px; display: flex; flex-direction: column; gap: 28px; width: 100%; }
.auth-logo { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .35)); }
.auth-tagline { font: 300 clamp(40px, 5vw, 66px)/1.02 var(--font-display); letter-spacing: -.02em; margin: 0; }
.auth-sub { margin: 14px 0 0; color: #e7e0d0; max-width: 40ch; font-size: 16px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; animation: rise .6s cubic-bezier(.2, .7, .2, 1) .1s both; }
.auth-brand { font: 500 13px/1.2 var(--font-display); color: var(--gold-deep); margin: 0 0 14px; letter-spacing: .02em; }
.auth-card h1 { font: 400 40px/1.1 var(--font-display); letter-spacing: -.02em; }
.auth-card .lede { margin: 8px 0 26px; }
.auth-card .btn-lg { margin-top: 4px; }
.auth-foot { margin: 22px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Point of sale ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.pos-main { min-width: 0; }
.pos-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pos-top h1 { font: 400 34px/1.1 var(--font-display); letter-spacing: -.02em; }
.pos-top .lede { margin-top: 4px; }
.branch-picker select { width: auto; min-width: 230px; }
.pos-search { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.barcode-field input { letter-spacing: .05em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #fff;
    font: 500 13.5px var(--font-ui);
    color: var(--ink-soft);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all .2s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pos-note { min-height: 20px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.pos-note.is-error { color: var(--red); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.tile {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font: inherit;
    color: inherit;
    transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow); }
.tile:disabled { opacity: .5; cursor: not-allowed; }
.tile-media { aspect-ratio: 1 / 1; background: #f5f3ee; display: block; }
.tile-media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.tile-name { font: 500 15px/1.2 var(--font-display); }
.tile-meta { font-size: 12px; color: var(--muted); }
.tile-price { font-variant-numeric: tabular-nums; font-weight: 600; margin-top: 4px; }
.tile-price s { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.tile-badge { position: absolute; right: 8px; top: 8px; }
.tile-count { position: absolute; left: 8px; top: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; height: 24px; min-width: 24px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }

.cart {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 20px;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cart-head { display: flex; justify-content: space-between; align-items: baseline; }
.cart-head h2 { font: 500 22px/1.2 var(--font-display); }
.cart-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-lines { display: flex; flex-direction: column; }
.cart-line { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1ede5; }
.cart-line:last-child { border-bottom: 0; }
.cart-line-name { font-weight: 500; font-size: 14px; line-height: 1.25; }
.cart-line-price { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 3px; height: 30px; }
.qty button { width: 30px; height: 30px; background: none; border: 0; cursor: pointer; font-size: 16px; color: var(--ink); }
.qty button:hover { background: var(--gold-soft); }
.qty span { min-width: 30px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.cart-line-total { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.cart-empty { color: var(--muted); font-size: 14px; margin: 4px 0; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 4px; text-align: center; }
.cart-block .field-row { grid-template-columns: 1fr 1fr; }
.totals { margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.totals > div, .receipt-totals > div { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-soft); }
.totals dd, .receipt-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font: 400 28px/1 var(--font-display); color: var(--ink); }
.totals .grand dd { font-weight: 400; }
.methods { border: 0; padding: 0; margin: 0; min-width: 0; }
.methods legend { font-size: 13px; color: var(--ink-soft); font-weight: 500; margin-bottom: 8px; padding: 0; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.method { position: relative; }
.method input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.method span { display: flex; align-items: center; justify-content: center; height: 40px; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .15s; background: #fff; }
.method input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.method input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.tender { display: flex; flex-direction: column; gap: 10px; }
.quick-cash { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.quick-cash button { height: 34px; border: 1px solid var(--line-strong); background: #fff; border-radius: 3px; font: 500 12.5px var(--font-ui); cursor: pointer; }
.quick-cash button:hover { border-color: var(--gold); background: var(--gold-soft); }
.change { margin: 0; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-soft); }
.change strong { font: 500 20px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.form-error { color: var(--red); font-size: 13.5px; margin: 0; }
.form-error:empty { display: none; }
.keys { font-size: 11.5px; color: var(--muted); margin: 0; text-align: center; }
.cart .btn-gold { height: 56px; font-size: 16px; }
.cart .btn-quiet { height: 36px; }

/* ---------- Receipts ---------- */
.receipt-layout { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 24px; align-items: start; }
.receipt { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 28px 26px; font-size: 13.5px; }
.receipt-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-bottom: 16px; border-bottom: 1px dashed var(--line-strong); }
.receipt-head img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 6px; }
.receipt-head h2 { font: 500 22px/1.2 var(--font-display); }
.receipt-head p { margin: 0; color: var(--ink-soft); font-size: 12.5px; }
.receipt-void { color: var(--red); font-weight: 700; text-align: center; margin: 12px 0; }
.receipt-meta { display: grid; gap: 6px; margin: 16px 0; font-size: 13px; }
.receipt-meta > div { display: flex; justify-content: space-between; gap: 12px; }
.receipt-meta dt { color: var(--muted); }
.receipt-meta dd { margin: 0; text-align: right; }
.receipt-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.receipt-items th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 0; }
.receipt-items td { padding: 8px 0; border-bottom: 1px dotted var(--line); vertical-align: top; }
.receipt-items td small { display: block; color: var(--muted); font-size: 11.5px; }
.receipt-items .num { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-totals { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 13.5px; }
.receipt-totals .grand { font: 500 20px/1.2 var(--font-display); padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink); }
.receipt-totals .grand dd { font-weight: 500; }
.receipt-foot { text-align: center; margin-top: 22px; padding-top: 14px; border-top: 1px dashed var(--line-strong); color: var(--muted); font-size: 12.5px; }
.receipt-foot p { margin: 0; }
.panel-danger .muted { margin-bottom: 12px; }

/* ---------- Settings and misc ---------- */
.settings .panel { margin-bottom: 18px; }
.settings .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings .form-grid .field-wide { grid-column: 1 / -1; }
.settings .form-grid .logo-row { grid-column: 1 / -1; }

/* ---------- Reports ---------- */
.report-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr); gap: 26px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 24px 26px; margin-bottom: 22px; }
.report-summary .hero-figure .figure { font-size: clamp(38px, 4.4vw, 56px); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; gap: 4px 0; }
.stat-grid > div { padding: 8px 18px; border-left: 1px solid var(--line); }
.stat-grid dt { font-size: 13px; color: var(--muted); }
.stat-grid dd { margin: 4px 0 0; font: 400 22px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-strong dd { color: var(--ink); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
    .split-wide-left, .split { grid-template-columns: minmax(0, 1fr); }
    .pos { grid-template-columns: minmax(0, 1fr); }
    .cart { position: static; max-height: none; }
    .product-editor { grid-template-columns: minmax(0, 1fr); }
    .receipt-layout { grid-template-columns: minmax(0, 1fr); }
    .report-summary { grid-template-columns: minmax(0, 1fr); }
    .hero-stats { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .settings .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-102%);
        transition: transform .28s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .4);
    }
    .sidebar.is-open { transform: none; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 10px 16px; }
    .main { padding: 22px 16px 56px; }
    .page-head h1 { font-size: 30px; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-art { min-height: 230px; }
    .auth-art-inner { padding: 26px; gap: 16px; }
    .auth-logo { width: 72px; height: 72px; }
    .auth-tagline { font-size: 38px; }
    .auth-panel { padding: 30px 20px 48px; }
    .pos-search { grid-template-columns: minmax(0, 1fr); }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .form-grid, .field-row, .settings .form-grid { grid-template-columns: minmax(0, 1fr); }
    .line-item, .line-item-3 { grid-template-columns: minmax(0, 1fr); }
    .stat-row > div { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0; }
    .presets-form { margin-left: 0; }
    .scope-form select { min-width: 0; width: 170px; }
    .branch-pill { font-size: 12.5px; }
}
@media (max-width: 480px) {
    .quick-cash { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cart { padding: 16px; }
    .topbar-spacer { display: none; }
}

@media print {
    .sidebar, .topbar, .page-head, .receipt-side, .flash, .no-print { display: none !important; }
    body { background: #fff; }
    .app, .content, .main { display: block; padding: 0; margin: 0; max-width: none; }
    .receipt-layout { display: block; }
    .receipt { border: 0; width: 80mm; margin: 0 auto; padding: 0; font-size: 12px; }
}
