/* ══════════════════════════════════════════════════════════════
   ISP Billing System — Main Stylesheet
   Premium Dark Design with Glassmorphism
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary:    #080d1a;
  --bg-secondary:  #0d1526;
  --bg-card:       rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border:        rgba(255,255,255,0.08);
  --border-hover:  rgba(255,255,255,0.16);

  /* Accent */
  --accent-1: #4f8ef7;
  --accent-2: #7c5cbf;
  --accent-grad: linear-gradient(135deg, #4f8ef7, #7c5cbf);
  --accent-grad-soft: linear-gradient(135deg, rgba(79,142,247,0.15), rgba(124,92,191,0.15));

  /* Status */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #38bdf8;

  /* Text */
  --text-primary:   #f0f4ff;
  --text-secondary: #8899b5;
  --text-muted:     #4a5875;

  /* Misc */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.5);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(79,142,247,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(124,92,191,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(56,189,248,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a { color: var(--accent-1); text-decoration: none; transition: color var(--transition); }
a:hover { color: #7aadff; }

/* ── Layout Shell ──────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.app-sidebar {
  width: 260px;
  min-height: 100vh;
  background: rgba(13,21,38,0.95);
  border-left: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  bottom: 0;
  z-index: 1000;
  transition: transform var(--transition);
}

.app-sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.app-sidebar-logo .logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(79,142,247,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  object-fit: cover;
  transform: scale(1.08);
}

.app-sidebar-logo h2 {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-sidebar-logo p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.app-sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 2px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity var(--transition);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 4px 16px rgba(79,142,247,0.3);
}

.nav-item .nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.app-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 0.72rem; color: var(--text-muted); }

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  font-size: 1rem;
}
.btn-logout:hover { color: var(--danger); }

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-right: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(8,13,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title h1 { font-size: 1.3rem; font-weight: 700; }
.topbar-title p { font-size: 0.8rem; color: var(--text-secondary); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
#app-sidebar-toggle { display: none; }

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 32px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.card:hover { border-color: var(--border-hover); }

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 24px; }

/* ── Stat Cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--stat-color, var(--accent-1));
  opacity: 0.08;
  transform: translate(40px, -40px);
  transition: transform var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { transform: translate(30px, -30px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-grad-soft);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

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

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 10px; }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79,142,247,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(79,142,247,0.45); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--border-hover); }

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}
.btn-success:hover { box-shadow: 0 6px 20px rgba(34,197,94,0.45); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.45); transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.btn-warning:hover { box-shadow: 0 6px 20px rgba(245,158,11,0.45); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); border-color: var(--border); }

/* ── Action Buttons ────────────────────────────────────────── */
.btn-action {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  transition: all var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-action svg {
  width: 16px;
  height: 16px;
}
.btn-action-view {
  background: rgba(56, 189, 248, 0.08) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.15) !important;
}
.btn-action-view:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #7dd3fc !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}
.btn-action-pay {
  background: rgba(34, 197, 94, 0.08) !important;
  color: #4ade80 !important;
  border-color: rgba(34, 197, 94, 0.15) !important;
}
.btn-action-pay:hover {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #22c55e !important;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}
.btn-action-remind {
  background: rgba(245, 158, 11, 0.08) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.15) !important;
}
.btn-action-remind:hover {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #f59e0b !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.btn-action-edit {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}
.btn-action-edit:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}
.btn-action-delete {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.15) !important;
}
.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-1);
  background: rgba(79,142,247,0.06);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg-secondary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  padding-top: 6px;
  padding-bottom: 6px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  padding: 14px 16px;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  line-height: 1.6;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }
  .stat-card {
    padding: 14px 12px !important;
  }
  .stat-card .stat-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
    margin-bottom: 8px !important;
  }
  .stat-card .stat-value {
    font-size: 1.25rem !important;
    margin-bottom: 4px !important;
  }
  .stat-card .stat-label {
    font-size: 0.72rem !important;
    line-height: 1.3 !important;
  }
  .stat-card .stat-sub {
    font-size: 0.65rem !important;
    margin-top: 2px !important;
  }
  .table-wrapper {
    overflow-x: visible !important;
  }
  .data-table thead {
    display: none !important;
  }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block !important;
    width: 100% !important;
  }
  .data-table tr {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  }
  .data-table tr:hover {
    background: rgba(255, 255, 255, 0.04) !important;
  }
  .data-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    padding: 10px 0 !important;
    text-align: right !important;
    font-size: 0.88rem !important;
  }
  .data-table td:last-child {
    border-bottom: none !important;
    padding-top: 14px !important;
    justify-content: center !important;
  }
  .data-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 12px;
  }
}

