/* ═══════════════════════════════════════════════════════════════════════════
   KAMPEA SUPER ADMIN — Premium SaaS UI
   Light + Dark Mode · Fully Responsive
═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables: Light Mode ── */
:root {
  --bg:          #f4f3ff;
  --surface:     #ffffff;
  --surface-2:   #f9f8ff;
  --border:      #e8e4ff;
  --border-2:    #d4cfff;
  --text:        #0d0c1d;
  --text-2:      #4a4870;
  --muted:       #8b89b0;

  --primary:         #6366f1;
  --primary-dark:    #4f46e5;
  --primary-soft:    #eef0ff;
  --primary-glow:    rgba(99,102,241,.18);

  --success:         #10b981;
  --success-soft:    #d1fae5;
  --success-border:  #6ee7b7;

  --warning:         #f59e0b;
  --warning-soft:    #fef3c7;
  --warning-border:  #fcd34d;

  --danger:          #ef4444;
  --danger-soft:     #fee2e2;
  --danger-border:   #fca5a5;

  --info:            #0ea5e9;
  --info-soft:       #e0f2fe;
  --info-border:     #7dd3fc;

  --sidebar-bg:      #0d0c24;
  --sidebar-text:    rgba(255,255,255,.75);
  --sidebar-muted:   rgba(255,255,255,.4);
  --sidebar-active:  rgba(99,102,241,.22);
  --sidebar-hover:   rgba(255,255,255,.07);
  --sidebar-border:  rgba(255,255,255,.07);
  --sidebar-w:       260px;

  --radius-xs:  8px;
  --radius-sm:  12px;
  --radius:     16px;
  --radius-lg:  22px;
  --radius-xl:  28px;

  --shadow-sm:  0 2px 8px rgba(13,12,29,.06);
  --shadow:     0 8px 24px rgba(13,12,29,.08);
  --shadow-lg:  0 24px 60px rgba(13,12,29,.14);

  --transition: .18s ease;
}

/* ── CSS Variables: Dark Mode ── */
body.admin-dark {
  --bg:          #080714;
  --surface:     #100f20;
  --surface-2:   #13122a;
  --border:      #1e1b38;
  --border-2:    #2a2650;
  --text:        #f0eeff;
  --text-2:      #9d9bc4;
  --muted:       #5e5c80;

  --primary-soft:  #1a1845;
  --primary-glow:  rgba(99,102,241,.25);

  --success-soft:   #052e1c;
  --success-border: #064e33;
  --warning-soft:   #2d1d00;
  --warning-border: #5a3900;
  --danger-soft:    #2a0b0b;
  --danger-border:  #5a1616;
  --info-soft:      #041f2e;
  --info-border:    #083344;

  --sidebar-bg:     #06051a;
  --sidebar-text:   rgba(255,255,255,.72);
  --sidebar-active: rgba(99,102,241,.28);
  --sidebar-hover:  rgba(255,255,255,.06);
  --sidebar-border: rgba(255,255,255,.06);

  --shadow-sm:  0 2px 8px rgba(0,0,0,.35);
  --shadow:     0 8px 24px rgba(0,0,0,.45);
  --shadow-lg:  0 24px 60px rgba(0,0,0,.60);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { height: 100vh; overflow: hidden; }
h1,h2,h3,h4,p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted) !important; }

/* ═══════════════════════════════════════════════════
   AUTH / LOGIN
═══════════════════════════════════════════════════ */
.shell { min-height: 100vh; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,.10) 0%, transparent 50%),
    var(--bg);
}

body.admin-dark .login-shell {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,.20) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,.15) 0%, transparent 50%),
    var(--bg);
}

.login-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

/* Brand in login */
.brand { font-size: 22px; font-weight: 900; letter-spacing: -.03em; color: var(--text); }
.brand-sub { color: var(--muted); font-size: 13px; margin-top: 3px; margin-bottom: 28px; }

