/* ═══════════════════════════════════════════════════════
   OFFPAY ADMIN PANEL — PRODUCTION CSS
   Dark/Light theme · Fintech design · Supabase-ready
═══════════════════════════════════════════════════════ */

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

/* ── CSS VARIABLES ──────────────────────────────────── */
:root {
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Brand */
  --brand-cyan:   #00D4FF;
  --brand-blue:   #3B82F6;
  --brand-indigo: #6366F1;
  --brand-red:    #EF4444;
  --brand-green:  #10B981;
  --brand-amber:  #F59E0B;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transition */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.2s;
}

[data-theme="dark"] {
  --bg-base:       #090E1A;
  --bg-surface:    #0F1729;
  --bg-elevated:   #162035;
  --bg-overlay:    rgba(9,14,26,0.85);
  --bg-hover:      rgba(255,255,255,0.04);
  --bg-active:     rgba(59,130,246,0.12);

  --border:        rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);

  --text-primary:   #F0F4FF;
  --text-secondary: #7B91B0;
  --text-muted:     #4A5568;
  --text-inverse:   #090E1A;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.7);
  --glow-blue:  0 0 24px rgba(59,130,246,0.25);
  --glow-cyan:  0 0 24px rgba(0,212,255,0.2);

  --sidebar-w: 256px;
}

[data-theme="light"] {
  --bg-base:       #F7F9FC;
  --bg-surface:    #FFFFFF;
  --bg-elevated:   #EEF2F8;
  --bg-overlay:    rgba(247,249,252,0.9);
  --bg-hover:      rgba(0,0,0,0.04);
  --bg-active:     rgba(59,130,246,0.08);

  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --text-inverse:   #FFFFFF;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.14);
  --glow-blue:  0 0 24px rgba(59,130,246,0.15);
  --glow-cyan:  0 0 24px rgba(0,212,255,0.1);

  --sidebar-w: 256px;
}

/* ── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur) var(--ease-smooth), color var(--dur) var(--ease-smooth);
  overflow-x: hidden;
}
a { cursor: pointer; text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ── LOADER OVERLAY ─────────────────────────────────── */
.loader-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #090E1A;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-overlay.fade-out {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.loader-inner { text-align: center; }
.loader-logo-wrap {
  position: relative;
  width: 96px; height: 96px;
  margin: 0 auto 24px;
}
.loader-favicon {
  width: 64px; height: 64px;
  border-radius: 16px;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: loaderPulse 2s ease-in-out infinite;
  box-shadow: 0 0 32px rgba(0,212,255,0.4);
}
.loader-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--brand-cyan);
  animation: loaderSpin 1s linear infinite;
}
.loader-ring--2 {
  inset: 8px;
  border-top-color: var(--brand-blue);
  animation-duration: 1.5s;
  animation-direction: reverse;
}
.loader-text {
  color: #7B91B0;
  font-size: 14px;
  letter-spacing: 0.05em;
}
.loader-dots span {
  display: inline-block;
  animation: dotBlink 1.4s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes loaderPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 32px rgba(0,212,255,0.4); }
  50% { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 48px rgba(0,212,255,0.6); }
}
@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* ── LOGIN PAGE ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  background: #090E1A;
}
.login-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
}
.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.login-glow--1 {
  width: 600px; height: 600px;
  background: rgba(59,130,246,0.12);
  top: -200px; left: -200px;
  animation: glowFloat 8s ease-in-out infinite;
}
.login-glow--2 {
  width: 400px; height: 400px;
  background: rgba(0,212,255,0.08);
  bottom: -100px; right: -100px;
  animation: glowFloat 10s ease-in-out infinite reverse;
}
@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, 20px); }
}
.login-card {
  background: rgba(15,23,41,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  animation: cardReveal 0.6s var(--ease-spring) both;
  position: relative; z-index: 1;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo { height: 44px; margin: 0 auto 12px; }
.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #FCA5A5;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-options {
  display: flex; align-items: center; justify-content: space-between;
}
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-secondary);
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 16px; height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-elevated);
  transition: all var(--dur);
  display: flex; align-items: center; justify-content: center;
}
.checkbox-label input:checked + .checkbox-custom {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '✓'; color: white; font-size: 11px;
}
.forgot-link { font-size: 13px; color: var(--brand-blue); }
.forgot-link:hover { text-decoration: underline; }
.btn-login {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: white;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--dur) var(--ease-smooth);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(59,130,246,0.35);
  position: relative; overflow: hidden;
}
.btn-login::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0; transition: opacity var(--dur);
}
.btn-login:hover::before { opacity: 1; }
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(59,130,246,0.45); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: loaderSpin 0.8s linear infinite;
}
.login-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ── FORM ELEMENTS ──────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
  position: absolute; left: 12px;
  color: var(--text-muted); pointer-events: none; z-index: 1;
}
.form-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--dur) var(--ease-smooth);
  outline: none;
  -webkit-appearance: none;
}
.input-wrap .form-input { padding-left: 38px; }
.form-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.pwd-toggle {
  position: absolute; right: 10px;
  color: var(--text-muted);
  padding: 4px;
  transition: color var(--dur);
}
.pwd-toggle:hover { color: var(--text-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B91B0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── APP LAYOUT ─────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--dur) var(--ease-smooth);
  overflow: hidden;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo { height: 32px; object-fit: contain; }
.sidebar-close {
  display: none;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--dur);
}
.sidebar-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.nav-section-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 8px 6px;
  margin-top: 4px;
}
.nav-section-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  transition: all var(--dur) var(--ease-smooth);
  cursor: pointer; margin-bottom: 2px;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--bg-active);
  color: var(--brand-blue);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand-blue);
  margin-left: -12px;
}
.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.nav-badge {
  margin-left: auto;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 22px; text-align: center;
}
.nav-badge--alert {
  background: rgba(239,68,68,0.15);
  color: #FCA5A5;
}
.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}
.user-avatar-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
  flex-shrink: 0;
}
.user-info-sm { flex: 1; min-width: 0; }
.user-name-sm { font-size: 13px; font-weight: 600; display: block; truncate: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-sm { font-size: 11px; color: var(--text-muted); }
.logout-btn { color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm); transition: all var(--dur); }
.logout-btn:hover { color: var(--brand-red); background: rgba(239,68,68,0.1); }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── MAIN WRAP ──────────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--dur) var(--ease-smooth);
}

