/* Allure Essence – light theme. Warm whites, charcoal text, restrained gold. */
:root {
  --bg: #faf8f5; --surface: #ffffff; --surface-2: #f4f1ec; --line: #e7e1d8; --line-strong: #d8d0c4;
  --ink: #26241f; --ink-2: #4a463f; --muted: #776f64;
  --gold: #a8832f; --gold-ink: #7a5d1c; --gold-soft: #f6efdf;
  --ok: #2c7a4b; --ok-soft: #e7f3ec; --warn: #9a6400; --warn-soft: #fbf1dc; --bad: #b0322a; --bad-soft: #fbe9e7;
  --info: #35618f; --info-soft: #e8eff7;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(38, 36, 31, .06), 0 2px 8px rgba(38, 36, 31, .04);
  --sidebar: 236px; --topbar: 56px; --bottombar: 60px;
  --num: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); color-scheme: light;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- controls */
label { display: block; font-size: .82rem; color: var(--ink-2); font-weight: 500; }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 11px; min-height: 40px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin: 0; accent-color: var(--gold); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  font-size: .9rem; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #3a372f; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--gold-ink); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: .8rem; color: var(--ink-2); cursor: pointer; }
.help { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); font-size: .7rem; font-weight: 700; cursor: pointer; padding: 0; vertical-align: 1px; margin-left: 4px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.login-card form { display: grid; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.brand-row { display: flex; gap: 12px; align-items: center; }
.brand-row h1 { font-size: 1.25rem; }
.logo { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--ink); color: #e9d6a3; font-weight: 700; letter-spacing: .5px; }
.small-logo { width: 32px; height: 32px; font-size: .78rem; border-radius: 8px; }
.demo-chip { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .4px; color: var(--warn); background: var(--warn-soft); border: 1px solid #ecd6a6; border-radius: 999px; padding: 2px 8px; margin-top: 10px; }
.topbar .demo-chip { margin-top: 0; }

/* ---------- shell */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--line);
  padding: 14px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; z-index: 20; }
.sidebar .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2);
  text-decoration: none; font-size: .9rem; font-weight: 500; }
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current=page] { background: var(--gold-soft); color: var(--ink); font-weight: 650; }
.nav-item[aria-current=page] svg { color: var(--gold-ink); }
.nav-item .tag { margin-left: auto; white-space: nowrap; font-size: .64rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.nav-item .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 0 6px; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 12px 10px 4px; }
.main-col { margin-left: var(--sidebar); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: var(--topbar); display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 20px; background: rgba(250, 248, 245, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left .small-logo { display: none; }
.page-title { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; position: relative; }
.branch-pick select { min-height: 36px; padding: 6px 30px 6px 10px; font-size: .88rem; max-width: 220px; }
.menu { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 220px; padding: 6px; z-index: 30; }
.menu-head { display: grid; padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-item { width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; font: inherit; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.page { padding: 18px 20px 40px; max-width: 1440px; outline: none; }
.bottombar { display: none; }

/* ---------- page building blocks */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.chips { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.chip { border: 0; background: none; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 32px; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; }
.date-range { display: inline-flex; gap: 6px; align-items: center; }
.date-range input { width: 150px; min-height: 36px; padding: 6px 8px; }
.updated { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--gold); }
.tab .count { background: var(--bad); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 6px; margin-left: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: .95rem; }
.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-label .tagline { text-transform: none; letter-spacing: 0; font-weight: 500; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.kpi { display: block; text-decoration: none; padding: 14px 16px; position: relative; transition: border-color .15s; }
a.kpi:hover { border-color: var(--gold); }
.kpi .k-label { font-size: .8rem; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.3px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi .k-arrow { position: absolute; right: 12px; top: 14px; color: var(--line-strong); }
a.kpi:hover .k-arrow { color: var(--gold); }
.kind { font-size: .64rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; border-radius: 4px; padding: 1px 5px; }
.kind.period { color: var(--info); background: var(--info-soft); }
.kind.now { color: var(--gold-ink); background: var(--gold-soft); }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); } .pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); } .pill.info { color: var(--info); background: var(--info-soft); }
.pill.muted { color: var(--muted); background: var(--surface-2); }

.list-rows { display: grid; }
.lrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); text-decoration: none; }
.lrow:first-child { border-top: 0; }
a.lrow:hover { background: var(--surface-2); }
.lrow .l-main { min-width: 0; }
.lrow .l-title { font-weight: 600; font-size: .9rem; }
.lrow .l-sub { font-size: .8rem; color: var(--muted); }
.lrow .l-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
.t th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.r, .t th.r { text-align: right; font-variant-numeric: tabular-nums; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: #fbf9f4; }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
.prod { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb { width: 38px; height: 38px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; overflow: hidden; border: 1px solid #efe3c4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 96px; height: 96px; font-size: 1.4rem; border-radius: 12px; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.notice { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; font-size: .86rem; color: var(--ink-2); }
.notice.gap { border-style: dashed; background: var(--surface); }
.notice b { color: var(--ink); }
.gap-list { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: .86rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink); font-weight: 500; }

.steps { display: grid; gap: 10px; counter-reset: step; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step .s-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--ink-2); flex: none; }
.step.done .s-num { background: var(--ok-soft); color: var(--ok); }
.step .s-body { flex: 1; min-width: 0; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: var(--surface-2); font-size: 1.1rem; cursor: pointer; }
.qty span { min-width: 32px; text-align: center; font-weight: 700; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: #d9c18a; } .chart .bar:hover { fill: var(--gold); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; }
.legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 16px; }
.hbar .track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--gold); border-radius: 3px; }

