/* ── FONTS ────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Playfair+Display:wght@700&display=swap');

/* ── DESIGN TOKENS ───────────────────────────────────────────────────────── */
:root {
  --ink:          #1a1a18;
  --paper:        #f5f0e8;
  --cream:        #ede8dc;
  --rule:         #c8bfa8;
  --green:        #3a6b4a;
  --green-light:  #d4e8da;
  --gold:         #c49a2c;
  --gold-light:   #f5e8c0;
  --red:          #8b2020;
  --red-light:    #f0d8d8;
  --font-mono:    'DM Mono', monospace;
  --font-display: 'Playfair Display', serif;

  /* Brand — overridden per user via <style id="brand-vars"> injected on login */
  --accent:       #b85c2c;
  --accent-light: #e8a07a;
}

/* ── RESET ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BASE BODY ───────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-mono);
  background:  var(--paper);
  color:       var(--ink);
  font-size:   13px;
  min-height:  100vh;
}

/* ── BADGES (shared) ─────────────────────────────────────────────────────── */
.badge       { display: inline-block; padding: 2px 6px; font-size: 10px; }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-gold  { background: var(--gold-light);  color: var(--gold);  }
.badge-red   { background: var(--red-light);   color: var(--red);   }


/* ═══════════════════════════════════════════════════════════════════════════
   APP  (body.app)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TOPBAR ── */
body.app #topbar {
  background: var(--ink);
  display: flex;
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  overflow: visible;
}
body.app #topbar .logo {
  padding: 0 16px;
  border-right: 1px solid #333;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
body.app #topbar .logo span {
  font-family: var(--font-display);
  color: var(--paper);
  font-size: 15px;
}
body.app #topbar .logo small {
  color: var(--accent-light);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
body.app #topbar nav {
  display: flex;
  flex: 1;
  overflow: visible;
  scrollbar-width: none;
}
body.app #topbar nav::-webkit-scrollbar { display: none; }
body.app #topbar nav button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  height: 44px;
  display: inline-block;
}
body.app #topbar nav button:hover { color: var(--paper); }
body.app #topbar nav button.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}
body.app .nav-group { position: relative; display: inline-block; }
body.app .nav-dropdown {
  display: none; position: absolute; top: 44px; left: 0;
  background: #1c1c1a; border: 1px solid #333; border-radius: 4px;
  min-width: 130px; z-index: 500; padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
body.app .nav-group:hover .nav-dropdown { display: block; }
body.app .nav-dropdown button {
  display: block !important; width: 100%; text-align: left;
  padding: 8px 14px !important; height: auto !important;
  border-bottom: 2px solid transparent !important; border-radius: 0;
}
body.app .nav-dropdown button:hover { background: #2a2a28; color: var(--paper); }
body.app .nav-dropdown button.active { color: var(--accent-light); background: #2a2a28; }
body.app #topbar .io {
  display: flex;
  align-items: center;
  border-left: 1px solid #333;
  flex-shrink: 0;
}
body.app #topbar .io button {
  background: none;
  border: none;
  border-right: 1px solid #333;
  color: #777;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 0 11px;
  cursor: pointer;
  height: 44px;
  transition: color 0.15s;
  display: inline-block;
}
body.app #topbar .io button:hover { color: var(--accent-light); }

/* ── PAGES ── */
body.app .page { display: none; }
body.app .page.active { display: block; }
body.app .page-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--paper);
}
body.app .page-header h2 { font-family: var(--font-display); font-size: 21px; }
body.app .page-body { padding: 14px 18px; }