/* ── TOPBAR ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  backdrop-filter: blur(20px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  padding: 6px; border-radius: var(--radius-sm);
  transition: all var(--dur);
}
.hamburger:hover { background: var(--bg-hover); }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px; transition: all var(--dur);
}
.topbar-search {
  position: relative;
  flex: 1; max-width: 480px;
  display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 12px;
  color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 40px 8px 38px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all var(--dur);
}
.search-input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.search-input::placeholder { color: var(--text-muted); }
.search-kbd {
  position: absolute; right: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all var(--dur);
  position: relative;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all var(--dur);
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-red);
  border: 2px solid var(--bg-surface);
}
.profile-btn {
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color var(--dur);
  padding: 0;
}
.profile-btn:hover { border-color: var(--brand-blue); }
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white;
}
.user-avatar--lg {
  width: 42px; height: 42px;
  font-size: 16px;
}

/* ── DROPDOWNS ──────────────────────────────────────── */
.dropdown-wrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  z-index: 500;
  overflow: hidden;
  animation: dropdownReveal 0.15s var(--ease-spring);
}
@keyframes dropdownReveal {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.mark-all-read {
  font-size: 12px; color: var(--brand-blue); font-weight: 500;
}
.mark-all-read:hover { text-decoration: underline; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur);
  cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(59,130,246,0.05); }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.notif-icon--payment { background: rgba(16,185,129,0.15); }
