/* ============================================================
   PulsaAdmin — Premium Design System
   ============================================================ */

/* ---------- 1. CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Brand Colors */
  --primary-50:  #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;

  --accent-400: #a78bfa;
  --accent-500: #8b5cf6;
  --accent-600: #7c3aed;

  /* Sidebar / Dark Surface */
  --sidebar-bg:     #0f172a;
  --sidebar-hover:  #1e293b;
  --sidebar-active: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --sidebar-width:  260px;

  /* Surface & Background */
  --bg-main:      #f1f5f9;
  --bg-card:      rgba(255, 255, 255, 0.72);
  --bg-card-solid:#ffffff;
  --bg-dark:      #0f172a;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-white:     #f8fafc;
  --text-sidebar:   #94a3b8;
  --text-sidebar-active: #ffffff;

  /* Borders */
  --border-light:   rgba(148, 163, 184, 0.2);
  --border-glass:   rgba(255, 255, 255, 0.18);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-blue:    linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
  --gradient-green:   linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
  --gradient-purple:  linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --gradient-orange:  linear-gradient(135deg, #f97316 0%, #eab308 100%);
  --gradient-red:     linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --gradient-amber:   linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-dark:    linear-gradient(160deg, #0f172a 0%, #1e293b 100%);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:   0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg:   0 10px 30px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);
  --shadow-xl:   0 20px 50px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --shadow-card-hover: 0 16px 40px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --z-sidebar: 100;
  --z-topbar:  90;
  --z-modal:   200;
  --z-toast:   300;
}

/* ---------- 2. Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ---------- 3. Scrollbar Styling ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

/* ---------- 4. Layout: Sidebar + Main ---------- */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--gradient-dark);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 24px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

.sidebar-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

.sidebar-brand-text span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background var(--transition-base),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.sidebar-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--gradient-primary);
  transition: transform var(--transition-base);
}

.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-white);
  transform: translateX(4px);
}

.sidebar-nav-item:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--text-sidebar-active);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
  font-weight: 600;
}

.sidebar-nav-item.active::before {
  display: none;
}

.sidebar-nav-item i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-base),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  transform: translateX(4px);
}

.sidebar-logout-btn i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(241, 245, 249, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.topbar-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
}

.topbar-admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}

.topbar-admin-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* ---- Content Area ---- */
.content-area {
  flex: 1;
  padding: 28px 32px 40px;
}

/* ---------- 5. Cards ---------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.card-modern {
  background: var(--bg-card-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

/* ---------- 6. Stat Cards ---------- */
.stat-card {
  background: var(--bg-card-solid);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-bounce),
    box-shadow var(--transition-base);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.06;
  transform: translate(30%, -30%);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.stat-card:hover::after {
  opacity: 0.12;
  transform: translate(25%, -25%) scale(1.2);
}

.stat-card.gradient-blue::after   { background: #3b82f6; }
.stat-card.gradient-green::after  { background: #22c55e; }
.stat-card.gradient-purple::after { background: #8b5cf6; }
.stat-card.gradient-orange::after { background: #f97316; }

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}

.stat-icon.bg-blue   { background: var(--gradient-blue); box-shadow: 0 4px 14px rgba(59,130,246,0.3); }
.stat-icon.bg-green  { background: var(--gradient-green); box-shadow: 0 4px 14px rgba(34,197,94,0.3); }
.stat-icon.bg-purple { background: var(--gradient-purple); box-shadow: 0 4px 14px rgba(139,92,246,0.3); }
.stat-icon.bg-orange { background: var(--gradient-orange); box-shadow: 0 4px 14px rgba(249,115,22,0.3); }

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* ---------- 7. Buttons ---------- */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-base),
    filter var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  color: #fff;
}

.btn-gradient:active {
  transform: translateY(0);
}

.btn-gradient-primary {
  background: var(--gradient-primary);
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.btn-gradient-primary:hover {
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.btn-gradient-green {
  background: var(--gradient-green);
  box-shadow: 0 4px 14px rgba(34,197,94,0.3);
}
.btn-gradient-green:hover {
  box-shadow: 0 6px 20px rgba(34,197,94,0.4);
}

.btn-gradient-red {
  background: var(--gradient-red);
  box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}
.btn-gradient-red:hover {
  box-shadow: 0 6px 20px rgba(239,68,68,0.4);
}

.btn-gradient-amber {
  background: var(--gradient-amber);
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
  color: #451a03;
}
.btn-gradient-amber:hover {
  box-shadow: 0 6px 20px rgba(245,158,11,0.4);
  color: #451a03;
}

.btn-gradient-purple {
  background: var(--gradient-purple);
  box-shadow: 0 4px 14px rgba(139,92,246,0.3);
}
.btn-gradient-purple:hover {
  box-shadow: 0 6px 20px rgba(139,92,246,0.4);
}

.btn-outline-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-base);
}

.btn-outline-modern:hover {
  border-color: var(--primary-400);
  color: var(--primary-600);
  background: var(--primary-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- 8. Badges ---------- */
.badge-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  border: none;
}

.badge-pending {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(251,191,36,0.15));
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.25);
}

