﻿/* ============================================================
   Meto Tech — main.css  (VISUAL UPGRADE, drop-in replacement)
   ------------------------------------------------------------
   This is a SKIN-ONLY upgrade of the original main.css.
   - Same class names, same structure, same selectors.
   - No HTML/template/logic changes required (one exception:
     add the font <link> to base.html <head> — see README).
   - Safe to drop in over static/css/main.css.

   What changed vs. original (all visual):
   - Typeface: Hanken Grotesk for UI, JetBrains Mono for numbers
   - Tokens: softer borders, larger radius (8 -> 11px), refined muted
   - Body: subtle cyan radial wash on the near-black background
   - Sidebar active state: accent bar + cyan glow
   - Cards / stats / map: gradient surfaces + soft depth shadows
   - Buttons: gradient primary + lift on hover + focus rings
   - Inputs/selects: focus ring, custom chevron
   - Table: tighter type, cyan-tinted row hover
   - .score-chip promoted here (was inline in scrape/search.html)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #04080d;
  --surface:  rgba(255,255,255,.035);
  --surface2: rgba(255,255,255,.06);
  --border:   rgba(138,150,163,.16);
  --accent:   #00E5FF;
  --accent-rgb: 0,229,255;
  --accent-border: rgba(0,229,255,.36);
  --cream:    #ffffff;
  --muted:    #7d8a99;
  --success:  #22c55e;
  --danger:   #ef4444;
  --r:        11px;
  --font:     'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, monospace;
  --shadow-card: 0 1px 0 0 rgba(255,255,255,.04) inset, 0 24px 48px -32px rgba(0,0,0,.9);
  --shadow-pop:  0 12px 40px -12px rgba(0,0,0,.8);
}

html, body {
  background:
    radial-gradient(80% 60% at 50% -10%, rgba(0,229,255,.06), transparent 60%),
    radial-gradient(90% 70% at 100% 0%, rgba(0,229,255,.04), transparent 55%),
    #04080d;
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .78; }

/* Tabular figures for any numeric-heavy element */
.mono, .stat-value, .score-chip, .basket-item-price, .basket-total span { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* ── APP SHELL (sidebar layout) ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; flex-shrink: 0;
  background: linear-gradient(180deg, #070f17, #050a11);
  border-right: 1px solid rgba(138,150,163,.12);
  display: flex; flex-direction: column; justify-content: space-between;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; overflow-y: auto;
}
.sidebar-top { padding: 28px 20px 20px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; text-decoration: none; }
.sidebar-brand-mark { width: 26px; height: auto; flex-shrink: 0; }
.sidebar-brand-text { font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: -.03em; }
.sidebar-brand-accent { color: var(--accent); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-section-label { margin: 16px 10px 5px; color: #5a6672; font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px; position: relative;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  text-decoration: none; transition: background .15s, color .15s;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-link:hover { background: rgba(255,255,255,.04); color: var(--cream); opacity: 1; }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(0,229,255,.16), rgba(0,229,255,.04));
  color: #7df4ff;
  box-shadow: inset 0 0 0 1px rgba(0,229,255,.22);
}
.sidebar-link.active::before {
  content: ""; position: absolute; left: -20px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 12px 1px rgba(0,229,255,.7);
}
.sidebar-link-disabled { cursor: default; opacity: .42; }
.sidebar-link-disabled:hover { background: transparent; color: var(--muted); }

.sidebar-bottom { padding: 16px 20px 24px; border-top: 1px solid var(--border); }
.sidebar-biz {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r);
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid rgba(138,150,163,.16);
  box-shadow: 0 8px 24px -16px rgba(0,0,0,.9);
}
.sidebar-biz-icon { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(160deg,#0c2730,#08161d); box-shadow: inset 0 0 0 1px rgba(0,229,255,.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.sidebar-biz-icon img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-biz-icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-biz-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar-biz-name { font-size: .85rem; font-weight: 600; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-biz-sub  { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-logout { width: 100%; padding: 8px 0; border: none; background: none; color: var(--muted); font-size: .82rem; cursor: pointer; text-align: left; font-family: var(--font); transition: color .15s; }
.sidebar-logout:hover { color: var(--cream); }

.app-main { margin-left: 260px; flex: 1; min-width: 0; }

/* ── HAMBURGER / MOBILE TOPBAR ── */
.mobile-topbar { display: none; }
.hamburger { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; flex-shrink: 0; }
.hamburger svg { width: 20px; height: 20px; stroke: var(--cream); fill: none; stroke-width: 2; stroke-linecap: round; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 199; }

@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .app-main { margin-left: 0; }
  .hamburger { display: flex; }
  .mobile-topbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: rgba(4,8,13,.9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 90; }
  .mobile-topbar-title { font-size: .95rem; font-weight: 600; color: var(--cream); flex: 1; }
}

/* ── NAV (logged-out marketing) ── */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 32px; position: sticky; top: 0; background: rgba(4,8,13,.8); backdrop-filter: blur(10px); z-index: 100; }
.nav-brand { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 800; color: var(--cream); text-decoration: none; letter-spacing: -.02em; }
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--muted); font-size: .88rem; letter-spacing: .02em; }
.nav-links a:hover { color: var(--cream); opacity: 1; }

