/* ============================================================
   EduSphere — Core Design System (style.css)
   "Aurora Glass" — Light + Dark themes, colorful & unique
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- Theme Tokens ---------- */
:root {
  --font-head: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --bg:        #eef1fb;
  --bg-soft:   #e6ebfa;
  --card:      #ffffff;
  --card-soft: #f7f8ff;
  --text:      #191f3a;
  --muted:     #626a8c;
  --border:    #e3e7f7;
  --shadow:    0 8px 28px -10px rgba(56, 61, 130, .16);
  --shadow-lg: 0 22px 55px -18px rgba(56, 61, 130, .30);
  --glow:      0 8px 22px -6px rgba(124, 58, 237, .45);

  --primary:      #7c3aed;
  --primary-2:    #e343e3;
  --primary-soft: #f2e9ff;
  --grad:  linear-gradient(135deg, #7c3aed 0%, #c026d3 55%, #e343e3 100%);
  --grad2: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  --grad3: linear-gradient(135deg, #f7b733 0%, #f43f5e 100%);
  --grad4: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  --grad5: linear-gradient(120deg, #6366f1, #a855f7, #ec4899);

  --violet:  #7c3aed;  --cyan:    #0891b2;  --amber:  #f59e0b;
  --rose:    #f43f5e;  --emerald: #10b981;  --blue:   #3b82f6;
  --violet-soft: #f1e9ff; --cyan-soft: #e0f6fc; --amber-soft: #fef3d8;
  --rose-soft:   #ffe7ec; --emerald-soft: #d9f6ec; --blue-soft: #e4eeff;

  --success: #10b981; --warning: #f59e0b; --danger: #f43f5e; --info: #3b82f6;
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 272px;
  --tr: all .25s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --bg:        #0a0e1e;
  --bg-soft:   #0e1428;
  --card:      #131a33;
  --card-soft: #182043;
  --text:      #e9ecfb;
  --muted:     #9aa3c9;
  --border:    #252e58;
  --shadow:    0 10px 32px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 26px 60px -18px rgba(0, 0, 0, .7);
  --glow:      0 8px 26px -6px rgba(168, 85, 247, .55);

  --primary-soft: #2a2153;
  --violet-soft: #2a2153; --cyan-soft: #0c3440; --amber-soft: #3d2e0e;
  --rose-soft:   #421426; --emerald-soft: #0b3527; --blue-soft: #14274f;
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.65;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}
[data-theme="light"] body {
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(124, 58, 237, .07), transparent 60%),
    radial-gradient(900px 480px at -10% 30%, rgba(6, 182, 212, .07), transparent 55%),
    radial-gradient(800px 500px at 55% 110%, rgba(244, 63, 94, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(124, 58, 237, .13), transparent 60%),
    radial-gradient(900px 480px at -10% 30%, rgba(6, 182, 212, .10), transparent 55%),
    radial-gradient(800px 500px at 55% 110%, rgba(236, 72, 153, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 600; line-height: 1.3; }
a { color: var(--primary); text-decoration: none; transition: var(--tr); }
a:hover { color: var(--primary-2); }
img { max-width: 100%; }
ul { list-style: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--violet), var(--primary-2)); border-radius: 99px; }
::selection { background: var(--primary); color: #fff; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Utility ---------- */
.flex { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.w-100 { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary); border: 1px solid transparent;
}
.chip .ic { width: 13px; height: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: 13px; border: 1.5px solid transparent;
  font-family: var(--font-head); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: var(--tr); position: relative; overflow: hidden;
  white-space: nowrap; line-height: 1.35; color: var(--text);
  background: var(--card-soft);
}
.btn .ic { width: 16px; height: 16px; }
.btn:active { transform: scale(.97); }
.btn-gradient {
  background: var(--grad); color: #fff;
  box-shadow: var(--glow);
}
.btn-gradient:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(124, 58, 237, .55); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; box-shadow: var(--glow); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { filter: brightness(.97); transform: translateY(-1px); }
[data-theme="dark"] .btn-soft:hover { filter: brightness(1.15); }
.btn-primary { background: var(--grad2); color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.btn-danger { background: var(--rose-soft); color: var(--rose); }
.btn-danger:hover { background: var(--rose); color: #fff; }
.btn-success { background: var(--emerald-soft); color: var(--emerald); }
.btn-success:hover { background: var(--emerald); color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 10px; }
.btn-sm .ic { width: 13px; height: 13px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }

/* ripple (from main.js) */
.ripple-ink {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .45); transform: scale(0);
  animation: ripple .55s ease-out forwards;
}
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 99px; font-size: 11.5px;
  font-weight: 700; letter-spacing: .2px; line-height: 1.5; white-space: nowrap;
}
.bg-success, .bg-emerald { background: var(--emerald-soft); color: var(--emerald); }
.bg-warning, .bg-amber   { background: var(--amber-soft);   color: #b45309; }
[data-theme="dark"] .bg-warning, [data-theme="dark"] .bg-amber { color: #fbbf24; }
.bg-danger, .bg-rose     { background: var(--rose-soft);    color: var(--rose); }
.bg-info, .bg-blue       { background: var(--blue-soft);    color: var(--blue); }
.bg-violet               { background: var(--violet-soft);  color: var(--violet); }
.bg-cyan                 { background: var(--cyan-soft);    color: var(--cyan); }
.bg-gray                 { background: color-mix(in srgb, var(--muted) 13%, transparent); color: var(--muted); }
.bg-emerald.bar-emerald, .progress-bar.bg-emerald { background: var(--emerald); }
.progress-bar.bg-cyan.bar-cyan, .progress-bar.bar-cyan { background: var(--cyan); }
.progress-bar.bar-amber { background: var(--amber); }
.progress-bar.bar-emerald { background: var(--emerald); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 17px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.card-title .ic { color: var(--primary); width: 19px; height: 19px; }
.card-body { padding: 22px; }
.card-hover { transition: var(--tr); }
.card-hover:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.card-grad-border { position: relative; border: 0; }
.card-grad-border::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1.6px; background: var(--grad5);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 17px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; letter-spacing: .3px; }
.form-label.req::after { content: ' *'; color: var(--rose); }
.form-control {
  width: 100%; padding: 11px 15px; border-radius: var(--radius-sm);
  border: 1.6px solid var(--border); background: var(--card-soft);
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  transition: var(--tr); outline: none;
}
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 62%, transparent); }
.form-control:focus {
  border-color: var(--primary); background: var(--card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.input-icon .form-control { padding-left: 42px; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 17px; border-radius: var(--radius-sm);
  font-size: 13.5px; border: 1px solid transparent; margin-bottom: 16px;
}
.alert .ic { width: 19px; height: 19px; margin-top: 1px; }
.alert-info    { background: var(--blue-soft);    color: var(--blue);    border-color: color-mix(in srgb, var(--blue) 22%, transparent); }
.alert-success { background: var(--emerald-soft); color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 22%, transparent); }
.alert-warning { background: var(--amber-soft);   color: #b45309;        border-color: color-mix(in srgb, var(--amber) 26%, transparent); }
[data-theme="dark"] .alert-warning { color: #fbbf24; }
.alert-danger  { background: var(--rose-soft);    color: var(--rose);    border-color: color-mix(in srgb, var(--rose) 22%, transparent); }

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed; right: 22px; bottom: 22px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 44px));
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--info);
  border-radius: 14px; padding: 13px 17px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .45s cubic-bezier(.21, 1.02, .73, 1) forwards;
  position: relative; overflow: hidden;
}
.toast::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px;
  background: var(--info); animation: toastBar 4.4s linear forwards;
}
.toast-success { border-left-color: var(--emerald); } .toast-success::after { background: var(--emerald); }
.toast-warning { border-left-color: var(--amber); }   .toast-warning::after { background: var(--amber); }
.toast-error, .toast-danger { border-left-color: var(--rose); } .toast-error::after, .toast-danger::after { background: var(--rose); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn  { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10, 12, 30, .55); backdrop-filter: blur(7px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .25s ease; }
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .35s cubic-bezier(.21, 1.02, .73, 1);
}
.modal-lg { max-width: 780px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 2;
}
.modal-header h4 { font-size: 16px; }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 16px 24px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--card);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { transform: translateY(26px) scale(.97); opacity: 0; } }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow);
}
.table-modern { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.table-modern thead th {
  text-align: left; font-family: var(--font-head); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px; color: var(--muted);
  padding: 13px 18px; background: var(--card-soft);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table-modern tbody td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr { transition: background .18s ease; }
.table-modern tbody tr:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.table-actions { display: flex; gap: 7px; }
.table-actions .btn-sm { padding: 6px 10px; }

/* progress bars */
.progress-bar {
  height: 8px; border-radius: 99px; overflow: hidden;
  background: color-mix(in srgb, var(--muted) 14%, transparent); min-width: 90px;
}
.progress-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--grad2); }