.badge-approved,
.badge-success {
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(20,184,166,0.15));
  color: #15803d;
  border: 1px solid rgba(34,197,94,0.25);
}

.badge-suspended,
.badge-failed {
  background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(249,115,22,0.15));
  color: #b91c1c;
  border: 1px solid rgba(239,68,68,0.25);
}

.badge-role {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
  color: var(--primary-700);
  border: 1px solid rgba(99,102,241,0.25);
}

.badge-count {
  background: var(--gradient-primary);
  color: #fff;
  padding: 3px 12px;
  font-size: 0.75rem;
}

/* ---------- 9. Tables ---------- */
.table-modern-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead th {
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: #f8fafc;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.table-modern thead th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}

.table-modern thead th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.table-modern tbody tr {
  transition: background var(--transition-fast);
}

.table-modern tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.5);
}

.table-modern tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

.table-modern tbody td {
  padding: 14px 18px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(148,163,184,0.1);
  vertical-align: middle;
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

.table-modern tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius-lg);
}

.table-modern tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--radius-lg) 0;
}

/* Action buttons inside tables */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table-actions form {
  display: inline-flex;
}

/* ---------- 10. Forms ---------- */
.form-modern .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-modern .form-control,
.form-modern .form-select {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card-solid);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.form-modern .form-control:focus,
.form-modern .form-select:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12), 0 0 16px rgba(99,102,241,0.06);
  outline: none;
  background: #fff;
}

.form-modern .form-control::placeholder {
  color: var(--text-muted);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color var(--transition-fast);
  pointer-events: none;
}

.input-icon-wrapper .form-control {
  padding-left: 44px;
}

.input-icon-wrapper:focus-within .input-icon {
  color: var(--primary-500);
}

.input-icon-wrapper .input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  transition: color var(--transition-fast);
}

.input-icon-wrapper .input-icon-right:hover {
  color: var(--primary-500);
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--bg-card-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.filter-bar .form-group {
  flex: 1;
  min-width: 180px;
}

.filter-bar .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

/* ---------- 11. Alerts / Flash Messages ---------- */
.alert-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  animation: slideDown 0.4s var(--transition-base);
  position: relative;
}

.alert-modern .btn-close {
  filter: none;
  opacity: 0.6;
}

.alert-modern .btn-close:hover {
  opacity: 1;
}

.alert-success-modern {
  background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(20,184,166,0.08));
  color: #15803d;
  border-left: 4px solid #22c55e;
}

.alert-error-modern {
  background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(249,115,22,0.08));
  color: #b91c1c;
  border-left: 4px solid #ef4444;
}

/* ---------- 12. Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-state-icon i {
  font-size: 2rem;
  color: var(--primary-400);
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* ---------- 13. Pagination ---------- */
.pagination-modern .page-item .page-link {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  margin: 0 3px;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.pagination-modern .page-item .page-link:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-600);
}

.pagination-modern .page-item.active .page-link {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.pagination-modern .page-item.disabled .page-link {
  background: #f8fafc;
  color: var(--text-muted);
}

/* ---------- 14. Auth Layout ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Floating particles */
.auth-wrapper::before,
.auth-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: floatParticle 20s ease-in-out infinite;
}

