/* ═══════════════════════════════════════════════════
   IYtech EduManage — Premium UI Stylesheet
   Font: Plus Jakarta Sans · Palette: Deep Navy + Azure
   ═══════════════════════════════════════════════════ */

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

/* ── Design Tokens ── */
:root {
  /* Core palette */
  --navy:          #080d1a;
  --navy-2:        #0e1628;
  --navy-3:        #162035;
  --accent:        #3b7ff5;
  --accent-dark:   #1d5fd4;
  --accent-glow:   rgba(59,127,245,.22);
  --gold:          #f0a500;
  --gold-light:    rgba(240,165,0,.12);

  /* Surface */
  --bg:            #f2f5fb;
  --surface:       #ffffff;
  --border:        #e4e9f2;
  --border-subtle: #f0f3fa;

  /* Text */
  --text:          #0e1628;
  --text-muted:    #6b7a99;
  --text-faint:    #a0aec0;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(14,22,40,.06);
  --shadow-sm:  0 2px 8px rgba(14,22,40,.07), 0 1px 2px rgba(14,22,40,.04);
  --shadow-md:  0 8px 24px rgba(14,22,40,.10), 0 2px 6px rgba(14,22,40,.06);
  --shadow-lg:  0 20px 48px rgba(14,22,40,.13), 0 4px 12px rgba(14,22,40,.07);

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-pill:50px;

  /* Sidebar */
  --sb-w: 220px;
  --nb-h: 58px;

  /* ── Navbar theming tokens (light mode) ── */
  --navbar-bg:        #ffffff;
  --navbar-shadow:    0 1px 0 rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
  --nb-brand-border:  rgba(0,0,0,.07);
  --nb-brand-name:    var(--text);
  --nb-brand-sub:     var(--text-muted);
  --nb-user-bg:       rgba(0,0,0,.04);
  --nb-user-border:   rgba(0,0,0,.08);
  --nb-user-name:     var(--text);
  --nb-role-bg:       rgba(59,127,245,.1);
  --nb-role-color:    var(--accent);
  --nb-logout-border: rgba(0,0,0,.1);
  --nb-logout-color:  var(--text-muted);
  --nb-toggle-bg:     rgba(0,0,0,.05);
  --nb-toggle-border: rgba(0,0,0,.1);
  --nb-toggle-color:  var(--text-muted);

  /* ── Sidebar theming tokens (light mode) ── */
  --sidebar-bg:          #f0f4ff;
  --sidebar-border:      rgba(0,0,0,.07);
  --sb-glow-line:        rgba(59,127,245,.3);
  --sb-section:          #9aabbf;
  --sb-link:             #4a5a78;
  --sb-link-hover-bg:    rgba(59,127,245,.07);
  --sb-link-hover:       var(--accent);
  --sb-active-bg:        rgba(59,127,245,.1);
  --sb-active:           var(--accent);
  --sb-icon-hover-bg:    rgba(59,127,245,.12);
  --sb-icon-hover:       var(--accent);
  --sb-icon-active-bg:   rgba(59,127,245,.18);
  --sb-icon-active:      var(--accent);
  --sb-divider:          rgba(0,0,0,.07);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
.lms-navbar {
  height: var(--nb-h);
  background: var(--navbar-bg) !important;
  border-bottom: 1px solid var(--nb-brand-border);
  box-shadow: var(--navbar-shadow);
  z-index: 1040;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Brand */
.nb-brand {
  width: var(--sb-w);
  height: var(--nb-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-right: 1px solid var(--nb-brand-border);
  text-decoration: none;
  flex-shrink: 0;
}

.nb-brand .logo-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.nb-logo {
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

/* Default: show light logo, hide dark logo */
.nb-logo-dark  { display: none; }
.nb-logo-light { display: block; }

/* Dark mode: swap */
[data-theme="dark"] .nb-logo-light { display: none; }
[data-theme="dark"] .nb-logo-dark  { display: block; }

.nb-brand .brand-text {
  display: flex; flex-direction: column; line-height: 1.1;
}

.nb-brand .brand-name {
  font-size: 14px; font-weight: 800;
  letter-spacing: -.3px;
  color: var(--nb-brand-name);
}

.nb-brand .brand-sub {
  font-size: 9.5px; font-weight: 500;
  color: var(--nb-brand-sub); letter-spacing: .05em; text-transform: uppercase;
}

/* Nav right section */
.nb-right {
  display: flex; align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 0 18px;
}

/* Search hint */
.nb-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  color: #4a6080;
  font-size: 12px;
  cursor: default;
}

/* User chip */
.nb-user {
  display: flex; align-items: center;
  gap: 9px;
  background: var(--nb-user-bg);
  border: 1px solid var(--nb-user-border);
  border-radius: var(--r-pill);
  padding: 5px 14px 5px 5px;
  text-decoration: none;
  transition: background .15s;
}
.nb-user:hover { background: rgba(59,127,245,.08); }

.nb-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6ea8fe);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.nb-user-name {
  font-size: 12.5px; font-weight: 600; color: var(--nb-user-name);
}

.nb-role-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px;
  background: var(--nb-role-bg);
  color: var(--nb-role-color);
  border: 1px solid var(--nb-role-color);
}

.btn-nb-logout {
  font-size: 12px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--nb-logout-border);
  color: var(--nb-logout-color);
  padding: 5px 13px;
  border-radius: var(--r-sm);
  background: transparent;
  transition: all .15s;
  display: flex; align-items: center; gap: 5px;
}
.btn-nb-logout:hover {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.25);
  color: #ef4444;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