/* ── BUTTONS ── */
body.app .btn {
  padding: 7px 13px;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
body.app .btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
body.app .btn-primary { background: var(--accent); color: white; }
body.app .btn-primary:hover { background: #9e3f1a; }
body.app .btn-ghost { background: transparent; border: 1px solid var(--rule); color: var(--ink); }
body.app .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
body.app .btn-danger { background: transparent; border: 1px solid var(--rule); color: var(--red); }
body.app .btn-danger:hover { background: var(--red-light); border-color: var(--red); }
body.app .btn-sm { padding: 4px 8px; font-size: 10px; }
body.app .btn-green { background: var(--green); color: white; }
body.app .btn-green:hover { background: #285a37; }

/* ── CARDS ── */
body.app .card { background: white; border: 1px solid var(--rule); margin-bottom: 12px; }
body.app .card-header {
  padding: 10px 13px;
  border-bottom: 1px solid var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
}
body.app .card-header h3 { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
body.app .card-body { padding: 13px; }

/* ── TABLES ── */
body.app .tw { overflow-x: auto; }
body.app table { width: 100%; border-collapse: collapse; min-width: 360px; }
body.app th {
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #999;
  text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--cream);
  background: var(--cream); white-space: nowrap;
}
body.app td { padding: 8px 9px; border-bottom: 1px solid var(--cream); font-size: 11px; vertical-align: middle; }
body.app tr:last-child td { border-bottom: none; }

/* ── FORMS ── */
body.app .fg  { display: grid; gap: 11px; }
body.app .fg2 { grid-template-columns: 1fr 1fr; }
body.app .fg3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 480px) { body.app .fg2, body.app .fg3 { grid-template-columns: 1fr; } }
body.app .field { display: flex; flex-direction: column; gap: 3px; }
body.app .field label { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #999; }
body.app .field input,
body.app .field select,
body.app .field textarea {
  padding: 7px 8px; border: 1px solid var(--rule); background: var(--paper);
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  outline: none; transition: border-color 0.15s; width: 100%;
}
body.app .field input:focus,
body.app .field select:focus,
body.app .field textarea:focus { border-color: var(--accent); background: white; }
body.app .hint { font-size: 9px; color: #bbb; }

/* ── MODAL ── */
body.app .modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 500;
  align-items: flex-start; justify-content: center;
  padding: 30px 10px; overflow-y: auto;
}
body.app .modal-overlay.open { display: flex; }
body.app .modal {
  background: var(--paper); border: 1px solid var(--rule);
  width: 100%; max-width: 560px; box-shadow: 0 16px 50px rgba(0,0,0,0.3); margin-bottom: 30px;
}
body.app .modal-header {
  padding: 14px 16px; border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; background: white;
}
body.app .modal-header h3 { font-family: var(--font-display); font-size: 16px; }
body.app .modal-body { padding: 16px; }
body.app .modal-footer {
  padding: 11px 16px; border-top: 1px solid var(--rule);
  display: flex; gap: 7px; justify-content: flex-end; background: white;
}
body.app .close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #bbb; line-height: 1; }

/* ── STATS ── */
body.app .stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { body.app .stats-row { grid-template-columns: 1fr 1fr; } }
body.app .stat-box { background: white; border: 1px solid var(--rule); padding: 11px 13px; }
body.app .stat-box .label { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #bbb; margin-bottom: 3px; }
body.app .stat-box .value { font-family: var(--font-display); font-size: 19px; }
body.app .stat-box .sub   { font-size: 9px; color: #ccc; margin-top: 2px; }

/* ── QUICK SALE ── */
body.app .quick-sale { background: white; border: 2px solid var(--accent); padding: 14px; margin-bottom: 14px; }
body.app .quick-sale h3 { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 11px; }

/* ── MATERIAL ROWS ── */
body.app .mat-row {
  display: grid; grid-template-columns: 1fr 70px 70px 70px 22px;
  gap: 5px; align-items: end; padding: 7px 0; border-bottom: 1px solid var(--cream);
}
body.app .mat-row:last-child { border-bottom: none; }
body.app .mat-add-btn {
  margin-top: 8px; background: none; border: 1px dashed var(--rule); color: #bbb;
  font-family: var(--font-mono); font-size: 11px; padding: 6px;
  cursor: pointer; width: 100%; transition: all 0.15s;
}
body.app .mat-add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── BARS ── */
body.app .bar-row { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 10px; }
body.app .bar-label { width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: #999; flex-shrink: 0; }
body.app .bar-track { flex: 1; height: 15px; background: var(--cream); }
body.app .bar-fill  { height: 100%; background: var(--accent); transition: width 0.4s; }
body.app .bar-val   { width: 50px; flex-shrink: 0; font-size: 11px; }

/* ── MISC ── */
body.app .divider   { height: 1px; background: var(--rule); margin: 12px 0; }
body.app .sec-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: #ccc; margin-bottom: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--cream); }
body.app .price-hi  { color: var(--green); font-weight: 500; }
body.app .empty     { text-align: center; padding: 28px 14px; color: #ccc; font-size: 11px; }
body.app .empty .icon { font-size: 26px; margin-bottom: 7px; }
body.app .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 580px) { body.app .two-col { grid-template-columns: 1fr; } }
body.app .report-filters {
  background: white; border: 1px solid var(--rule); padding: 12px;
  margin-bottom: 12px; display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
}
body.app .report-filters .field { min-width: 110px; }

/* ── PRODUCT SEARCH DROPDOWN ── */
body.app #pdd {
  position: absolute; left: 0; right: 0; top: 100%;
  background: white; border: 1px solid var(--rule); z-index: 300;
  max-height: 180px; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
body.app .dd-item {
  padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--cream);
  font-size: 11px; display: flex; justify-content: space-between; align-items: center;
}
body.app .dd-item:hover { background: var(--cream); }
body.app .dd-item:last-child { border-bottom: none; }

/* ── TOAST ── */
body.app #toast {
  position: fixed; bottom: 14px; right: 14px;
  padding: 9px 14px; background: var(--ink); color: var(--paper);
  font-size: 11px; z-index: 9999; transform: translateY(50px); opacity: 0;
  transition: all 0.2s; max-width: 240px;
}
body.app #toast.show { transform: translateY(0); opacity: 1; }

/* ── COMPARE ── */
body.app .compare-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 90px); }
body.app .compare-panel  { flex: 1; min-width: 0; padding: 14px 18px; }
body.app .compare-panel + .compare-panel { border-left: 2px solid var(--rule); }
body.app .compare-tag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; background: var(--ink); color: var(--paper);
  font-size: 12px; font-family: var(--font-display); font-weight: 700; flex-shrink: 0;
}
body.app .cmp-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--cream); }
body.app .cmp-filters .field { display: flex; flex-direction: column; gap: 3px; }
body.app .cmp-filters label { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: #999; }
body.app .cmp-filters input,
body.app .cmp-filters select { font-family: var(--font-mono); font-size: 11px; background: white; border: 1px solid var(--rule); padding: 4px 7px; color: var(--ink); max-width: 130px; }

/* ── TRANSACTIONS ── */
body.app #txn-banner { display: none; margin-bottom: 12px; }
body.app #txn-banner.open { display: block; }
body.app .txn-panel { background: var(--ink); color: var(--paper); padding: 12px 16px; }
body.app .txn-hdr { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
body.app .txn-title { font-family: var(--font-display); font-size: 14px; }
body.app .txn-items { border-top: 1px solid #333; padding-top: 8px; font-size: 11px; color: #bbb; }
body.app .txn-item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 4px 0; border-bottom: 1px solid #2a2a28; }
body.app .txn-item span:first-child { flex: 1; }
body.app .txn-item span:last-child  { flex-shrink: 0; color: var(--paper); }
body.app .txn-total { display: flex; justify-content: space-between; font-size: 13px; padding: 10px 0 0; margin-top: 8px; border-top: 1px solid #444; color: var(--paper); }
body.app .txn-row { background: #f9f6f0 !important; }
body.app .txn-group-hdr td { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #999; background: var(--cream) !important; padding: 4px 8px !important; border-top: 2px solid var(--rule); }

/* ── SALE SELECTION BAR ── */
body.app #sel-bar {
  display: none; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper); padding: 10px 18px;
  border-radius: 6px; font-size: 12px; position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 999; box-shadow: 0 4px 16px rgba(0,0,0,0.35); white-space: nowrap;
}
body.app #sel-bar.active { display: flex; }
body.app .log-cb { width: 14px; height: 14px; cursor: pointer; accent-color: var(--green); }


/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN  (body.admin)
   ═══════════════════════════════════════════════════════════════════════════ */

body.admin #topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 52px; background: var(--cream);
  border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10;
}
body.admin .logo       { font-family: var(--font-display); font-size: 18px; }
body.admin .logo small { display: block; font-family: var(--font-mono); font-size: 9px; color: #999; font-weight: 300; }
body.admin .topbar-right { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #999; }
body.admin .topbar-right a { color: var(--accent); text-decoration: none; }

body.admin .wrap { max-width: 960px; margin: 0 auto; padding: 32px 24px; }

body.admin .msg     { padding: 10px 14px; border-radius: 3px; margin-bottom: 24px; font-size: 12px; }
body.admin .msg-ok  { background: var(--green-light); color: var(--green); }
body.admin .msg-err { background: var(--red-light);   color: var(--red);   }

body.admin .card { background: var(--cream); border: 1px solid var(--rule); border-radius: 4px; margin-bottom: 32px; }
body.admin .card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--rule);
  font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .08em;
  display: flex; align-items: center; justify-content: space-between;
}
body.admin .card-header h2 { font-family: var(--font-display); font-size: 18px; color: var(--ink); text-transform: none; letter-spacing: 0; }
body.admin .card-body { padding: 18px; }

body.admin table { width: 100%; border-collapse: collapse; font-size: 12px; }
body.admin th { text-align: left; padding: 6px 10px; font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--rule); }
body.admin td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
body.admin tr:last-child td { border-bottom: none; }
body.admin tr:hover td { background: rgba(0,0,0,.02); }

body.admin .badge { border-radius: 20px; }

body.admin .btn { display: inline-block; padding: 6px 12px; border-radius: 3px; border: none; font-family: var(--font-mono); font-size: 11px; cursor: pointer; }
body.admin .btn + .btn { margin-left: 6px; }
body.admin .btn-primary { background: var(--accent); color: #fff; }
body.admin .btn-ghost   { background: transparent; border: 1px solid var(--rule); color: var(--ink); }
body.admin .btn-danger  { background: var(--red-light); color: var(--red); border: 1px solid #e0b0b0; }

body.admin .form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
body.admin .form-row.three { grid-template-columns: 1fr 1fr 1fr; }
body.admin label { display: block; font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
body.admin input[type=text],
body.admin input[type=email],
body.admin input[type=password] {
  width: 100%; padding: 8px 10px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: 3px; font-family: var(--font-mono); font-size: 12px; color: var(--ink);
}

body.admin .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; align-items: center; justify-content: center; }
body.admin .modal-overlay.open { display: flex; }
body.admin .modal { background: var(--cream); border: 1px solid var(--rule); border-radius: 4px; width: 100%; max-width: 420px; padding: 24px; }
body.admin .modal h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 18px; }
body.admin .modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }


/* ═══════════════════════════════════════════════════════════════════════════
   RESET / LOGIN PAGE  (body.reset)
   ═══════════════════════════════════════════════════════════════════════════ */

body.reset {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
body.reset .box {
  width: 100%; max-width: 380px;
  background: var(--cream); border: 1px solid var(--rule); border-radius: 4px; padding: 40px;
}
body.reset .logo       { text-align: center; margin-bottom: 32px; }
body.reset .logo-title { font-family: var(--font-display); font-size: 26px; }
body.reset .logo-sub   { font-size: 11px; color: #999; margin-top: 4px; }
body.reset h2  { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
body.reset p   { font-size: 12px; color: #888; line-height: 1.6; margin-bottom: 20px; }
body.reset label { display: block; font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
body.reset input {
  width: 100%; padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: 3px; font-family: var(--font-mono); font-size: 13px; color: var(--ink); margin-bottom: 14px;
}
body.reset button,
body.reset .btn {
  display: block; width: 100%; padding: 12px;
  background: var(--accent); color: #fff; border: none; border-radius: 3px;
  font-family: var(--font-mono); font-size: 13px; cursor: pointer;
  text-align: center; text-decoration: none; margin-top: 8px;
}
body.reset .error {
  background: var(--red-light); color: var(--red);
  padding: 10px 12px; border-radius: 3px; font-size: 12px; margin-bottom: 16px;
}
body.reset .back { display: block; text-align: center; margin-top: 20px; font-size: 11px; color: #aaa; text-decoration: none; }
body.reset .back:hover { color: var(--accent); }


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE  (≤640px)  —  body.app only
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── BOTTOM NAV (hidden on desktop) ── */
#bottom-nav { display: none; }

/* ── MOBILE SUB-NAV (hidden on desktop) ── */
.mobile-subnav { display: none; }

@media (max-width: 900px) {

  /* Bottom nav */
  body.app #bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 58px;
    background: var(--ink);
    border-top: 1px solid #2a2a28;
    z-index: 200;
    align-items: stretch;
  }
  body.app #bottom-nav button {
    flex: 1;
    background: none;
    border: none;
    border-top: 2px solid transparent;
    color: #666;
    font-family: var(--font-mono);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
    transition: color 0.15s;
  }
  body.app #bottom-nav button.active {
    color: var(--accent-light);
    border-top-color: var(--accent);
  }
  body.app #bottom-nav .bnav-icon  { font-size: 17px; line-height: 1; }
  body.app #bottom-nav .bnav-label { font-size: 9px; letter-spacing: 0.05em; }

  /* Topbar — hide desktop nav, keep logo + logout */
  body.app #topbar           { overflow: hidden; }
  body.app #top-nav          { display: none !important; }
  body.app #topbar-user      { display: none; }
  body.app #admin-tools      { display: none !important; }
  body.app #topbar .logo     { border-right: none; }

  /* Push page content above the bottom nav, tighter horizontal padding */
  body.app .page-body        { padding: 10px 14px 72px; }

  /* Prevent grid children from overflowing their track */
  body.app .fg > *           { min-width: 0; }

  /* Prevent iOS auto-zoom on input focus (triggers when font-size < 16px) */
  body.app .field input,
  body.app .field select,
  body.app .field textarea   { font-size: 16px; }

  /* Collapse inline-style grids in modals to single column */
  body.app .modal-body > div[style*="grid"] { grid-template-columns: 1fr !important; }

  /* Constrain date inputs to a natural width */
  body.app .field input[type=date] { max-width: 160px; }

  /* Remove table min-width so they fit within cards on mobile */
  body.app table             { min-width: 0; }

  /* Constrain date inputs to a natural date-field width */
  body.app #sale-date        { max-width: 150px; }
  body.app .field input,
  body.app .field select     { max-width: 100%; }


  /* Page header — tighter on small screens */
  body.app .page-header      { padding: 10px 12px; }
  body.app .page-header h2   { font-size: 18px; }

  /* Hide desktop-only elements on mobile */
  body.app .mobile-hide      { display: none !important; }

  /* Small gap between stacked action buttons in table cells */
  body.app td .btn + .btn    { margin-top: 4px; }

  /* Mobile sub-nav (Products/Categories, Venues/Markets, Reports/Compare) */
  body.app .mobile-subnav {
    display: flex;
    background: var(--cream);
    border-bottom: 1px solid var(--rule);
  }
  body.app .mobile-subnav button {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 9px 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: #999;
    cursor: pointer;
  }
  body.app .mobile-subnav button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  /* Toast — above bottom nav */
  body.app #toast            { bottom: 68px; right: 10px; }

  /* Selection bar — above bottom nav */
  body.app #sel-bar          { bottom: 68px; }

  /* Modals — bottom sheet style */
  body.app .modal-overlay    { padding: 0; align-items: flex-end; }
  body.app .modal {
    max-width: 100%;
    margin-bottom: 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Compare — stack panels vertically */
  body.app .compare-layout               { flex-direction: column; }
  body.app .compare-panel + .compare-panel {
    border-left: none;
    border-top: 2px solid var(--rule);
  }

  /* Quick sale — 2-col grid, product search spans full width */
  body.app .quick-sale .fg { grid-template-columns: 1fr 1fr; }
  body.app .quick-sale .fg > :first-child { grid-column: 1 / -1; }
  /* Date | Price / Venue | Qty / Notes */
  body.app .quick-sale .fg > :nth-child(2) { order: 2; } /* Price  → right col, row 1 */
  body.app .quick-sale .fg > :nth-child(3) { order: 1; } /* Date   → left col,  row 1 */
  body.app .quick-sale .fg > :nth-child(4) { order: 3; } /* Venue  → left col,  row 2 */
  body.app .quick-sale .fg > :nth-child(5) { order: 4; } /* Qty    → right col, row 2 */
  body.app .quick-sale .fg > :nth-child(6) { order: 5; } /* Notes  → left col,  row 3 */

}
