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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.09);
  --secondary: #0f172a;
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger: #f43f5e;
  --danger-light: rgba(244, 63, 94, 0.12);
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-width: 260px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.14);
  --navbar-bg: #ffffff;
  --input-bg: #ffffff;
  --table-header-bg: #f8fafc;
  --table-hover-bg: #f8fafc;
  --modal-bg: #ffffff;
  --modal-header-bg: #f8fafc;
  --footer-bg: #ffffff;
  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
}

/* ─── DARK THEME (SLEEK MIDNIGHT OBSIDIAN) ───────────────────────── */
[data-theme="dark"] {
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-light: rgba(129, 140, 248, 0.16);
  --secondary: #f1f5f9;
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.14);
  --danger: #fb7185;
  --danger-light: rgba(251, 113, 133, 0.14);
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-surface: #1a2234;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border: #1f293d;
  --sidebar-bg: #070b14;
  --sidebar-text: #9ca3af;
  --navbar-bg: #0d1322;
  --input-bg: #070b14;
  --table-header-bg: #151d2f;
  --table-hover-bg: #172136;
  --modal-bg: #111827;
  --modal-header-bg: #151d2f;
  --footer-bg: #0d1322;
  --scrollbar-track: #0b0f19;
  --scrollbar-thumb: #1f293d;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* ─── STATUS PILLS & BADGES (ACTIVE / INACTIVE) ───────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge-active,
.badge-success {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.38) !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12) !important;
  transition: all 0.2s ease !important;
}
.status-badge-active:hover,
.badge-success:hover {
  background: rgba(16, 185, 129, 0.18) !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2) !important;
}
.status-badge-active .status-dot,
.badge-success .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.9);
}

.status-badge-inactive,
.badge-danger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.32) !important;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.1) !important;
  transition: all 0.2s ease !important;
}
.status-badge-inactive:hover,
.badge-danger:hover {
  background: rgba(239, 68, 68, 0.16) !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2) !important;
}
.status-badge-inactive .status-dot,
.badge-danger .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.9);
}

[data-theme="dark"] .status-badge-active,
[data-theme="dark"] .badge-success {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
}
[data-theme="dark"] .status-badge-inactive,
[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

html {
  font-size: 88.5%; /* Reduces font sizes across the entire application globally */
}

html, body {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Layout Structure - Flexible Scrollable View */
.app-layout,
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-main);
}

.page-content {
  padding: 1.5rem 2rem 3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: min-content;
}

.page {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar - Smooth Scrollable Layout */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 1.5rem 1.15rem 1rem;
  box-shadow: 4px 0 25px rgba(15, 23, 42, 0.15);
  z-index: 1000;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
  -webkit-overflow-scrolling: touch;
}

/* Custom sleek scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

.sidebar-content-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.sidebar-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 0 auto;
}

.nav-section-label {
  font-size: 0.675rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.4rem 1.1rem 0.2rem;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.95rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.nav-icon {
  font-size: 1.15rem;
}

.sidebar-footer {
  padding: 1.25rem 0.75rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  margin-top: auto;
}

/* Sidebar Toggle & Close Buttons */
.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.sidebar-close-btn {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.2s ease;
}
.sidebar-close-btn:hover {
  color: #ffffff;
  background: rgba(244, 63, 94, 0.3);
  border-color: #f43f5e;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Responsive Behavior for Small Screens / Mobile */
@media (max-width: 992px) {
  .sidebar-toggle-btn {
    display: inline-flex !important;
  }
  .sidebar-close-btn {
    display: inline-flex !important;
  }
  .sidebar-overlay {
    display: block !important;
  }
  .sidebar-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
  }
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    width: 285px !important;
    max-width: 85vw !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.5) !important;
    z-index: 10000 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  .navbar {
    padding: 0 1rem !important;
  }
  .page-container {
    padding: 1rem 1rem !important;
  }
}

/* Navbar Header */
.navbar {
  height: 75px;
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  box-shadow: var(--shadow-sm);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Footer Bottom */
.footer {
  padding: 1.25rem 2.5rem;
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Page Components & Cards */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.page-header .subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.35rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.35rem 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.3);
}

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

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Main Data Card & Tables */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.table-controls {
  padding: 1.35rem 1.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
}

.search-input {
  max-width: 400px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--table-header-bg);
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.table th {
  background: var(--table-header-bg);
  padding: 0.75rem 1.1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 0.15s;
}

.table tbody tr:hover {
  background-color: var(--table-hover-bg);
}

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

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem !important;
  color: var(--text-muted);
  font-weight: 500;
}

.loading-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.badge-active {
  background: var(--success-light);
  color: #059669;
}

.badge-inactive {
  background: var(--danger-light);
  color: #dc2626;
}