.notif-icon--alert   { background: rgba(239,68,68,0.15); }
.notif-icon--user    { background: rgba(59,130,246,0.15); }
.notif-icon--warning { background: rgba(245,158,11,0.15); }
.notif-text { flex: 1; }
.notif-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notif-body  { font-size: 12px; color: var(--text-muted); }
.notif-time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.unread-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-blue);
  flex-shrink: 0; margin-top: 6px;
}
.dropdown-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px; color: var(--brand-blue);
}
.dropdown-footer a:hover { text-decoration: underline; }
.profile-dropdown { min-width: 240px; }
.profile-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
}
.profile-name { font-weight: 600; font-size: 14px; }
.profile-email { font-size: 12px; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px; color: var(--text-secondary);
  transition: all var(--dur);
  cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item--danger:hover { background: rgba(239,68,68,0.1); color: var(--brand-red); }

/* ── PAGE LAYOUT ────────────────────────────────────── */
.page-content { flex: 1; padding: 32px; overflow: auto; }
.page { animation: pageReveal 0.3s var(--ease-smooth); }
@keyframes pageReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.last-updated { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  transition: all var(--dur) var(--ease-smooth);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #FCA5A5;
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon-only { padding: 7px; }

/* ── STATS GRID ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: all var(--dur) var(--ease-smooth);
  animation: statReveal 0.4s var(--ease-spring) both;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
@keyframes statReveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  opacity: 0.8;
}
.stat-card--blue::before   { background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan)); }
.stat-card--green::before  { background: linear-gradient(90deg, var(--brand-green), #34D399); }
.stat-card--amber::before  { background: linear-gradient(90deg, var(--brand-amber), #FCD34D); }
.stat-card--indigo::before { background: linear-gradient(90deg, var(--brand-indigo), var(--brand-blue)); }
.stat-card--red::before    { background: linear-gradient(90deg, var(--brand-red), #F87171); }
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.stat-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.stat-icon--blue   { background: rgba(59,130,246,0.12); color: var(--brand-blue); }
.stat-icon--green  { background: rgba(16,185,129,0.12); color: var(--brand-green); }
.stat-icon--amber  { background: rgba(245,158,11,0.12); color: var(--brand-amber); }
.stat-icon--indigo { background: rgba(99,102,241,0.12); color: var(--brand-indigo); }
.stat-icon--red    { background: rgba(239,68,68,0.12); color: var(--brand-red); }
.stat-trend {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 4px 8px;
  border-radius: 100px;
}
.stat-trend--up   { background: rgba(16,185,129,0.12); color: var(--brand-green); }
.stat-trend--down { background: rgba(239,68,68,0.12); color: var(--brand-red); }
.stat-value {
  font-size: 30px; font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.stat-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── CHARTS ─────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: box-shadow var(--dur);
}
.chart-card:hover { box-shadow: var(--shadow-md); }
.chart-card--lg { /* already large via grid */ }
.chart-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 8px;
}
.chart-title { font-size: 15px; font-weight: 700; }
.chart-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.chart-legend {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-secondary);
}
.legend-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
}
.legend-dot--primary   { background: var(--brand-blue); }
.legend-dot--secondary { background: var(--brand-indigo); }
.chart-wrap { height: 220px; position: relative; }
.chart-wrap--donut { height: 180px; }
.donut-legend {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px;
}
.donut-legend-item {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
}
.donut-legend-label { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.donut-legend-value { font-weight: 600; }

/* ── SECTION CARDS ──────────────────────────────────── */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.section-title { font-size: 15px; font-weight: 700; }

/* ── TABLES ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse;
  min-width: 600px;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--dur);
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.table-count { font-size: 12px; color: var(--text-muted); }

/* Table cell helpers */
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.cell-name { font-weight: 600; font-size: 13px; }
.cell-email { font-size: 12px; color: var(--text-muted); }
.cell-mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }
.badge--success { background: rgba(16,185,129,0.12); color: #34D399; }
.badge--success::before { background: var(--brand-green); }
.badge--failed  { background: rgba(239,68,68,0.12); color: #FCA5A5; }
.badge--failed::before  { background: var(--brand-red); }
.badge--pending { background: rgba(245,158,11,0.12); color: #FCD34D; }
.badge--pending::before { background: var(--brand-amber); }
.badge--refunded{ background: rgba(99,102,241,0.12); color: #A5B4FC; }
.badge--refunded::before{ background: var(--brand-indigo); }
.badge--overdue { background: rgba(239,68,68,0.12); color: #FCA5A5; }
.badge--overdue::before { background: var(--brand-red); }
.badge--draft   { background: rgba(148,163,184,0.12); color: #94A3B8; }
.badge--draft::before   { background: #94A3B8; }
.badge--paid    { background: rgba(16,185,129,0.12); color: #34D399; }
.badge--paid::before    { background: var(--brand-green); }
.badge--active  { background: rgba(16,185,129,0.12); color: #34D399; }
.badge--active::before  { background: var(--brand-green); }
.badge--inactive{ background: rgba(148,163,184,0.12); color: #94A3B8; }
.badge--inactive::before{ background: #94A3B8; }
.badge--blocked { background: rgba(239,68,68,0.12); color: #FCA5A5; }
.badge--blocked::before { background: var(--brand-red); }
.badge--basic   { background: rgba(148,163,184,0.12); color: #94A3B8; }
.badge--pro     { background: rgba(59,130,246,0.12); color: #93C5FD; }
.badge--business{ background: rgba(99,102,241,0.12); color: #A5B4FC; }
.badge--warning { background: rgba(245,158,11,0.12); color: #FCD34D; }

/* Plan badges (no dot) */
.plan-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
}

/* ── ACTION BUTTONS ─────────────────────────────────── */
.action-btns { display: flex; align-items: center; gap: 6px; }
.action-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--dur);
}
.action-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.action-btn--danger:hover { background: rgba(239,68,68,0.1); color: var(--brand-red); border-color: rgba(239,68,68,0.25); }

/* ── FILTERS BAR ────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-bar {
  position: relative;
  display: flex; align-items: center;
  flex: 1; min-width: 200px; max-width: 320px;
}
.search-bar svg {
  position: absolute; left: 10px;
  color: var(--text-muted); pointer-events: none;
}
.search-bar input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 13px; outline: none;
  transition: all var(--dur);
}
.search-bar input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.search-bar input::placeholder { color: var(--text-muted); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px; font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--dur);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-chip.active {
  background: var(--bg-active);
  color: var(--brand-blue);
  border-color: rgba(59,130,246,0.3);
}

/* ── PAGINATION ─────────────────────────────────────── */
.pagination { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--dur);
}
.page-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.page-btn.active {
  background: var(--brand-blue);
  color: white; border-color: var(--brand-blue);
}

/* ── MODALS ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: fixed; z-index: 500;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  animation: modalReveal 0.2s var(--ease-spring);
  overflow: hidden;
}
@keyframes modalReveal {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--dur);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Detail rows in modals */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.detail-value { font-size: 14px; font-weight: 500; }

/* ── SETTINGS PAGE ──────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-card--full { grid-column: 1 / -1; }
.plans-editor { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.plan-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color var(--dur);
}
.plan-card:hover { border-color: var(--border-strong); }
.plan-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.plan-name { font-weight: 700; font-size: 14px; }
.plan-price-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  width: 100px;
  outline: none;
  transition: border-color var(--dur);
}
.plan-price-input:focus { border-color: var(--brand-blue); }
.plan-features { display: flex; flex-direction: column; gap: 6px; }
.plan-feature { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.feature-toggles { display: flex; flex-direction: column; padding: 20px; gap: 0; }
.feature-toggle-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.feature-toggle-item:last-child { border-bottom: none; }
.feature-info { }
.feature-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.feature-desc  { font-size: 12px; color: var(--text-muted); }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: white;
}
.supabase-config { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.supabase-status {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: none;
}
.supabase-status.success { display: block; background: rgba(16,185,129,0.1); color: #34D399; border: 1px solid rgba(16,185,129,0.2); }
.supabase-status.error   { display: block; background: rgba(239,68,68,0.1); color: #FCA5A5; border: 1px solid rgba(239,68,68,0.2); }

/* ── NOTIFICATIONS FULL PAGE ────────────────────────── */
.notif-full-list { display: flex; flex-direction: column; }
.notif-full-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur);
  cursor: pointer;
}
.notif-full-item:last-child { border-bottom: none; }
.notif-full-item:hover { background: var(--bg-hover); }
.notif-full-item.unread { background: rgba(59,130,246,0.03); }
.notif-full-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.notif-full-content { flex: 1; }
.notif-full-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notif-full-body  { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.notif-full-time  { font-size: 12px; color: var(--text-muted); }

/* ── TOAST ──────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 600;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  pointer-events: auto;
  min-width: 280px;
  animation: toastSlide 0.3s var(--ease-spring);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.removing { opacity: 0; transform: translateX(20px); }
@keyframes toastSlide {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast--success { border-left: 3px solid var(--brand-green); }
.toast--error   { border-left: 3px solid var(--brand-red); }
.toast--info    { border-left: 3px solid var(--brand-blue); }
.toast--warning { border-left: 3px solid var(--brand-amber); }
.toast-icon { font-size: 16px; }
.toast-text { flex: 1; }
.toast-close {
  color: var(--text-muted); font-size: 16px; line-height: 1;
  transition: color var(--dur);
}
.toast-close:hover { color: var(--text-primary); }

/* ── BOTTOM NAVIGATION (Mobile & Tablet) ────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 3px;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--dur) var(--ease-smooth);
  position: relative;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.bottom-nav-item:active { transform: scale(0.92); }
.bottom-nav-item.active { color: var(--brand-blue); }
.bottom-nav-icon-wrap {
  position: relative;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  transition: all var(--dur) var(--ease-smooth);
}
.bottom-nav-item.active .bottom-nav-icon-wrap {
  background: var(--bg-active);
}
.bottom-nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease-spring);
}
.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
}
.bottom-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color var(--dur);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}
.bottom-nav-indicator {
  display: none;
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--brand-blue);
}
.bottom-nav-item.active .bottom-nav-indicator { display: block; }
.bottom-nav-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-red);
  border: 2px solid var(--bg-surface);
}

/* ── BOTTOM SHEET (More Menu) ───────────────────────── */
.bottom-sheet-overlay {
  position: fixed; inset: 0; z-index: 450;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 460;
  background: var(--bg-elevated);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid var(--border-strong);
  padding: 12px 20px calc(32px + env(safe-area-inset-bottom));
  box-shadow: 0 -16px 48px rgba(0,0,0,0.4);
  animation: sheetSlideUp 0.3s var(--ease-spring);
  transform: translateY(0);
}
@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.bottom-sheet.closing {
  animation: sheetSlideDown 0.25s var(--ease-smooth) forwards;
}
@keyframes sheetSlideDown {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}
.bottom-sheet-handle {
  width: 40px; height: 4px;
  border-radius: 100px;
  background: var(--border-strong);
  margin: 0 auto 16px;
}
.bottom-sheet-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 4px;
}
.bottom-sheet-items { display: flex; flex-direction: column; gap: 4px; }
.bottom-sheet-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.bottom-sheet-item:hover, .bottom-sheet-item:active { background: var(--bg-hover); }
.bottom-sheet-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: rgba(16,185,129,0.15);
}
.bottom-sheet-info { flex: 1; min-width: 0; }
.bottom-sheet-label { display: block; font-weight: 600; font-size: 14px; }
.bottom-sheet-sub   { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.bottom-sheet-badge {
  background: rgba(239,68,68,0.15);
  color: #FCA5A5;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 100px;
}
.bottom-sheet-divider { height: 1px; background: var(--border); margin: 6px 0; }
.bottom-sheet-item--danger .bottom-sheet-label { color: var(--brand-red); }
.bottom-sheet-item svg { color: var(--text-muted); flex-shrink: 0; }

/* Topbar mobile logo */
.topbar-mobile-logo {
  display: none;
  height: 28px;
  object-fit: contain;
}

/* ── TABLET SPECIFIC (768px - 1024px) ───────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
  .bottom-nav {
    display: flex;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav-label { font-size: 11px; }
  .bottom-nav-icon { width: 22px; height: 22px; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }
  .main-wrap {
    margin-left: 0;
    padding-bottom: 80px;
  }
  .hamburger { display: none; }
  .topbar-mobile-logo { display: block; }
  .page-content { padding: 24px 20px; }
  .topbar { padding: 0 20px; }
  .search-kbd { display: none; }
  .topbar-search { max-width: 260px; }
  .charts-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── MOBILE (≤768px) ────────────────────────────────── */
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }
  .main-wrap {
    margin-left: 0;
    padding-bottom: 70px;
  }
  .hamburger { display: none; }
  .topbar-mobile-logo { display: block; }
  .topbar { padding: 0 14px; height: 56px; }
  .topbar-search { max-width: 160px; }
  .search-input { font-size: 12px; padding: 7px 10px 7px 34px; }
  .search-kbd { display: none; }
  .page-content { padding: 16px 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal {
    width: calc(100vw - 24px);
    max-width: 100%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
  }
  .filters-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .search-bar { max-width: 100%; width: 100%; }
  .login-card { margin: 14px; padding: 28px 20px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-title { font-size: 20px; }

  /* Bottom nav compact on very small */
  .bottom-nav-label { font-size: 9px; }
  .bottom-nav-icon { width: 18px; height: 18px; }
  .bottom-nav-icon-wrap { width: 26px; height: 26px; }

  /* Topbar icons smaller on mobile */
  .theme-toggle, .icon-btn { width: 32px; height: 32px; }
  .user-avatar { width: 32px; height: 32px; font-size: 12px; }
}

/* ── SMALL MOBILE (≤480px) ──────────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .topbar-search { max-width: 130px; }
  .topbar { gap: 8px; }
  .topbar-right { gap: 4px; }
  .page-content { padding: 14px 12px; }

  /* Stack filters vertically */
  .filter-chips { flex-wrap: wrap; gap: 5px; }
  .filter-chip { padding: 5px 10px; font-size: 11px; }

  /* Modal full width */
  .modal {
    width: 100vw;
    left: 0; right: 0;
    transform: translateX(0);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    top: auto;
    bottom: 0;
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  @keyframes modalReveal {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
}

/* ── DESKTOP (>1024px) ──────────────────────────────── */
@media (min-width: 1025px) {
  .bottom-nav { display: none !important; }
  .bottom-sheet { display: none !important; }
  .bottom-sheet-overlay { display: none !important; }
  .topbar-mobile-logo { display: none !important; }
  .hamburger { display: none; }
  .main-wrap { margin-left: var(--sidebar-w); }
}

/* ── LARGE DESKTOP ──────────────────────────────────── */
@media (min-width: 1280px) {
  .charts-row { grid-template-columns: 2fr 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── UTILITIES ──────────────────────────────────────── */
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--brand-green); }
.text-danger  { color: var(--brand-red); }
.text-blue    { color: var(--brand-blue); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-auto { margin-top: auto; }
.gap-8 { gap: 8px; }
.flex { display: flex; align-items: center; }
.separator { height: 1px; background: var(--border); margin: 8px 0; }

/* ═══════════════════════════════════════════════════════
   OFFPAY MOBILE-FIRST ENHANCEMENTS v3.0
   Premium fintech • Glassmorphism • iOS safe-area aware
═══════════════════════════════════════════════════════ */

/* ── ENHANCED CSS VARIABLES ─────────────────────────── */
:root {
  --bottom-nav-height: 68px;
  --topbar-height-mobile: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tap-feedback: rgba(59,130,246,0.12);
  --glass-bg: rgba(15,23,41,0.85);
  --glass-border: rgba(255,255,255,0.08);
  --radius-pill: 100px;
}

[data-theme="light"] {
  --glass-bg: rgba(255,255,255,0.9);
  --glass-border: rgba(0,0,0,0.08);
}

/* ── GLOBAL TOUCH IMPROVEMENTS ──────────────────────── */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
input, textarea, select {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: text;
  user-select: text;
}
button, a[onclick], [onclick] {
  touch-action: manipulation;
}

/* ── ENHANCED LOADER ─────────────────────────────────── */
.loader-overlay {
  background: linear-gradient(135deg, #060B18 0%, #090E1A 50%, #0A1020 100%);
}
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.loader-logo-wrap {
  width: 100px;
  height: 100px;
}
.loader-favicon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  box-shadow: 0 0 0 0 rgba(0,212,255,0.4), 0 0 60px rgba(0,212,255,0.2);
  animation: loaderPulseEnhanced 2s ease-in-out infinite;
}
@keyframes loaderPulseEnhanced {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(0,212,255,0.4), 0 0 60px rgba(0,212,255,0.2);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 0 0 12px rgba(0,212,255,0), 0 0 80px rgba(0,212,255,0.3);
  }
}
.loader-brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 28px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #00D4FF, #3B82F6, #6366F1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loader-progress {
  width: 160px;
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 24px;
}
.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00D4FF, #3B82F6);
  border-radius: 2px;
  animation: progressFill 1.8s ease forwards;
}
@keyframes progressFill {
  0%   { width: 0%; }
  30%  { width: 40%; }
  70%  { width: 75%; }
  100% { width: 100%; }
}

/* ── ENHANCED LOGIN PAGE ─────────────────────────────── */
.login-page {
  background: #060B18;
  padding: env(safe-area-inset-top, 20px) 0 env(safe-area-inset-bottom, 20px);
}
.login-bg-grid {
  background-image:
    linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.login-card {
  background: rgba(11,18,36,0.95);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 32px 64px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.03),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ── ENHANCED BOTTOM NAVIGATION ──────────────────────── */
.bottom-nav {
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding: 0 8px var(--safe-bottom);
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -1px 0 rgba(255,255,255,0.04), 0 -8px 32px rgba(0,0,0,0.3);
  display: none;
  align-items: center;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: var(--bottom-nav-height);
  gap: 4px;
  padding: 8px 4px;
  border-radius: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.bottom-nav-item:active {
  transform: scale(0.90);
  transition: transform 0.08s ease;
}
.bottom-nav-item.active {
  color: var(--brand-blue);
}
.bottom-nav-icon-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s ease;
}
.bottom-nav-item.active .bottom-nav-icon-wrap {
  background: rgba(59,130,246,0.15);
}
.bottom-nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-spring);
}
.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
}
.bottom-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  white-space: nowrap;
  text-align: center;
}
.bottom-nav-indicator {
  display: none;
  position: absolute;
  top: 4px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-blue));
  box-shadow: 0 0 8px rgba(59,130,246,0.6);
}
.bottom-nav-item.active .bottom-nav-indicator {
  display: block;
}
.bottom-nav-dot {
  position: absolute;
  top: 6px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-red);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
}

/* ── ENHANCED SIDEBAR ────────────────────────────────── */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  box-shadow: none;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s ease;
}
.sidebar.open {
  box-shadow: 8px 0 48px rgba(0,0,0,0.5);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}
.sidebar-overlay.open {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* ── ENHANCED TOPBAR ─────────────────────────────────── */
.topbar {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  padding-top: env(safe-area-inset-top, 0px);
  min-height: 64px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03), 0 2px 16px rgba(0,0,0,0.15);
}

/* ── ENHANCED STAT CARDS ─────────────────────────────── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  overflow: hidden;
  position: relative;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25), 0 0 0 1px var(--border-strong);
}
.stat-card:active {
  transform: translateY(0) scale(0.98);
  transition: transform 0.08s ease;
}

/* ── ENHANCED CHART CARDS ────────────────────────────── */
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.chart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.3), transparent);
}