.auth-wrapper::before {
  width: 400px;
  height: 400px;
  background: #6366f1;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.auth-wrapper::after {
  width: 300px;
  height: 300px;
  background: #8b5cf6;
  bottom: -80px;
  left: -80px;
  animation-delay: -10s;
}

.auth-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(139,92,246,0.3);
  animation: floatUp 15s linear infinite;
}

.auth-particle:nth-child(1) { left: 10%; animation-duration: 18s; animation-delay: 0s; width: 4px; height: 4px; }
.auth-particle:nth-child(2) { left: 25%; animation-duration: 22s; animation-delay: -3s; width: 8px; height: 8px; }
.auth-particle:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: -6s; }
.auth-particle:nth-child(4) { left: 55%; animation-duration: 20s; animation-delay: -9s; width: 5px; height: 5px; }
.auth-particle:nth-child(5) { left: 70%; animation-duration: 24s; animation-delay: -12s; width: 7px; height: 7px; }
.auth-particle:nth-child(6) { left: 85%; animation-duration: 19s; animation-delay: -4s; width: 4px; height: 4px; }
.auth-particle:nth-child(7) { left: 15%; animation-duration: 21s; animation-delay: -7s; width: 3px; height: 3px; }
.auth-particle:nth-child(8) { left: 60%; animation-duration: 17s; animation-delay: -11s; width: 6px; height: 6px; }

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
  animation: cardFloat 6s ease-in-out infinite;
}

.auth-card-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.auth-card-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
  margin-bottom: 16px;
}

.auth-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.auth-card-subtitle {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  margin-top: 4px;
}

.auth-card .form-control {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  padding-left: 44px;
  font-size: 0.9rem;
}

.auth-card .form-control::placeholder {
  color: rgba(255,255,255,0.35);
}

.auth-card .form-control:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
  background: rgba(255,255,255,0.1);
}

.auth-card .input-icon {
  color: rgba(255,255,255,0.35) !important;
}

.auth-card .input-icon-right {
  color: rgba(255,255,255,0.35) !important;
}

.auth-card .input-icon-right:hover {
  color: rgba(255,255,255,0.7) !important;
}

.auth-card:focus-within .input-icon {
  color: var(--primary-400) !important;
}

.auth-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  animation: shake 0.5s ease-in-out;
}

.auth-error ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-error li {
  color: #fca5a5;
  font-size: 0.85rem;
  padding: 2px 0;
}

/* ---------- 15. User Detail Card ---------- */
.user-detail-card {
  padding: 32px;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.user-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-detail-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.user-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- 16. Section Header ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Welcome banner */
.welcome-banner {
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(99,102,241,0.25);
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60%;
  right: 10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.welcome-banner h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.welcome-banner p {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* ---------- 17. Keyframe Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

@keyframes floatParticle {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(30px, -30px) rotate(5deg); }
  50%      { transform: translate(-20px, 20px) rotate(-5deg); }
  75%      { transform: translate(20px, 10px) rotate(3deg); }
}

@keyframes floatUp {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Animation utility classes */
.animate-fadeIn {
  animation: fadeIn 0.5s ease-out both;
}

.animate-slideUp {
  animation: slideUp 0.6s ease-out both;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* ---------- 18. Utility Classes ---------- */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gap-grid {
  display: grid;
  gap: 24px;
}

.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---------- 19. Responsive ---------- */
@media (max-width: 1200px) {
  .cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 10px 0 40px rgba(0,0,0,0.3);
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    padding: 14px 20px;
  }

  .content-area {
    padding: 20px;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--z-sidebar) - 1);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .topbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-card-solid);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-fast);
  }

  .topbar-toggle:hover {
    background: var(--primary-50);
  }
}

@media (min-width: 993px) {
  .topbar-toggle {
    display: none;
  }
}

@media (max-width: 768px) {
  .cols-4 {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .form-group {
    min-width: 100%;
  }

  .welcome-banner h2 {
    font-size: 1.2rem;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .auth-card {
    padding: 32px 24px;
  }

  .user-detail-grid {
    grid-template-columns: 1fr;
  }

  .table-actions {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .topbar-admin-name {
    display: none;
  }

  .content-area {
    padding: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