/* user cell (avatar + name) */
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell b { display: block; font-size: 13.5px; line-height: 1.3; }
.user-cell small { color: var(--muted); font-size: 12px; display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Avatars ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 13px; display: inline-flex;
  align-items: center; justify-content: center; object-fit: cover;
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.avatar-sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.avatar-md { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.avatar-lg { width: 74px; height: 74px; border-radius: 22px; font-size: 25px; }
.avatar-gradient { background: var(--grad); color: #fff; box-shadow: var(--glow); }

/* ---------- Dropdowns ---------- */
.avatar-wrap { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 500;
  min-width: 230px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 7px;
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98);
  transition: var(--tr);
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border-radius: 10px; color: var(--text); font-size: 13.5px; font-weight: 500;
}
.dropdown-menu a:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-head { padding: 11px 13px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head small { color: var(--muted); }
.notif-panel { width: 340px; max-height: 430px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 11px; padding: 11px 13px; border-radius: 12px;
  align-items: flex-start; transition: background .18s;
}
.notif-item:hover { background: var(--card-soft); }
.notif-item b { font-size: 13px; display: block; line-height: 1.4; }
.notif-item p { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 2px 0; }
.notif-item small { font-size: 11px; color: var(--muted); opacity: .8; }
.notif-item .n-icon {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.notif-item .n-icon .ic { width: 16px; height: 16px; }
.notif-dot {
  position: absolute; top: 7px; right: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--rose);
  box-shadow: 0 0 0 2.5px var(--card); animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot { 50% { transform: scale(1.25); opacity: .7; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 20px; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 12px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 13px;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.page-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.page-dots { align-self: center; color: var(--muted); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty-state .empty-icon {
  width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.empty-state .empty-icon .ic { width: 32px; height: 32px; }
.empty-state h4 { color: var(--text); margin-bottom: 6px; }

/* ---------- Tabs & Accordion ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 20px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--muted); font-family: var(--font-head);
  font-weight: 600; font-size: 13px; cursor: pointer; transition: var(--tr);
}
.tab-btn:hover { color: var(--primary); border-color: var(--primary); }
.tab-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.accordion-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 15px;
  margin-bottom: 12px; overflow: hidden; transition: var(--tr);
}
.accordion-item.open { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow); }
.accordion-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 17px 21px; background: none; border: 0; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: var(--text); text-align: left;
}
.accordion-head .ic { transition: transform .3s; color: var(--primary); }
.accordion-item.open .accordion-head .ic { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.accordion-body-inner { padding: 0 21px 19px; color: var(--muted); font-size: 13.8px; }

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 34px 18px; position: relative; overflow: hidden;
}
[data-theme="light"] .auth-page {
  background:
    radial-gradient(900px 600px at 12% 8%, rgba(124, 58, 237, .13), transparent 55%),
    radial-gradient(800px 560px at 88% 88%, rgba(236, 72, 153, .12), transparent 55%),
    radial-gradient(700px 500px at 78% 12%, rgba(6, 182, 212, .11), transparent 55%),
    var(--bg);
}
[data-theme="dark"] .auth-page {
  background:
    radial-gradient(900px 600px at 12% 8%, rgba(124, 58, 237, .22), transparent 55%),
    radial-gradient(800px 560px at 88% 88%, rgba(236, 72, 153, .16), transparent 55%),
    radial-gradient(700px 500px at 78% 12%, rgba(6, 182, 212, .15), transparent 55%),
    var(--bg);
}
.bg-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; animation: blobFloat 14s ease-in-out infinite alternate; }
.bg-blob.b1 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(124, 58, 237, .4), transparent 70%); top: -130px; left: -90px; }
.bg-blob.b2 { width: 380px; height: 380px; background: radial-gradient(circle, rgba(236, 72, 153, .34), transparent 70%); bottom: -120px; right: -70px; animation-delay: -5s; }
.bg-blob.b3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(6, 182, 212, .32), transparent 70%); top: 42%; right: 16%; animation-delay: -9s; }
@keyframes blobFloat { to { transform: translate(34px, -26px) scale(1.08); } }

.auth-card {
  width: 100%; max-width: 450px; position: relative; z-index: 2;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 26px;
  padding: 42px 38px; box-shadow: var(--shadow-lg);
  animation: cardIn .6s cubic-bezier(.21, 1.02, .73, 1);
}
.auth-card.wide { max-width: 560px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(28px) scale(.98); } }
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 4.5px;
  border-radius: 0 0 8px 8px; background: var(--grad5); background-size: 200% 100%;
  animation: gradSlide 5s linear infinite;
}
@keyframes gradSlide { to { background-position: 200% 0; } }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 22px; }
.auth-logo img { width: 52px; height: 52px; border-radius: 15px; box-shadow: var(--glow); }
.auth-logo .logo-name { font-family: var(--font-head); font-size: 25px; font-weight: 800; }
.auth-title { text-align: center; font-size: 22.5px; margin-bottom: 7px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.auth-footer { text-align: center; color: var(--muted); font-size: 12.8px; margin-top: 22px; }
.auth-footer code { background: var(--card-soft); padding: 2px 7px; border-radius: 7px; border: 1px solid var(--border); }
.auth-top-link {
  position: absolute; top: 22px; left: 22px; z-index: 5;
  display: inline-flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(10px); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 13px; color: var(--text); font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow);
}
.auth-top-link:hover { color: var(--primary); border-color: var(--primary); }
.auth-page .auth-theme-toggle {
  position: absolute; top: 22px; right: 22px; z-index: 5;
  width: 43px; height: 43px; border-radius: 13px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(10px);
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: var(--tr);
}
.auth-page .auth-theme-toggle:hover { color: var(--primary); border-color: var(--primary); transform: rotate(14deg); }
.demo-creds {
  background: var(--primary-soft); border: 1.5px dashed color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 14px; padding: 14px 17px; font-size: 13px; line-height: 2; color: var(--text);
}
.demo-creds code { background: var(--card); padding: 2.5px 9px; border-radius: 8px; font-size: 12px; border: 1px solid var(--border); color: var(--primary); font-weight: 600; }

/* theme icon swap */
.ic-sun, .ic-moon { display: none; }
[data-theme="light"] .ic-moon { display: inline-block; }
[data-theme="light"] .ic-sun  { display: none; }
[data-theme="dark"] .ic-sun   { display: inline-block; }
[data-theme="dark"] .ic-moon  { display: none; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.21, 1.02, .73, 1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Scroll top ---------- */
.scroll-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 800;
  width: 46px; height: 46px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; box-shadow: var(--glow);
  opacity: 0; visibility: hidden; transform: translateY(14px); transition: var(--tr);
}
.scroll-top::before { content: ''; width: 16px; height: 16px; border-left: 2.6px solid #fff; border-top: 2.6px solid #fff; transform: rotate(45deg) translate(3px, 3px); }
.scroll-top.show { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { transform: translateY(-3px); }

/* ---------- Print / documents ---------- */
.print-area { background: var(--card); }
.doc-sheet {
  background: #fff; color: #1c2240; border-radius: 14px; padding: 44px 46px;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
  max-width: 860px; margin: 0 auto; border: 1px solid #e8eaf5;
}
.doc-header {
  display: flex; align-items: center; gap: 17px; padding-bottom: 20px; margin-bottom: 22px;
  border-bottom: 3px solid; border-image: linear-gradient(90deg, #7c3aed, #e343e3, #06b6d4) 1;
}
.doc-header img, .doc-header .logo { width: 62px; height: 62px; border-radius: 16px; object-fit: cover; flex-shrink: 0; box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .4); }
.doc-header h2 { font-size: 21px; color: #191f3a; }
.doc-header p { color: #626a8c; font-size: 12.5px; }
.doc-body { position: relative; z-index: 1; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-table th { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; text-align: left; padding: 11px 15px; font-family: var(--font-head); font-size: 12px; letter-spacing: .5px; }
.doc-table td { padding: 11px 15px; border-bottom: 1px solid #eceef8; }
.doc-table tr:nth-child(even) td { background: #f8f8fe; }
.doc-watermark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 88px; color: rgba(124, 58, 237, .05);
  transform: rotate(-24deg); pointer-events: none; user-select: none; z-index: 0;
}
.doc-stamp {
  position: absolute; right: 44px; bottom: 44px; z-index: 2;
  width: 128px; height: 128px; border-radius: 50%;
  border: 2.5px dashed rgba(16, 185, 129, .65); color: rgba(16, 185, 129, .9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 12px; text-align: center;
  transform: rotate(-12deg); background: rgba(16, 185, 129, .05); line-height: 1.5;
}
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0; padding: 0; background: #fff; }
  .no-print, .sidebar, .topbar, .scroll-top, .toast-container { display: none !important; }
  .doc-sheet { box-shadow: none; border: 0; }
}

/* ---------- misc ---------- */
.sig { font-family: 'Segoe Script', 'Comic Sans MS', cursive; color: var(--primary); font-size: 19px; }
.vr-icon { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); display: inline-block; box-shadow: 0 0 0 3px var(--emerald-soft); }

/* ---------- Confetti (birthday / celebration) ---------- */
.confetti {
  position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2.5px;
  opacity: .95; pointer-events: none; z-index: 5;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(660deg); opacity: 0; }
}
[data-theme="dark"] .ic-sun, [data-theme="dark"] .ic-moon { width: 19px; height: 19px; }

/* ============================================================
   v2 Master-Prompt Components — popups, WhatsApp float, UPI,
   gateways, templates, branches, documents
   ============================================================ */

/* ---------- Dynamic Popup Modal ---------- */
.popup-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(10, 14, 30, .55); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 18px;
}
.popup-overlay.open { display: flex; animation: fadeIn .25s ease; }
.popup-card {
  position: relative; width: min(460px, 100%);
  background: var(--card); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  animation: popUp .35s cubic-bezier(.34, 1.56, .64, 1);
}
.popup-card .popup-img { width: 100%; display: block; max-height: 280px; object-fit: cover; }
.popup-body { padding: 22px 24px 24px; }
.popup-body h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 8px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.popup-body p { color: var(--muted); font-size: 14px; line-height: 1.65; margin-bottom: 16px; }
.popup-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.92); color: #1e293b; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: var(--tr);
}
.popup-close:hover { transform: rotate(90deg); }
@keyframes popUp { from { transform: scale(.85) translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- WhatsApp Float Buttons ---------- */
.wa-float {
  position: fixed; left: 18px; bottom: 18px; z-index: 185; /* v6: below sidebar(200)/backdrop(190) so drawer & sidebar never get overlapped */
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #0ea55b); color: #fff;
  display: grid; place-items: center; text-decoration: none;
  box-shadow: 0 10px 26px -8px rgba(14, 165, 91, .65);
  transition: var(--tr);
}
.wa-float:hover { transform: translateY(-4px) scale(1.06); color: #fff; }
.wa-float + .wa-float { bottom: 80px; background: linear-gradient(135deg, #7c3aed, #c026d3); box-shadow: 0 10px 26px -8px rgba(168, 85, 247, .6); }
.wa-float .wa-tip {
  position: absolute; left: 60px; top: 50%; transform: translateY(-50%) scale(.85);
  background: var(--card); color: var(--text); font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  opacity: 0; pointer-events: none; transition: var(--tr);
}
.wa-float:hover .wa-tip { opacity: 1; transform: translateY(-50%) scale(1); }
@media (max-width: 640px) { .wa-float { width: 46px; height: 46px; } .wa-float .wa-tip { display: none; } }

/* v6: inside admin/student/franchise panels, keep the floats clear of the fixed sidebar */
@media (min-width: 901px) {
  body:has(.layout) .wa-float { left: calc(var(--sidebar-w) + 18px); }
}

/* ---------- Payment Gateway Selector ---------- */
.gateway-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gateway-card {
  position: relative; border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 12px; cursor: pointer; background: var(--card-soft);
  transition: var(--tr); text-align: center;
}
.gateway-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.gateway-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.gateway-card.selected::after {
  content: '✓'; position: absolute; top: -9px; right: -7px; width: 22px; height: 22px;
  background: var(--grad); color: #fff; border-radius: 50%; font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.gateway-card .gw-dot { width: 34px; height: 34px; border-radius: 10px; margin: 0 auto 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.gateway-card .gw-name { font-weight: 700; font-size: 13px; color: var(--text); }
.gateway-card .gw-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.gateway-card.gw-disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.7); }

/* ---------- Manual UPI / QR box ---------- */
.upi-box {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  background: var(--card-soft); border: 1.5px dashed var(--primary); border-radius: var(--radius);
  padding: 18px;
}
.upi-box .qr-wrap { background: #fff; border-radius: 14px; padding: 10px; box-shadow: var(--shadow); text-align: center; }
.upi-box .qr-wrap svg { display: block; }
.upi-id-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--primary-soft);
  color: var(--primary); font-weight: 700; padding: 7px 14px; border-radius: 999px; font-size: 14px;
  margin: 8px 0 12px;
}
.utr-form { display: grid; gap: 10px; margin-top: 12px; }
.utr-form .hint { font-size: 12px; color: var(--muted); }

/* ---------- Certificate Template Picker ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tpl-card {
  border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: var(--tr); background: var(--card);
}
.tpl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tpl-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.tpl-card .tpl-preview { height: 110px; position: relative; display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 13px; text-align: center; padding: 8px; }
.tpl-card .tpl-preview::before {
  content: ''; position: absolute; inset: 8px; border: 1.5px solid rgba(255,255,255,.5); border-radius: 8px;
}
.tpl-card .tpl-meta { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-card .tpl-name { font-weight: 700; font-size: 13px; }
.tpl-badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--grad); color: #fff; }

/* ---------- Branch Directory ---------- */
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.branch-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); transition: var(--tr); display: flex; flex-direction: column; }
.branch-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.branch-card .branch-map { height: 150px; width: 100%; border: 0; display: block; }
.branch-card .branch-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.branch-card h4 { font-family: var(--font-head); font-size: 16px; }
.branch-loc { color: var(--muted); font-size: 13px; display: flex; gap: 7px; align-items: flex-start; }
.branch-loc .ic { flex-shrink: 0; margin-top: 1px; width: 15px; height: 15px; }
.branch-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.head-badge { background: var(--grad3); }

/* ---------- Verify result QR strip / doc actions ---------- */
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.verify-qr-box { display: flex; gap: 16px; align-items: center; background: var(--card-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.verify-qr-box .qr-img { border-radius: 10px; background: #fff; padding: 6px; box-shadow: var(--shadow); }

/* ---------- ID card print helper ---------- */
.idcard-print-wrap { display: grid; place-items: center; min-height: 300px; }
@media print { .idcard-print-wrap { margin: 0; } }

/* ---------- Security settings checklist (v4) ---------- */
.check-list { list-style: none; }
.check-list li { display: flex; gap: 9px; align-items: flex-start; color: var(--text); font-size: 13.5px; }
.check-list li .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--green); }
