/* ============================================================
   Student Management System – Main Stylesheet
   Design: Glassmorphism | Palette: Sky / Water Blues
   Font: Poppins (Google Fonts)
   ============================================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Blues */
  --blue-50:  #E3F2FD;
  --blue-100: #BBDEFB;
  --blue-200: #90CAF9;
  --blue-300: #64B5F6;
  --blue-400: #42A5F5;
  --blue-500: #2196F3;
  --blue-600: #1E88E5;
  --blue-700: #1565C0;
  --blue-800: #0D47A1;
  --sky-400:  #29B6F6;
  --sky-500:  #03A9F4;
  --sky-600:  #0288D1;
  --sky-700:  #0277BD;

  /* Glassmorphism */
  --glass-bg:          rgba(255, 255, 255, 0.30);
  --glass-bg-hover:    rgba(255, 255, 255, 0.45);
  --glass-border:      rgba(255, 255, 255, 0.55);
  --glass-shadow:      0 8px 32px rgba(31, 100, 180, 0.18);
  --glass-shadow-lg:   0 16px 48px rgba(31, 100, 180, 0.25);
  /* Background gradient (water / sky) */
  --bg-gradient: linear-gradient(135deg,
      #E3F2FD 0%,
      #BBDEFB 20%,
      #90CAF9 45%,
      #64B5F6 70%,
      #42A5F5 100%);

  /* Text */
  --text-primary:   #0D47A1;
  --text-secondary: #1565C0;
  --text-body:      #1a2e4a;
  --text-muted:     #5a7fa8;
  --text-white:     #ffffff;

  /* Status colours */
  --success:  #00897B;
  --danger:   #E53935;
  --warning:  #F57C00;
  --info:     #0288D1;

  /* Misc */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --radius-xl:  32px;
  --transition: 0.3s ease;
  --font:       'Poppins', sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text-body);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--sky-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-800); }

img { display: block; max-width: 100%; }

ul, ol { list-style: none; }

/* ---------- Animated Background Bubbles ---------- */
.bg-bubbles {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.bg-bubbles li {
  position: absolute;
  bottom: -160px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  animation: rise 18s infinite ease-in;
}

.bg-bubbles li:nth-child(1)  { left:10%;  width:80px;  height:80px;  animation-duration:16s; animation-delay:0s;  }
.bg-bubbles li:nth-child(2)  { left:20%;  width:30px;  height:30px;  animation-duration:14s; animation-delay:2s;  }
.bg-bubbles li:nth-child(3)  { left:35%;  width:60px;  height:60px;  animation-duration:20s; animation-delay:4s;  }
.bg-bubbles li:nth-child(4)  { left:50%;  width:20px;  height:20px;  animation-duration:12s; animation-delay:1s;  }
.bg-bubbles li:nth-child(5)  { left:65%;  width:90px;  height:90px;  animation-duration:22s; animation-delay:6s;  }
.bg-bubbles li:nth-child(6)  { left:75%;  width:45px;  height:45px;  animation-duration:18s; animation-delay:3s;  }
.bg-bubbles li:nth-child(7)  { left:85%;  width:25px;  height:25px;  animation-duration:15s; animation-delay:5s;  }
.bg-bubbles li:nth-child(8)  { left:5%;   width:55px;  height:55px;  animation-duration:24s; animation-delay:8s;  }
.bg-bubbles li:nth-child(9)  { left:42%;  width:70px;  height:70px;  animation-duration:19s; animation-delay:7s;  }
.bg-bubbles li:nth-child(10) { left:92%;  width:35px;  height:35px;  animation-duration:13s; animation-delay:9s;  }

@keyframes rise {
  0%   { bottom: -160px; transform: translateX(0)   rotate(0deg);   opacity: 0.7; }
  50%  {                 transform: translateX(60px) rotate(180deg); opacity: 0.5; }
  100% { bottom: 110vh;  transform: translateX(-60px) rotate(360deg); opacity: 0; }
}

/* ---------- Glass Card ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.glass-dark {
  background: rgba(13, 71, 161, 0.18);
  border: 1px solid rgba(100, 181, 246, 0.35);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

/* ---------- Navigation Bar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  box-shadow: 0 2px 16px rgba(31,100,180,0.12);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition);
}
.navbar-brand:hover { opacity: 0.85; color: var(--text-primary); }

.navbar-brand .brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--sky-500), var(--blue-700));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(2,136,209,0.4);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-body);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.55);
  color: var(--text-primary);
}

.nav-link.nav-logout {
  color: var(--danger);
}
.nav-link.nav-logout:hover {
  background: rgba(229,57,53,0.12);
  color: var(--danger);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  animation: fadeInUp 0.5s ease both;
}

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

/* ---------- Page Header ---------- */
.page-header {
  margin-bottom: 2rem;
}
.page-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ---------- Stat Cards (Dashboard) ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-lg);
}

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