/* Login logo badge */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 32px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,.10) 0%, transparent 50%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 32px;
}
.brand-line { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.brand-badge {
  width: 50px; height: 50px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff; font-weight: 900; font-size: 22px;
  box-shadow: 0 8px 20px rgba(99,102,241,.30);
  flex-shrink: 0;
}
.brand-line h1 { font-size: 22px; font-weight: 900; letter-spacing: -.02em; color: var(--text); }
.brand-line p { margin-top: 2px; color: var(--muted); font-size: 13px; }

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════════ */
.field, .form-row {
  display: flex; flex-direction: column;
  gap: 7px; margin-bottom: 14px;
}
.field label, .form-row label {
  font-size: 12px; font-weight: 700;
  color: var(--text-2); letter-spacing: .02em; text-transform: uppercase;
}

.field input, .field select, .field textarea,
.form-row input:not([type="checkbox"]):not([type="radio"]),
.form-row select, .form-row textarea,
.search {
  width: 100%; height: 44px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field textarea, .form-row textarea {
  height: auto; padding: 12px 14px; resize: vertical;
}

.field input:focus, .field select:focus, .field textarea:focus,
.form-row input:not([type="checkbox"]):not([type="radio"]):focus,
.form-row select:focus, .form-row textarea:focus,
.search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

input:disabled, select:disabled {
  background: var(--surface-2); color: var(--muted); cursor: not-allowed;
  opacity: .75;
}

/* Password wrap */
.password-wrap, .auth-pass {
  position: relative; display: flex; align-items: center; width: 100%; gap: 0;
}
.password-wrap input, .auth-pass input { flex: 1; padding-right: 52px !important; }
.auth-pass input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.auth-pass > button:last-child {
  height: 44px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border: 1.5px solid var(--border); border-left: none;
  background: var(--surface-2); color: var(--text-2); padding: 0 14px;
}

.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: transparent;
  display: grid; place-items: center; padding: 0; color: var(--muted);
  font-size: 16px; z-index: 2; border-radius: var(--radius-xs);
  transition: background var(--transition), color var(--transition);
}
.eye-btn:hover { background: var(--surface-2); color: var(--text); }

/* Error/info boxes */
.error-box, .form-error {
  background: var(--danger-soft); color: #991b1b;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px;
}
.info-box {
  background: var(--info-soft); color: #0369a1;
  border: 1px solid var(--info-border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px;
}
body.admin-dark .error-box, body.admin-dark .form-error { color: #fca5a5; }
body.admin-dark .info-box { color: #7dd3fc; }

/* Remember row */
.remember-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; background: var(--surface-2); flex-wrap: wrap;
}
.remember-left { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-2); }
.remember-left input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.remember-help { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm); height: 42px;
  padding: 0 18px; font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: transform var(--transition), opacity var(--transition),
              box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff; box-shadow: 0 6px 18px rgba(99,102,241,.28);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(99,102,241,.38); }

.btn-secondary {
  background: var(--primary-soft); color: var(--primary-dark); border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

body.admin-dark .btn-secondary {
  background: var(--surface-2); color: var(--text-2); border-color: var(--border);
}
body.admin-dark .btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-full { width: 100%; }
.btn-small { height: 36px; padding: 0 12px; font-size: 12px; }

.btn-danger { background: var(--danger-soft); color: #991b1b; border: 1px solid var(--danger-border); }
.btn-danger:hover { background: var(--danger-border); }
body.admin-dark .btn-danger { color: #fca5a5; }

.btn-link {
  background: transparent; color: var(--primary); border: none;
  box-shadow: none; height: auto; padding: 2px 0; font-weight: 700;
  border-radius: 0; align-self: flex-start;
}
.btn-link:hover { transform: none; text-decoration: underline; }

/* Mini action buttons (in tables) */
.mini-btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); border-radius: var(--radius-xs);
  padding: 7px 11px; font-size: 12px; font-weight: 700;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.mini-btn:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.mini-btn.danger { background: var(--danger-soft); color: #991b1b; border-color: var(--danger-border); }
.mini-btn.danger:hover { background: var(--danger-border); }
body.admin-dark .mini-btn.danger { color: #fca5a5; }
body.admin-dark .mini-btn { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
body.admin-dark .mini-btn:hover { background: var(--border); color: var(--text); }

.danger { background: #dc2626 !important; color: #fff !important; border-color: #dc2626 !important; }

/* Toggle buttons (Enabled/Disabled) */
.plan-toggle {
  height: 38px; border: 1.5px solid transparent;
  border-radius: var(--radius-sm); padding: 0 16px;
  font-weight: 700; font-size: 12px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.plan-toggle.on {
  background: var(--success-soft); color: #065f46; border-color: var(--success-border);
}
.plan-toggle.on:hover { background: var(--success-border); }
.plan-toggle.off {
  background: var(--danger-soft); color: #991b1b; border-color: var(--danger-border);
}
.plan-toggle.off:hover { background: var(--danger-border); }
body.admin-dark .plan-toggle.on { color: #6ee7b7; }
body.admin-dark .plan-toggle.off { color: #fca5a5; }

.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: var(--radius-xs); background: var(--surface-2);
  color: var(--text-2); font-size: 17px; display: grid; place-items: center;
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--border); color: var(--text); }
body.admin-dark .icon-btn { background: var(--surface-2); border-color: var(--border); }

/* ═══════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════ */
.app-shell {
  height: 100vh; overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════ */
.sidebar {
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  gap: 6px; padding: 22px 14px;
  height: 100vh; overflow-y: auto; overflow-x: hidden;
  position: sticky; top: 0;
  border-right: 1px solid rgba(255,255,255,.05);
}

/* Hide default scrollbar on sidebar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

.sidebar-brand, .brand-line {
  display: flex; align-items: center;
  gap: 12px; padding: 6px 8px 18px; border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
}
.sidebar-brand .brand-badge {
  width: 36px; height: 36px; border-radius: 11px; font-size: 18px;
}
.brand-name { font-size: 16px; font-weight: 900; color: #fff; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--sidebar-muted); margin-top: 1px; }

/* Nav */
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  width: 100%; text-align: left; border: none;
  background: transparent; color: var(--sidebar-text);
  padding: 11px 12px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--sidebar-active); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.4);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}

/* Nav section label */
.nav-section-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--sidebar-muted);
  padding: 14px 12px 6px; margin-top: 4px;
}

.sidebar-footer {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; gap: 8px;
}

/* Dark toggle inside sidebar */
#adminDarkToggle {
  width: 100%; background: var(--sidebar-hover); border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  transition: background var(--transition);
}
#adminDarkToggle:hover { background: rgba(255,255,255,.1); color: #fff; }
#adminDarkIndicator {
  width: 30px; height: 17px; border-radius: 999px;
  background: rgba(255,255,255,.2); position: relative; flex-shrink: 0;
  transition: background var(--transition);
}
#adminDarkIndicator.on { background: var(--primary) !important; }
#adminDarkThumb {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; transition: transform .2s ease;
}
#adminDarkIndicator.on #adminDarkThumb { transform: translateX(13px); }

#logoutBtn {
  width: 100%; background: rgba(239,68,68,.1); color: #fca5a5;
  border: 1px solid rgba(239,68,68,.2); border-radius: var(--radius-sm);
  height: 40px; font-weight: 700; font-size: 13px;
  transition: background var(--transition);
}
#logoutBtn:hover { background: rgba(239,68,68,.2); }