/* ── SECTION & TABLE CARDS ───────────────────────────── */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

/* ── MOBILE CARD VIEW FOR TABLES ─────────────────────── */
.mobile-card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.mobile-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.mobile-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-blue);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.mobile-card:hover::before,
.mobile-card:active::before { opacity: 1; }
.mobile-card:active {
  transform: scale(0.98);
  background: var(--bg-hover);
  transition: transform 0.08s ease;
}
.mobile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mobile-card-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.mobile-card-info {
  flex: 1;
  min-width: 0;
}
.mobile-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.mobile-card-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.mobile-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.mobile-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mobile-card-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── ENHANCED PAGE HEADER ────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── ENHANCED BUTTONS ────────────────────────────────── */
.btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s ease;
}
.btn:active::after {
  background: rgba(255,255,255,0.08);
}
.btn-primary {
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  color: white;
  box-shadow: 0 4px 16px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-ghost:active {
  transform: scale(0.97);
}
.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 10px;
}

/* ── ENHANCED FILTER CHIPS ───────────────────────────── */
.filter-chip {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.filter-chip:active {
  transform: scale(0.95);
}
.filter-chip.active {
  background: rgba(37,99,235,0.12);
  color: var(--brand-blue);
  border-color: rgba(37,99,235,0.3);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.06);
}