.stat-icon.blue    { background: linear-gradient(135deg,#42A5F5,#1565C0); color:#fff; }
.stat-icon.green   { background: linear-gradient(135deg,#4DB6AC,#00695C); color:#fff; }
.stat-icon.orange  { background: linear-gradient(135deg,#FFA726,#E65100); color:#fff; }
.stat-icon.purple  { background: linear-gradient(135deg,#AB47BC,#6A1B9A); color:#fff; }

.stat-info .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ---------- Data Table ---------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

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

.data-table thead th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(33, 150, 243, 0.1);
  white-space: nowrap;
  border-bottom: 1px solid var(--glass-border);
}
.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.data-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.4);
  transition: background var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.35); }

.data-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  color: var(--text-body);
}

/* ---------- Badge / Status ---------- */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-active    { background: rgba(0,137,123,0.15); color: var(--success); }
.badge-inactive  { background: rgba(245,124,0,0.15);  color: var(--warning); }
.badge-graduated { background: rgba(30,136,229,0.15); color: var(--blue-700); }

/* ---------- Forms ---------- */
.form-card {
  padding: 2rem;
  max-width: 780px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-grid .full { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.55);
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-body);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
  width: 100%;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--sky-500);
  background: rgba(255,255,255,0.78);
  box-shadow: 0 0 0 3px rgba(3,169,244,0.2);
}
.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.15);
}

select.form-control { cursor: pointer; }

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 0.2rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sky-500), var(--blue-700));
  color: #fff;
  box-shadow: 0 4px 14px rgba(2,136,209,0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--sky-600), var(--blue-800));
  box-shadow: 0 6px 20px rgba(2,136,209,0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #4DB6AC, #00695C);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,105,92,0.3);
}
.btn-success:hover {
  background: linear-gradient(135deg, #26A69A, #004D40);
  transform: translateY(-1px);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #EF5350, #B71C1C);
  color: #fff;
  box-shadow: 0 4px 14px rgba(183,28,28,0.3);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #E53935, #B71C1C);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: rgba(255,255,255,0.45);
  border: 1.5px solid var(--glass-border);
  color: var(--text-primary);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.70);
  color: var(--text-primary);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem;  font-size: 1rem; }
.btn-block { width: 100%; }