/* Admin meta */
.admin-meta { font-size: 12px; color: var(--sidebar-muted); padding: 0 4px; line-height: 1.6; }

/* Sidebar backdrop */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); border: none; padding: 0; margin: 0; z-index: 25;
}

/* ═══════════════════════════════════════════════════
   MAIN SHELL
═══════════════════════════════════════════════════ */
.main-shell {
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: var(--bg);
  padding: 0;
}

/* ── Topbar ── */
.topbar {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  padding: 22px 28px 18px;
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-title-wrap { display: flex; align-items: flex-start; gap: 12px; }
.topbar h2, #pageTitle {
  font-size: 22px; font-weight: 900; letter-spacing: -.025em;
  color: var(--text); line-height: 1.2;
}
#pageSub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.topbar-actions, .top-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.search, #userSearch {
  width: 240px; height: 40px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 14px;
  color: var(--text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search:focus, #userSearch:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow);
}
body.admin-dark .search, body.admin-dark #userSearch { background: var(--surface-2); }

.menu-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-2); font-size: 18px;
  align-items: center; justify-content: center;
  transition: background var(--transition);
}
.menu-toggle:hover { background: var(--border); }

/* ── Main content area ── */
.main {
  padding: 24px 28px 36px;
  display: flex; flex-direction: column; gap: 18px;
  flex: 1;
}

/* ═══════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* Subtle gradient accent per card type */
.card-total    { background: linear-gradient(145deg, var(--surface) 60%, rgba(99,102,241,.05)); }
.card-subscribed { background: linear-gradient(145deg, var(--surface) 60%, rgba(16,185,129,.05)); }
.card-trial    { background: linear-gradient(145deg, var(--surface) 60%, rgba(14,165,233,.05)); }
.card-expired  { background: linear-gradient(145deg, var(--surface) 60%, rgba(239,68,68,.05)); }
.card-deactive { background: linear-gradient(145deg, var(--surface) 60%, rgba(100,116,139,.05)); }
.card-blocked  { background: linear-gradient(145deg, var(--surface) 60%, rgba(245,158,11,.05)); }
.card-banned   { background: linear-gradient(145deg, var(--surface) 60%, rgba(139,92,246,.05)); }
.card-events   { background: linear-gradient(145deg, var(--surface) 60%, rgba(6,182,212,.05)); }

.stat-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px;
}
.stat-value {
  font-size: 26px; font-weight: 900; color: var(--text);
  line-height: 1.1; margin-bottom: 6px; letter-spacing: -.03em;
}
.stat-sub { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════
   PANELS
═══════════════════════════════════════════════════ */
.panel, section.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.panel-head h3 {
  font-size: 15px; font-weight: 800; color: var(--text);
  letter-spacing: -.01em;
}

/* ═══════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════ */
table { width: 100%; border-collapse: collapse; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.data-table { width: 100%; }

.data-table th {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1.5px solid var(--border);
  background: var(--surface-2); text-align: left; white-space: nowrap;
}
.data-table td {
  padding: 13px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-2); }

body.admin-dark .data-table th { background: var(--surface-2); color: var(--muted); border-bottom-color: var(--border-2); }
body.admin-dark .data-table td { border-bottom-color: var(--border); }
body.admin-dark .data-table tbody tr:hover td { background: var(--surface-2); }

/* Table utility */
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; }