.badge-admin {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.badge-user {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.825rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger-light);
  color: #dc2626;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Inputs & Form Controls */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.input,
.form-control {
  width: 100%;
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  font-size: 0.825rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.input:focus,
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background: var(--modal-bg);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSpring 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border);
}

.modal-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--modal-header-bg);
}

.modal-header h3 {
  font-size: 1.05rem;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.75rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--modal-header-bg);
}

/* Alerts */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: var(--danger-light);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Auth Page Styling - Executive Enterprise Aesthetic */
.auth-page {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  background-color: #0b1120;
  background-image: 
    radial-gradient(at 0% 0%, rgba(30, 41, 59, 0.7) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(30, 58, 138, 0.25) 0px, transparent 45%),
    radial-gradient(at 100% 100%, rgba(15, 23, 42, 0.9) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(30, 41, 59, 0.5) 0px, transparent 50%);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-ambient-glow-1 {
  position: absolute;
  top: -100px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
}

.auth-ambient-glow-2 {
  position: absolute;
  bottom: -100px;
  right: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
}

.auth-brand-side {
  flex: 1.15;
  padding: 3.5rem 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
  color: #ffffff;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auth-brand-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.auth-hero-headline {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #f8fafc;
  margin-bottom: 1.25rem;
}

.auth-feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-lg, 12px);
  transition: all 0.2s ease-out;
}

.auth-feature-item:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(4px);
}

.auth-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  z-index: 2;
}

.auth-card-modern {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  color: #ffffff;
}

.auth-card-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
  margin-bottom: 0.3rem;
}

.auth-card-sub {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

.auth-input-group {
  margin-bottom: 1.15rem;
}

.auth-input-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.auth-input-field {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #0b1120;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}

.auth-input-field:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-input-field::placeholder {
  color: #475569;
}

.auth-input-field {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease-out;
}

.auth-input-field:focus {
  border-color: #6366f1;
  background: rgba(30, 41, 59, 1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

.demo-account-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.demo-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSpring {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ─── Dark Mode Catch-all Overrides ─────────────────────────── */
/* Fix any remaining elements that use hardcoded light-mode values */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .table-controls {
  background: var(--table-header-bg) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .modal {
  background: var(--modal-bg) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  background: var(--modal-header-bg) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .modal-body {
  background: var(--modal-bg);
}

/* Fix table text readability in dark mode */
[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
  color: var(--text-main);
  border-color: var(--border);
}

[data-theme="dark"] .table thead th {
  background: var(--table-header-bg) !important;
}

[data-theme="dark"] .table tbody tr:hover {
  background-color: var(--table-hover-bg) !important;
}

/* Fix form inputs in dark mode */
[data-theme="dark"] .input,
[data-theme="dark"] select.input,
[data-theme="dark"] input.input,
[data-theme="dark"] textarea.input {
  background: var(--input-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}

/* Fix stat values that use hardcoded text colors */
[data-theme="dark"] .stat-value {
  color: var(--text-main);
}

/* Fix sidebar in dark mode */
[data-theme="dark"] .sidebar {
  background: var(--sidebar-bg) !important;
}

/* Smooth transition on all key elements */
.sidebar, .navbar, .card, .stat-card, .modal, .input,
.table, .table-controls, .modal-header, .modal-footer, .footer {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}


@media print {
  /* Hide elements explicitly marked as no-print */
  .no-print { display: none !important; }
  /* Ensure printable receipt (if any) remains visible */
  #printable-receipt, #printable-receipt * { visibility: visible; }
  #printable-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
  }
}

/* =========================================
   Glassmorphism SweetAlert2 Styles 
   ========================================= */
.glass-toast {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15) !important;
  border-radius: 16px !important;
  color: #1e293b !important;
}

.glass-toast-title {
  color: #0f172a !important;
  font-weight: 600 !important;
}

.glass-modal-popup {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25) !important;
  border-radius: 24px !important;
  color: #1e293b !important;
}

.glass-modal-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

.glass-modal-actions {
  gap: 12px;
}

/* =========================================
   Professional Action Buttons
   ========================================= */
.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 50%; /* Make perfectly circular */
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.action-btn.view-btn {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}
.action-btn.view-btn:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-1px);
}

.action-btn.edit-btn {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}
.action-btn.edit-btn:hover {
  background: #6366f1;
  color: #fff;
  transform: translateY(-1px);
}

.action-btn.delete-btn {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}
.action-btn.delete-btn:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.action-btn.print-btn {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}
.action-btn.print-btn:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-1px);
}

.action-btn.verify-btn {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}
.action-btn.verify-btn:hover {
  background: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
}

/* Also upgrade the standard btn-primary for consistency */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* =========================================
   Custom CSS Tooltips
   ========================================= */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: auto;
  top: 120%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background-color: #0f172a;
  color: #f8fafc;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  z-index: 50;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: auto;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #0f172a transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 50;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

[data-tooltip]:hover::before {
  transform: translateX(-50%);
}

/* =========================================
   Attendance Register & Datatable Enhancements
   ========================================= */
.attendance-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-nav {
  display: inline-flex;
  background: var(--bg-surface);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border);
  gap: 4px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.segmented-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.segmented-nav-btn:hover {
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.06);
}