#sidebar {
  width: var(--sb-w);
  height: 100%;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 12px 0 24px;
  overflow-y: auto;
  position: relative;
}

/* Subtle top glow */
#sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--sb-glow-line), transparent);
}

.sb-section {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sb-section);
  padding: 16px 18px 6px;
}

#sidebar .nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--sb-link);
  padding: 9px 12px 9px 16px;
  border-radius: var(--r-sm);
  margin: 1px 10px;
  display: flex; align-items: center; gap: 10px;
  transition: all .18s;
  position: relative;
  white-space: nowrap;
}

#sidebar .nav-link .sb-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all .18s;
  flex-shrink: 0;
}

#sidebar .nav-link:hover {
  color: var(--sb-link-hover);
  background: var(--sb-link-hover-bg);
}

#sidebar .nav-link:hover .sb-icon {
  background: var(--sb-icon-hover-bg);
  color: var(--sb-icon-hover);
}

#sidebar .nav-link.active {
  color: var(--sb-active);
  background: var(--sb-active-bg);
  font-weight: 600;
}

#sidebar .nav-link.active .sb-icon {
  background: var(--sb-icon-active-bg);
  color: var(--sb-icon-active);
  box-shadow: 0 0 12px rgba(59,127,245,.2);
}

#sidebar .nav-link.active::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 2px 0 0 2px;
}

.sb-divider {
  height: 1px;
  background: var(--sb-divider);
  margin: 10px 14px;
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.app-body {
  display: flex;
  height: calc(100vh - var(--nb-h));
}

main {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 26px 28px !important;
}

/* ══════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════ */
.page-hd {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}

.page-hd h2, h2.fw-bold {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.page-hd small, h2.fw-bold + small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .22s, transform .22s;
}

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

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
  display: flex; align-items: center; justify-content: space-between;
}

.card-header .card-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  margin-right: 8px;
}

.card-body { padding: 20px; }

/* ══════════════════════════════════════
   PREMIUM STAT CARDS
══════════════════════════════════════ */
.stat-card {
  border: none !important;
  border-radius: var(--r-xl) !important;
  overflow: hidden;
  position: relative;
  transition: transform .22s, box-shadow .22s !important;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg) !important;
}

/* Shine overlay */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.stat-card .card-body {
  padding: 22px 20px;
  position: relative; z-index: 2;
}

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

.stat-icon-wrap {
  width: 54px; height: 54px;
  border-radius: 16px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}

