/* ============================================================
   SCHOOL MANAGEMENT SYSTEM — GLOBAL DESIGN SYSTEM
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS CUSTOM PROPERTIES ── */
:root {
  --primary:       #10B981;
  --primary-dark:  #059669;
  --primary-light: #34D399;
  --secondary:     #059669;
  --accent:        #34D399;
  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;
  --info:          #3B82F6;

  --bg:            #0F1117;
  --bg-card:       #1A1D27;
  --bg-sidebar:    #13151F;
  --bg-input:      #1E2130;
  --border:        rgba(255,255,255,0.08);
  --border-focus:  rgba(16,185,129,0.6);

  --text:          #E2E8F0;
  --text-muted:    #8892A4;
  --text-light:    #CBD5E1;

  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-card:   0 2px 16px rgba(0,0,0,0.3);
  --transition:    0.2s ease;

  --surface-1: rgba(255,255,255,0.05);
  --surface-2: rgba(255,255,255,0.08);
  --surface-3: rgba(255,255,255,0.14);
}

/* ── LIGHT THEME ── */
:root[data-theme="light"] {
  --bg:            #F3F4F6;
  --bg-card:       #FFFFFF;
  --bg-sidebar:    #FFFFFF;
  --bg-input:      #F9FAFB;
  --border:        rgba(0,0,0,0.08);
  --border-focus:  rgba(16,185,129,0.5);

  --text:          #111827;
  --text-muted:    #6B7280;
  --text-light:    #374151;

  --shadow:        0 4px 24px rgba(0,0,0,0.08);
  --shadow-card:   0 2px 16px rgba(0,0,0,0.06);

  --surface-1: rgba(0,0,0,0.035);
  --surface-2: rgba(0,0,0,0.055);
  --surface-3: rgba(0,0,0,0.09);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.sidebar-brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; }