.segmented-nav-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  font-weight: 700;
}

[data-theme="dark"] .segmented-nav-btn.active {
  background: #1e293b;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Datatable Filters Bar */
.datatable-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.datatable-filters-left {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1;
}

.datatable-filters-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-filter-pills {
  display: inline-flex;
  gap: 6px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.status-pill-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-pill-btn:hover {
  color: var(--text-main);
}

.status-pill-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.status-pill-btn.active.pill-present {
  color: #16a34a;
  background: #dcfce7;
}

.status-pill-btn.active.pill-absent {
  color: #dc2626;
  background: #fee2e2;
}

.status-pill-btn.active.pill-late {
  color: #d97706;
  background: #fef3c7;
}

[data-theme="dark"] .status-pill-btn.active.pill-present {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .status-pill-btn.active.pill-absent {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .status-pill-btn.active.pill-late {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
}

.pill-count {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

/* Enhanced Table Rows */
.user-avatar-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.student-name-text {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.2;
}

.student-meta-subtext {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.775rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.status-badge-modern.present {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-badge-modern.absent {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-badge-modern.late {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .status-badge-modern.present {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .status-badge-modern.absent {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .status-badge-modern.late {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Status Segmented Buttons for Batch marking */
.status-segmented-group {
  display: inline-flex;
  background: var(--bg-surface);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  gap: 2px;
}

.status-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-seg-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.status-seg-btn.active-present {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.status-seg-btn.active-absent {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
  font-weight: 700;
}

.status-seg-btn.active-late {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
  font-weight: 700;
}

/* Table Pagination */
.datatable-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Quick Batch Action Pill Bar */
.batch-actions-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--primary-light);
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  flex-wrap: wrap;
}

.batch-quick-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.batch-quick-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.batch-quick-btn.present {
  background: #dcfce7;
  color: #15803d;
}
.batch-quick-btn.present:hover {
  background: #bbf7d0;
  transform: translateY(-1px);
}

.batch-quick-btn.absent {
  background: #fee2e2;
  color: #b91c1c;
}
.batch-quick-btn.absent:hover {
  background: #fecaca;
  transform: translateY(-1px);
}

.batch-quick-btn.late {
  background: #fef3c7;
  color: #b45309;
}
.batch-quick-btn.late:hover {
  background: #fde68a;
  transform: translateY(-1px);
}

/* Print Styles */
@media print {
  .sidebar, .navbar, .datatable-filter-bar, .datatable-footer, .segmented-nav, .btn, .action-buttons {
    display: none !important;
  }
  .page, .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .table {
    border: 1px solid #000 !important;
  }
  .table th, .table td {
    border: 1px solid #ddd !important;
    color: #000 !important;
  }
}

/* ==========================================================================
   SWEETALERT2 MODAL OVERLAY & POPUP Z-INDEX
   ========================================================================== */
.swal2-container {
  z-index: 99999999 !important;
}
.swal2-popup {
  z-index: 100000000 !important;
}

/* ==========================================================================
   GLOBAL MODAL DIALOG COMPONENT
   ========================================================================== */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 999999 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem !important;
  overflow-y: auto !important;
}

.modal-backdrop.active {
  display: flex !important;
}

.modal-dialog {
  background: var(--bg-card, #1e293b) !important;
  border: 1px solid var(--border, #334155) !important;
  border-radius: 18px !important;
  width: 100% !important;
  max-width: 580px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  overflow: hidden !important;
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  margin: auto !important;
  position: relative !important;
  z-index: 1000000 !important;
  color: var(--text-main, #f8fafc) !important;
}

.modal-dialog.modal-xl {
  max-width: 1140px !important;
  width: 95% !important;
}

.modal-dialog.modal-lg {
  max-width: 860px !important;
  width: 90% !important;
}

.modal-dialog.modal-md {
  max-width: 640px !important;
  width: 90% !important;
}

.modal-dialog.modal-sm {
  max-width: 480px !important;
  width: 90% !important;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.75rem !important;
  border-bottom: 1px solid var(--border, #334155) !important;
  background: var(--table-header-bg, #162032) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.modal-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: var(--text-main, #ffffff) !important;
  letter-spacing: -0.02em !important;
}

.modal-close {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted, #94a3b8) !important;
  font-size: 1.35rem !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
  line-height: 1 !important;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

.modal-body {
  padding: 1.75rem !important;
  max-height: 75vh !important;
  overflow-y: auto !important;
}

.modal-footer {
  padding: 1rem 1.75rem !important;
  border-top: 1px solid var(--border, #334155) !important;
  background: var(--table-header-bg, #162032) !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}

.form-group {
  margin-bottom: 1.2rem !important;
}

.form-label {
  display: block !important;
  font-size: 0.825rem !important;
  font-weight: 600 !important;
  color: var(--text-muted, #cbd5e1) !important;
  margin-bottom: 0.4rem !important;
}

.form-control {
  width: 100% !important;
  padding: 0.65rem 0.95rem !important;
  background-color: var(--input-bg, #0b1120) !important;
  border: 1.5px solid var(--border, #334155) !important;
  border-radius: 10px !important;
  color: var(--text-main, #f8fafc) !important;
  font-size: 0.875rem !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  font-family: inherit !important;
}

.form-control:focus {
  border-color: var(--primary, #6366f1) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* ─── COMPACT OPTIONS & ACTIONS STYLING ("Show options as small") ─── */
select.form-control,
select.input,
select {
  font-size: 0.85rem !important;
  padding: 0.55rem 0.85rem !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  background-color: var(--input-bg, #111827) !important;
  color: var(--text-main, #f8fafc) !important;
  border: 1.5px solid var(--border, #334155) !important;
}

select option {
  font-size: 0.85rem !important;
  padding: 8px 12px !important;
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="light"] select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

.badge {
  font-size: 0.725rem !important;
  padding: 3px 9px !important;
  border-radius: 9999px !important;
  letter-spacing: 0.02em !important;
}

.btn-sm {
  font-size: 0.75rem !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
}

.status-pill-btn {
  font-size: 0.75rem !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
}

.status-seg-btn {
  font-size: 0.75rem !important;
  padding: 4px 10px !important;
}

.action-btn {
  font-size: 0.75rem !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
}

.demo-pill-btn {
  font-size: 0.72rem !important;
  padding: 6px 4px !important;
}

.demo-pill-btn span:first-child {
  font-size: 1.1rem !important;
}

/* ─── TOAST NOTIFICATION STYLING (MODERN FLOATING TOASTER) ─── */
.edunova-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 48px);
}

.edunova-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 1rem 1.25rem;
  background: var(--bg-card, #1e293b);
  border: 1.5px solid var(--border, #334155);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

[data-theme="light"] .edunova-toast {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.edunova-toast.toast-leaving {
  animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(110%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(110%) scale(0.95);
  }
}

.edunova-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.edunova-toast-content {
  flex: 1;
  min-width: 0;
}

.edunova-toast-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main, #f8fafc);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.edunova-toast-message {
  font-size: 0.825rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
  word-break: break-word;
}

.edunova-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.edunova-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main, #f8fafc);
}

.edunova-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

.segmented-nav-btn {
  font-size: 0.78rem !important;
  padding: 6px 14px !important;
}

/* ══════════════════════════════════════════════════════════════════════
   GLOBAL STANDARDIZED SEARCH INPUT SYSTEM (NO ICON/TEXT OVERLAPPING)
   ══════════════════════════════════════════════════════════════════════ */
.search-box-wrap,
.search-input-wrap,
.search-group {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
}

.search-icon,
.search-box-wrap .search-icon,
.search-input-wrap .search-icon,
.search-group .search-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: var(--text-muted) !important;
  pointer-events: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  z-index: 4 !important;
}

/* Force generous left padding on ALL search inputs across the application */
.search-input-field,
input.search-input-field,
input[id="searchCourse"],
input[id="searchStu"],
input[id="searchDues"],
input[id="searchFee"],
input[id="searchIns"],
input[id="searchBr"],
input[id="searchBranch"],
input[id="searchUser"],
input[id="searchBatch"],
input[id="studentSearchInput"],
input[id="facultySearchInput"],
input[id="rosterSearchInput"],
input[id="searchRoster"],
input[id*="search" i],
input[placeholder*="search" i],
.search-box-wrap input,
.search-input-wrap input {
  padding-left: 2.85rem !important; /* 45.6px - leaves guaranteed 16px clearance after 14px+15px icon */
}

/* If input is inside an inline-flex pill/box where the icon is an inline sibling, keep natural padding */
div[style*="inline-flex"] > input[style*="border: none"],
div[style*="display: inline-flex"] > input[style*="border: none"],
.search-flex-pill input {
  padding-left: 0.35rem !important;
}