.btn-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ---------- Alert / Flash Messages ---------- */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  animation: slideDown 0.35s ease both;
}
@keyframes slideDown {
  from { opacity:0; transform: translateY(-12px); }
  to   { opacity:1; transform: translateY(0); }
}
.alert-success { background: rgba(0,137,123,0.14); color: var(--success); border-left: 4px solid var(--success); }
.alert-danger   { background: rgba(229,57,53,0.12); color: var(--danger);  border-left: 4px solid var(--danger); }
.alert-warning  { background: rgba(245,124,0,0.12); color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info     { background: rgba(2,136,209,0.12); color: var(--info);    border-left: 4px solid var(--info); }

/* ---------- Search Bar ---------- */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.search-bar .form-control { max-width: 380px; flex: 1; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover   { background: rgba(255,255,255,0.65); }
.page-btn.active  { background: linear-gradient(135deg,var(--sky-500),var(--blue-700)); color:#fff; border-color:transparent; }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Modal Confirm ---------- */
.modal-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(13,71,161,0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal {
  padding: 2rem;
  max-width: 440px;
  width: 92%;
  animation: scaleIn 0.3s ease both;
}
@keyframes scaleIn {
  from { opacity:0; transform: scale(0.88); }
  to   { opacity:1; transform: scale(1); }
}

.modal h3 { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.modal p  { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* School silhouette decoration */
.login-page::before {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 220px;
  background:
    /* windows row 2 */
    radial-gradient(ellipse 6px 4px at 18% calc(100% - 90px), rgba(255,240,100,0.6) 100%, transparent 100%),
    radial-gradient(ellipse 6px 4px at 24% calc(100% - 90px), rgba(255,240,100,0.6) 100%, transparent 100%),
    radial-gradient(ellipse 6px 4px at 30% calc(100% - 90px), rgba(255,240,100,0.6) 100%, transparent 100%),
    radial-gradient(ellipse 6px 4px at 70% calc(100% - 90px), rgba(255,240,100,0.6) 100%, transparent 100%),
    radial-gradient(ellipse 6px 4px at 76% calc(100% - 90px), rgba(255,240,100,0.6) 100%, transparent 100%),
    radial-gradient(ellipse 6px 4px at 82% calc(100% - 90px), rgba(255,240,100,0.6) 100%, transparent 100%),
    /* Building body */
    linear-gradient(to top, rgba(13,71,161,0.55) 0%, rgba(13,71,161,0.55) 55%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2.25rem 2rem;
  position: relative;
  z-index: 1;
  animation: loginEntrance 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes loginEntrance {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem;
  background: linear-gradient(135deg, var(--sky-400), var(--blue-700));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(2,136,209,0.45);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { box-shadow: 0 8px 24px rgba(2,136,209,0.45); }
  50%      { box-shadow: 0 8px 36px rgba(2,136,209,0.70); }
}

.login-logo h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}
.login-logo p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  display: flex;
  align-items: center;
}
.input-icon-wrap .form-control {
  padding-left: 2.6rem;
}
.input-icon-wrap .toggle-pw {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: color var(--transition);
}
.input-icon-wrap .toggle-pw:hover { color: var(--sky-600); }

.login-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================================
   DASHBOARD QUICK ACTIONS
   ============================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.quick-action-card {
  padding: 1.4rem;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: transform var(--transition), box-shadow var(--transition);
}
.quick-action-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glass-shadow-lg);
  color: inherit;
}
.quick-action-card .qa-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
  display: block;
}
.quick-action-card .qa-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================================
   SECTION CARD
   ============================================================ */
.section-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.section-card .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.section-card .section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   DELETE / CONFIRM PAGE
   ============================================================ */
.student-preview {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(229,57,53,0.07);
  border: 1px solid rgba(229,57,53,0.2);
  margin: 1.25rem 0;
}
.student-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-400), var(--blue-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
}
.student-preview-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.student-preview-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
}
.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); }
.empty-state p  { color: var(--text-muted); font-size: 0.9rem; margin: 0.4rem 0 1.25rem; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: rgba(13,71,161,0.55);
}

/* ============================================================
   DARK MODE SUPPORT
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --text-body:      #D0E8FF;
    --text-muted:     #8EB8DC;
    --text-primary:   #90CAF9;
    --text-secondary: #64B5F6;
    --glass-bg:       rgba(10, 40, 80, 0.45);
    --glass-border:   rgba(100, 181, 246, 0.30);
    --glass-shadow:   0 8px 32px rgba(0,0,0,0.4);
  }
  body {
    background: linear-gradient(135deg, #0a1929 0%, #0d2b4e 40%, #0a3d70 70%, #0d47a1 100%);
  }
  .form-control {
    background: rgba(10,40,80,0.55);
    border-color: rgba(100,181,246,0.3);
    color: #D0E8FF;
  }
  .form-control:focus {
    background: rgba(10,40,80,0.75);
    border-color: var(--sky-500);
  }
  .data-table thead th { background: rgba(21,101,192,0.25); }
  .data-table tbody tr:hover { background: rgba(10,40,80,0.35); }
  .btn-outline {
    background: rgba(10,40,80,0.45);
    border-color: rgba(100,181,246,0.35);
    color: #90CAF9;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-toggle { display: flex; }

  .navbar-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: rgba(255,255,255,0.90);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem;
    gap: 0.25rem;
  }
  .navbar-nav.open { display: flex; }
  .nav-link { width: 100%; padding: 0.65rem 1rem; }

  .page-wrapper { padding: 1.25rem 1rem 3rem; }
  .form-grid    { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .quick-actions{ grid-template-columns: 1fr 1fr; }

  .page-header h1 { font-size: 1.4rem; }

  .data-table { font-size: 0.82rem; }
  .data-table td, .data-table th { padding: 0.65rem 0.7rem; }
}

@media (max-width: 480px) {
  .stats-grid   { grid-template-columns: 1fr; }
  .quick-actions{ grid-template-columns: 1fr; }
  .login-card   { padding: 1.75rem 1.25rem 1.5rem; }
  .search-bar   { flex-direction: column; }
  .search-bar .form-control { max-width: 100%; }
}