.stat-info { flex: 1; }
.stat-value { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.75); }
.stat-trend { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 8px; }

/* Gradient themes */
.g-blue   { background: linear-gradient(135deg, #1e6ff5 0%, #0d4fcc 100%);
             box-shadow: 0 8px 24px rgba(30,111,245,.35) !important; }
.g-teal   { background: linear-gradient(135deg, #0ea5a0 0%, #0d7d78 100%);
             box-shadow: 0 8px 24px rgba(14,165,160,.35) !important; }
.g-violet { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
             box-shadow: 0 8px 24px rgba(124,58,237,.35) !important; }
.g-rose   { background: linear-gradient(135deg, #e8305a 0%, #be1a42 100%);
             box-shadow: 0 8px 24px rgba(232,48,90,.35) !important; }
.g-amber  { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
             box-shadow: 0 8px 24px rgba(245,158,11,.35) !important; }

/* ══════════════════════════════════════
   TABLES
══════════════════════════════════════ */
.table {
  font-size: 13px;
  margin: 0;
}

.table > thead > tr > th {
  background: #f8faff;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 2px solid var(--border-subtle);
  padding: 11px 16px;
  white-space: nowrap;
}

.table > tbody > tr > td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
}

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

.table-hover > tbody > tr {
  transition: background .12s;
}
.table-hover > tbody > tr:hover > td {
  background: #f5f8ff;
}

/* ══════════════════════════════════════
   BADGES
══════════════════════════════════════ */
.badge {
  font-weight: 600;
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 20px;
}

/* Premium status badges */
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--r-sm);
  transition: all .18s;
  letter-spacing: .01em;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(59,127,245,.35);
  transform: translateY(-1px);
}

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

.btn-sm { font-size: 12px; padding: 5px 12px; border-radius: var(--r-sm); }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  font-size: 14px;
}

/* ══════════════════════════════════════
   FORM FIELDS
══════════════════════════════════════ */
.form-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.form-control,
.form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  padding: 9px 13px;
  color: var(--text);
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
  box-shadow: var(--shadow-xs);
}

.form-control:hover, .form-select:hover {
  border-color: #b8c9e8;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(59,127,245,.14);
  outline: none;
}

.form-control::placeholder { color: var(--text-faint); font-weight: 400; }

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,127,245,.15);
}

.field-wrap .text-danger.small,
.field-wrap .text-danger {
  font-size: 11.5px; margin-top: 5px;
  display: flex; align-items: center; gap: 4px;
}

/* Form card (panel style) */
.form-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.form-panel .form-panel-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 13.5px;
}

.form-panel .form-panel-body { padding: 22px; }

/* ══════════════════════════════════════
   ALERTS / MESSAGES
══════════════════════════════════════ */
.messages-container {
  position: fixed;
  top: calc(var(--nb-h) + 12px);
  right: 18px;
  z-index: 1055;
  min-width: 310px;
  max-width: 420px;
}

.messages-container .alert {
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-md);
  border: none;
  box-shadow: var(--shadow-lg);
  padding: 13px 18px;
  backdrop-filter: blur(8px);
}

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.pagination { gap: 3px; }

.pagination .page-link {
  border-radius: var(--r-sm) !important;
  border: 1.5px solid var(--border);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  transition: all .15s;
}

.pagination .page-link:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.pagination .page-item.active .page-link {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ══════════════════════════════════════
   QUICK ACTION CHIPS
══════════════════════════════════════ */
.action-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition: all .18s;
  box-shadow: var(--shadow-xs);
}

.action-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
  transform: translateY(-1px);
}

.action-chip i { font-size: 14px; }

/* ══════════════════════════════════════
   LOGIN PAGE  (Premium)
══════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Left side: branded hero */
.login-hero {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;

  /* Mesh gradient */
  background:
    radial-gradient(ellipse at 20% 20%, rgba(59,127,245,.25) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(124,58,237,.2)  0%, transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(14,165,160,.15) 0%, transparent 45%),
    linear-gradient(160deg, #060b17 0%, #0a1225 50%, #0d1730 100%);
}

/* Floating orbs */
.login-hero::before {
  content: '';
  position: absolute; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(59,127,245,.1) 0%, transparent 70%);
  top: -180px; right: -140px;
  border-radius: 50%;
  animation: float-orb 8s ease-in-out infinite;
}