/* ── ENHANCED MODALS ─────────────────────────────────── */
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  box-shadow:
    0 32px 64px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.04);
}
.modal-header {
  padding: 20px 24px 18px;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.modal-close:hover {
  background: rgba(239,68,68,0.12);
  color: var(--brand-red);
}
.modal-close:active {
  transform: scale(0.9);
}

/* ── ENHANCED TOASTS ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 16px;
  left: 16px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: flex-end;
}
.toast {
  max-width: 360px;
  width: auto;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  min-width: 240px;
  animation: toastSlideEnhanced 0.35s var(--ease-spring);
}
@keyframes toastSlideEnhanced {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ── ENHANCED BOTTOM SHEET ───────────────────────────── */
.bottom-sheet {
  background: var(--bg-elevated);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-strong);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 12px 16px calc(20px + var(--safe-bottom));
  box-shadow: 0 -24px 64px rgba(0,0,0,0.4);
}
.bottom-sheet-handle {
  width: 36px;
  height: 5px;
  border-radius: 5px;
  background: var(--border-strong);
  margin: 0 auto 20px;
}
.bottom-sheet-item {
  padding: 14px 16px;
  border-radius: 14px;
  min-height: 60px;
  gap: 14px;
}
.bottom-sheet-item:active {
  transform: scale(0.98);
  transition: transform 0.08s ease;
}
.bottom-sheet-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex-shrink: 0;
  font-size: 20px;
}