.sidebar-brand .brand-name { font-weight: 700; font-size: 15px; color: var(--text); }
.sidebar-brand .brand-sub  { font-size: 11px; color: var(--text-muted); }

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(16,185,129,0.15);
  color: var(--primary-light);
}
.sidebar-nav a.active { color: var(--primary-light); font-weight: 600; }
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav .badge-count {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-body { padding: 24px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-body  { padding: 20px; }

/* STAT CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--primary));
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  background: rgba(16,185,129,0.15);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:hover { background: var(--surface-1); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 16px; font-size: 13.5px; color: var(--text-light); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.5px; text-transform: uppercase; }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 5px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary{ background: var(--surface-2); color: var(--text); }
.btn-secondary:hover{ background: var(--surface-3); }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-warning  { background: var(--warning); color: #1a1a1a; }
.btn-info     { background: var(--info); color: #fff; }
.btn-outline  { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-success { background: rgba(16,185,129,0.15); color: #10B981; }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #EF4444; }
.badge-warning { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-info    { background: rgba(59,130,246,0.15); color: #3B82F6; }
.badge-primary { background: rgba(16,185,129,0.15);  color: #34D399; }
.badge-muted   { background: var(--surface-1); color: var(--text-muted); }

/* ── ALERTS ── */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 16px; }
.alert-success { background: rgba(16,185,129,0.12); border-left: 3px solid var(--success); color: #6EE7B7; }
.alert-error,
.alert-danger  { background: rgba(239,68,68,0.12);  border-left: 3px solid var(--danger);  color: #FCA5A5; }
.alert-warning { background: rgba(245,158,11,0.12); border-left: 3px solid var(--warning); color: #FCD34D; }
.alert-info    { background: rgba(59,130,246,0.12); border-left: 3px solid var(--info);    color: #93C5FD; }
:root[data-theme="light"] .alert-success { color: #047857; }
:root[data-theme="light"] .alert-error,
:root[data-theme="light"] .alert-danger  { color: #B91C1C; }
:root[data-theme="light"] .alert-warning { color: #B45309; }
:root[data-theme="light"] .alert-info    { color: #1D4ED8; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 820px; }
.modal-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin: 20px 0 10px;
}
.modal-section-title:first-child { margin-top: 0; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── AVATAR ── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 84px; height: 84px; font-size: 30px; border: 3px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border); }
.avatar-sq { border-radius: var(--radius-sm); }

/* ── PROFILE HERO ── */
.profile-hero { margin-bottom: 20px; overflow: visible; }
.profile-hero-body { display: flex; align-items: center; gap: 22px; padding: 24px 28px; flex-wrap: wrap; }
.profile-hero-info { flex: 1; min-width: 220px; }
.profile-hero-name { font-size: 21px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.profile-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.profile-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-1); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; color: var(--text-muted); font-weight: 600;
}

/* ── PROFILE LAYOUT (sidebar + main) ── */
.profile-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .profile-layout { grid-template-columns: 1fr; } }
.profile-stack { display: flex; flex-direction: column; gap: 20px; }

/* ── DETAIL LIST (icon + label + value rows) ── */
.detail-list { display: flex; flex-direction: column; }
.detail-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.detail-item:last-child { border-bottom: none; }
.detail-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--surface-1); display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.detail-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; }
.detail-value { font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 2px; word-break: break-word; }

/* ── MINI STAT (compact stat card variant for profile sidebars) ── */
.mini-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stat { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 10px; text-align: center; }
.mini-stat-value { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
.mini-stat-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* ── PROGRESS BAR ── */
.progress-track { width: 100%; height: 8px; background: var(--surface-2); border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; background: var(--card-color, var(--primary)); transition: width 0.4s ease; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.6; }
.empty-state-text { font-size: 13px; }

/* ── STATUS PILLS (segmented radio control, e.g. attendance marking) ── */
.status-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.status-pill { cursor: pointer; }
.status-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.status-pill span {
  display: inline-block; padding: 5px 13px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.2px;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: all 0.15s ease; -webkit-user-select: none; user-select: none;
}
.status-pill input:focus-visible + span { box-shadow: 0 0 0 2px var(--border-focus); }
.status-pill-present input:checked + span { background: var(--success); border-color: var(--success); color: #fff; }
.status-pill-absent  input:checked + span { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.status-pill-late    input:checked + span { background: var(--warning); border-color: var(--warning); color: #1a1a1a; }
.status-pill-excused input:checked + span { background: var(--info);    border-color: var(--info);    color: #fff; }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb span { color: var(--text-muted); }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header-title { font-size: 22px; font-weight: 800; }
.page-header-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── HAMBURGER ── */
.sidebar-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }
.sidebar-toggle svg { width: 24px; height: 24px; }

/* ── SEARCH BOX ── */
.search-box { position: relative; }
.search-box input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 16px 8px 38px;
  color: var(--text);
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
}
.search-box input:focus { border-color: var(--primary); width: 260px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--text-muted); }

/* ── DROPDOWN ── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.dropdown-menu.open { display: block; animation: fadeDown 0.15s ease; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px; color: var(--text-light);
  cursor: pointer;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--surface-1); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.pagination a:hover { background: rgba(16,185,129,0.15); color: var(--primary-light); border-color: var(--primary); }
.pagination span.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pagination span.disabled { opacity: 0.4; }
.pagination-info { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning{ color: var(--warning); }
.text-primary{ color: var(--primary-light); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.rounded { border-radius: var(--radius); }
.hidden { display: none; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(16,185,129,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(5,150,105,0.08) 0%, transparent 50%);
  padding: 20px;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { width: 56px; margin: 0 auto 12px; border-radius: var(--radius-sm); }
.login-logo h1 { font-size: 22px; font-weight: 800; }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── SPLIT LOGIN LAYOUT (form + carousel) ── */
.login-split { min-height: 100vh; display: flex; }
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.login-carousel {
  position: relative;
  width: 54%;
  min-height: 100vh;
  overflow: hidden;
}
.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease;
}
.carousel-slide.active { opacity: 1; visibility: visible; }
.carousel-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 22% 22%, rgba(255,255,255,0.14) 0%, transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,0.10) 0%, transparent 45%);
}
.carousel-icon {
  position: relative;
  z-index: 1;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.carousel-icon svg { width: 56px; height: 56px; color: #fff; }
.carousel-caption { position: relative; z-index: 1; max-width: 420px; }
.carousel-caption h2 { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 12px; line-height: 1.3; }
.carousel-caption p { font-size: 14.5px; color: rgba(255,255,255,0.88); line-height: 1.65; }
.carousel-dots {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}
.carousel-dot.active { background: #fff; width: 22px; border-radius: 4px; }
.carousel-brand {
  position: absolute;
  top: 32px;
  left: 40px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.carousel-brand img { width: 30px; height: 30px; border-radius: 8px; }
@media (max-width: 900px) {
  .login-carousel { display: none; }
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ── TOASTS ── */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
}
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info    { border-left-color: var(--info); }
.toast.toast-out { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ── AJAX FORM STATES ── */
.modal .alert { margin: 0 0 16px; }
.btn[disabled] { opacity: 0.65; cursor: not-allowed; }
.btn-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnspin 0.6s linear infinite;
  margin-right: 7px;
  vertical-align: -2px;
  opacity: 0.85;
}
@keyframes btnspin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search-box input { width: 180px; }
  .search-box input:focus { width: 200px; }
  .topbar-right span { display: none; }
  .toast-stack { left: 12px; right: 12px; top: 12px; max-width: none; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .login-box { padding: 28px 20px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation: modalInMobile 0.25s ease; }
  .modal-body, .modal-header, .modal-footer { padding: 16px; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
}
@keyframes modalInMobile {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