.row-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }

/* User cell */
.user-cell { display: flex; flex-direction: column; gap: 3px; }
.user-name { font-weight: 800; font-size: 14px; }
.user-sub { color: var(--muted); font-size: 12px; word-break: break-word; }

/* ═══════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .03em;
  text-transform: capitalize; border: 1.5px solid transparent;
  white-space: nowrap;
}

.badge.active, .badge.success     { background: var(--success-soft); color: #065f46; border-color: var(--success-border); }
.badge.trial                       { background: var(--info-soft); color: #075985; border-color: var(--info-border); }
.badge.grace                       { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge.expired                     { background: var(--danger-soft); color: #991b1b; border-color: var(--danger-border); }
.badge.cancelled                   { background: var(--surface-2); color: var(--text-2); border-color: var(--border-2); }
.badge.suspended, .badge.warning   { background: var(--warning-soft); color: #92400e; border-color: var(--warning-border); }
.badge.blocked, .badge.danger      { background: var(--danger-soft); color: #b91c1c; border-color: var(--danger-border); }
.badge.deactivated                 { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge.removed, .badge.banned      { background: #1f2937; color: #f9fafb; border-color: #374151; }

.badge.basic, .badge.pro, .badge.enterprise,
.badge.studio, .badge.free, .badge.plan   { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--border-2); }
.badge.plan-trial                  { background: var(--info-soft); color: #075985; border-color: var(--info-border); }

body.admin-dark .badge.active      { color: #6ee7b7; }
body.admin-dark .badge.trial       { color: #7dd3fc; }
body.admin-dark .badge.expired     { color: #fca5a5; }
body.admin-dark .badge.suspended   { color: #fcd34d; }
body.admin-dark .badge.removed, body.admin-dark .badge.banned { background: #374151; color: #f9fafb; }

/* ═══════════════════════════════════════════════════
   PLAN CARDS
═══════════════════════════════════════════════════ */
.plan-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.plan-card {
  border: 1.5px solid var(--border); background: var(--surface);
  border-radius: var(--radius-lg); padding: 18px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.plan-card:hover { box-shadow: var(--shadow); border-color: var(--border-2); transform: translateY(-1px); }
body.admin-dark .plan-card { background: var(--surface-2); }

.plan-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.plan-name { font-size: 15px; font-weight: 900; color: var(--text); margin-bottom: 5px; letter-spacing: -.01em; }
.plan-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.price { font-size: 20px; font-weight: 900; color: var(--text); letter-spacing: -.03em; }

/* Payment method settings */
.pm-method-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
body.admin-dark .pm-method-card { background: var(--surface-2); border-color: var(--border); }

/* Toggle limit wrap */
.plan-toggle-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 46px; }
.toggle-limit-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.toggle-limit-wrap label { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.toggle-limit-wrap input { height: 38px; width: 100px; font-size: 13px; }
.toggle-limit-wrap small { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ═══════════════════════════════════════════════════
   ACTIVITY CARDS
═══════════════════════════════════════════════════ */
.activity-list { display: grid; gap: 10px; }
.activity-card {
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius); padding: 14px 16px;
  transition: border-color var(--transition);
}
.activity-card:hover { border-color: var(--border-2); }
body.admin-dark .activity-card { background: var(--surface-2); }

/* ═══════════════════════════════════════════════════
   DIALOGS / MODALS
═══════════════════════════════════════════════════ */
.dialog, .dialog-card {
  border: none; padding: 0;
  border-radius: var(--radius-xl); background: transparent;
  max-width: min(720px, calc(100vw - 24px));
  width: min(720px, calc(100vw - 24px));
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop, .dialog-card::backdrop {
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
}
.dialog-form, .dialog-body {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
}
body.admin-dark .dialog-form, body.admin-dark .dialog-body {
  background: var(--surface) !important; border-color: var(--border) !important;
  color: var(--text) !important;
}
.dialog-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 14px; margin-bottom: 20px;
}
.dialog-head h3 { font-size: 17px; font-weight: 900; color: var(--text); letter-spacing: -.02em; }
.dialog-actions {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 22px;
}
.dialog-actions-start { justify-content: flex-start; }
.dialog-actions-between { justify-content: space-between; align-items: center; }
.dialog-grid, .grid-two {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.full, .col-span-2 { grid-column: 1 / -1; }

/* Modallike dialogs */
.modal, .modalBody, .fbModal, .fbMModal {
  background: var(--surface) !important; border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ═══════════════════════════════════════════════════
   CONTENT GRIDS
═══════════════════════════════════════════════════ */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
  gap: 18px;
}
.right-stack { display: flex; flex-direction: column; gap: 18px; }
.resp-health-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; }
.resp-broadcast-grid { display: grid; grid-template-columns: 1fr minmax(240px,300px); gap: 20px; }

/* ═══════════════════════════════════════════════════
   REVENUE CARDS
═══════════════════════════════════════════════════ */
#revenueCards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════
   ANNOUNCEMENT / BROADCAST
═══════════════════════════════════════════════════ */
#announcementPreview {
  border-radius: var(--radius); padding: 14px 18px;
  font-size: 14px; font-weight: 600;
}
#bcAudienceCount {
  background: var(--success-soft); border: 1px solid var(--success-border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: #065f46; font-weight: 700; margin-top: 8px;
}
body.admin-dark #bcAudienceCount { color: #6ee7b7; }