.login-hero::after {
  content: '';
  position: absolute; width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(124,58,237,.09) 0%, transparent 70%);
  bottom: -100px; left: -80px;
  border-radius: 50%;
  animation: float-orb 11s ease-in-out infinite reverse;
}

@keyframes float-orb {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-24px) scale(1.04); }
}

/* Hero content wrapper — above the orbs */
.hero-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  max-width: 320px;
}

.hero-logo-wrap {
  margin-bottom: 28px;
}

.hero-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: brightness(1);
}

.hero-title {
  font-size: 2.1rem; font-weight: 800; color: #fff;
  text-align: center; line-height: 1.15; margin-bottom: 14px;
  letter-spacing: -.5px;
}

.hero-title span {
  background: linear-gradient(90deg, #93c5fd, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 13.5px; color: #4d6a8e; text-align: center;
  line-height: 1.65; margin-bottom: 38px;
}

.hero-features {
  width: 100%; list-style: none; padding: 0; margin: 0;
}

.hero-features li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 13px; color: #4a6a8a;
}

.hero-features li:last-child { border-bottom: none; }

.hero-features .hf-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: rgba(59,127,245,.12);
  border: 1px solid rgba(59,127,245,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #60a5fa;
  flex-shrink: 0;
}

/* Right side: form */
.login-panel {
  width: 440px; flex-shrink: 0;
  background: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px 52px;
  position: relative;
  box-shadow: -8px 0 40px rgba(0,0,0,.06);
}

/* Top accent line */
.login-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #818cf8, var(--accent));
}

.login-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}

.login-eyebrow::before {
  content: ''; width: 20px; height: 2px;
  background: var(--accent); border-radius: 1px;
}

.login-heading {
  font-size: 1.7rem; font-weight: 800; color: var(--text);
  letter-spacing: -.4px; margin-bottom: 6px;
}

.login-sub {
  font-size: 13px; color: var(--text-muted); margin-bottom: 34px;
}

.login-form-label {
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
  display: block;
}