/* ── ACTION BUTTONS ENHANCED ─────────────────────────── */
.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:active {
  transform: scale(0.90);
}

/* ── ENHANCED NAV ITEMS ──────────────────────────────── */
.nav-item {
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 44px;
  transition: all 0.15s ease;
}
.nav-item:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(79,70,229,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.nav-item.active::before {
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-blue));
  box-shadow: 0 0 8px rgba(59,130,246,0.4);
}

/* ── SEARCH INPUT ENHANCED ───────────────────────────── */
.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 40px;
  font-size: 14px;
  transition: all 0.2s ease;
}
.search-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: var(--bg-surface);
}

/* ── FORM INPUTS ENHANCED ────────────────────────────── */
.form-input {
  min-height: 48px;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  transition: all 0.2s ease;
}
.form-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
  background: rgba(255,255,255,0.04);
}
.input-wrap .form-input {
  padding-left: 44px;
}
.input-icon {
  left: 14px;
  width: 18px;
  height: 18px;
}
.btn-login {
  min-height: 52px;
  font-size: 16px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-login:active {
  transform: scale(0.98);
}

/* ── SCROLLABLE HORIZONTAL FILTERS ──────────────────── */
.filter-scroll-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.filter-scroll-wrap::-webkit-scrollbar {
  display: none;
}
.filter-scroll-inner {
  display: flex;
  gap: 6px;
  width: max-content;
}

/* ── SWIPEABLE TABLE HINT ────────────────────────────── */
.table-scroll-hint {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 16px 0;
  font-style: italic;
}
.table-scroll-hint svg {
  animation: swipeHint 2s ease-in-out infinite;
}
@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* ── PULL-TO-REFRESH VISUAL ──────────────────────────── */
.ptr-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.ptr-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: loaderSpin 0.8s linear infinite;
}