/* ═══════════════════════════════════════════════════
   SECURITY PANEL — DANGER ZONE
═══════════════════════════════════════════════════ */
.security-panel { max-width: 860px; }
.danger-zone {
  margin-top: 24px; border-top: 2px solid var(--danger-border); padding-top: 20px;
}
.danger-zone-label {
  font-size: 11px; font-weight: 800; color: var(--danger);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px;
}
.danger-card {
  background: var(--danger-soft); border: 1.5px solid var(--danger-border);
  border-radius: var(--radius); padding: 16px;
}
body.admin-dark .danger-card { background: var(--surface-2); }

/* ═══════════════════════════════════════════════════
   FORGOT PASSWORD DIALOG
═══════════════════════════════════════════════════ */
.forgot-form { width: min(520px, calc(100vw - 28px)); padding: 20px; }
#forgotDialog.dialog-card { width: min(540px, calc(100vw - 28px)); }
.forgot-inline-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.forgot-inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.forgot-attempts {
  font-size: 12px; color: #991b1b; background: var(--danger-soft);
  border: 1px solid var(--danger-border); border-radius: 999px; padding: 5px 10px;
}
body.admin-dark .forgot-attempts { color: #fca5a5; }
.forgot-timer { font-size: 12px; color: var(--muted); }
.forgot-email-readonly {
  background: var(--surface-2) !important; color: var(--muted) !important;
  cursor: not-allowed !important; user-select: text;
}
.forgot-email-readonly:focus {
  outline: none !important; box-shadow: none !important; border-color: var(--border) !important;
}

/* ═══════════════════════════════════════════════════
   MISC
═══════════════════════════════════════════════════ */
.stack { display: flex; flex-direction: column; }
.gap8  { gap: 8px; }
.gap10 { gap: 10px; }
.gap12 { gap: 12px; }

.content-grid.single-col { grid-template-columns: 1fr; }

/* Pending UPI badge */
#pendingUpiSection .pending-label {
  background: var(--warning-soft); border: 1px solid var(--warning-border);
  border-radius: var(--radius-xs); padding: 2px 8px;
  font-size: 11px; font-weight: 800; color: #92400e;
}
body.admin-dark #pendingUpiSection .pending-label { color: #fcd34d; }

/* Revenue graph canvas */
#revenueGraphWrap { height: 180px; position: relative; }

/* Scrollbar (main content) */
.main-shell::-webkit-scrollbar { width: 5px; }
.main-shell::-webkit-scrollbar-track { background: transparent; }
.main-shell::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* Hide label */
#sidebarBackdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 49; }
#sidebarBackdrop.show { display: block; }

/* admin-dark input overrides */
body.admin-dark input:not([type="checkbox"]):not([type="radio"]),
body.admin-dark select, body.admin-dark textarea {
  background: var(--surface-2) !important; color: var(--text) !important;
  border-color: var(--border) !important;
}
body.admin-dark .form-row label { color: var(--text-2); }
body.admin-dark #pmSaveStatus { color: var(--success); }