.btn-sign-in {
  width: 100%; height: 46px;
  background: linear-gradient(135deg, #1e6ff5, #0d4fcc);
  border: none; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .3px;
  box-shadow: 0 4px 18px rgba(30,111,245,.4);
  transition: all .22s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.btn-sign-in:hover {
  background: linear-gradient(135deg, #1d5fd4, #0a3db0);
  box-shadow: 0 6px 24px rgba(30,111,245,.5);
  transform: translateY(-2px);
  color: #fff;
}

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

.login-footer {
  font-size: 11.5px; color: var(--text-faint);
  text-align: center; margin-top: 32px;
}

.login-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

@media (max-width: 768px) {
  .login-hero { display: none; }
  .login-panel { width: 100%; padding: 40px 28px; }
}

/* ══════════════════════════════════════
   THEME TOGGLE BUTTON
══════════════════════════════════════ */
.btn-theme-toggle {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--nb-toggle-bg);
  border: 1px solid var(--nb-toggle-border);
  color: var(--nb-toggle-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all .18s;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  background: rgba(59,127,245,.12);
  color: var(--accent);
  border-color: rgba(59,127,245,.3);
  transform: rotate(12deg);
}

/* ══════════════════════════════════════
   DARK MODE
══════════════════════════════════════ */
[data-theme="dark"] {
  /* Surface overrides */
  --bg:            #0d1117;
  --surface:       #161c2b;
  --border:        rgba(255,255,255,.08);
  --border-subtle: rgba(255,255,255,.05);

  /* Text — bright and clear */
  --text:          #edf2fc;
  --text-muted:    #8fa3c8;
  --text-faint:    #4a6080;

  /* Shadow overrides — deeper in dark */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
  --shadow-md: 0 8px 24px rgba(0,0,0,.50), 0 2px 6px rgba(0,0,0,.30);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.60), 0 4px 12px rgba(0,0,0,.35);

  /* Navbar tokens */
  --navbar-bg:        #060a13;
  --navbar-shadow:    0 1px 0 rgba(255,255,255,.03), 0 4px 16px rgba(0,0,0,.4);
  --nb-brand-border:  rgba(255,255,255,.05);
  --nb-brand-name:    #ffffff;
  --nb-brand-sub:     #4a6080;
  --nb-user-bg:       rgba(255,255,255,.06);
  --nb-user-border:   rgba(255,255,255,.09);
  --nb-user-name:     #dce8f8;
  --nb-role-bg:       rgba(59,127,245,.2);
  --nb-role-color:    #93c5fd;
  --nb-logout-border: rgba(255,255,255,.1);
  --nb-logout-color:  #94a3b8;
  --nb-toggle-bg:     rgba(255,255,255,.06);
  --nb-toggle-border: rgba(255,255,255,.1);
  --nb-toggle-color:  #94a3b8;

  /* Sidebar tokens */
  --sidebar-bg:        #090d18;
  --sidebar-border:    rgba(255,255,255,.03);
  --sb-glow-line:      rgba(59,127,245,.5);
  --sb-section:        #3a5070;
  --sb-link:           #607a9a;
  --sb-link-hover-bg:  rgba(255,255,255,.04);
  --sb-link-hover:     #c8d6f0;
  --sb-active-bg:      rgba(59,127,245,.14);
  --sb-active:         #e2ecff;
  --sb-icon-hover-bg:  rgba(59,127,245,.12);
  --sb-icon-hover:     #93c5fd;
  --sb-icon-active-bg: rgba(59,127,245,.22);
  --sb-icon-active:    #93c5fd;
  --sb-divider:        rgba(255,255,255,.04);
}

/* ── Body / page background ── */
[data-theme="dark"] body { background: var(--bg); }

/* ── Cards — force dark; !important beats Bootstrap's --bs-card-bg ── */
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .form-panel {
  background: #161c2b !important;
  border-color: rgba(255,255,255,.08) !important;
  color: #edf2fc !important;
}

[data-theme="dark"] .card-header {
  background: #111827 !important;
  border-bottom-color: rgba(255,255,255,.06) !important;
  color: #edf2fc !important;
}

/* ── Tables — force all row/cell backgrounds dark ── */
[data-theme="dark"] .table,
[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent !important;
  color: #edf2fc !important;
  border-color: rgba(255,255,255,.06) !important;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,.03);
  --bs-table-hover-bg: rgba(255,255,255,.04);
}

[data-theme="dark"] .table > thead > tr > th {
  background: #111827 !important;
  color: #8fa3c8 !important;
  border-bottom-color: rgba(255,255,255,.08) !important;
}

[data-theme="dark"] .table > tbody > tr > td {
  color: #edf2fc !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > td {
  background: rgba(59,127,245,.06) !important;
}

/* ── Forms ── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #111827;
  border-color: rgba(255,255,255,.12);
  color: #edf2fc;
}

[data-theme="dark"] .form-control:hover,
[data-theme="dark"] .form-select:hover {
  border-color: rgba(59,127,245,.4);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background: #111827;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(59,127,245,.18);
}

[data-theme="dark"] .form-control::placeholder { color: var(--text-faint); }

[data-theme="dark"] .form-select option { background: #1a2030; }

/* ── Badges ── */
[data-theme="dark"] .badge-neutral { background: rgba(255,255,255,.07); color: #94a3b8; }
[data-theme="dark"] .badge-success { background: rgba(22,163,74,.15);  color: #86efac; }
[data-theme="dark"] .badge-danger  { background: rgba(220,38,38,.15);  color: #fca5a5; }
[data-theme="dark"] .badge-warning { background: rgba(217,119,6,.15);  color: #fcd34d; }
[data-theme="dark"] .badge-info    { background: rgba(59,127,245,.15); color: #93c5fd; }
[data-theme="dark"] .bg-light { background: rgba(255,255,255,.07) !important; color: #94a3b8 !important; }
[data-theme="dark"] .bg-secondary { background: rgba(255,255,255,.12) !important; }

/* ── Text utilities ── */
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .text-dark  { color: var(--text) !important; }

/* ── Action chips ── */
[data-theme="dark"] .action-chip {
  background: #161c2b;
  border-color: rgba(255,255,255,.09);
  color: var(--text);
}

[data-theme="dark"] .action-chip:hover {
  border-color: var(--accent);
  color: #93c5fd;
}

/* ── Buttons ── */
[data-theme="dark"] .btn-outline-primary { border-color: rgba(59,127,245,.45); color: #93c5fd; }
[data-theme="dark"] .btn-outline-primary:hover { background: rgba(59,127,245,.15); color: #93c5fd; border-color: var(--accent); }
[data-theme="dark"] .btn-outline-secondary { border-color: rgba(255,255,255,.12); color: #94a3b8; }
[data-theme="dark"] .btn-outline-secondary:hover { background: rgba(255,255,255,.06); color: var(--text); }
[data-theme="dark"] .btn-outline-success { border-color: rgba(22,163,74,.4); color: #86efac; }
[data-theme="dark"] .btn-outline-success:hover { background: rgba(22,163,74,.1); color: #86efac; }
[data-theme="dark"] .btn-outline-warning { border-color: rgba(217,119,6,.4); color: #fcd34d; }
[data-theme="dark"] .btn-outline-warning:hover { background: rgba(217,119,6,.1); color: #fcd34d; }
[data-theme="dark"] .btn-outline-danger { border-color: rgba(220,38,38,.4); color: #fca5a5; }
[data-theme="dark"] .btn-outline-danger:hover { background: rgba(220,38,38,.1); color: #fca5a5; }

/* ── Alerts ── */
[data-theme="dark"] .alert-info    { background: rgba(59,127,245,.12); color: #93c5fd; }
[data-theme="dark"] .alert-success { background: rgba(22,163,74,.12);  color: #86efac; }
[data-theme="dark"] .alert-warning { background: rgba(217,119,6,.12);  color: #fcd34d; }
[data-theme="dark"] .alert-danger  { background: rgba(220,38,38,.12);  color: #fca5a5; }

/* ── Pagination ── */
[data-theme="dark"] .pagination .page-link {
  background: var(--surface);
  border-color: rgba(255,255,255,.08);
  color: #93c5fd;
}
[data-theme="dark"] .pagination .page-link:hover { background: var(--accent); color: #fff; }

/* ── Login panel in dark ── */
[data-theme="dark"] .login-panel {
  background: #111827;
  box-shadow: -8px 0 40px rgba(0,0,0,.4);
}

[data-theme="dark"] .login-panel::before {
  background: linear-gradient(90deg, var(--accent), #818cf8, var(--accent));
}

[data-theme="dark"] .login-heading { color: #edf2fc; }
[data-theme="dark"] .login-sub     { color: #8fa3c8; }
[data-theme="dark"] .login-footer  { color: #4a6080; }
[data-theme="dark"] .login-form-label { color: #8fa3c8; }

/* ── Page headings ── */
[data-theme="dark"] h2.fw-bold { color: var(--text); }

/* ── Notice board item separator ── */
[data-theme="dark"] .card-body [style*="border-bottom"] {
  border-bottom-color: rgba(255,255,255,.04) !important;
}

/* Theme toggle icon swap */
[data-theme="dark"] #themeIcon::before { content: "\f5a2"; } /* bi-sun-fill */

/* ══════════════════════════════════════
   PRINT
══════════════════════════════════════ */
@media print {
  .no-print, #sidebar, .lms-navbar, .messages-container { display: none !important; }
  main { padding: 0 !important; }
  .card { border: none !important; box-shadow: none !important; }
  a[href]::after { content: none !important; }
}

/* ═══════════════════════════════════════════════════
   AUTH V2 — Premium login (scoped under .auth-v2)
   ═══════════════════════════════════════════════════ */
[x-cloak] { display: none !important; }

.auth-v2 {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Left hero ── */
.auth-v2 .av-hero {
  position: relative;
  padding: 54px 50px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at -10% -20%, #1b3a6e 0, transparent 60%),
    linear-gradient(155deg, #0a1326 0%, #0e1c38 45%, #10254d 100%);
}
.auth-v2 .av-hero::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  top: -160px; right: -160px;
  background: radial-gradient(circle, rgba(59,127,245,.45), transparent 62%);
}
.auth-v2 .av-hero::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  bottom: -180px; left: -120px;
  background: radial-gradient(circle, rgba(240,165,0,.20), transparent 60%);
}
.auth-v2 .av-hero-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000 40%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 20%, #000 40%, transparent 75%);
}
.auth-v2 .av-hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; }
.auth-v2 .av-brand { display: flex; align-items: center; gap: 13px; margin-bottom: auto; }
.auth-v2 .av-brand-mark {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 22px; color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 22px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.25);
}
.auth-v2 .av-brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.auth-v2 .av-brand-name span { color: #8fb4ff; }
.auth-v2 .av-hero-title {
  font-size: 38px; line-height: 1.12; font-weight: 800; letter-spacing: -.025em; margin: 30px 0 16px;
}
.auth-v2 .av-hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, #7aa7ff, #bcd0ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-v2 .av-hero-desc { color: #aebbd4; font-size: 14.5px; max-width: 380px; margin-bottom: 34px; }
.auth-v2 .av-feat { display: flex; flex-direction: column; gap: 13px; margin-bottom: auto; padding: 0; }
.auth-v2 .av-feat li { display: flex; align-items: center; gap: 14px; list-style: none; font-size: 13.5px; font-weight: 500; color: #dbe3f3; }
.auth-v2 .av-fi {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); color: #9dc0ff; font-size: 16px;
}
.auth-v2 .av-hero-foot {
  display: flex; gap: 26px; margin-top: 38px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.09);
}
.auth-v2 .av-stat .n { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.auth-v2 .av-stat .l { font-size: 11px; color: #8d9cbd; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* ── Right panel ── */
.auth-v2 .av-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-v2 .av-panel-inner { width: 100%; max-width: 400px; }
.auth-v2 .av-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.auth-v2 .av-title { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 6px; color: var(--text); }
.auth-v2 .av-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }

.auth-v2 .av-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.auth-v2 .av-role {
  border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 12px 6px; text-align: center;
  font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: .15s;
  background: var(--surface); font-family: inherit; line-height: 1.3;
}
.auth-v2 .av-role i { display: block; font-size: 17px; margin-bottom: 6px; }
.auth-v2 .av-role:hover { border-color: var(--accent); color: var(--accent); }
.auth-v2 .av-role.active { border-color: var(--accent); color: var(--accent); background: #f5f9ff; box-shadow: 0 0 0 3px var(--accent-glow); }

.auth-v2 .av-role-hint {
  font-size: 12px; color: #92681a; background: var(--gold-light); border: 1px solid #fae9c8;
  border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 18px; display: flex; gap: 7px; align-items: flex-start;
}
.auth-v2 .av-alert {
  font-size: 13px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: var(--r-sm); padding: 10px 13px; margin-bottom: 18px; display: flex; gap: 8px; align-items: center;
}

.auth-v2 .av-field { margin-bottom: 18px; }
.auth-v2 .av-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.auth-v2 .av-input { position: relative; }
.auth-v2 .av-input > i {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 16px;
}
.auth-v2 .av-input input {
  width: 100%; height: 50px; border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 0 16px 0 44px; font-size: 14px; font-family: inherit; color: var(--text);
  background: #fbfcfe; transition: .18s;
}
.auth-v2 .av-input input::placeholder { color: var(--text-faint); }
.auth-v2 .av-input input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-glow); }
.auth-v2 .av-err { color: #dc2626; font-size: 11.5px; margin-top: 6px; display: flex; gap: 5px; align-items: center; }

.auth-v2 .av-row { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 22px; }
.auth-v2 .av-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin: 0; cursor: pointer; }
.auth-v2 .av-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-v2 .av-link { font-size: 13px; color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-v2 .av-link:hover { text-decoration: underline; }

.auth-v2 .av-btn {
  width: 100%; height: 52px; border: none; border-radius: var(--r-md); cursor: pointer;
  font-family: inherit; font-size: 14.5px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 24px var(--accent-glow); transition: .18s;
}
.auth-v2 .av-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px var(--accent-glow); }
.auth-v2 .av-foot { margin-top: 30px; font-size: 11.5px; color: var(--text-faint); text-align: center; }

@media (max-width: 860px) {
  .auth-v2 { grid-template-columns: 1fr; }
  .auth-v2 .av-hero { display: none; }
  .auth-v2 .av-panel { padding: 40px 24px; min-height: 100vh; }
}

/* ── Auth V2 — dark mode ── */
[data-theme="dark"] .auth-v2 .av-input input {
  background: #111827;
  border-color: rgba(255,255,255,.12);
  color: #edf2fc;
}
[data-theme="dark"] .auth-v2 .av-input input:focus {
  background: #111827;
  border-color: var(--accent);
}
[data-theme="dark"] .auth-v2 .av-role {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .auth-v2 .av-role.active {
  background: rgba(59,127,245,.16);
  border-color: var(--accent);
}
[data-theme="dark"] .auth-v2 .av-alert {
  background: rgba(220,38,38,.14); border-color: rgba(220,38,38,.3); color: #fca5a5;
}
[data-theme="dark"] .auth-v2 .av-role-hint {
  background: rgba(240,165,0,.12); border-color: rgba(240,165,0,.28); color: #fcd34d;
}

/* ══════════════════════════════════════
   RESPONSIVE — app shell / mobile drawer
══════════════════════════════════════ */
.bottom-nav { display: none; }
#sidebarBackdrop { display: none; }

@media (max-width: 768px) {
  /* Brand stops reserving the 220px column */
  .nb-brand { width: auto; border-right: none; padding: 0 14px; }
  .nb-brand .brand-sub { display: none; }

  /* Trim the right side so it never overflows on a phone */
  .nb-right { gap: 8px; padding: 0 10px; }
  .nb-user-name { display: none; }
  .nb-user { padding: 4px; }

  /* Sidebar becomes an off-canvas drawer */
  #sidebar {
    position: fixed;
    top: var(--nb-h); left: 0;
    height: calc(100vh - var(--nb-h));
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open #sidebar { transform: translateX(0); }

  /* Dimmed backdrop behind the open drawer */
  #sidebarBackdrop {
    display: block;
    position: fixed; inset: var(--nb-h) 0 0 0;
    background: rgba(0,0,0,.45);
    z-index: 1045;
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
  }
  body.sidebar-open #sidebarBackdrop { opacity: 1; pointer-events: auto; }

  /* Main fills the width (sidebar is now out of flow); leave room for bottom bar */
  main { padding: 18px 15px 84px !important; }

  /* ── App-style bottom tab bar ── */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(14,22,40,.07);
    z-index: 1035;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a,
  .bottom-nav button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    font-size: 10.5px; font-weight: 600;
    color: var(--text-muted); text-decoration: none;
    background: none; border: none; font-family: inherit; cursor: pointer;
    transition: color .15s;
  }
  .bottom-nav a i,
  .bottom-nav button i { font-size: 20px; }
  .bottom-nav a:active,
  .bottom-nav button:active { background: var(--border-subtle); }
  .bottom-nav a.active { color: var(--accent); }
}

/* Slightly tighter padding on very small phones */
@media (max-width: 420px) {
  main { padding: 14px 12px 84px !important; }
  .nb-brand .brand-name { font-size: 13px; }
}