/* modal, sheet, toast */
.modal-backdrop, .sheet-backdrop { position: fixed; inset: 0; background: rgba(30, 27, 22, .38); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal .m-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal .m-body { padding: 16px 18px 18px; }
.sheet-backdrop { place-items: end center; padding: 0; }
.sheet { background: var(--surface); width: 100%; border-radius: 18px 18px 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 10px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; max-width: min(520px, calc(100vw - 32px)); width: max-content;
  padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: .9rem; }
.toast.error { background: var(--bad); }

/* ---------- tablet */
@media (max-width: 1100px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phone: no sidebar, bottom bar, tables become cards */
@media (max-width: 760px) {
  html, body { font-size: 15px; }
  .sidebar { display: none; }
  .main-col { margin-left: 0; }
  .topbar { padding: 0 12px; }
  .topbar-left .small-logo { display: inline-grid; }
  .page-title { font-size: 1rem; }
  .branch-pick select { max-width: 132px; font-size: .82rem; }
  .page { padding: 12px 12px calc(var(--bottombar) + 24px + env(safe-area-inset-bottom)); }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a, .bottombar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 2px; height: var(--bottombar); border: 0; background: none;
    font: inherit; font-size: .7rem; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; cursor: pointer; }
  .bottombar [aria-current=page] { color: var(--ink); }
  .bottombar [aria-current=page] svg { color: var(--gold-ink); }
  .bottombar .count { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--bad); color: #fff; border-radius: 999px; font-size: .62rem; padding: 0 5px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .g2.stack, .g3.stack { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 11px 12px; }
  .kpi .k-value { font-size: 1.2rem; }
  .kpi .k-label { font-size: .74rem; }
  .kpi .k-arrow { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .date-range input { width: 132px; }
  .toast { bottom: calc(var(--bottombar) + 16px); }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  /* responsive tables: each row becomes a card, each cell shows its column name */
  .table-wrap { overflow: visible; }
  table.t.rt thead { display: none; }
  table.t.rt, .t.rt tbody, .t.rt tfoot { display: block; width: 100%; }
  .t.rt tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .t.rt tbody tr:last-child { border-bottom: 0; }
  .t.rt td { border: 0; padding: 0; display: block; text-align: left; min-width: 0; }
  .t.rt td.r { text-align: left; }
  .t.rt td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .3px; font-weight: 600; }
  .t.rt td.lead { grid-column: 1 / -1; padding-bottom: 2px; }
  .t.rt td.lead::before, .t.rt td[data-label=""]::before { content: none; }
  .t.rt td:empty { display: none; }
  .t.rt tfoot tr { background: var(--surface-2); }
}

.thumb.empty { background: var(--surface-2); color: #b9ab8f; border-style: dashed; }
.thumb.empty svg.i { width: 55%; height: 55%; stroke-width: 1.4; }
.thumb.lg.empty svg.i { width: 50%; height: 50%; }
.evidence { display: flex; gap: 8px; flex-wrap: wrap; }
.evidence img { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.scan-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.big-input { font-size: 1.1rem; min-height: 48px; }
.diff-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 760px) { .diff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scan-box { grid-template-columns: minmax(0, 1fr); } }
.costing td.r b { font-size: 1rem; }
.flag { color: var(--bad); font-weight: 600; }

/* ---------- v1.0 camera scanner */
.scan-btn { border-color: var(--gold); color: var(--gold-ink); background: var(--gold-soft); min-height: 44px; }
.scan-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 18, 15, .78); display: grid; place-items: center; padding: 12px; }
.scan-card { position: relative; width: min(520px, 100%); background: var(--surface); border-radius: var(--radius); padding: 12px; }
.scan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.scan-card video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #111; border-radius: var(--radius-sm); display: block; }
.scan-frame { position: absolute; left: 18%; right: 18%; top: 34%; height: 22%; border: 2px solid var(--gold); border-radius: 8px; pointer-events: none; }
.scan-msg { margin: 10px 2px; font-weight: 600; min-height: 1.4em; }
.scan-msg.bad { color: var(--bad); }
.scan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-actions .btn { flex: 1; min-height: 44px; }

/* ======================================================================================================
   v1.1 glass theme (frosted cards over a warm, softly blurred background). Overrides colours and surfaces only:
   the layout, navigation and every screen stay the same. Text stays dark on light glass for strong contrast.
   ====================================================================================================== */