/* ═══════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════ */
@keyframes kFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.admin-view { animation: kFadeIn .22s ease; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — 1200px
═══════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .resp-health-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — 900px (Tablet)
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  body.sidebar-open { overflow: hidden; }

  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: min(280px, 82vw); height: 100vh;
    z-index: 50; transform: translateX(-105%);
    transition: transform .26s ease;
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--sidebar-border);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }

  .main-shell { padding: 0; height: 100vh; overflow-y: auto; }

  .topbar { padding: 16px 18px 14px; position: sticky; top: 0; z-index: 20; }
  .main { padding: 16px 18px 28px; }

  .menu-toggle { display: inline-flex !important; }
  .topbar-title-wrap { width: 100%; }
  .topbar-actions, .top-actions { flex-wrap: wrap; justify-content: flex-end; width: 100%; }
  .search, #userSearch { width: 100%; }

  .resp-broadcast-grid { grid-template-columns: 1fr; }
  #featureOverrideGrid { grid-template-columns: repeat(3,1fr) !important; }
  .resp-health-grid { grid-template-columns: 1fr !important; }
  #serverHealthGrid { grid-template-columns: 1fr 1fr !important; }

  .hide-tablet { display: none !important; }

  .dialog, .dialog-card { width: calc(100vw - 20px) !important; }
  .dialog-grid, .grid-two { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — 640px (Mobile)
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .plan-list { grid-template-columns: 1fr; }

  .main { padding: 14px 14px 28px; gap: 14px; }
  .topbar { padding: 14px 14px 12px; }

  .stat-card, .panel { border-radius: var(--radius); padding: 14px; }
  .stat-value { font-size: 22px; }

  .dialog, .dialog-card { width: calc(100vw - 16px) !important; border-radius: var(--radius-lg); }
  .dialog-form, .dialog-body { padding: 18px; border-radius: var(--radius-lg); }

  .table-wrap table { min-width: 680px; }
  .data-table th, .data-table td { padding: 10px 8px; font-size: 12px; }

  .topbar h2, #pageTitle { font-size: 18px; }
  .hide-mobile { display: none !important; }

  #featureOverrideGrid { grid-template-columns: repeat(2,1fr) !important; }
  #serverHealthGrid { grid-template-columns: 1fr !important; }

  .forgot-inline-row { flex-direction: column; align-items: flex-start; }
  .forgot-inline-actions { width: 100%; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — 480px (Small Mobile)
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card, .auth-card { padding: 22px 18px; border-radius: var(--radius-lg); }
  .brand-line h1 { font-size: 20px; }
  .resp-broadcast-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   LARGE SCREEN — 1600px+
═══════════════════════════════════════════════════ */
@media (min-width: 1600px) {
  .main { padding: 28px 36px 44px; gap: 22px; }
  .topbar { padding: 26px 36px 20px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
  .stat-card, .panel { border-radius: var(--radius-xl); }
  .topbar h2, #pageTitle { font-size: 26px; }
  :root { --sidebar-w: 280px; }
}

/* ── Disabled button state ── */
#resendResetCodeBtn:disabled, #resendResetCodeBtn.is-disabled {
  opacity: .5; cursor: not-allowed; pointer-events: none; box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   KAMPEA SUPER ADMIN — PREMIUM REDESIGN LAYER
   Appended last so it wins the cascade
═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar: complete visual overhaul ─────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, #0a0920 0%, #0d0c24 60%, #07061a 100%) !important;
  border-right: 1px solid rgba(99,102,241,.15) !important;
  padding: 0 !important;
  gap: 0 !important;
  position: relative; /* no !important — allow mobile media query to override */
  overflow: hidden; /* no !important */
}

/* Ambient glow top */
.sidebar::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(99,102,241,.18), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.sidebar::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(139,92,246,.12), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Brand area */
.sa-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
}
.sa-brand-badge {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900; color: #fff;
  box-shadow: 0 8px 20px rgba(99,102,241,.40), 0 0 0 1px rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sa-brand-name {
  font-size: 15px; font-weight: 900;
  color: #fff; letter-spacing: .06em;
  line-height: 1.1;
}
.sa-brand-sub {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.38);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}

/* Nav section label */
.sa-nav-section-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.28);
  padding: 16px 18px 5px;
  position: relative;
  z-index: 1;
}

/* Nav icon */
.sa-nav-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background .15s;
  color: rgba(255,255,255,.55);
}

/* Nav items */
.nav-item {
  width: calc(100% - 16px) !important;
  margin: 1px 8px !important;
  border-radius: 12px !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,.65) !important;
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  transition: background .15s, color .15s !important;
  position: relative;
  z-index: 1 !important;
  box-shadow: none !important;
  text-align: left !important;
}
.nav-item:hover {
  background: rgba(99,102,241,.12) !important;
  color: #fff !important;
}
.nav-item:hover .sa-nav-icon { color: rgba(255,255,255,.9); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(124,58,237,.14)) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.35) !important;
}
.nav-item.active .sa-nav-icon {
  background: rgba(99,102,241,.25);
  color: #a5b4fc;
}
.nav-item.active::before { display: none !important; }

/* Sidebar footer */
.sidebar-foot {
  margin-top: auto !important;
  padding: 14px 10px 18px !important;
  border-top: 1px solid rgba(255,255,255,.06) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  position: relative;
  z-index: 1;
}
#adminDarkToggle {
  width: 100% !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.7) !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer !important;
}
#adminDarkToggle:hover { background: rgba(255,255,255,.10) !important; color: #fff !important; }
#logoutBtn {
  background: rgba(239,68,68,.08) !important;
  border: 1px solid rgba(239,68,68,.22) !important;
  color: rgba(252,165,165,.85) !important;
  border-radius: 12px !important;
  height: 40px !important;
  font-weight: 700 !important;
}
#logoutBtn:hover { background: rgba(239,68,68,.16) !important; color: #fca5a5 !important; }

