/* ==========================================================================
   FoneShop design system · 2026 mobile-first · Plus Jakarta Sans
   Brand colors (--primary / --secondary + tints) are injected at runtime by
   AppSession.ThemeCss so changes apply instantly without a reload.
   ========================================================================== */

:root { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  background: #F4F6F9; color: #0F172A;
}

.fs-app {
  --primary: #2563EB; --primary-fg: #fff; --primary-strong: #1E51C0; --primary-soft: #E9F0FD; --primary-soft-fg: #1C4AB0; --primary-ring: rgba(37,99,235,.28);
  --secondary: #7C3AED; --secondary-fg: #fff; --secondary-strong: #652FC2; --secondary-soft: #F2EBFD; --secondary-soft-fg: #5D2BB2;
  --bg: #F4F6F9; --surface: #FFFFFF; --surface-2: #F8FAFC; --surface-3: #EEF2F7;
  --border: #E2E8F0; --border-strong: #CBD5E1;
  --text: #0F172A; --text-2: #334155; --muted: #64748B; --faint: #94A3B8;
  --success: #059669; --success-soft: #E7F7F0; --success-fg: #047857;
  --warning: #D97706; --warning-soft: #FEF5E6; --warning-fg: #B45309;
  --danger: #DC2626; --danger-soft: #FDECEC; --danger-fg: #B91C1C;
  --info: #0284C7; --info-soft: #E6F4FB; --info-fg: #0369A1;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.12);
  --shadow-lg: 0 24px 64px -16px rgba(15,23,42,.30);
  --radius-sm: 10px; --radius: 16px; --radius-lg: 22px; --radius-xl: 28px;
  --sidebar-w: 264px; --topbar-h: 68px;
  min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
}
.fs-app[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090D16; --surface: #0F172A; --surface-2: #131C31; --surface-3: #1A2540;
  --border: #1F2A44; --border-strong: #2B3A5C;
  --text: #E7ECF5; --text-2: #C3CCDB; --muted: #8C9AB3; --faint: #5E6C86;
  --success: #10B981; --success-soft: #0E2A23; --success-fg: #34D399;
  --warning: #F59E0B; --warning-soft: #2E2310; --warning-fg: #FBBF24;
  --danger: #EF4444; --danger-soft: #331618; --danger-fg: #F87171;
  --info: #38BDF8; --info-soft: #0E2433; --info-fg: #7DD3FC;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.75);
}
body:has(.fs-app[data-theme="dark"]) { background: #090D16; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.h1 { font-size: 26px; font-weight: 800; }
.h2 { font-size: 21px; font-weight: 800; }
.h3 { font-size: 16.5px; font-weight: 700; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 700; } .xbold { font-weight: 800; }
.eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.text-primary { color: var(--primary); } .text-secondary { color: var(--secondary); }
.text-success { color: var(--success-fg); } .text-danger { color: var(--danger-fg); } .text-warning { color: var(--warning-fg); }
.strike { text-decoration: line-through; opacity: .7; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:24px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:24px}
.ml-auto{margin-left:auto}.w-100{width:100%}
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; } .row.top { align-items: flex-start; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack.tight { gap: 6px; }
.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)); }
.span-2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.divider { height: 1px; background: var(--border); margin: 14px 0; border: 0; }
.spacer { flex: 1; }
code { font-size: 12.5px; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }

/* ---------- Shell (laptop / desktop ≥1024px) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.shell.collapsed { --sidebar-w: 84px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; background: var(--surface);
  border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; z-index: 30;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 19px;
  color: var(--primary-fg); background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 8px 20px -8px var(--primary);
  flex-shrink: 0;
}
.brand-name { font-weight: 800; font-size: 17px; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2);
  font-weight: 600; font-size: 14px; min-height: 42px; position: relative; text-decoration: none !important;
  border: 0; background: none; font-family: inherit; cursor: pointer; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-soft-fg); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nav-item .ico { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 700; background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 7px; }
.shell.collapsed .nav-label, .shell.collapsed .nav-section, .shell.collapsed .brand-text, .shell.collapsed .nav-item .count { display: none; }
.shell.collapsed .nav-item { justify-content: center; }
.sidebar-foot { margin-top: auto; padding-top: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border);
}
.topbar .crumb { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.content { padding: 24px 28px 48px; width: 100%; max-width: 1600px; margin: 0 auto; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13.5px;
  background: var(--primary-soft); color: var(--primary-soft-fg); border: 1px solid var(--border); flex-shrink: 0; cursor: pointer;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 300px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; z-index: 60;
}
.menu-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--surface-3); text-decoration: none; }
.notif { padding: 10px 12px; border-radius: 12px; display: block; color: var(--text); cursor: pointer; }
.notif:hover { background: var(--surface-3); text-decoration: none; }
.notif.unread { background: var(--primary-soft); }
.menu-backdrop { position: fixed; inset: 0; z-index: 55; }

/* ---------- Bottom dock (phone) ---------- */
.dock { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .title-wrap { min-width: 0; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.accent-primary { border-top: 3px solid var(--primary); }
.kpi.accent-secondary { border-top: 3px solid var(--secondary); }
.kpi.accent-success { border-top: 3px solid var(--success); }
.kpi.accent-warning { border-top: 3px solid var(--warning); }
.kpi.accent-danger { border-top: 3px solid var(--danger); }
.kpi.clickable { cursor: pointer; } .kpi.clickable:hover { border-color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; text-decoration: none !important;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); border-color: var(--primary); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); box-shadow: 0 6px 16px -8px var(--primary); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--secondary-fg); }
.btn-secondary:hover { background: var(--secondary-strong); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-soft-fg); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 80%, var(--primary)); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.95); background: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--danger); }
.btn-outline-danger { color: var(--danger-fg); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; }
.btn-outline-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 42px; }

/* ---------- Badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  white-space: nowrap; line-height: 1.5; background: var(--surface-3); color: var(--text-2);
}
.badge.primary { background: var(--primary-soft); color: var(--primary-soft-fg); }
.badge.secondary { background: var(--secondary-soft); color: var(--secondary-soft-fg); }
.badge.success { background: var(--success-soft); color: var(--success-fg); }
.badge.warning { background: var(--warning-soft); color: var(--warning-fg); }
.badge.danger { background: var(--danger-soft); color: var(--danger-fg); }
.badge.info { background: var(--info-soft); color: var(--info-fg); }
.badge.solid-danger { background: var(--danger); color: #fff; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.pill:hover { border-color: var(--border-strong); }
.pill.active { background: var(--primary-soft); color: var(--primary-soft-fg); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.pill .count { opacity: .7; font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 14px; border: 0; background: none; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 0 8px; font-size: 11.5px; }
.tab.active .count { background: var(--primary-soft); color: var(--primary-soft-fg); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field-error, .validation-message { font-size: 12px; color: var(--danger-fg); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input.lg { min-height: 52px; font-size: 16px; }
.input.money { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 42px; }
.input-group .lead { position: absolute; left: 14px; color: var(--muted); pointer-events: none; display: flex; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-soft-fg); }

/* Option cards (payment mode, terms) */
.options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.option {
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); cursor: pointer; text-align: left;
  font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; min-height: 72px;
}
.option:hover { border-color: var(--border-strong); }
.option.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.option .t { font-weight: 800; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.option.active .t { color: var(--primary-soft-fg); }
.option .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.option:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Tables (→ stacked cards on phones) ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.row-danger td { background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
.table tr.row-warning td { background: color-mix(in srgb, var(--warning-soft) 60%, transparent); }
.table tr.row-muted td { opacity: .7; }
.table tfoot td { font-weight: 800; background: var(--surface-2); border-top: 1px solid var(--border); }
.table .actions { text-align: right; white-space: nowrap; }
.table .cell-title { font-weight: 700; color: var(--text); }
.table .cell-sub { font-size: 12px; color: var(--muted); }
.table tr.clickable { cursor: pointer; }
.cell-low { background: var(--warning-soft); color: var(--warning-fg); font-weight: 800; border-radius: 8px; padding: 2px 8px; display: inline-block; }
.cell-zero { color: var(--faint); }

/* ---------- Modal / sheet ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9,13,22,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 100;
  display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 40px); overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .18s ease-out;
}
.modal.lg { max-width: 820px; } .modal.xl { max-width: 1080px; } .modal.sm { max-width: 440px; }
.modal-head { padding: 22px 24px 14px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.sheet-handle { display: none; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }
@keyframes up { from { transform: translateY(100%) } }

/* ---------- Alerts, banners, toasts, empty ---------- */
.alert { padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert-info { background: var(--info-soft); color: var(--info-fg); }
.alert-success { background: var(--success-soft); color: var(--success-fg); }
.alert-warning { background: var(--warning-soft); color: var(--warning-fg); }
.alert-danger { background: var(--danger-soft); color: var(--danger-fg); }
.alert-secondary { background: var(--secondary-soft); color: var(--secondary-soft-fg); }
.banner { padding: 16px 20px; border-radius: var(--radius); font-weight: 700; display: flex; gap: 12px; align-items: center; }
.banner.warning { background: var(--warning-soft); color: var(--warning-fg); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); }
.banner.success { background: var(--success-soft); color: var(--success-fg); border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); }
.banner.danger { background: var(--danger-soft); color: var(--danger-fg); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  padding: 14px 16px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; gap: 12px; align-items: flex-start; font-weight: 600; animation: pop .2s ease-out; border-left: 4px solid var(--info);
}
.toast.success { border-left-color: var(--success); } .toast.error { border-left-color: var(--danger); } .toast.warning { border-left-color: var(--warning); }
.toast button { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ico-lg { font-size: 36px; margin-bottom: 8px; opacity: .6; }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0 } }
.loading-block { display: flex; justify-content: center; padding: 56px; color: var(--muted); gap: 10px; align-items: center; }