:root {
  --bg: #efe6da; --surface: rgba(255, 252, 247, .62); --surface-2: rgba(255, 255, 255, .45);
  --line: rgba(255, 255, 255, .55); --line-strong: rgba(70, 52, 34, .18);
  --ink: #1f1c18; --ink-2: #3d3730; --muted: #6a6157;
  --gold: #b0693c; --gold-ink: #8a4a22; --gold-soft: rgba(214, 120, 70, .14);   /* terracotta / bronze accent */
  --ok: #24724a; --ok-soft: rgba(36, 114, 74, .12); --warn: #8d5a00; --warn-soft: rgba(196, 140, 30, .16);
  --bad: #a52b22; --bad-soft: rgba(165, 43, 34, .12); --info: #2f5d8a; --info-soft: rgba(47, 93, 138, .12);
  --radius: 18px; --radius-sm: 11px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 30px rgba(60, 40, 20, .10), 0 1px 3px rgba(60, 40, 20, .08);
  --glass-blur: blur(18px) saturate(140%);
}
html, body { background:
    radial-gradient(1200px 700px at 12% 8%, rgba(255, 255, 255, .75), transparent 60%),
    radial-gradient(900px 600px at 88% 18%, rgba(214, 150, 100, .35), transparent 65%),
    radial-gradient(1000px 800px at 70% 95%, rgba(120, 88, 60, .28), transparent 60%),
    linear-gradient(160deg, #f4ede3 0%, #e9ddcd 55%, #ddcbb6 100%) fixed; }
.card, .sidebar, .topbar, .modal, .login-card, .sheet, .bottombar, .scan-card {
  background: var(--surface); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.sidebar { border-right: 1px solid var(--line); }
.topbar { border-bottom: 1px solid var(--line); box-shadow: 0 4px 18px rgba(60, 40, 20, .06); }
.card-head { border-bottom: 1px solid rgba(70, 52, 34, .08); }
.kpi { border-radius: var(--radius); }
.kpi:hover { border-color: rgba(176, 105, 60, .45); }
.nav-item { border-radius: 12px; min-height: 42px; }
.nav-item:hover { background: rgba(255, 255, 255, .55); }
.nav-item[aria-current=page] { background: #1f1c18; color: #fff; }
.nav-item[aria-current=page] svg { color: #fff; }
.btn { border-radius: 999px; min-height: 42px; padding: 8px 18px; background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(70, 52, 34, .14); }
.btn:hover { background: rgba(255, 255, 255, .92); }
.btn.primary { background: #1f1c18; border-color: #1f1c18; color: #fff; }
.btn.primary:hover { background: #38322b; }
.btn.gold { background: linear-gradient(180deg, #c97a48, #b0693c); border-color: #a65f33; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 4px 12px; }
input, select, textarea { background: rgba(255, 255, 255, .72); border-color: rgba(70, 52, 34, .18); border-radius: 12px; }
.t th { color: var(--muted); font-weight: 600; }
.t tbody tr:hover { background: rgba(255, 255, 255, .45); }
.modal-backdrop, .sheet-backdrop { background: rgba(40, 28, 18, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.notice { background: rgba(255, 255, 255, .55); border: 1px solid var(--line); border-radius: 14px; }
.toast { border-radius: 999px; }
.scan-btn { border-color: rgba(176, 105, 60, .55); color: var(--gold-ink); background: rgba(214, 120, 70, .14); font-weight: 700; }
/* prominent workflow actions */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.quick-actions .btn { min-height: 52px; font-size: .95rem; }
/* dashboard charts and compact cards */
.mini-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.mini { padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
.mini .k { font-size: .76rem; color: var(--muted); font-weight: 600; }
.mini .v { font-size: 1.15rem; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 8px 4px 0; }
.chart-bars .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 8px; }
.chart-bars .s { background: rgba(31, 28, 24, .85); border-radius: 6px 6px 2px 2px; }
.chart-bars .p { background: linear-gradient(180deg, #d98a58, #b0693c); border-radius: 6px 6px 2px 2px; }
.chart-x { display: flex; gap: 6px; font-size: .68rem; color: var(--muted); padding: 2px 4px; }
.chart-x span { flex: 1; text-align: center; min-width: 8px; overflow: hidden; }
.legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
/* inventory photo cards */
.prod-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.prod-card { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.prod-card .ph { aspect-ratio: 1; border-radius: 12px; background: rgba(255, 255, 255, .6) center/cover no-repeat;
  display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.prod-card b { font-size: .9rem; line-height: 1.25; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .55); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 36px; }
.seg button[aria-pressed=true] { background: #1f1c18; color: #fff; }
.rank-list .lrow { padding: 6px 0; }
@media (max-width: 900px) {
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --glass-blur: blur(10px) saturate(130%); }              /* lighter blur: smoother on phones */
  .btn, .nav-item, .seg button { min-height: 44px; }
}
@media (prefers-reduced-transparency: reduce) {
  .card, .sidebar, .topbar, .modal, .sheet, .bottombar { background: #fbf7f1; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
html, body { overflow-x: hidden; }
.inv-mode-cards [data-testid="inventory-table"], .inv-mode-cards [data-testid="staff-inventory"] .table-wrap,
.inv-mode-cards .card:has(> .table-wrap > [data-testid="inventory-table"]) { display: none; }
.heat td, .heat th { padding: 6px 4px; text-align: center; font-size: .78rem; min-width: 26px; }