/* ── Topbar: frosted glass premium look ────────────────────────────────── */
.topbar {
  background: rgba(244,243,255,.92) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(99,102,241,.12) !important;
  padding: 20px 28px 16px !important;
}
body.admin-dark .topbar {
  background: rgba(8,7,20,.88) !important;
  border-bottom-color: rgba(99,102,241,.15) !important;
}
#pageTitle {
  font-size: 24px !important;
  font-weight: 900 !important;
  background: linear-gradient(135deg, #0d0c1d 0%, #4f46e5 120%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  letter-spacing: -.03em !important;
}
body.admin-dark #pageTitle {
  background: linear-gradient(135deg, #f0eeff 0%, #a5b4fc 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
#pageSub { color: var(--muted) !important; font-size: 12.5px !important; }

/* ── Stat cards: premium with icon & left accent ───────────────────────── */
.stat-card {
  border-radius: 18px !important;
  padding: 20px 20px 18px !important;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border) !important;
  transition: transform .18s, box-shadow .18s !important;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--primary);
}
.card-total::before    { background: linear-gradient(180deg, #6366f1, #7c3aed); }
.card-subscribed::before { background: linear-gradient(180deg, #10b981, #059669); }
.card-trial::before    { background: linear-gradient(180deg, #0ea5e9, #0284c7); }
.card-expired::before  { background: linear-gradient(180deg, #ef4444, #dc2626); }
.card-deactive::before { background: linear-gradient(180deg, #64748b, #475569); }
.card-blocked::before  { background: linear-gradient(180deg, #f59e0b, #d97706); }
.card-banned::before   { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }
.card-events::before   { background: linear-gradient(180deg, #06b6d4, #0891b2); }

/* Stat icon badge */
.stat-icon-badge {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  font-size: 18px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.card-total .stat-icon-badge    { background: rgba(99,102,241,.1); }
.card-subscribed .stat-icon-badge { background: rgba(16,185,129,.1); }
.card-trial .stat-icon-badge    { background: rgba(14,165,233,.1); }
.card-expired .stat-icon-badge  { background: rgba(239,68,68,.1); }
.card-deactive .stat-icon-badge { background: rgba(100,116,139,.1); }
.card-blocked .stat-icon-badge  { background: rgba(245,158,11,.1); }
.card-banned .stat-icon-badge   { background: rgba(139,92,246,.1); }
.card-events .stat-icon-badge   { background: rgba(6,182,212,.1); }

.stat-label {
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
  margin-bottom: 6px !important;
}
.stat-value {
  font-size: 30px !important;
  font-weight: 900 !important;
  letter-spacing: -.04em !important;
  line-height: 1 !important;
  margin-bottom: 6px !important;
}
.stat-sub { font-size: 12px !important; }

/* ── Panels: elevated look ─────────────────────────────────────────────── */
.panel {
  border-radius: 18px !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 2px 12px rgba(13,12,29,.06) !important;
  padding: 22px !important;
}
body.admin-dark .panel { box-shadow: 0 2px 16px rgba(0,0,0,.3) !important; }

.panel-head {
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--border) !important;
  margin-bottom: 18px !important;
}
.panel-head h3 {
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: -.01em !important;
}

/* ── Tables: professional SaaS style ───────────────────────────────────── */
.data-table thead tr {
  background: transparent !important;
}
.data-table th {
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: .07em !important;
  color: var(--muted) !important;
  padding: 10px 14px !important;
  border-bottom: 2px solid var(--border) !important;
  background: var(--surface-2) !important;
  white-space: nowrap !important;
}
.data-table th:first-child { border-radius: 10px 0 0 0; }
.data-table th:last-child  { border-radius: 0 10px 0 0; }

.data-table td {
  padding: 12px 14px !important;
  font-size: 13px !important;
  border-bottom: 1px solid var(--border) !important;
  vertical-align: middle !important;
}
.data-table tbody tr {
  transition: background .14s !important;
}
.data-table tbody tr:hover td {
  background: rgba(99,102,241,.04) !important;
}
body.admin-dark .data-table tbody tr:hover td {
  background: rgba(99,102,241,.08) !important;
}
.data-table tbody tr:last-child td { border-bottom: none !important; }

/* User cell with avatar */
.user-cell {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(124,58,237,.2));
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900;
  color: var(--primary);
  flex-shrink: 0;
  border: 1px solid rgba(99,102,241,.15);
}
.user-name { font-weight: 700 !important; font-size: 13px !important; color: var(--text) !important; }
.user-sub  { color: var(--muted) !important; font-size: 11.5px !important; }

/* ── Badges: polished pill style ───────────────────────────────────────── */
.badge {
  font-size: 10.5px !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  letter-spacing: .04em !important;
}

/* ── Mini buttons in tables ─────────────────────────────────────────────── */
.mini-btn {
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  transition: background .14s, transform .14s !important;
}
.mini-btn:hover { transform: translateY(-1px) !important; }

/* ── Search input ───────────────────────────────────────────────────────── */
#userSearch {
  background: var(--surface) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 12px !important;
  height: 40px !important;
  padding: 0 14px 0 36px !important;
  font-size: 13px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b89b0' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 12px center !important;
  transition: border-color .15s, box-shadow .15s !important;
}
#userSearch:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important;
}

/* ── Main area background ───────────────────────────────────────────────── */
.main {
  background: var(--bg) !important;
}

/* ── Login page: more dramatic ──────────────────────────────────────────── */
.login-shell {
  background:
    radial-gradient(ellipse at 15% 15%, rgba(99,102,241,.22) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(139,92,246,.16) 0%, transparent 55%),
    linear-gradient(160deg, #f4f3ff 0%, #ede9fe 100%) !important;
}
.login-card {
  border-radius: 24px !important;
  box-shadow: 0 30px 80px rgba(99,102,241,.15), 0 8px 24px rgba(0,0,0,.08) !important;
  padding: 40px 36px !important;
  border: 1px solid rgba(99,102,241,.15) !important;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(99,102,241,.1), transparent 65%);
  pointer-events: none;
}
.login-card .brand {
  font-size: 26px !important;
  font-weight: 900 !important;
  background: linear-gradient(135deg, #0d0c1d, #4f46e5) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  letter-spacing: -.03em !important;
}
.login-card .brand-sub {
  font-size: 13px !important;
  color: #8b89b0 !important;
  margin-bottom: 32px !important;
}
body.admin-dark .login-card .brand {
  background: linear-gradient(135deg, #f0eeff, #a5b4fc) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
  box-shadow: 0 8px 20px rgba(99,102,241,.30) !important;
  border-radius: 12px !important;
  height: 46px !important;
  font-size: 14px !important;
  letter-spacing: .01em !important;
}
.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(99,102,241,.40) !important;
  transform: translateY(-1px) !important;
}

/* ── Sidebar scrollbar ──────────────────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 3px !important; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(99,102,241,.25) !important; border-radius: 3px !important; }
.sidebar { overflow-y: auto !important; padding-bottom: 16px !important; }


/* ════════════════════════════════════════════════════════════
   SUPERADMIN MOBILE FIX
   Overrides the premium redesign's sidebar position at ≤900px
════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Force sidebar off-screen (out of grid flow) */
  #sidebar, .sidebar {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: min(280px, 82vw) !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transform: translateX(-110%) !important;
    transition: transform .27s cubic-bezier(.4,0,.2,1) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 !important;
  }
  /* When sidebar is open */
  body.sidebar-open #sidebar,
  body.sidebar-open .sidebar {
    transform: translateX(0) !important;
    box-shadow: 6px 0 40px rgba(0,0,0,.5) !important;
  }

  /* App shell: single column, full width content */
  .app-shell {
    display: block !important;
    height: 100vh !important;
    overflow: hidden !important;
  }

  /* Main content wrapper: full width */
  .app-shell > div {
    width: 100% !important;
    height: 100vh !important;
  }

  /* Menu toggle: visible and prominent */
  .menu-toggle, #menuToggleBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    order: -1 !important;
    flex-shrink: 0 !important;
  }

  /* Backdrop */
  .sidebar-backdrop {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.55) !important;
    z-index: 9998 !important;
    backdrop-filter: blur(2px) !important;
  }
  body.sidebar-open .sidebar-backdrop { display: block !important; }

  /* Topbar: stack nicely */
  .topbar {
    padding: 12px 16px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .top-actions {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
  }
  #userSearch { flex: 1 !important; min-width: 0 !important; }

  /* Stats: 2 columns */
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 10px !important;
  }

  /* Hide tablet columns */
  .hide-tablet { display: none !important; }

  /* Tables scroll */
  .table-wrap { overflow-x: auto !important; }
  .data-table { min-width: 600px !important; }

  /* Panels */
  .panel { padding: 14px !important; }
  .main { padding: 14px 14px 28px !important; gap: 14px !important; }

  /* Health grid: single col */
  .resp-health-grid { grid-template-columns: 1fr !important; }
  #serverHealthGrid { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .top-actions { flex-wrap: wrap !important; }
  #userSearch { width: 100% !important; }
  .stat-value { font-size: 22px !important; }
  #pageTitle { font-size: 18px !important; }
}