/* ── MOBILE QUICK ACTIONS STRIP ──────────────────────── */
.mobile-quick-actions {
  display: none;
  gap: 8px;
  padding: 0 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mobile-quick-actions::-webkit-scrollbar { display: none; }
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.quick-action-btn:active {
  transform: scale(0.95);
  background: var(--bg-hover);
}
.quick-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.quick-action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── MOBILE SUMMARY STRIP ────────────────────────────── */
.mobile-summary-strip {
  display: none;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(79,70,229,0.08));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mobile-summary-strip::-webkit-scrollbar { display: none; }
.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.summary-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.summary-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── THEME TOGGLE ENHANCEMENT ────────────────────────── */
.theme-toggle, .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  transition: all 0.15s ease;
}
.theme-toggle:active, .icon-btn:active {
  transform: scale(0.90);
}

/* ── HAMBURGER ENHANCED ──────────────────────────────── */
.hamburger {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
}
.hamburger:active {
  transform: scale(0.90);
  background: var(--bg-hover);
}
.hamburger span {
  width: 16px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.2s ease;
  display: block;
}

/* ── NOTIFICATION DOT ANIMATION ─────────────────────── */
.notif-dot {
  animation: notifPulse 2s ease-in-out infinite;
}
@keyframes notifPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* ── PAGE TRANSITION ENHANCED ────────────────────────── */
.page {
  animation: pageRevealEnhanced 0.3s var(--ease-smooth) both;
}
@keyframes pageRevealEnhanced {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES — MOBILE FIRST
═══════════════════════════════════════════════════════ */

/* ── LARGE DESKTOP (1280px+) ─────────────────────────── */
@media (min-width: 1280px) {
  .charts-row { grid-template-columns: 2fr 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(5, 1fr); }
  .bottom-nav { display: none !important; }
  .bottom-sheet, .bottom-sheet-overlay { display: none !important; }
  .topbar-mobile-logo { display: none !important; }
  .main-wrap { margin-left: var(--sidebar-w); }
  .hamburger { display: none !important; }
}

/* ── DESKTOP (1025px – 1279px) ───────────────────────── */
@media (min-width: 1025px) and (max-width: 1279px) {
  .charts-row { grid-template-columns: 2fr 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .bottom-nav { display: none !important; }
  .bottom-sheet, .bottom-sheet-overlay { display: none !important; }
  .topbar-mobile-logo { display: none !important; }
  .main-wrap { margin-left: var(--sidebar-w); }
  .hamburger { display: none !important; }
}

/* ── TABLET (769px – 1024px) ─────────────────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 64px rgba(0,0,0,0.5);
  }
  .sidebar-close { display: flex !important; }
  .main-wrap {
    margin-left: 0;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  }
  .bottom-nav {
    display: flex;
    padding: 0 16px var(--safe-bottom);
  }
  .hamburger {
    display: flex !important;
  }
  .topbar-mobile-logo { display: block !important; }
  .page-content { padding: 24px 20px; }
  .topbar { padding: 0 20px; }
  .search-kbd { display: none !important; }
  .topbar-search { max-width: 280px; }
  .charts-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .toast-container {
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  }
}

/* ── MOBILE (≤768px) ─────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
    width: 280px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 64px rgba(0,0,0,0.5);
  }
  .sidebar-close { display: flex !important; }
  .main-wrap {
    margin-left: 0 !important;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    min-height: 100vh;
    overflow-x: hidden;
  }
  .bottom-nav {
    display: flex !important;
    padding: 0 4px var(--safe-bottom);
  }
  .hamburger {
    display: flex !important;
  }
  .topbar {
    padding: 0 12px;
    height: var(--topbar-height-mobile);
    min-height: var(--topbar-height-mobile);
  }
  .topbar-mobile-logo {
    display: block !important;
    height: 26px;
  }
  .topbar-search {
    max-width: 160px;
  }
  .search-input {
    font-size: 13px;
    padding: 7px 12px 7px 36px;
    min-height: 36px;
  }
  .search-kbd { display: none !important; }
  .page-content {
    padding: 14px 12px;
    overflow-x: hidden;
  }
  .page-title {
    font-size: 22px;
  }
  .page-subtitle {
    font-size: 13px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 16px;
    border-radius: 16px;
  }
  .stat-value {
    font-size: 24px;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
  }
  .charts-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .chart-card {
    padding: 16px;
  }
  .chart-wrap {
    height: 180px;
  }
  .settings-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  /* Table: hide on mobile, show cards */
  .table-wrap { display: none; }
  .mobile-card-list { display: flex; }
  .table-scroll-hint { display: flex; }

  /* Filters bar mobile */
  .filters-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .search-bar {
    max-width: 100%;
    width: 100%;
  }
  .search-bar input {
    min-height: 44px;
    font-size: 14px;
  }
  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    width: 100%;
    gap: 6px;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chip {
    flex-shrink: 0;
  }

  /* Modal full-screen on mobile */
  .modal {
    width: 100vw;
    max-width: 100vw;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 28px 28px 0 0;
    top: auto;
    bottom: 0;
    max-height: 92vh;
    animation: mobileModalUp 0.3s var(--ease-spring);
  }
  @keyframes mobileModalUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }

  /* Toast position */
  .toast-container {
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px);
    left: 12px;
    right: 12px;
    align-items: stretch;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  /* Bottom nav adjustments */
  .bottom-nav-label { font-size: 9px; }
  .bottom-nav-icon { width: 20px; height: 20px; }
  .bottom-nav-icon-wrap { width: 30px; height: 30px; }

  /* Topbar buttons */
  .theme-toggle, .icon-btn {
    width: 36px;
    height: 36px;
  }
  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  /* Hide last-updated on mobile */
  .last-updated { display: none; }

  /* Table footer */
  .table-footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .pagination {
    align-self: flex-end;
  }

  /* Section header */
  .section-header {
    padding: 14px 16px;
  }
}

