:root {
  --bg: #090c0b;
  --surface: #101512;
  --surface-2: #151b17;
  --surface-3: #1b231e;
  --line: rgba(255,255,255,.08);
  --text: #f1f5ee;
  --muted: #91a095;
  --accent: #c8ff68;
  --accent-2: #d9ff91;
  --danger: #ff7a7a;
  --warning: #ffc766;
  --success: #8ce7a0;
  --shadow: 0 22px 60px rgba(0,0,0,.32);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 258px;
}

/* V2 viewport lock */
html, body { width:100%; max-width:100%; overflow-x:hidden; }
body { overscroll-behavior-x:none; }
.app-shell, .main, .content { width:100%; min-width:0; max-width:100%; overflow-x:clip; }
.grid > *, .panel, .hero-card, .stat-card, .membership-card, .transaction, .qr-panel, .timeline-item { min-width:0; }
.table-wrap { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }


* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% -10%, rgba(200,255,104,.10), transparent 34%),
    radial-gradient(circle at -10% 80%, rgba(111,180,113,.08), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 24px 18px;
  border-right: 1px solid var(--line); background: rgba(9,12,11,.92); backdrop-filter: blur(16px); z-index: 20;
  display: flex; flex-direction: column; gap: 22px;
}
.brand-block { display: flex; gap: 12px; align-items: center; padding: 8px 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); display: grid; gap: 4px; padding: 8px; }
.brand-mark span { display: block; background: #0c100d; border-radius: 4px; }
.brand-mark span:nth-child(1) { height: 4px; align-self: end; }
.brand-mark span:nth-child(2) { height: 4px; }
.brand-mark span:nth-child(3) { height: 4px; align-self: start; }
.brand-block strong { font-family: Manrope, sans-serif; font-size: 15px; letter-spacing: .08em; display: block; }
.brand-block small { color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.nav { display: grid; gap: 6px; }
.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 12px 13px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav button:hover, .nav button.active { color: var(--text); background: rgba(255,255,255,.05); }
.nav .nav-dot { width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.65; }
.sidebar-foot { margin-top:auto; display:grid; gap:10px; }
.mini-profile { display:flex; align-items:center; gap:10px; padding:10px; }
.mini-profile strong { font-size:13px; display:block; }
.mini-profile span { color:var(--muted); font-size:10px; letter-spacing:.12em; }
.avatar { width:36px; height:36px; display:grid; place-items:center; border-radius:12px; background: linear-gradient(145deg,#c9ff69,#75b64e); color:#0e140e; font-weight:800; }
.avatar.sm { width:31px; height:31px; border-radius:10px; font-size:12px; }

.main { margin-left: var(--sidebar); min-height:100vh; }
.topbar {
  min-height:92px; padding: 20px 34px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; background:rgba(9,12,11,.76); backdrop-filter: blur(18px); z-index:10;
}
.topbar-title .eyebrow { margin-bottom:2px; }
.eyebrow { color:var(--accent); font-size:10px; letter-spacing:.16em; font-weight:700; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { font-family:Manrope, sans-serif; }
h1 { font-size:26px; letter-spacing:-.03em; }
h2 { font-size:21px; }
h3 { font-size:16px; }
.topbar-actions { display:flex; gap:8px; align-items:center; }
.icon-btn, .profile-chip { border:1px solid var(--line); background:rgba(255,255,255,.03); color:var(--text); border-radius:12px; min-height:42px; }
.icon-btn { width:42px; display:grid; place-items:center; font-size:18px; }
.profile-chip { padding:5px 8px; display:flex; align-items:center; gap:8px; }

.content { padding:34px; max-width:1500px; margin:0 auto; }
.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.hero-card {
  border:1px solid var(--line); border-radius:var(--radius-xl); background:linear-gradient(150deg, rgba(200,255,104,.12), rgba(255,255,255,.025) 45%, rgba(255,255,255,.015));
  padding:28px; box-shadow: var(--shadow); overflow:hidden; position:relative;
}
.hero-card::after { content:""; position:absolute; width:300px; height:300px; border-radius:50%; background:rgba(200,255,104,.09); filter:blur(10px); right:-120px; top:-160px; }
.hero-card .actions { position:relative; z-index:1; }
.hero-copy { max-width:630px; }
.hero-copy h2 { font-size:38px; margin:7px 0 10px; line-height:1.04; }
.hero-copy p { color:var(--muted); max-width:580px; line-height:1.7; }
.stat-card, .panel, .membership-card, .transaction, .timeline-item, .qr-panel {
  border:1px solid var(--line); background:rgba(255,255,255,.025); border-radius:var(--radius-lg); padding:19px;
}
.stat-card .label { color:var(--muted); font-size:12px; }
.stat-card .value { font-family:Manrope,sans-serif; font-size:29px; margin-top:8px; letter-spacing:-.04em; }
.stat-card .trend { margin-top:7px; font-size:11px; color:var(--success); }
.panel-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:15px; gap:12px; }
.muted { color:var(--muted); }
.small { font-size:12px; }

.actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:16px; }
.btn { border:1px solid var(--line); border-radius:12px; padding:11px 15px; background:rgba(255,255,255,.04); color:var(--text); font-weight:700; }
.btn.primary { background:var(--accent); color:#0d130d; border-color:transparent; }
.btn.primary:hover { background:var(--accent-2); }
.btn.danger { color:#160e0e; background:var(--danger); border-color:transparent; }
.ghost-btn { border:1px solid var(--line); background:transparent; color:var(--muted); border-radius:12px; padding:10px 12px; }
.ghost-btn:hover { color:var(--text); background:rgba(255,255,255,.04); }
.wide { width:100%; }

.status { display:inline-flex; align-items:center; gap:7px; border-radius:99px; padding:7px 10px; font-size:11px; font-weight:700; }
.status::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.status.active { color:var(--success); background:rgba(140,231,160,.08); }
.status.expired { color:var(--danger); background:rgba(255,122,122,.08); }
.status.pending { color:var(--warning); background:rgba(255,199,102,.08); }

.membership-card { background: linear-gradient(150deg, rgba(200,255,104,.12), rgba(255,255,255,.02)); }
.membership-top { display:flex; justify-content:space-between; gap:12px; }
.membership-price { font-family:Manrope,sans-serif; font-size:28px; margin-top:18px; }
.meter { height:7px; background:#1d261f; border-radius:99px; overflow:hidden; margin:12px 0 7px; }
.meter span { display:block; height:100%; background:var(--accent); border-radius:inherit; }
.info-list { display:grid; gap:10px; }
.info-row { display:flex; justify-content:space-between; gap:15px; font-size:13px; }
.info-row strong { font-weight:700; }

.list { display:grid; gap:9px; }
.transaction { display:flex; justify-content:space-between; gap:15px; align-items:center; }
.transaction-main { display:flex; gap:10px; align-items:center; min-width:0; }
.transaction-icon { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; background:rgba(200,255,104,.08); color:var(--accent); }
.transaction strong { display:block; font-size:13px; }
.transaction span { color:var(--muted); font-size:11px; }
.transaction .amount { font-weight:800; white-space:nowrap; }

.qr-wrap { display:grid; place-items:center; padding:22px; border-radius:20px; background:#f5f8f3; }
.qr-code { width:min(280px,70vw); aspect-ratio:1; display:grid; grid-template-columns:repeat(13,1fr); gap:4px; }
.qr-cell { background:#0d110e; border-radius:2px; }
.qr-cell.off { background:transparent; }
.qr-caption { text-align:center; margin-top:14px; }
.qr-caption strong { font-family:Manrope,sans-serif; display:block; }

.scanner-stage { text-align:center; padding:28px; min-height:440px; display:grid; place-items:center; border-radius:var(--radius-xl); background:radial-gradient(circle at center, rgba(200,255,104,.07), transparent 55%), rgba(255,255,255,.02); border:1px dashed rgba(255,255,255,.12); }
.scanner-ring { width:160px; aspect-ratio:1; border-radius:50%; border:1px solid rgba(200,255,104,.35); box-shadow:0 0 0 18px rgba(200,255,104,.025),0 0 70px rgba(200,255,104,.10); display:grid; place-items:center; }
.scanner-ring > div { width:112px; height:112px; border-radius:22px; border:2px solid var(--accent); position:relative; }
.scanner-ring > div::before, .scanner-ring > div::after { content:""; position:absolute; background:var(--accent); }
.scanner-ring > div::before { width:55px; height:2px; left:26px; top:54px; }
.scanner-ring > div::after { width:2px; height:55px; left:54px; top:26px; }
.scan-state { margin-top:20px; }
.scan-state h2 { font-size:25px; }
.scan-state p { color:var(--muted); margin-top:8px; line-height:1.6; }
.scanner-input { margin-top:18px; display:flex; gap:9px; max-width:650px; margin-left:auto; margin-right:auto; }
.scanner-input input { flex:1; min-width:0; border:1px solid var(--line); background:#0c100d; color:var(--text); padding:13px; border-radius:12px; }
.key-hint { display:inline-flex; gap:7px; margin-top:12px; color:var(--muted); font-size:11px; }
.key { padding:4px 7px; border-radius:7px; border:1px solid var(--line); background:rgba(255,255,255,.03); }

.scan-result { display:grid; gap:12px; text-align:left; width:100%; max-width:660px; margin:0 auto; }
.scan-result .result-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.result-person { display:flex; gap:12px; align-items:center; }
.result-person .avatar { width:52px; height:52px; }
.callout { border-radius:14px; padding:13px; font-size:12px; line-height:1.6; }
.callout.success { background:rgba(140,231,160,.08); color:var(--success); }
.callout.danger { background:rgba(255,122,122,.08); color:#ffc1c1; }

.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:16px; }
table { width:100%; border-collapse:collapse; min-width:640px; }
th, td { padding:13px 15px; text-align:left; border-bottom:1px solid var(--line); font-size:12px; }
th { color:var(--muted); font-weight:600; }
tr:last-child td { border-bottom:0; }

.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.field { display:grid; gap:7px; }
.field.full { grid-column:1/-1; }
.field label { color:var(--muted); font-size:11px; }
.field textarea { width:100%; min-height:110px; resize:vertical; border:1px solid var(--line); background:var(--surface-2); color:var(--text); border-radius:12px; padding:12px; }

.timeline { position:relative; display:grid; gap:12px; }
.timeline-item { display:grid; grid-template-columns:80px 1fr; gap:13px; align-items:start; }
.timeline-item .time { color:var(--accent); font-weight:800; font-size:12px; }

.empty { min-height:220px; display:grid; place-items:center; text-align:center; color:var(--muted); }
.empty strong { display:block; color:var(--text); margin-bottom:7px; }

.toast { position:fixed; left:50%; top:18px; transform:translate(-50%,-120px); opacity:0; z-index:100; padding:11px 14px; border:1px solid var(--line); background:#151a16; border-radius:12px; box-shadow:var(--shadow); transition:.22s; font-size:12px; }
.toast.show { transform:translate(-50%,0); opacity:1; }

.modal { width:min(760px,calc(100vw - 24px)); border:1px solid var(--line); border-radius:22px; padding:0; background:#0f1411; color:var(--text); box-shadow:var(--shadow); }
.modal::backdrop { background:rgba(0,0,0,.7); backdrop-filter:blur(7px); }
.modal-card { padding:22px; }
.modal-head { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:17px; }

.mobile-only { display:none; }
.desktop-only { display:inline; }

@media (max-width: 1100px) {
  :root { --sidebar:228px; }
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .content { padding:25px; }
  .topbar { padding:17px 25px; }
}

@media (max-width: 780px) {
  :root { --sidebar:0px; }
  .sidebar { transform:translateX(-105%); width:min(300px,88vw); box-shadow:var(--shadow); transition:.22s; }
  .sidebar.open { transform:translateX(0); }
  .main { margin-left:0; }
  .topbar { min-height:76px; padding:14px 15px; }
  .mobile-only { display:grid; }
  .desktop-only { display:none; }
  .topbar-title h1 { font-size:21px; }
  .content { padding:18px 15px 25px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns:1fr; }
  .hero-card { padding:20px; }
  .hero-copy h2 { font-size:30px; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .scanner-stage { min-height:390px; padding:19px; }
  .scanner-input { flex-direction:column; }
  .transaction { align-items:flex-start; }
}

/* V3 layout lock: page never scrolls horizontally; only explicit components may. */
*, *::before, *::after { box-sizing: border-box; }
html, body, #app { width: 100%; max-width: 100%; min-width: 0; overflow-x: hidden; }
body { overscroll-behavior-x: none; }
.app-shell, .sidebar, .main, .content, .topbar, .topbar-title, .topbar-actions,
.content > *, .grid, .grid > *, .panel, .hero-card, .stat-card, .membership-card,
.transaction, .transaction-main, .info-row, .form-grid, .field, .modal, .modal-card,
.result-person, .scanner-stage, .scanner-controls { min-width: 0; max-width: 100%; }
.content > * { width: 100%; }
.content, .main { overflow-x: clip; }
.topbar-title h1, .panel h2, .panel h3, .hero-card h2, .membership-card h3,
.transaction strong, .transaction span, .muted, .eyebrow, .label, td, th, p, label,
button, input, select, textarea { overflow-wrap: anywhere; }
img, svg, video, canvas { max-width: 100%; height: auto; }
button, input, select, textarea { max-width: 100%; }
.transaction-main > div:last-child, .topbar-title { overflow: hidden; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.table-wrap table { min-width: 620px; }
@media (max-width: 780px) {
  .topbar { gap: 8px; }
  .topbar-actions { margin-left: auto; }
  .profile-chip { max-width: 48px; overflow: hidden; }
  .grid, .grid.grid-2, .grid.grid-3, .grid.grid-4 { grid-template-columns: minmax(0, 1fr); }
  .actions { flex-wrap: wrap; }
  .actions > * { min-width: 0; max-width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field.full { grid-column: auto; }
  .scanner-input-row { grid-template-columns: minmax(0, 1fr); }
}

/* V5: one navigation system only. No bottom navigation. */
html, body { width:100%; max-width:100vw; min-width:0; overflow-x:hidden; overscroll-behavior-x:none; }
#app, .app-shell, .main, .content, .sidebar { width:100%; max-width:100%; min-width:0; }
.main { width:calc(100% - var(--sidebar)); }
.content { width:100%; max-width:1500px; margin-left:auto; margin-right:auto; overflow-x:clip; }
.topbar, .topbar-title, .topbar-actions { min-width:0; max-width:100%; }
.topbar-title { flex:1 1 auto; min-width:0; }
.topbar-actions { flex:0 1 auto; min-width:0; }
.content > *, .grid > *, .panel, .hero-card, .stat-card, .membership-card, .transaction, .transaction-main, .info-row, .form-grid, .field, .scanner-stage, .scan-result, .timeline-item, .result-person, .modal, .modal-card { min-width:0; max-width:100%; }
.content > * { width:100%; }
.transaction-main > div:last-child { min-width:0; overflow-wrap:anywhere; }
.transaction .amount { flex:0 1 auto; min-width:0; }
.info-row > * { min-width:0; max-width:100%; }
.info-row strong { overflow-wrap:anywhere; text-align:right; }
.field input, .field select, .field textarea { min-width:0; max-width:100%; }
button, input, select, textarea { font:inherit; }
button { overflow-wrap:anywhere; }
img, svg, video, canvas { display:block; max-width:100%; height:auto; }
.dev-session-modal { width:min(520px, calc(100vw - 24px)); }
.dev-session-note { line-height:1.65; font-size:12px; }
.dev-session-grid { display:grid; gap:10px; margin-top:16px; }
.dev-session-btn { width:100%; min-width:0; padding:14px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.03); color:var(--text); text-align:left; display:grid; gap:4px; cursor:pointer; }
.dev-session-btn:hover { background:rgba(255,255,255,.06); }
.dev-session-btn strong { font-size:13px; }
.dev-session-btn span { color:var(--muted); font-size:11px; }
@media (max-width:780px) {
  .main { width:100%; }
  .content { padding-left:15px; padding-right:15px; }
  .topbar { width:100%; gap:8px; }
  .topbar-title { overflow:hidden; }
  .topbar-title h1, .topbar-title .eyebrow { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .topbar-actions { flex-shrink:0; }
  .profile-chip { flex:0 0 42px; width:42px; padding:5px; justify-content:center; }
  .panel-head { align-items:flex-start; flex-wrap:wrap; }
  .transaction { width:100%; }
  .transaction .amount { max-width:42%; text-align:right; white-space:normal; overflow-wrap:anywhere; }
}
@media (min-width:781px) { .sidebar { width:var(--sidebar); } .main { margin-left:var(--sidebar); } }


/* V6 navigation repair: sidebar is the only navigation system. */
.nav button { min-height: 42px; }
@media (max-width: 780px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translate3d(-105%,0,0);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
  }
  .sidebar.open {
    transform: translate3d(0,0,0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
  .main { width: 100%; margin-left: 0; }
  .topbar { position: sticky; z-index: 40; }
}


/* V7 mobile sidebar: content navigation closes the drawer; Android/browser Back closes it first. */

/* V8 UI/UX system: fixed viewport, component-only overflow, mobile drawer */
html, body { overscroll-behavior-x: none; }
body { overflow-x: hidden; }
.app-shell { position: relative; width: 100%; max-width: 100vw; overflow-x: clip; }
.main { width: calc(100% - var(--sidebar)); max-width: calc(100% - var(--sidebar)); }
.content { width: 100%; max-width: 1500px; }
.content > .grid, .content > .panel { min-width: 0; }
.panel-subtitle { margin-top: 5px; line-height: 1.55; }
.search-row { display: flex; gap: 9px; width: 100%; min-width: 0; }
.search-box { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 0 12px; }
.search-box > span { color: var(--muted); font-size: 18px; flex: 0 0 auto; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); padding: 13px 0; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.filter-chip { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 7px 10px; font-size: 11px; }
.filter-chip.active { color: var(--text); background: rgba(200,255,104,.08); border-color: rgba(200,255,104,.25); }
.filter-chip b { margin-left: 5px; color: var(--accent); }
.table-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.table-person > div:last-child { min-width: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--accent); }
.empty-state, .error-state { min-height: 220px; display: grid; place-items: center; text-align: center; align-content: center; gap: 7px; padding: 24px; color: var(--muted); }
.empty-state strong, .error-state strong { color: var(--text); font-family: Manrope, sans-serif; font-size: 16px; }
.empty-state span, .error-state span { max-width: 420px; line-height: 1.6; font-size: 12px; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 15px; color: var(--accent); background: rgba(200,255,104,.05); font-weight: 800; margin-bottom: 3px; }
.error-state .empty-icon { color: var(--danger); background: rgba(255,122,122,.05); }
.notification-list { display: grid; gap: 8px; }
.notification-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.02); }
.notification-item strong { display: block; font-size: 12px; }
.notification-item p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.notification-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: var(--success); }
.notification-dot.warning { background: var(--warning); }
.quick-hero { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.quick-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(390px, 100%); position: relative; z-index: 1; }
.quick-steps div { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(0,0,0,.14); }
.quick-steps b { color: var(--accent); font-size: 10px; display: block; }
.quick-steps span { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.scan-methods { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 13px; }
.scan-methods span { border: 1px solid var(--line); border-radius: 99px; padding: 7px 9px; font-size: 10px; color: var(--muted); background: rgba(255,255,255,.02); }
.mini-checklist { display: grid; gap: 9px; }
.mini-checklist div { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 11px; line-height: 1.5; }
.mini-checklist div span:first-child { color: var(--success); font-weight: 800; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.result-stage { min-height: 520px; }
.result-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; font-weight: 700; background: rgba(140,231,160,.08); color: var(--success); }
.result-icon.danger { color: var(--danger); background: rgba(255,122,122,.08); }
.result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.permission-badge { display: inline-flex; padding: 6px 8px; border-radius: 8px; background: rgba(200,255,104,.07); color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.sidebar-overlay { display: none; }

@media (max-width: 780px) {
  .main { width: 100%; max-width: 100%; }
  .quick-hero { display: block; }
  .quick-steps { margin-top: 18px; width: 100%; }
  .search-row { flex-direction: column; }
  .search-row > .btn { width: 100%; }
  .result-grid { grid-template-columns: 1fr; }
  .sidebar-overlay { position: fixed; inset: 0; display: block; background: rgba(0,0,0,.58); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 19; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
  .sidebar { z-index: 30; }
  .topbar-title h1 { max-width: 55vw; }
  .profile-chip { min-width: 0; }
  .profile-chip .avatar { flex: 0 0 auto; }
  .scanner-stage { width: 100%; max-width: 100%; }
  .qr-wrap { max-width: 100%; }
}

@media (max-width: 430px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar-actions .icon-btn { display: none; }
  .hero-card, .panel, .stat-card, .membership-card { padding: 15px; }
  .hero-copy h2 { font-size: 27px; }
  .quick-steps { grid-template-columns: 1fr; }
  .transaction { padding: 13px; }
  .transaction .amount { white-space: normal; text-align: right; }
  .membership-top, .panel-head, .info-row { align-items: flex-start; }
  .info-row { flex-wrap: wrap; }
}

/* V9 UI/UX AUDIT + PREMIUM MOTION: subtle, fast, layout-safe */
:root {
  --motion-fast: 150ms;
  --motion: 220ms;
  --motion-slow: 360ms;
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-standard: cubic-bezier(.2,.8,.2,1);
}

html, body, #app, .app-shell, .main, .content { min-width: 0; }
html, body { overflow-x: clip; }
body { overflow-x: hidden; }

/* Page entrance: opacity/translate only, so it never changes layout width. */
.content.page-enter > * {
  animation: smg-page-in var(--motion-slow) var(--ease-out) both;
}
.content.page-enter > *:nth-child(2) { animation-delay: 35ms; }
.content.page-enter > *:nth-child(3) { animation-delay: 65ms; }
.content.page-enter > *:nth-child(4) { animation-delay: 90ms; }
@keyframes smg-page-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Premium micro-interactions */
.btn, .ghost-btn, .icon-btn, .profile-chip, .filter-chip, .dev-session-btn, .nav button {
  transition:
    transform var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
.btn:hover, .ghost-btn:hover, .filter-chip:hover, .dev-session-btn:hover {
  transform: translateY(-1px);
}
.btn:active, .ghost-btn:active, .icon-btn:active, .profile-chip:active,
.filter-chip:active, .dev-session-btn:active, .nav button:active {
  transform: translateY(1px) scale(.985);
}
.btn.primary { box-shadow: 0 8px 24px rgba(200,255,104,.08); }
.btn.primary:hover { box-shadow: 0 10px 30px rgba(200,255,104,.14); }

/* Cards feel responsive without floating excessively. */
.panel, .stat-card, .membership-card, .transaction, .qr-panel, .hero-card, .timeline-item {
  transition: transform var(--motion) var(--ease-out), border-color var(--motion) ease, background-color var(--motion) ease, box-shadow var(--motion) ease;
}
@media (hover: hover) and (pointer: fine) {
  .panel:hover, .stat-card:hover, .membership-card:hover, .transaction:hover, .qr-panel:hover, .timeline-item:hover {
    transform: translateY(-2px);
    border-color: rgba(200,255,104,.14);
  }
}

/* Active navigation gets a restrained accent rail; still only one sidebar. */
.nav button { position: relative; }
.nav button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 99px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--motion) var(--ease-out);
}
.nav button.active::before { transform: scaleY(1); }

/* Brand gives a tiny tactile cue for the hidden dev gesture, not a heavy animation. */
.brand-mark { transition: transform var(--motion) var(--ease-out), box-shadow var(--motion) ease; }
.brand-mark:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .brand-mark:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(200,255,104,.10); }
}

/* Scanner: subtle breathing indicator, no expensive filters/canvas. */
.scanner-ring { animation: smg-scan-pulse 2.8s ease-in-out infinite; }
@keyframes smg-scan-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 18px rgba(200,255,104,.025), 0 0 70px rgba(200,255,104,.10); }
  50% { transform: scale(1.018); box-shadow: 0 0 0 21px rgba(200,255,104,.018), 0 0 76px rgba(200,255,104,.12); }
}
.status.active::before { animation: smg-status-pulse 2.2s ease-in-out infinite; }
@keyframes smg-status-pulse {
  0%, 100% { opacity: .55; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* Progress bars animate once when rendered. */
.meter span { transform-origin: left center; animation: smg-meter-in 650ms var(--ease-out) both; }
@keyframes smg-meter-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Drawer motion remains transform/opacity only and avoids layout reflow. */
@media (max-width: 780px) {
  .sidebar {
    transition: transform var(--motion) var(--ease-out), opacity var(--motion-fast) ease, visibility 0s linear var(--motion);
  }
  .sidebar.open {
    transition: transform var(--motion) var(--ease-out), opacity var(--motion-fast) ease, visibility 0s linear 0s;
  }
  .sidebar.open .nav button {
    animation: smg-nav-in 300ms var(--ease-out) both;
  }
  .sidebar.open .nav button:nth-child(2) { animation-delay: 20ms; }
  .sidebar.open .nav button:nth-child(3) { animation-delay: 40ms; }
  .sidebar.open .nav button:nth-child(4) { animation-delay: 60ms; }
  .sidebar.open .nav button:nth-child(5) { animation-delay: 80ms; }
  .sidebar.open .nav button:nth-child(6) { animation-delay: 100ms; }
  .sidebar.open .nav button:nth-child(7) { animation-delay: 120ms; }
  @keyframes smg-nav-in {
    from { opacity: 0; transform: translate3d(-7px, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
}

/* Toast + dialog polish. */
.toast {
  transition: transform var(--motion) var(--ease-out), opacity var(--motion) ease;
  will-change: transform, opacity;
}
.modal[open] {
  animation: smg-modal-in 220ms var(--ease-out) both;
}
@keyframes smg-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Keep interactive text/content from ever forcing the viewport wider. */
.nav, .sidebar-foot, .mini-profile, .brand-block, .topbar-actions,
.panel-head, .actions, .search-row, .membership-top, .transaction, .result-head,
.quick-hero, .quick-steps, .scan-methods, .notification-item {
  min-width: 0;
  max-width: 100%;
}
.mini-profile > div:last-child, .panel-head > div, .membership-top > div,
.result-head > div, .notification-item > div:last-child { min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* V10 — sidebar containment + navigation polish */
html, body { width:100%; max-width:100%; min-width:0; overflow-x:hidden; }
body { overscroll-behavior-x:none; }
.app-shell, .main, .content, .topbar, .sidebar { min-width:0; max-width:100%; }

/* Sidebar is a contained vertical surface. It may scroll internally only when
   the navigation list is longer than the available viewport. */
.sidebar {
  overflow:hidden;
  min-height:100vh;
  padding-top:max(18px, env(safe-area-inset-top));
  padding-bottom:max(18px, env(safe-area-inset-bottom));
}
.brand-block { flex:0 0 auto; min-width:0; }
.nav {
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  padding-right:2px;
}
.nav button { flex:0 0 auto; }
.sidebar-foot {
  flex:0 0 auto;
  min-width:0;
  padding-top:2px;
  padding-bottom:2px;
}
.mini-profile { min-width:0; }
.mini-profile > div:last-child { min-width:0; overflow:hidden; }
.mini-profile strong, .mini-profile span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-foot .wide { min-height:42px; }

/* Mobile drawer has its own viewport-safe dimensions. */
@media (max-width:780px) {
  .sidebar {
    width:min(304px,88vw);
    max-width:88vw;
    height:100dvh;
    min-height:100dvh;
    padding-left:16px;
    padding-right:16px;
    padding-top:max(16px, env(safe-area-inset-top));
    padding-bottom:max(16px, env(safe-area-inset-bottom));
    gap:16px;
  }
  .sidebar .nav { flex:1 1 auto; }
  .sidebar-foot { margin-top:0; }
  .sidebar-overlay { z-index:29; }
  .sidebar { z-index:30; }
  .topbar { z-index:40; }
  body.sidebar-open .topbar { pointer-events:none; }
  body.sidebar-open #menuBtn { pointer-events:auto; }
  #menuBtn { transition:transform var(--motion-fast,150ms) var(--ease-out, cubic-bezier(.22,1,.36,1)); }
  #menuBtn[aria-expanded="true"] { transform:rotate(90deg); }
}

/* Keep cards and actions contained; never let a long label expand the page. */
.actions, .panel-head, .membership-top, .result-head, .quick-hero,
.transaction, .notification-item, .search-row { min-width:0; max-width:100%; }
.actions > * { min-width:0; max-width:100%; }
.btn, .ghost-btn, .icon-btn, .profile-chip { min-width:0; }

/* A table is the only intentional horizontal scroller. */
.table-wrap { width:100%; max-width:100%; overflow-x:auto; overflow-y:hidden; }

/* Modal never exceeds the visual viewport. */
dialog.modal {
  max-width:calc(100vw - 24px);
  max-height:calc(100dvh - 24px);
}
.modal-card { max-height:calc(100dvh - 24px); overflow:auto; overscroll-behavior:contain; }

@media (prefers-reduced-motion: reduce) {
  #menuBtn[aria-expanded="true"] { transform:none; }
}

/* V11 — compact sidebar list cards + slower premium motion + floating dev role control */
:root {
  --sidebar: 244px;
  --motion-fast: 190ms;
  --motion: 300ms;
  --motion-slow: 480ms;
}

/* Sidebar items are intentionally slimmer and read like compact list cards. */
.sidebar { padding-left: 14px; padding-right: 14px; gap: 16px; }
.nav { gap: 5px; padding: 2px; }
.nav button {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  background: rgba(255,255,255,.018);
}
.nav button:hover { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.045); }
.nav button.active { background: rgba(200,255,104,.065); border-color: rgba(200,255,104,.09); }
.nav .nav-dot { width: 6px; height: 6px; flex: 0 0 6px; }
.sidebar-foot { gap: 7px; }
.mini-profile {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
}
.mini-profile .avatar { width: 32px; height: 32px; border-radius: 10px; }
.sidebar-foot .wide {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 11px;
  font-size: 12px;
  text-align: left;
}

/* Slower, calmer drawer/menu choreography. */
@media (max-width:780px) {
  .sidebar { width: min(292px, 86vw); max-width: 86vw; }
  .sidebar.open .nav button { animation-duration: 420ms; }
  .sidebar.open .nav button:nth-child(2) { animation-delay: 35ms; }
  .sidebar.open .nav button:nth-child(3) { animation-delay: 70ms; }
  .sidebar.open .nav button:nth-child(4) { animation-delay: 105ms; }
  .sidebar.open .nav button:nth-child(5) { animation-delay: 140ms; }
  .sidebar.open .nav button:nth-child(6) { animation-delay: 175ms; }
  .sidebar.open .nav button:nth-child(7) { animation-delay: 210ms; }
}

.scanner-ring { animation-duration: 3.8s; }
.status.active::before { animation-duration: 3.2s; }

/* Development role control: floating bottom-right, never part of the sidebar/navbar. */
.dev-role-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border: 1px solid rgba(200,255,104,.24);
  border-radius: 15px;
  background: rgba(16,21,18,.92);
  color: var(--accent);
  display: grid;
  place-items: center;
  z-index: 80;
  box-shadow: 0 12px 34px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.025) inset;
  backdrop-filter: blur(14px);
  transition: transform 300ms var(--ease-out), border-color 300ms ease, box-shadow 300ms ease;
}
.dev-role-fab:hover { transform: translateY(-2px); border-color: rgba(200,255,104,.42); box-shadow: 0 16px 38px rgba(0,0,0,.38), 0 0 22px rgba(200,255,104,.08); }
.dev-role-fab:active { transform: translateY(1px) scale(.96); }
.dev-role-fab[aria-expanded="true"] { transform: rotate(45deg); }
.dev-role-fab-icon { font-size: 20px; line-height: 1; font-weight: 700; }

.dev-session-popover {
  position: fixed;
  inset: auto max(16px, env(safe-area-inset-right)) calc(72px + max(16px, env(safe-area-inset-bottom))) auto;
  width: min(360px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(14,19,16,.96);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  overflow: visible;
}
.dev-session-popover::backdrop { background: transparent; }
.dev-session-popover-card { padding: 17px; }
.dev-session-popover[open] { animation: smg-dev-pop-in 420ms var(--ease-out) both; }
@keyframes smg-dev-pop-in {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.97); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.dev-session-popover .modal-head { margin-bottom: 10px; }
.dev-session-popover h2 { font-size: 18px; }
.dev-session-popover .dev-session-grid { gap: 7px; margin-top: 12px; }
.dev-session-popover .dev-session-btn { padding: 11px 12px; border-radius: 12px; }

@media (max-width:430px) {
  .dev-role-fab { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); width: 44px; height: 44px; border-radius: 14px; }
  .dev-session-popover {
    right: 12px;
    bottom: calc(68px + max(12px, env(safe-area-inset-bottom)));
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
}

/* V12 — navigation reliability: sidebar buttons are explicit controls. */
#desktopNav { pointer-events: auto; }
#desktopNav button { pointer-events: auto; cursor: pointer; touch-action: manipulation; }

/* V13 section interface system */
:root{--motion:560ms;--motion-fast:360ms;--ease:cubic-bezier(.22,.8,.24,1)}
body{overflow-x:hidden}
.content{max-width:1540px}
.page-stack{display:grid;gap:16px;min-width:0}
.section-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:4px 2px 2px;min-width:0}
.section-intro h2{margin-top:6px;font-size:28px;letter-spacing:-.035em}
.section-intro p{margin-top:7px;color:var(--muted);line-height:1.6;max-width:700px}
.section-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.nav{gap:4px;overflow:auto;min-height:0;padding-right:2px}
.nav button{min-height:40px;padding:9px 11px;border:1px solid transparent;transition:background var(--motion-fast) var(--ease),transform var(--motion-fast) var(--ease),color var(--motion-fast) var(--ease)}
.nav button:hover{transform:translateX(2px)}
.nav button.active{border-color:rgba(200,255,104,.08);box-shadow:inset 2px 0 0 var(--accent)}
.nav-icon{width:22px;display:inline-grid;place-items:center;color:currentColor;font-size:14px;flex:0 0 22px}
.sidebar-foot{gap:8px}
.mini-profile{padding:8px}
.mini-profile .avatar{width:34px;height:34px}
.hero-card,.panel,.stat-card,.membership-card{transition:transform var(--motion) var(--ease),border-color var(--motion) var(--ease),box-shadow var(--motion) var(--ease)}
@media (hover:hover){.panel:hover,.stat-card:hover,.membership-card:hover{transform:translateY(-2px);border-color:rgba(200,255,104,.12)}.btn,.ghost-btn,.icon-btn,.profile-chip{transition:transform var(--motion-fast) var(--ease),background var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease)}.btn:hover,.ghost-btn:hover,.icon-btn:hover,.profile-chip:hover{transform:translateY(-1px)}}
.page-enter{animation:pageIn var(--motion) var(--ease) both}
@keyframes pageIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.scanner-ring{animation:scannerBreath 4.8s ease-in-out infinite}
@keyframes scannerBreath{0%,100%{transform:scale(.985);box-shadow:0 0 0 18px rgba(200,255,104,.025),0 0 50px rgba(200,255,104,.06)}50%{transform:scale(1.01);box-shadow:0 0 0 23px rgba(200,255,104,.035),0 0 70px rgba(200,255,104,.11)}}
.meter span{animation:meterIn 900ms var(--ease) both}
@keyframes meterIn{from{width:0}to{width:72%}}
.featured{position:relative;overflow:hidden}
.featured:after{content:"";position:absolute;width:190px;height:190px;right:-90px;top:-100px;border-radius:50%;background:rgba(200,255,104,.08);filter:blur(18px);pointer-events:none}
.timeline.compact{gap:8px}
.timeline.compact .timeline-item{padding:12px 14px;background:rgba(255,255,255,.018);border-radius:14px}
.qr-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:14px}
.code-card{padding:22px;border:1px solid rgba(200,255,104,.16);border-radius:18px;background:linear-gradient(145deg,rgba(200,255,104,.08),rgba(255,255,255,.02))}
.code-card strong{display:block;font:800 34px Manrope;margin-top:7px;letter-spacing:-.04em}
.profile-hero{display:flex;align-items:center;gap:14px}
.avatar.lg{width:58px;height:58px;border-radius:17px;font-size:17px}
.quick-panel{min-height:250px}
.quick-steps.large{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:18px}
.quick-steps.large>div{padding:16px;border:1px solid var(--line);border-radius:15px;background:rgba(255,255,255,.02);display:grid;gap:5px}
.quick-steps.large b{font:800 20px Manrope;color:var(--accent)}
.quick-steps.large span{font-weight:700}
.quick-steps.large small{color:var(--muted);line-height:1.45}
.scanner-control{align-self:stretch}
.scanner-input{max-width:none}
.product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.product-card{border:1px solid var(--line);background:rgba(255,255,255,.025);color:var(--text);border-radius:16px;padding:15px;text-align:left;display:grid;gap:5px;min-width:0}
.product-card:hover{border-color:rgba(200,255,104,.22);background:rgba(200,255,104,.05)}
.product-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:rgba(200,255,104,.08);color:var(--accent);font-size:18px}
.product-card b{font-size:14px}.product-card small{color:var(--muted)}
.pos-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);gap:16px;min-width:0}
.cart-panel{display:flex;flex-direction:column;min-width:0}.cart-list{display:grid;gap:8px}.cart-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--line);border-radius:13px}.cart-row>div:first-child{min-width:0}.cart-row strong,.cart-row span{display:block}.cart-row span{color:var(--muted);font-size:11px;margin-top:4px}.cart-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}.cart-actions button{width:30px;height:30px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.03);color:var(--text)}.cart-total{display:flex;justify-content:space-between;gap:12px;margin-top:auto;padding:17px 0;border-top:1px solid var(--line);margin-top:18px}.cart-total strong{font:800 22px Manrope}.cart-count{font-size:11px;color:var(--muted)}
.package-grid .membership-card{display:grid;gap:8px}.package-top{display:flex;justify-content:space-between;align-items:center}.package-divider{height:1px;background:var(--line);margin:8px 0}
.cash-diff{margin-top:16px;padding:16px;border-radius:16px;border:1px solid var(--line);display:grid;gap:4px}.cash-diff span,.cash-diff small{color:var(--muted)}.cash-diff strong{font:800 28px Manrope}.cash-diff.good{background:rgba(140,231,160,.06);color:var(--success)}.cash-diff.over{background:rgba(200,255,104,.06);color:var(--accent)}.cash-diff.short{background:rgba(255,122,122,.06);color:var(--danger)}
.chart-panel{min-height:340px}.bar-chart{height:245px;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));align-items:end;gap:9px;padding-top:20px}.bar-col{height:100%;display:grid;grid-template-rows:1fr auto auto;align-items:end;text-align:center;gap:6px;min-width:0}.bar-col span,.bar-col small{font-size:10px;color:var(--muted)}.bar{width:100%;max-width:38px;justify-self:center;background:linear-gradient(#c8ff68,#597b35);border-radius:9px 9px 4px 4px;min-height:12px;animation:barIn 850ms var(--ease) both}.bar-col:nth-child(2) .bar{animation-delay:50ms}.bar-col:nth-child(3) .bar{animation-delay:100ms}.bar-col:nth-child(4) .bar{animation-delay:150ms}.bar-col:nth-child(5) .bar{animation-delay:200ms}.bar-col:nth-child(6) .bar{animation-delay:250ms}.bar-col:nth-child(7) .bar{animation-delay:300ms}@keyframes barIn{from{transform:scaleY(.05);transform-origin:bottom}to{transform:scaleY(1)}}
.payment-mix{display:grid;grid-template-columns:150px 1fr;gap:20px;align-items:center}.mix-ring{width:150px;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;align-content:center;background:radial-gradient(circle at center,var(--surface) 0 54%,transparent 55%),conic-gradient(var(--accent) 0 54%,#789b52 54% 92%,#536f42 92% 99%,#3b4d33 99%);box-shadow:0 0 50px rgba(200,255,104,.06)}.mix-ring strong{font:800 26px Manrope}.mix-ring span{font-size:10px;color:var(--muted)}
.settings-list{display:grid;gap:10px}.toggle-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.02)}.toggle-row span{display:grid;gap:3px}.toggle-row small{color:var(--muted);line-height:1.45}.toggle-row input{display:none}.toggle-row i{width:42px;height:24px;border-radius:99px;background:#253026;position:relative;flex:0 0 auto}.toggle-row i:after{content:"";position:absolute;width:18px;height:18px;border-radius:50%;left:3px;top:3px;background:#667269;transition:transform var(--motion-fast) var(--ease)}.toggle-row input:checked+i{background:rgba(200,255,104,.28)}.toggle-row input:checked+i:after{transform:translateX(18px);background:var(--accent)}
.dev-role-fab{transition:transform var(--motion) var(--ease),box-shadow var(--motion) var(--ease)}.dev-role-fab:hover{transform:translateY(-3px)}
.modal,.dev-session-popover{animation:modalIn var(--motion) var(--ease) both}.modal::backdrop,.dev-session-popover::backdrop{animation:backdropIn var(--motion) var(--ease) both}@keyframes modalIn{from{opacity:0;transform:translateY(16px) scale(.985)}to{opacity:1;transform:none}}@keyframes backdropIn{from{opacity:0}to{opacity:1}}
@media(max-width:900px){.section-intro{align-items:flex-start;flex-direction:column}.section-actions{justify-content:flex-start}.pos-layout{grid-template-columns:1fr}.payment-mix{grid-template-columns:120px 1fr}.mix-ring{width:120px}}
@media(max-width:780px){.sidebar{width:min(300px,88vw);padding:18px 14px}.nav{padding-bottom:4px}.section-intro h2{font-size:24px}.content{padding:18px 15px 28px}.quick-steps.large{grid-template-columns:1fr}.product-grid{grid-template-columns:1fr 1fr}.bar-chart{gap:5px}.bar-col small{font-size:9px}.payment-mix{grid-template-columns:1fr}.mix-ring{margin:auto}.cart-row{align-items:flex-start}.section-actions{width:100%}.section-actions>*{flex:1 1 auto}.scanner-stage{min-height:400px}.qr-wrap{padding:18px}.qr-code{gap:3px}}
@media(max-width:420px){.product-grid{grid-template-columns:1fr}.actions>*{width:100%}.section-actions>*{width:100%}.topbar-title h1{font-size:19px}.stat-card .value{font-size:25px}.panel,.membership-card,.hero-card{padding:16px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* V14 — role-specific compact navigation + contained sidebar list cards */
:root{
  --sidebar: 230px;
  --sidebar-item-h: 37px;
}
.sidebar{
  width:var(--sidebar);
  padding:18px 12px max(14px, env(safe-area-inset-bottom));
  gap:12px;
}
.brand-block{padding:7px 8px;gap:10px}
.brand-mark{width:36px;height:36px;border-radius:10px;padding:7px;gap:3px}
.nav{gap:4px;padding:1px 0}
.nav button{
  min-height:var(--sidebar-item-h);
  padding:8px 10px;
  border-radius:10px;
  gap:9px;
  font-size:11.5px;
  line-height:1.2;
}
.nav button.active{box-shadow:inset 2px 0 0 var(--accent)}
.nav-icon{font-size:13px;width:16px;flex:0 0 16px;text-align:center;opacity:.8}
.sidebar-foot{gap:6px;padding-top:4px}
.mini-profile{padding:7px 8px;border-radius:10px}
.mini-profile .avatar{width:30px;height:30px;border-radius:9px}
.sidebar-foot .wide{min-height:36px;padding:7px 10px;border-radius:10px;font-size:11.5px}
@media (max-width:1100px) and (min-width:781px){:root{--sidebar:220px}.content{padding:24px}.topbar{padding:16px 24px}}
@media (max-width:780px){
  :root{--sidebar:0px}
  .sidebar{width:min(282px,84vw);max-width:84vw;padding:16px 12px max(14px, env(safe-area-inset-bottom));gap:12px}
  .nav button{min-height:39px;padding:8px 10px}
}