/* ── LAYOUT ── */
.container    { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.container-sm { max-width:  520px; margin: 0 auto; padding: 40px 24px; }
.container-xs { max-width:  420px; margin: 0 auto; padding: 40px 16px; }

/* ── MESSAGES ── */
.messages { padding: 0 24px; }
.message  { padding: 12px 16px; border-radius: var(--r); margin: 10px 0; font-size: .9rem; }
.message-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.message-error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.message-info    { background: rgba(var(--accent-rgb),.10); border: 1px solid rgba(var(--accent-rgb),.36); color: var(--accent); }

/* ── CARDS ── */
.card  {
  background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  border: 1px solid rgba(138,150,163,.14); border-radius: 14px; padding: 24px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 16px; }
.module-card-title { color: #6b7785; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 16px; }
.module-card-spaced { margin-bottom: 16px; }
.module-form-grid, .module-filter-grid { display: grid; gap: 12px; align-items: end; }
.module-form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.module-filter-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.module-stack-form { display: flex; flex-direction: column; gap: 12px; }
.form-group-compact { margin: 0; }
.form-group-wide { grid-column: 1 / -1; }
.module-action { height: 42px; }
.module-form-error { color: var(--danger); font-size: .85rem; margin-top: 12px; }
.module-empty { color: var(--muted); font-size: .9rem; padding: 12px 0; }
.module-muted { color: var(--muted); font-size: .9rem; }
.module-description { color: var(--muted); font-size: .9rem; line-height: 1.6; margin-top: 16px; }
.table-main-cell { font-weight: 600; }
.table-muted-cell { color: var(--muted); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .7rem; color: #6b7785; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: rgba(255,255,255,.04); border: 1px solid rgba(138,150,163,.2);
  border-radius: 10px; color: var(--cream); padding: 11px 14px; font-size: .95rem; font-family: var(--font);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.form-group select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='%237d8a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 15px; padding-right: 36px;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(0,229,255,.14); }
.form-group input[type="color"] { height: 42px; padding: 4px 8px; cursor: pointer; }
.form-group textarea { resize: vertical; min-height: 80px; }
.errorlist { list-style: none; color: #fca5a5; font-size: .82rem; margin-top: 4px; }
.helptext  { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px;
  font-size: .9rem; font-weight: 600; cursor: pointer; border: none; font-family: var(--font);
  text-decoration: none; letter-spacing: .005em; transition: transform .12s, box-shadow .18s, opacity .15s, border-color .15s, background .15s;
}
.btn:hover { opacity: 1; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg,#3df0ff,#00d2ec); color: #00181d; box-shadow: 0 8px 24px -10px rgba(0,229,255,.6), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-primary:hover { box-shadow: 0 12px 30px -10px rgba(0,229,255,.75), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-ghost   { background: rgba(255,255,255,.02); border: 1px solid rgba(138,150,163,.24); color: var(--cream); }
.btn-ghost:hover { border-color: var(--accent-border); color: #7df4ff; background: rgba(0,229,255,.05); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm      { padding: 6px 14px; font-size: .82rem; }
.btn-block   { width: 100%; justify-content: center; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 12px 12px; color: #65717f; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid rgba(138,150,163,.16); }
td { padding: 14px 12px; border-bottom: 1px solid rgba(138,150,163,.08); vertical-align: middle; transition: background .12s; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,229,255,.045); }

/* ── INTERVENTIONS TABLE SCROLL ── */
.table-scroll { overflow: auto; max-height: calc(100vh - 280px); cursor: grab; }
.table-scroll.dragging { cursor: grabbing; user-select: none; }
.table-scroll thead th { background: #060d14; position: sticky; top: 0; z-index: 3; }
.tr-new td { position: sticky; top: 41px; z-index: 2; background: #060d14; border-bottom: 1px solid var(--border); }
.tr-new { cursor: pointer; }
.tr-new td { color: var(--muted); font-size: .82rem; padding: 10px 14px; transition: color .15s; }
.tr-new:hover td { color: var(--accent); }
.tr-new-inner { display: inline-flex; align-items: center; gap: 6px; }
.td-act { width: 36px; text-align: center; padding: 0 8px !important; }
.act-plus { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); width: 24px; height: 24px; font-size: 1rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, color .15s; font-family: var(--font); }
.act-plus:hover { border-color: var(--accent); color: var(--accent); }

/* ── SORTABLE TABLE HEADERS ── */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.th-sort:hover { color: var(--cream); opacity: 1; }
.th-sort-icon { opacity: .4; font-size: .8em; }
.th-sort-icon::after { content: "↕"; }
.th-sort.asc .th-sort-icon::after { content: "↑"; opacity: 1; }
.th-sort.desc .th-sort-icon::after { content: "↓"; opacity: 1; }
.th-sort.asc .th-sort-icon, .th-sort.desc .th-sort-icon { opacity: 1; color: var(--accent); }

/* ── SCORE CHIP (promoted from scrape/search.html inline <style>) ── */
.score-chip { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: .8rem; font-weight: 700; min-width: 38px; text-align: center; }
.score-high { background: rgba(34,197,94,.16); color: #4ade80; box-shadow: inset 0 0 0 1px rgba(34,197,94,.35); }
.score-mid  { background: rgba(234,179,8,.14); color: #fbbf24; box-shadow: inset 0 0 0 1px rgba(234,179,8,.32); }
.score-low  { background: rgba(239,68,68,.14); color: #f87171; box-shadow: inset 0 0 0 1px rgba(239,68,68,.32); }
.maps-link  { font-size: .75rem; color: #5fd8e6; border-bottom: 1px solid transparent; }
.maps-link:hover { border-bottom-color: rgba(0,229,255,.5); opacity: 1; }
.result-num { color: #555; font-size: .8rem; font-variant-numeric: tabular-nums; width: 32px; text-align: right; }

/* ── SEARCH ── */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input { flex: 1; background: rgba(255,255,255,.04); border: 1px solid rgba(138,150,163,.2); border-radius: 10px; color: var(--cream); padding: 10px 14px; font-size: .9rem; outline: none; transition: border-color .18s, box-shadow .18s; }
.search-bar input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(0,229,255,.14); }

/* ── FILTER TOOLBAR ── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar-search { position: relative; flex: 1; min-width: 180px; }
.toolbar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.toolbar-search input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 8px 34px; color: var(--cream); font-size: .84rem; font-family: var(--font); outline: none; transition: border-color .15s, box-shadow .15s; }
.toolbar-search input::placeholder { color: var(--muted); }
.toolbar-search input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(0,229,255,.12); }
.filter-select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='%237d8a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 14px; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 32px 8px 12px; color: var(--cream); font-size: .84rem; font-family: var(--font);
  cursor: pointer; outline: none; transition: border-color .15s; white-space: nowrap; min-width: 160px;
}
.filter-select:focus { border-color: var(--accent-border); }
.filter-select option { background: #0d1520; }

/* ── SEARCH WRAP (mockup class names) ── */
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.search-input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 8px 34px; color: var(--cream); font-size: .84rem; font-family: var(--font); outline: none; transition: border-color .15s, box-shadow .15s; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(0,229,255,.12); }

/* ── CSEL — native select styled to match mockup custom select ── */
.csel { position: relative; min-width: 160px; }
.csel select { width: 100%; background: var(--surface) url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='%237d8a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center; background-size: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 32px 8px 12px; color: var(--cream); font-size: .84rem; font-family: var(--font); cursor: pointer; appearance: none; -webkit-appearance: none; outline: none; transition: border-color .15s; }
.csel select:focus { border-color: var(--accent-border); }
.csel select option { background: #0d1520; }

/* ── TABS (mockup class names) ── */
.tabs-wrap { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab-btn { padding: 8px 16px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: .84rem; font-weight: 500; cursor: pointer; font-family: var(--font); margin-bottom: -1px; transition: color .15s, border-color .15s; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.tab-btn:hover { color: var(--cream); opacity: 1; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { display: inline-block; padding: 1px 6px; border-radius: 100px; font-size: .68rem; font-weight: 600; background: var(--surface2); color: var(--muted); margin-left: 5px; }
.tab-btn.active .tab-count { background: rgba(var(--accent-rgb),.15); color: var(--accent); }
.tabs-lock-btn { height: 30px; min-width: 30px; border: 1px solid var(--border); border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; flex-shrink: 0; transition: color .15s, border-color .15s; padding: 0 8px; }
.tabs-lock-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── STATS ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat  { background: linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.012)); border: 1px solid rgba(138,150,163,.14); border-radius: 14px; padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 24px 48px -34px rgba(0,0,0,.9); }
.stat-header { display: flex; align-items: center; gap: 10px; }
.stat-icon { width: 36px; height: 36px; border-radius: 9px; background: rgba(var(--accent-rgb), .1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,229,255,.16); }
.stat-icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-label { font-size: .72rem; color: #6b7785; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { font-size: 2.1rem; font-weight: 700; line-height: 1; background: linear-gradient(180deg,#9defff,#00d2ec); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-trend { font-size: .78rem; display: flex; align-items: center; gap: 4px; }
.stat-trend-up   { color: #22c55e; }
.stat-trend-down { color: #ef4444; }
.stat-trend-flat { color: var(--muted); }
.stat-trend span { color: var(--muted); }
.stat-sub { font-size: .74rem; color: var(--muted); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { font-size: 1rem; font-weight: 600; }

/* ── STAMP GRID ── */
.stamps-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.stamp { width: 46px; height: 46px; border-radius: 50%; border: 2px solid; display: flex; align-items: center; transform: translateZ(0); justify-content: center; font-size: .95rem; font-weight: 600; }
.stamp-filled { background: var(--accent); border-color: var(--accent); color: #001015; box-shadow: 0 0 14px -2px rgba(0,229,255,.6); }
.stamp-empty  { background: transparent; border-color: var(--border); color: var(--muted); }

/* ── PROGRESS ── */
.progress { background: var(--surface2); border-radius: 100px; height: 8px; overflow: hidden; margin: 8px 0; transform: translateZ(0); }
.progress-bar { height: 100%; background: linear-gradient(90deg,#00d2ec,#3df0ff); border-radius: 100px; transition: width .4s ease; }

/* ── BADGE ── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.badge-green  { background: rgba(34,197,94,.15);  color: #86efac; }
.badge-red    { background: rgba(239,68,68,.15);   color: #fca5a5; }
.badge-yellow { background: rgba(245,158,11,.15);  color: #fcd34d; }
.badge-gray   { background: rgba(148,163,184,.12); color: #94a3b8; }
.badge-gold   { background: rgba(var(--accent-rgb),.12); color: var(--accent); }
.badge-cyan   { background: rgba(var(--accent-rgb),.12); color: var(--accent); }
.badge-muted  { background: rgba(138,150,163,.12); color: var(--muted); }

/* ── QR BOX ── */
.qr-box { background: #fff; display: inline-block; padding: 10px; border-radius: var(--r); }
.qr-box img { display: block; width: 150px; height: 150px; }

/* ── LOYALTY CARD (customer-facing) ── */
.loyalty-card-wrap { max-width: 400px; margin: 0 auto; background: linear-gradient(165deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid rgba(138,150,163,.16); border-radius: 18px; padding: 32px 28px; text-align: center; position: relative; overflow: hidden; box-shadow: var(--shadow-card); }
.loyalty-card-wrap--image { background: var(--surface); }
.loyalty-card-wrap--image::before { content: ''; position: absolute; inset: 0; background-image: var(--card-bg); background-size: cover; background-position: center; opacity: .22; z-index: 0; }
.loyalty-card-wrap--image > * { position: relative; z-index: 1; }
.loyalty-card-brand { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.loyalty-card-member { font-size: .85rem; color: var(--muted); margin-bottom: 24px; }
.loyalty-card-reward { background: var(--surface2); border-radius: var(--r); padding: 12px 16px; font-size: .9rem; color: var(--cream); margin: 16px 0; }
.wallet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.wallet-btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border-radius: var(--r); background: #fff; color: #1a1a1a; font-weight: 600; font-size: .9rem; text-decoration: none; border: none; cursor: pointer; width: 100%; }
.wallet-btn-apple { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border-radius: var(--r); background: #000; color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none; border: 1px solid #333; cursor: pointer; width: 100%; }

/* ── HERO ── */
.hero { padding: 100px 24px 80px; text-align: center; max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem,5vw,3.4rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--muted); font-size: 1.05rem; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── SETTINGS ── */
.settings-wrap { padding: 36px 32px; max-width: 760px; }
.settings-header { margin-bottom: 28px; }
.settings-header h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.settings-header p  { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.settings-tabs { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.settings-tab { padding: 9px 18px; font-size: .88rem; font-weight: 500; border-radius: var(--r) var(--r) 0 0; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.settings-tab:hover { color: var(--cream); opacity: 1; }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.settings-section { margin-bottom: 28px; }
.settings-section-title { font-size: .72rem; font-weight: 600; color: #6b7785; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }

/* ── PAGE HEADER (module pages) ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.page-header p { color: var(--muted); font-size: .88rem; margin-top: 4px; }

/* ── DASHBOARD GRID ── */
.dashboard-wrap { padding: 36px 32px; }
.dashboard-greeting { margin-bottom: 28px; }
.dashboard-greeting h1 { font-size: 1.7rem; font-weight: 800; line-height: 1.2; letter-spacing: -.03em; }
.dashboard-greeting p  { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.dashboard-lower { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }

.chart-card { background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); border: 1px solid rgba(138,150,163,.14); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-card); }
.chart-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.chart-card-header h2 { font-size: .95rem; font-weight: 600; }
.chart-wrap { position: relative; height: 220px; }

.activity-card { background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); border: 1px solid rgba(138,150,163,.14); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-card); }
.activity-card h2 { font-size: .95rem; font-weight: 600; margin-bottom: 16px; }
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--surface2); display: flex; align-items: center; justify-content: center; transform: translateZ(0); }
.activity-icon svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.activity-icon--redeem svg { stroke: #f59e0b; }
.activity-icon--remove svg { stroke: #ef4444; }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: .85rem; font-weight: 500; color: var(--cream); }
.activity-sub   { font-size: .78rem; color: var(--muted); }
.activity-time  { font-size: .75rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1000px) { .dashboard-lower { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .dashboard-wrap { padding: 20px 16px; } }

/* ── DASHBOARD ALERTS ── */
.dashboard-alerts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.alert-card { background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); border: 1px solid rgba(138,150,163,.14); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow-card); }
.alert-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.alert-card-title { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--cream); }
.alert-card-sub { font-size: .75rem; color: var(--muted); }
.alert-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.alert-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: none; }
.alert-item-name { font-size: .85rem; font-weight: 500; color: var(--accent); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-item-name:hover { opacity: .75; }
.alert-progress { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.alert-pips { display: flex; gap: 3px; }
.alert-pip { width: 10px; height: 10px; border-radius: 50%; background: var(--border); border: 1px solid rgba(138,150,163,.3); }
.alert-pip--filled { background: var(--accent); border-color: var(--accent); }
.alert-remaining { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.alert-last-visit { font-size: .78rem; color: #f59e0b; white-space: nowrap; flex-shrink: 0; }
.alert-empty { font-size: .85rem; color: var(--muted); padding: 8px 0; }
@media (max-width: 900px) { .dashboard-alerts { grid-template-columns: 1fr; } }

/* ── POS GRID ── */
.pos-wrap      { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.pos-grid      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; background: var(--border); border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.pos-tile      { position: relative; background: var(--surface2); border: none; color: var(--cream); cursor: pointer; padding: 20px 14px; text-align: left; transition: background .15s; min-height: 90px; display: flex; flex-direction: column; justify-content: space-between; font-family: var(--font); }
.pos-tile:hover { background: rgba(255,255,255,.1); }
.pos-tile--active { background: rgba(0,229,255,.12); outline: 2px solid var(--accent); outline-offset: -2px; }
.pos-tile-name  { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.pos-tile-price { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.pos-tile-badge { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #001015; border-radius: 100px; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.pos-header    { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pos-header p  { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.basket-panel  { background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); border: 1px solid rgba(138,150,163,.14); border-radius: 14px; position: sticky; top: 20px; overflow: hidden; box-shadow: var(--shadow-card); }
.basket-head   { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.basket-head p { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.basket-items  { padding: 12px 18px; min-height: 120px; max-height: 280px; overflow-y: auto; }
.basket-item   { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(138,150,163,.1); }
.basket-item:last-child { border-bottom: none; }
.basket-item-name  { flex: 1; font-size: .88rem; }
.basket-item-qty   { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.basket-item-price { font-size: .88rem; font-weight: 500; color: var(--accent); white-space: nowrap; }
.basket-item-rm    { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.basket-item-rm:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.basket-empty  { padding: 24px 18px; color: var(--muted); font-size: .85rem; text-align: center; }
.basket-footer { padding: 14px 18px; border-top: 1px solid var(--border); background: rgba(255,255,255,.02); }
.basket-total  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 700; font-size: 1.05rem; }
.basket-total span { color: var(--accent); }
@media (max-width: 700px) { .pos-wrap { grid-template-columns: 1fr; } .basket-panel { position: static; } .pos-grid { grid-template-columns: repeat(2,1fr); } }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(138,150,163,.22); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,229,255,.3); background-clip: content-box; }

/* ── NAV HAMBURGER ── */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; flex-direction: column; gap: 5px; flex-shrink: 0; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--cream); border-radius: 2px; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .nav { padding: 12px 16px; position: relative; flex-wrap: wrap; }
  .nav-toggle { display: flex; }
  .nav-links { display: none; flex-direction: column; align-items: flex-start; gap: 18px; width: 100%; padding: 16px 0 8px; border-top: 1px solid var(--border); margin-top: 12px; }
  .nav.nav-open .nav-links { display: flex; }
  .container { padding: 24px 16px; }
  .card { padding: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .settings-wrap { padding: 20px 16px; }
  .section-header { flex-wrap: wrap; gap: 8px; }
}

/* ── PANEL MAP (hide on mobile — sidebar hamburger provides nav) ── */
@media (max-width: 768px) { .panel-map-card { display: none !important; } }

/* ── TABLE SCROLL HINT (visible scrollbar on mobile) ── */
@media (max-width: 768px) {
  .table-wrap::-webkit-scrollbar, .table-scroll::-webkit-scrollbar { height: 4px; }
  .table-wrap::-webkit-scrollbar-track, .table-scroll::-webkit-scrollbar-track { background: var(--surface); border-radius: 4px; }
  .table-wrap::-webkit-scrollbar-thumb, .table-scroll::-webkit-scrollbar-thumb { background: var(--accent-border); border-radius: 4px; }
  .table-wrap, .table-scroll { padding-bottom: 6px; }
}

/* date inputs must keep native picker UI */
input[type="date"].filter-select { appearance: auto; -webkit-appearance: auto; background-image: none; }

/* ── SETTINGS SECTIONS ── */
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 20px; overflow: hidden; }
.settings-section-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.settings-section-icon { width: 30px; height: 30px; border-radius: 7px; background: rgba(0,229,255,.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-section-icon svg { width: 14px; height: 14px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-section-title { font-size: .92rem; font-weight: 600; }
.settings-section-sub { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.settings-body { padding: 18px 22px; }

/* ── TOGGLE SWITCH ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; min-width: 0; }
.toggle-title { font-size: .86rem; font-weight: 500; }
.toggle-sub { font-size: .76rem; color: var(--muted); margin-top: 1px; }
.toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; inset: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 100px; transition: background .2s, border-color .2s; }
.toggle input:checked + .toggle-track { background: rgba(0,229,255,.18); border-color: var(--accent); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--muted); border-radius: 50%; transition: transform .2s, background .2s; pointer-events: none; }
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); background: var(--accent); }

/* ── SETTINGS TEAM ROWS ── */
.settings-team-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.settings-team-row:last-child { border-bottom: none; }
.settings-team-avatar { width: 34px; height: 34px; border-radius: 8px; background: rgba(0,229,255,.1); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; text-transform: uppercase; }
.settings-team-info { flex: 1; min-width: 0; }
.settings-team-name { font-size: .86rem; font-weight: 500; }
.settings-team-role { font-size: .75rem; color: var(--muted); }

/* ── EXPORT GRID ── */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.export-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.export-card-title { font-size: .86rem; font-weight: 600; }
.export-card-sub { font-size: .76rem; color: var(--muted); }

/* ── VERSION BADGE ── */
.version-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 100px; font-size: .74rem; color: var(--muted); }
.version-badge strong { color: var(--cream); }

/* ── BTN DANGER ── */
.btn-danger { background: transparent; border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.7); }

/* ── ADD FORM TOGGLE (shared) ── */
.add-form-toggle { display: none; }
.add-form-toggle.open { display: block; }

/* ── MOBILE BOTTOM NAV ── */
.m-nav { display: none; }

@media (max-width: 768px) {
  .m-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #0d1520; border-top: 1px solid rgba(138,150,163,.15);
    z-index: 100; padding: 0 0 env(safe-area-inset-bottom);
  }
  .m-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px 4px 6px; text-decoration: none; color: var(--muted); font-size: .62rem; gap: 4px;
  }
  .m-nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .m-nav-active { color: var(--accent); }
  .m-nav-active svg { stroke: var(--accent); }

  .app-main main { padding-bottom: 70px; }

  .m-list { display: flex; flex-direction: column; }
  .m-row {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    border-bottom: 1px solid var(--border); text-decoration: none;
    transition: background .12s;
  }
  .m-row:hover { background: rgba(0,229,255,.04); }
  .m-row:last-child { border-bottom: none; }
  .m-row-icon {
    width: 40px; height: 40px; border-radius: 10px; background: var(--surface2);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .m-row-icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.5; }
  .m-row-body { flex: 1; min-width: 0; }
  .m-row-name { font-size: .9rem; font-weight: 600; color: var(--cream); }
  .m-row-sub { font-size: .76rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
  .m-chevron { color: var(--muted); }
  .m-chevron svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

  .m-section-label {
    font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); padding: 16px 0 6px;
  }

  .m-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
  .m-back {
    display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 9px; background: var(--surface); border: 1px solid var(--border);
    text-decoration: none; color: var(--cream); flex-shrink: 0;
  }
  .m-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
  .m-detail-ref { flex: 1; font-size: .78rem; font-family: monospace; color: var(--muted); }

  .m-info-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 16px; margin-bottom: 12px;
  }
  .m-info-name { font-size: 1.2rem; font-weight: 700; color: var(--cream); margin-bottom: 4px; }
  .m-info-row {
    display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted);
    padding: 6px 0; border-top: 1px solid var(--border);
  }
  .m-info-row svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; flex-shrink: 0; }
  .m-info-row a { color: var(--accent); text-decoration: none; }

  .m-section { margin-bottom: 12px; }

  .m-cta-wrap {
    position: fixed; bottom: 56px; left: 0; right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, #0a0f1a 60%, transparent);
    z-index: 50;
  }
  .m-cta {
    display: block; width: 100%; padding: 14px;
    background: var(--accent); color: #000; font-weight: 700; font-size: .9rem; font-family: var(--font);
    border-radius: 12px; text-align: center; text-decoration: none; border: none; cursor: pointer;
  }

  .m-search-wrap {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 10px 14px; margin-bottom: 14px;
  }
  .m-search-wrap svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; flex-shrink: 0; }
  .m-search-wrap input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--cream); font-size: .9rem; font-family: var(--font);
  }
  .m-search-wrap input::placeholder { color: var(--muted); }
  .m-search-wrap .csel { border: none; background: none; min-width: 0; }
  .m-search-wrap .csel select { background-color: transparent; border: none; padding-right: 24px; font-size: .82rem; }

  .tabs-wrap { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs-wrap::-webkit-scrollbar { display: none; }
  .tabs { white-space: nowrap; }

  .dashboard-lower { grid-template-columns: 1fr; }
  .dashboard-alerts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-wrap { padding: 20px 16px; }

  .toolbar { display: none; }
  .toolbar.m-show { display: flex; }

  .page-header h1 { font-size: 1.2rem; }
  .grid-2 { grid-template-columns: 1fr; }
  input, textarea, select { font-size: 16px; }
}

/* ── STATUS DOT ── */
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; margin-top: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.4); }
.dot-muted { background: var(--muted); }

/* ── PAGE HEADER ── */
.page-header-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 4px; }
.page-subtitle { font-size: .85rem; color: var(--muted); margin: 0; }
.header-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; border: 1px solid transparent; }
.status-pill svg { width: 12px; height: 12px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status-pill-green { background: rgba(34,197,94,.1); color: #22c55e; border-color: rgba(34,197,94,.2); }
.status-pill-live { background: rgba(0,229,255,.1); color: var(--accent); border-color: var(--accent-border); }

/* ── STATS 4-COL ── */
.stats-4 { grid-template-columns: repeat(4, 1fr) !important; }
.stat-sub { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.stat-val-green { color: #22c55e; }
.stat-val-muted { color: var(--muted); }

/* ── MODULE CARDS ── */
.modules-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.module-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.module-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.module-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; }
.module-icon svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.module-icon-sm { width: 26px !important; height: 26px !important; border-radius: 7px !important; }
.module-icon-sm svg { width: 13px !important; height: 13px !important; }
.module-icon-core { background: #3b82f6; }
.module-icon-loyalty { background: #8b5cf6; }
.module-icon-interventions { background: #10b981; }
.module-icon-scrape { background: #64748b; }
.module-icon-business { background: #f59e0b; }
.module-icon-inventory { background: #0ea5e9; }
.module-icon-ugc_gen { background: #ec4899; }
.module-badge { font-size: .67rem; font-weight: 700; letter-spacing: .05em; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; white-space: nowrap; }
.module-badge-active { background: rgba(34,197,94,.15); color: #22c55e; }
.module-badge-core { background: rgba(0,229,255,.12); color: var(--accent); }
.module-badge-available { background: rgba(100,116,139,.15); color: #94a3b8; }
.module-card-name { font-size: .95rem; font-weight: 700; color: var(--cream); margin: 0; }
.module-card-desc { font-size: .8rem; color: var(--muted); line-height: 1.5; margin: 0; flex: 1; }
.module-card-access { font-size: .76rem; display: flex; align-items: center; gap: 5px; margin: 0; }
.module-card-access svg { width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.module-card-access.access-ok { color: #22c55e; }
.module-card-access.access-lock { color: var(--muted); }
.module-card-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ── ACCESS TABLE ── */
.page-chip { display: inline-flex; padding: 2px 7px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.tbl-status { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; }
.tbl-status-active { color: #22c55e; }
.tbl-status-core { color: var(--accent); }
.tbl-status-locked { color: var(--muted); }
.tbl-access { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; }
.tbl-access-full { color: #22c55e; }
.tbl-access-none { color: var(--muted); }
.dot-sm { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-cyan { background: var(--accent); }

/* ── ACTIVITY PAGE ── */
.activity-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.activity-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.activity-search svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.activity-search input { background: none; border: none; outline: none; color: var(--cream); font-size: .83rem; width: 100%; }
.activity-search input::placeholder { color: var(--muted); }
.activity-search-kbd { font-size: .68rem; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; white-space: nowrap; flex-shrink: 0; }
.activity-count-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.activity-count-label { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--muted); }
.activity-count-label svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.activity-sync { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.activity-sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); flex-shrink: 0; animation: sync-pulse 2s infinite; }
@keyframes sync-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.event-category { display: inline-flex; align-items: center; gap: 6px; }
.event-cat-icon { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.event-cat-icon svg { width: 13px; height: 13px; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.event-cat-module { background: rgba(0,229,255,.1); }
.event-cat-module svg { stroke: var(--accent); }
.event-cat-billing { background: rgba(139,92,246,.15); }
.event-cat-billing svg { stroke: #8b5cf6; }
.event-cat-default { background: rgba(100,116,139,.15); }
.event-cat-default svg { stroke: #94a3b8; }
.event-action { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; }
.event-action-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.event-action-enabled { color: #22c55e; }
.event-action-enabled .event-action-dot { background: #22c55e; }
.event-action-disabled { color: #ef4444; }
.event-action-disabled .event-action-dot { background: #ef4444; }
.event-action-neutral { color: var(--accent); }
.event-actor { display: inline-flex; align-items: center; gap: 6px; }
.event-actor-avatar { width: 24px; height: 24px; border-radius: 6px; background: rgba(0,229,255,.1); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.event-source { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--muted); }
.event-source svg { width: 13px; height: 13px; stroke: var(--muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── RESPONSIVE (modules + activity) ── */
@media (max-width: 1200px) {
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-4 { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
  .modules-grid { grid-template-columns: 1fr; }
  .stats-4 { grid-template-columns: 1fr !important; }
  .activity-filter-bar { flex-direction: column; align-items: stretch; }
  .activity-search { width: 100%; }
}

/* ── MEMBER META GRID ── */
.member-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.meta-item { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.meta-label { font-size: .7rem; color: var(--muted); margin-bottom: 2px; }
.meta-val { font-size: 1rem; font-weight: 700; color: var(--cream); }

/* ── SKILL TAGS ── */
.member-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; min-height: 0; }
.skill-tag { padding: 3px 10px; background: rgba(0,229,255,.07); border: 1px solid rgba(0,229,255,.18); border-radius: 100px; font-size: .72rem; color: var(--accent); }

/* ── INACTIVE FILTER BAR ── */
.inactive-bar { display: flex; align-items: center; gap: 10px; background: rgba(245,158,11,.07); border: 1px solid rgba(245,158,11,.25); border-radius: var(--r); padding: 10px 16px; margin-bottom: 14px; font-size: .83rem; color: var(--muted); }
.inactive-bar strong { color: #fbbf24; }

/* ── REPORT PREVIEW MODAL ── */
.rpt-preview-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 600; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.rpt-preview-backdrop.open { opacity: 1; pointer-events: all; }
.rpt-preview-modal { background: #fff; color: #111; border-radius: var(--r); width: 620px; max-width: calc(100vw - 32px); max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; }
.rpt-preview-paper { padding: 40px; flex: 1; }
.rpt-preview-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid #e5e7eb; background: #f9fafb; border-radius: 0 0 var(--r) var(--r); }
.pt-header { border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; }
.pt-logo { font-size: 17px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: #111; }
.pt-type { font-size: 11px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: .05em; }
.pt-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; background: #f5f5f5; border-radius: 6px; padding: 14px 18px; margin-bottom: 24px; }
.pt-field { font-size: 13px; line-height: 1.7; color: #111; }
.pt-field strong { display: inline-block; width: 110px; font-weight: 600; }
.pt-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #888; margin-bottom: 10px; }
.pt-notes { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; margin-bottom: 32px; }
.pt-notes li { font-size: 13px; line-height: 1.65; padding: 10px 14px; border-left: 3px solid #111; background: #fafafa; }
.pt-signature { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 36px; }
.pt-sig-box { border-top: 1px solid #111; padding-top: 8px; font-size: 11px; color: #666; }
.pt-footer { margin-top: 24px; border-top: 1px solid #ddd; padding-top: 12px; display: flex; justify-content: space-between; font-size: 11px; color: #aaa; }

/* ── PLANNING CALENDAR ── */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-nav-left { display: flex; align-items: center; gap: 10px; }
.cal-nav-right { display: flex; align-items: center; gap: 8px; }
.cal-week-label { font-size: .9rem; font-weight: 600; color: var(--cream); min-width: 180px; text-align: center; }
.cal-arrow { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border); color: var(--muted); text-decoration: none; transition: border-color .15s, color .15s; }
.cal-arrow:hover { border-color: var(--accent); color: var(--accent); }
.cal-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.csel-inline { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--cream); font-size: .82rem; padding: 5px 10px; font-family: var(--font); cursor: pointer; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.cal-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.cal-outer { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal-head-row { display: grid; grid-template-columns: 48px repeat(5, 1fr); border-bottom: 1px solid var(--border); background: var(--surface); }
.cal-gutter-head { height: 52px; border-right: 1px solid var(--border); }
.cal-col-head { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-left: 1px solid var(--border); }
.cal-col-name { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal-col-date { font-size: 1rem; font-weight: 700; color: var(--cream); }
.cal-col-today .cal-col-name { color: var(--accent); }
.cal-col-today .cal-col-date { color: var(--accent); }
.cal-today-chip { font-size: .6rem; font-weight: 700; background: var(--accent); color: #000; padding: 1px 6px; border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; }
.cal-scroll { max-height: 620px; overflow-y: auto; }
.cal-body-grid { display: grid; grid-template-columns: 48px repeat(5, 1fr); }
.cal-gutter-body { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.cal-gutter-cell { height: 60px; flex-shrink: 0; display: flex; align-items: flex-start; justify-content: flex-end; padding: 4px 8px 0 0; font-size: .68rem; color: var(--muted); }
.cal-col-body { position: relative; border-left: 1px solid var(--border); }
.cal-hour-line { height: 60px; border-bottom: 1px solid rgba(138,150,163,.1); }
.cal-event { position: absolute; left: 4px; right: 4px; border-left: 3px solid; border-radius: 6px; padding: 5px 7px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; overflow: hidden; transition: filter .15s; }
.cal-event:hover { filter: brightness(1.15); }
.cal-event-title { font-size: .75rem; font-weight: 600; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-event-sub { font-size: .68rem; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Day strip — mobile only */
.cal-day-strip { display: none; gap: 6px; margin-bottom: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cal-day-strip::-webkit-scrollbar { display: none; }
.cal-day-pill { display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; cursor: pointer; flex-shrink: 0; transition: border-color .15s; }
.cal-day-pill-name { font-size: .65rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal-day-pill-num { font-size: .95rem; font-weight: 700; color: var(--cream); }
.cal-day-pill-today .cal-day-pill-name, .cal-day-pill-today .cal-day-pill-num { color: var(--accent); }
.cal-day-pill-active { border-color: var(--accent); background: rgba(0,229,255,.08); }
.cal-day-pill-active .cal-day-pill-name, .cal-day-pill-active .cal-day-pill-num { color: var(--accent); }

@media (max-width: 768px) {
  .cal-day-strip { display: flex; }
  .cal-head-row { display: none; }
  .cal-body-grid { grid-template-columns: 36px 1fr; }
  .cal-col-body { display: none; }
  .cal-col-body.cal-day-active { display: block; }
  .cal-gutter-cell { font-size: .6rem; padding-right: 4px; }
  .cal-event-title { white-space: normal; font-size: .82rem; }
  .cal-event-sub { font-size: .76rem; }
  .cal-event { left: 6px; right: 6px; padding: 8px 10px; }
  .cal-scroll { max-height: calc(100vh - 340px); }
}

/* ── Reports module ─────────────────────────────────────────── */
.rpt-list { display: flex; flex-direction: column; gap: 10px; }
.rpt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; display: flex; align-items: center; gap: 16px; transition: background .12s; }
.rpt-card:hover { background: var(--surface2); }
.rpt-icon { width: 40px; height: 48px; background: rgba(0,210,200,.08); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rpt-icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rpt-info { flex: 1; min-width: 0; }
.rpt-id { font-size: .72rem; color: var(--muted); font-family: monospace; }
.rpt-title { font-size: .9rem; font-weight: 600; color: var(--cream); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpt-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.rpt-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.add-form-toggle { display: none; }
.add-form-toggle.open { display: block; }
@media (max-width: 768px) {
  .rpt-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .rpt-icon { display: none; }
  .rpt-info { width: 100%; }
  .rpt-title { white-space: normal; }
  .rpt-actions { width: 100%; flex-wrap: wrap; }
}
@media (min-width: 769px) and (max-width: 900px) { .cal-head-row, .cal-body-grid { grid-template-columns: 36px repeat(5, 1fr); } .cal-gutter-cell { font-size: .6rem; padding-right: 4px; } }