/* ── SMALL MOBILE (≤480px) ──────────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 20px; }
  .stat-card { padding: 14px; }
  .stat-sublabel { display: none; }
  .topbar-search { display: none; }
  .topbar { gap: 0; }
  .topbar-right { gap: 6px; }
  .page-content { padding: 12px 10px; }
  .chart-wrap { height: 160px; }
  .chart-wrap--donut { height: 140px; }
  .bottom-nav-label { font-size: 8.5px; letter-spacing: 0; }
  .bottom-nav-icon-wrap { width: 28px; height: 28px; border-radius: 8px; }
  .bottom-nav-icon { width: 18px; height: 18px; }
  .bottom-nav-item { gap: 3px; }
  .page-title { font-size: 20px; }
  .btn { min-height: 44px; }
  .filter-chip { min-height: 34px; padding: 5px 12px; }
}

/* ── VERY SMALL (≤360px) ─────────────────────────────── */
@media (max-width: 360px) {
  .page-content { padding: 10px 8px; }
  .stats-grid { gap: 6px; }
  .stat-value { font-size: 18px; }
  .stat-card { padding: 12px; }
  .bottom-nav-label { display: none; }
  .bottom-nav-item { justify-content: center; }
  .bottom-nav-icon-wrap { width: 34px; height: 34px; }
  .bottom-nav-icon { width: 20px; height: 20px; }
}

/* ── HOVER ONLY ON POINTER DEVICES ──────────────────── */
@media (hover: none) {
  .stat-card:hover { transform: none; box-shadow: none; }
  .btn-primary:hover { transform: none; }
  .nav-item:hover { background: transparent; }
  .action-btn:hover { background: var(--bg-elevated); border-color: var(--border); }
}

/* ── SAFE AREA UTILITIES ─────────────────────────────── */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.safe-top {
  padding-top: env(safe-area-inset-top, 0px);
}