/* ── Badges / Status ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-info    { background: rgba(56,189,248,0.15); color: #38bdf8; border: 1px solid rgba(56,189,248,0.25); }
.badge-muted   { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  overflow-y: auto;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 760px; }

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.15rem; font-weight: 700; }

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

.modal-body { padding: 24px 28px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 0 28px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── Search & Filter Bar ──────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.search-box .form-control { padding-right: 44px; }

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  min-width: 280px;
  max-width: 400px;
  backdrop-filter: blur(20px);
  border: 1px solid;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.toast-success { background: rgba(34,197,94,0.15);  border-color: rgba(34,197,94,0.3);  color: #4ade80; }
.toast-error   { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.3);  color: #f87171; }
.toast-warning { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.toast-info    { background: rgba(56,189,248,0.15); border-color: rgba(56,189,248,0.3); color: #38bdf8; }

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8,13,26,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(13,21,38,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-grad);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
  box-shadow: 0 0 40px rgba(79,142,247,0.3);
}

.login-logo h1 {
  font-size: 1.6rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  justify-content: center;
}

.page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.875rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover { border-color: var(--accent-1); color: var(--accent-1); }
.page-btn.active { background: var(--accent-grad); border-color: transparent; color: #fff; }

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

/* ── Utilities ─────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-mono { font-family: monospace; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }

/* ── General Navigation Styles (No Sidebar Mode) ────────────── */
.dashboard-quick-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.quick-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.quick-nav-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-1);
  background: rgba(30, 41, 59, 0.7);
  box-shadow: 0 12px 40px rgba(79, 142, 247, 0.15);
}
.quick-nav-card:active {
  transform: translateY(-1px) scale(0.98);
}
.quick-nav-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}
.quick-nav-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.topbar-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
}
.topbar-back-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.top-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}
.top-user-card .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 0 10px rgba(79, 142, 247, 0.3);
}
.top-user-card .user-info {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  line-height: 1.25;
}
.top-user-card .user-info .name {
  font-weight: 600;
  color: var(--text-primary);
}
.top-user-card .user-info .role {
  color: var(--text-muted);
}
.top-user-card .btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  margin-right: 4px;
  transition: color var(--transition);
}
.top-user-card .btn-logout:hover {
  color: var(--danger);
}

/* Hide top-user-card globally since we have sidebar on desktop and bottom nav on mobile */
.top-user-card {
  display: none !important;
}

/* ── Bottom Navigation (Desktop Hidden) ───────────────────────── */
.bottom-nav {
  display: none;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  #app-sidebar-toggle { display: none !important; }
  .app-sidebar { display: none !important; }
  
  body {
    padding-bottom: 96px !important; /* Space for floating bottom nav */
  }

  /* Floating Bottom Nav Capsule */
  .bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 16px !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    transform: none !important;
    width: calc(100% - 32px) !important;
    max-width: 480px !important;
    height: 64px !important;
    background: #0d1526 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    z-index: 99999 !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    backdrop-filter: blur(20px) !important;
  }
  
  .bottom-nav-item {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    flex: 1 !important;
    height: 100% !important;
    gap: 4px !important;
    transition: all var(--transition) !important;
  }
  
  .bottom-nav-item:active {
    transform: scale(0.95);
  }
  
  .bottom-nav-item.active {
    color: #3b82f6 !important;
  }
  
  .bottom-nav-item.active::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important; /* aligned with top border of capsule */
    left: 20% !important;
    right: 20% !important;
    height: 3px !important;
    background: #3b82f6 !important;
    border-radius: 0 0 4px 4px !important;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.8) !important;
  }
  
  .bottom-nav-icon {
    font-size: 1.3rem !important;
  }
  
  .bottom-nav-label {
    font-size: 0.65rem !important;
  }

  .dashboard-quick-nav {
    gap: 10px;
    margin-bottom: 20px;
  }
  .quick-nav-card {
    padding: 16px 8px;
  }
  .quick-nav-icon {
    font-size: 1.7rem;
    margin-bottom: 4px;
  }
  .quick-nav-title {
    font-size: 0.85rem;
  }
  .topbar-back-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .main-content { margin-right: 0 !important; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 20px 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .topbar {
    height: auto !important;
    min-height: 68px;
    padding: 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .topbar-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .topbar-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .stats-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .login-card { padding: 32px 24px; }
}