/* ---------- Key-value lists ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; min-width: 0; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.sum-row.total { font-size: 21px; font-weight: 800; color: var(--primary); padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--border); }
.sum-row.discount { color: var(--secondary); font-weight: 700; }

/* ---------- Dashboard ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar .fill { width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--primary), var(--secondary)); min-height: 4px; }
.bars .bar .lbl { font-size: 11px; color: var(--muted); font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; }
.quick a:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.quick .qi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-soft-fg); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.pos-catalog { padding: 18px; }
.pos-search { display: flex; gap: 10px; margin-bottom: 14px; }
.pos-search .input-group { flex: 1; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.product-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--surface); cursor: pointer; text-align: left;
  font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 6px; min-height: 172px; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.product-card:active { transform: scale(.99); }
.product-card.in-cart { border-color: var(--primary); background: var(--primary-soft); }
.product-card.oos { opacity: .55; cursor: not-allowed; }
.product-card .pc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.product-card .pc-stock { font-size: 12px; font-weight: 700; color: var(--success-fg); }
.product-card .pc-stock.low { color: var(--warning-fg); } .product-card .pc-stock.zero { color: var(--danger-fg); }
.product-card .pc-name { font-weight: 800; font-size: 15px; line-height: 1.3; }
.product-card .pc-variant { font-size: 12.5px; color: var(--muted); }
.product-card .pc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.product-card .pc-price { font-size: 18px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.cart { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; max-height: calc(100dvh - var(--topbar-h) - 36px); overflow: hidden; }
.cart-head { padding: 16px 18px 12px; }
.cart-scroll { overflow-y: auto; padding: 0 18px; flex: 1; min-height: 80px; }
.cart-line { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.cart-line .cl-main { flex: 1; min-width: 0; }
.cart-line .cl-name { font-weight: 700; font-size: 14px; }
.cart-line .cl-meta { font-size: 12px; color: var(--muted); }
.cart-line .cl-imei { font-size: 12px; font-weight: 700; color: var(--primary); }
.cart-line .cl-promo { font-size: 12px; font-weight: 700; color: var(--secondary); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.qty button { width: 32px; height: 32px; border: 0; background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; }
.qty input { width: 44px; height: 32px; border: 0; text-align: center; font: inherit; font-weight: 700; background: var(--surface); color: var(--text); }
.promo-box { margin: 12px 18px 0; padding: 12px 14px; border-radius: 14px; background: var(--secondary-soft); color: var(--secondary-soft-fg); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.summary { margin: 12px 18px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.cart-actions { padding: 0 18px 18px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.cart-fab, .cart-overlay, .cart-close { display: none; }
.customer-box { margin: 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.imei-list, .list-select { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.imei-opt { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: var(--text); width: 100%; }
.imei-opt:hover, .imei-opt.active { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Printable documents ---------- */
.doc-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; max-width: 900px; margin-left: auto; margin-right: auto; }
.doc {
  background: #fff; color: #0F172A; max-width: 900px; margin: 0 auto; padding: 44px 48px; border-radius: 18px; border: 1px solid #E2E8F0;
  box-shadow: var(--shadow); position: relative; font-size: 13px; --doc-accent: var(--primary); overflow: hidden;
}
.doc .muted { color: #64748B; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 3px solid var(--doc-accent); }
.doc .doc-logo { display: flex; gap: 12px; align-items: center; }
.doc .doc-logo .brand-mark { width: 48px; height: 48px; font-size: 22px; }
.doc .doc-company { font-weight: 800; font-size: 16px; }
.doc .doc-title { font-size: 20px; font-weight: 800; color: var(--doc-accent); text-align: right; letter-spacing: .03em; text-transform: uppercase; }
.doc .doc-no { font-size: 17px; font-weight: 800; text-align: right; }
.doc .doc-meta { font-size: 11.5px; color: #475569; text-align: right; }
.doc .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0; }
.doc .doc-box { border: 1px solid #E2E8F0; border-radius: 12px; padding: 12px 14px; }
.doc .doc-box h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #64748B; margin-bottom: 6px; }
.doc .kv { font-size: 12.5px; gap: 4px 14px; }
.doc .kv dt { color: #64748B; }
.doc table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc th { background: #F1F5F9; color: #334155; text-align: left; padding: 9px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.doc th.num { text-align: right; }
.doc td { padding: 10px; border-bottom: 1px solid #E2E8F0; vertical-align: top; color: #0F172A; }
.doc .imei { font-size: 11.5px; color: #1D4ED8; font-weight: 700; }
.doc .totals { margin-left: auto; width: 360px; margin-top: 14px; }
.doc .totals .sum-row { font-size: 13px; padding: 4px 0; color: #0F172A; }
.doc .totals .sum-row.discount { color: #6D28D9; }
.doc .totals .sum-row.total { color: var(--doc-accent); font-size: 18px; border-top-color: #CBD5E1; }
.doc .sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; }
.doc .sign.two { grid-template-columns: repeat(2, 1fr); }
.doc .sign > div { border-top: 1.5px solid #334155; padding-top: 6px; text-align: center; font-size: 11.5px; color: #475569; min-height: 40px; position: relative; }
.doc .sign .esig { position: absolute; bottom: 100%; left: 0; right: 0; font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 22px; color: #1E3A8A; }
.doc .sign img { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); max-height: 44px; }
.doc .watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 110px; font-weight: 800; color: rgba(220,38,38,.13); transform: rotate(-24deg); letter-spacing: .1em; }
.doc .doc-foot { margin-top: 28px; font-size: 10.5px; color: #64748B; text-align: center; border-top: 1px dashed #CBD5E1; padding-top: 10px; }
.doc .badge { background: #EEF2F7; color: #334155; }
.doc .amount-box { border: 2px solid var(--doc-accent); border-radius: 14px; padding: 14px 18px; margin: 18px 0; }
.doc .amount-box .big { font-size: 26px; font-weight: 800; color: var(--doc-accent); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--secondary-soft), transparent 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 36px; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; gap: 14px; align-items: center; }
.auth-title { font-weight: 800; font-size: 20px; }
.demo-accounts { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.demo-accounts summary { cursor: pointer; font-weight: 700; }
.demo-accounts ul { margin: 8px 0 0; padding-left: 18px; }

/* ---------- Swatches ---------- */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 12px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.swatch.active { box-shadow: 0 0 0 2.5px var(--text); }
.color-input { width: 56px; height: 44px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 4px; background: var(--surface); cursor: pointer; flex-shrink: 0; }

/* ---------- Scanner ---------- */
.scanner-video { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 4/3; object-fit: cover; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 12px 20px; background: #FEF3C7; color: #78350F; font-weight: 600; box-shadow: 0 -4px 16px rgba(0,0,0,.15); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; }

/* ==========================================================================
   Tablet touch viewport (768–1023px): icon rail, 2-col bento grid, slide-over cart
   ========================================================================== */
@media (max-width: 1023.98px) {
  .shell, .shell.collapsed { --sidebar-w: 84px; }
  .shell .nav-label, .shell .nav-section, .shell .brand-text, .shell .nav-item .count { display: none; }
  .shell .nav-item { justify-content: center; min-height: 48px; }
  .content { padding: 20px; }
  .topbar { padding: 0 20px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn, .pill, .input, .select { min-height: 48px; }
  .btn-sm { min-height: 40px; } .btn-xs { min-height: 34px; }
  .pos { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 92vw); max-height: none; z-index: 90; border-radius: 0;
    transform: translateX(105%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  .cart.open { transform: none; }
  .cart-close { display: inline-grid; }
  .cart-fab {
    display: flex; position: fixed; right: 20px; bottom: 20px; z-index: 80; align-items: center; gap: 10px; padding: 0 22px; min-height: 58px;
    border-radius: 999px; background: var(--primary); color: var(--primary-fg); border: 0; font: inherit; font-weight: 800; box-shadow: 0 12px 28px -10px var(--primary); cursor: pointer;
  }
  .cart-overlay.show { display: block; position: fixed; inset: 0; background: rgba(9,13,22,.45); z-index: 85; }
}

/* ==========================================================================
   Smartphone 2026 viewport (<768px): glass bottom dock, bottom sheets, cards
   ========================================================================== */
@media (max-width: 767.98px) {
  body { font-size: 15px; }
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.mobile-open { display: flex; position: fixed; inset: 0 auto 0 0; width: 300px; z-index: 120; box-shadow: var(--shadow-lg); animation: fade .15s; }
  .shell .sidebar.mobile-open .nav-label, .shell .sidebar.mobile-open .nav-section, .shell .sidebar.mobile-open .brand-text, .shell .sidebar.mobile-open .nav-item .count { display: initial; }
  .shell .sidebar.mobile-open .nav-item { justify-content: flex-start; }
  .mobile-nav-backdrop { position: fixed; inset: 0; background: rgba(9,13,22,.45); z-index: 110; }
  .topbar { padding: 0 14px; height: 60px; }
  .topbar .crumb, .topbar .hide-sm { display: none; }
  .content { padding: 16px 14px calc(110px + env(safe-area-inset-bottom)); }
  .h1 { font-size: 22px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kpi .value { font-size: 22px; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .dock {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 70; height: 68px;
    justify-content: space-around; align-items: center; border-radius: 24px; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: var(--shadow-lg);
  }
  .dock a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; position: relative; padding: 6px 0; }
  .dock a.active { color: var(--primary); }
  .dock a.active .ico { background: var(--primary-soft); }
  .dock .ico { width: 48px; height: 30px; border-radius: 999px; display: grid; place-items: center; }
  .dock .count { position: absolute; top: 0; right: calc(50% - 28px); background: var(--danger); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal, .modal.lg, .modal.xl, .modal.sm { max-width: 100%; border-radius: 26px 26px 0 0; max-height: 92dvh; animation: up .25s ease-out; }
  .sheet-handle { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--border-strong); margin: 10px auto 0; flex-shrink: 0; }
  .modal-foot .btn { flex: 1; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card { min-height: 150px; padding: 12px; }
  .product-card .pc-name { font-size: 13.5px; }
  .product-card .pc-price { font-size: 15.5px; }
  .pos-catalog { padding: 12px; }
  .cart { top: auto; left: 0; right: 0; width: 100%; height: 90dvh; border-radius: 26px 26px 0 0; transform: translateY(105%); }
  .cart.open { transform: none; }
  .cart-fab { left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); justify-content: space-between; }
  .toasts { left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); }

  /* Data tables become stacked summary cards — no horizontal scrolling */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td, .table-cards tfoot { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--border); border-radius: 16px; margin: 0 0 12px; padding: 8px 4px; background: var(--surface); }
  .table-cards tbody tr:hover td { background: transparent; }
  .table-cards td { border: 0 !important; padding: 6px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: left; flex-shrink: 0; }
  .table-cards td:not([data-label])::before, .table-cards td[data-label=""]::before { content: none; }
  .table-cards td.actions { justify-content: flex-end; flex-wrap: wrap; }
  .card .table-cards { padding: 12px; }
  .doc { padding: 22px 18px; border-radius: 0; }
  .doc .doc-head { flex-direction: column; }
  .doc .doc-grid { grid-template-columns: 1fr; }
  .doc .doc-title, .doc .doc-no, .doc .doc-meta { text-align: left; }
  .doc .totals { width: 100%; }
  .doc .sign { grid-template-columns: 1fr; gap: 44px; }
}

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body, .fs-app, .fs-app[data-theme="dark"] { background: #fff !important; color: #000 !important; }
  .sidebar, .topbar, .dock, .no-print, .doc-toolbar, .toasts, .cart-fab, #blazor-error-ui { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .doc { box-shadow: none; border: 0; padding: 0; max-width: none; border-radius: 0; }
  .card { box-shadow: none; border-color: #CBD5E1; background: #fff; color: #000; }
  .print-only { display: block !important; }
  a { color: inherit; text-decoration: none; }
}
.print-only { display: none; }

/* ---------- Subscription plans ---------- */
.plan-badge { font-size: 10.5px; padding: 2px 8px; gap: 4px; letter-spacing: .02em; }
.plan-badge.plan-lite { background: var(--surface-3); color: var(--text-2); }
.plan-badge.plan-plus { background: var(--primary-soft); color: var(--primary-soft-fg); }
.plan-badge.plan-pro { background: var(--secondary-soft); color: var(--secondary-soft-fg); }
.plan-badge.plan-ultra { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; }
.nav-item .plan-badge { margin-left: auto; }
.nav-item.locked { opacity: .72; }
.upgrade-card { text-align: center; padding: 40px 24px; max-width: 720px; margin: 24px auto; }
.upgrade-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 12px 30px -12px var(--primary); }
.upgrade-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--secondary-soft); color: var(--secondary-soft-fg); font-size: 13px; }
.plan-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan-card.current { border: 2px solid var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.plan-card .plan-name { font-size: 20px; font-weight: 800; }
.plan-card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.meter.over > span { background: var(--danger); }
.compare td.tick { text-align: center; font-weight: 800; }
.compare td.tick.yes { color: var(--success-fg); }
.compare td.tick.no { color: var(--faint); }
.license-box { font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-height: 110px; word-break: break-all; }
.plan-banner { margin: 0 0 16px; }
@media (max-width: 1279.98px) {
  .plan-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023.98px) {
  .plan-cards { grid-template-columns: 1fr; }
  .shell .nav-item .plan-badge { display: none; }
}

/* ---------- Standalone PWA & iPadOS Home Screen App Polish ---------- */
button, .btn, .icon-btn, .nav-item, .product-card, .pill, .tab, .dock a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media all and (display-mode: standalone) {
  html, body {
    overscroll-behavior-y: none;
    -webkit-user-select: none;
    user-select: none;
  }
  input, textarea, select, code, pre, .table-cards, .doc {
    -webkit-user-select: text;
    user-select: text;
  }
  .topbar {
    padding-top: env(safe-area-inset-top);
    padding-left: max(28px, env(safe-area-inset-left));
    padding-right: max(28px, env(safe-area-inset-right));
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
  }
  .sidebar {
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
  }
  .content {
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }
}
