/* ============================================================
   ACTC MUI Admin — Material UI dark glass theme
   ============================================================ */
:root {
  --bg: #0a0a0f;
  --bg-2: #101018;
  --bg-card: #15151f;
  --bg-card-2: #1a1a28;
  --bg-glass: rgba(255,255,255,0.045);
  --bg-glass-2: rgba(255,255,255,0.08);
  --border-glass: rgba(255,255,255,0.09);
  --border-glass-2: rgba(255,255,255,0.15);
  --text: #eaeaf4;
  --text-2: #a2a2ba;
  --text-muted: #6f6f8a;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --violet: #a855f7;
  --accent: linear-gradient(135deg,#6366f1 0%,#a855f7 100%);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow: 0 6px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.55);
  --sidebar-w: 250px;
  --appbar-h: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background:
    radial-gradient(1100px 620px at 85% -10%, rgba(99,102,241,.16), transparent 60%),
    radial-gradient(900px 520px at -10% 30%, rgba(168,85,247,.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--violet); }
h1,h2,h3,h4,h5,h6 { color: var(--text); font-weight: 600; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #2c2c3f; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3b3b55; }

/* ---------------- Layout ---------------- */
.mui-app {
  display: flex;
  min-height: 100vh;
}
.mui-sidebar {
  width: var(--sidebar-w);
  background: rgba(13,13,20,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-glass);
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 12px;
  z-index: 900;
  transition: transform .25s ease;
}
.mui-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 20px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 12px;
}
.mui-brand .logo-badge {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  box-shadow: 0 6px 18px rgba(99,102,241,.4);
  flex-shrink: 0;
}
.mui-brand .brand-name { font-weight: 700; font-size: 14.5px; line-height: 1.2; }
.mui-brand .brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; }
/* Desktop: the nav list scrolls inside the fixed sidebar, but the logo + name
   stay pinned. The sidebar's top padding moves into the brand so its opaque
   background covers the whole strip — otherwise nav links peek above it. */
@media (min-width: 901px) {
  .mui-sidebar { padding-top: 0; }
  .mui-brand {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: 24px; /* 18px old sidebar padding + 6px old brand padding */
    background: rgba(13,13,20,.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}
.mui-nav { list-style: none; }
.mui-nav .nav-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-muted); padding: 16px 12px 6px;
}
.mui-nav a.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 4px;
  border-radius: 10px; color: var(--text-2);
  font-size: 13.5px; font-weight: 500;
  transition: all .16s ease;
}
.mui-nav a.nav-link:hover { background: var(--bg-glass-2); color: var(--text); }
.mui-nav a.nav-link.active { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(99,102,241,.35); }
.mui-nav a.nav-link .ic { width: 20px; font-size: 16px; text-align: center; }

.mui-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.mui-appbar {
  min-height: var(--appbar-h);
  position: sticky; top: 0;
  background: rgba(17,17,26,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 0 24px;
  z-index: 800;
}
/* the burger + title group must be allowed to shrink, or long page titles
   push the user chip off the right edge on narrow screens */
.mui-appbar > .appbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.mui-appbar .page-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mui-appbar .page-title .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display:inline-block; box-shadow: 0 0 10px rgba(139,92,246,.8); }
.mui-appbar .tools { display: flex; align-items: center; gap: 10px; }
.mui-burger { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
.mui-user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  padding: 5px 14px 5px 6px; border-radius: 999px;
  cursor: pointer; color: var(--text);
}
.mui-user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; overflow: hidden; flex-shrink: 0;
}
.mui-user-chip .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.mui-user-chip .avatar-letter { font-weight: 700; font-size: 14px; color: #fff; }
.mui-user-chip .u-name { font-size: 13px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-logout {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  transition: all .15s ease; white-space: nowrap;
}
.app-logout .material-icons { font-size: 19px; }
.app-logout:hover { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.4); color: #f87171; }
@media (max-width: 560px) {
  .app-logout { padding: 0 11px; }
  .app-logout .lbl { display: none; }
}
.mui-content { padding: 24px 26px; flex: 1; }

.mui-footer {
  border-top: 1px solid var(--border-glass);
  padding: 14px 26px; font-size: 12.5px; color: var(--text-muted);
  display: flex; justify-content: space-between;
}

/* ---------------- Dropdown ---------------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-card-2);
  border: 1px solid var(--border-glass-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  padding: 6px;
  display: none;
  z-index: 999;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 13px;
}
.dropdown-menu a:hover { background: var(--bg-glass-2); color: var(--text); }
.dropdown-menu .dropdown-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* ---------------- Cards ---------------- */
.mui-grid { display: grid; gap: 20px; }
.mui-grid-4 { grid-template-columns: repeat(4, 1fr); }
.mui-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mui-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Questions page: the Add Question and Upload Questions forms sit side by
   side; a one-shot bulk upload result spans both columns underneath them. */
.question-form-grid { align-items: start; }
.question-form-grid > #qForm { order: 1; }
.question-form-grid > .upload-questions-card { order: 2; }
.question-form-grid > .bulk-report-card { order: 3; grid-column: 1 / -1; }

.mui-card {
  background: linear-gradient(150deg, var(--bg-card), #1b1b2b);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mui-card .card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mui-card .card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.mui-card .card-body { padding: 20px; }

.stat-card {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  position: relative; overflow: hidden;
}
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.stat-card .stat-val { font-size: 20px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-lbl { font-size: 11px; color: var(--text-2); margin-top: 1px; }
/* optional second line on a stat card. It carries the label itself on the fee
   cards ("This Month | 34 Students Paid"), so it reads a touch larger than a
   plain caption would. */
.stat-card .stat-sub {
  font-size: 11px; color: var(--text-2); margin-top: 4px; line-height: 1.35;
}
/* The line is built from segments so that on a roomy card it stays on ONE line
   and breaks at the pipe rather than orphaning "Paid". `.ss-b` is deliberately
   NOT nowrap: in a 2-up phone card beside the icon there is not room for it, and
   wrapping it ("34 / Students Paid") is far better than clipping it. */
.stat-card .stat-sub .ss-a { white-space: nowrap; }
.stat-card .stat-sub .ss-sep { margin: 0 5px; opacity: .5; }
/* the count is highlighted in the theme's own green (--success, #22c55e).
   A literal dark green such as #15803d lands at ~2:1 against the #15151f card
   and would be unreadable; this one is ~8:1. */
.stat-card .stat-sub .stat-sub-num {
  color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums;
}
/* Today's tally on the right of the Recent Fees heading: (7 Students · Rs 5,800).
   The count is picked out in the theme's green — a literal dark green such as
   #15803d is ~2:1 against the #15151f card and would be unreadable, this is ~8:1. */
.card-head .head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.card-head .fees-today-badge {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-size: 11.5px; color: var(--text-2);
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.card-head .fees-today-badge b {
  color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  /* on a phone the heading and the badge must not fight for the same row */
  .card-head .head-right { flex-wrap: wrap; }
  .card-head .fees-today-badge { order: -1; }
}
.stat-card::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06), transparent 70%);
}
.grad-indigo { background: linear-gradient(135deg,#6366f1,#8b5cf6); box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.grad-cyan { background: linear-gradient(135deg,#06b6d4,#0ea5e9); box-shadow: 0 8px 20px rgba(6,182,212,.35); }
.grad-green { background: linear-gradient(135deg,#22c55e,#16a34a); box-shadow: 0 8px 20px rgba(34,197,94,.35); }
.grad-amber { background: linear-gradient(135deg,#f59e0b,#f97316); box-shadow: 0 8px 20px rgba(245,158,11,.35); }
.grad-pink { background: linear-gradient(135deg,#ec4899,#f43f5e); box-shadow: 0 8px 20px rgba(236,72,153,.35); }
.grad-violet { background: linear-gradient(135deg,#a855f7,#8b5cf6); box-shadow: 0 8px 20px rgba(168,85,247,.35); }
.grad-red { background: linear-gradient(135deg,#ef4444,#f97316); box-shadow: 0 8px 20px rgba(239,68,68,.35); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 10px; border: none;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .16s ease;
  text-decoration: none; line-height: 1.3;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(99,102,241,.3); }
.btn-success { background: linear-gradient(135deg,#22c55e,#16a34a); color: #fff; }
.btn-danger { background: linear-gradient(135deg,#ef4444,#dc2626); color: #fff; }
.btn-warning { background: linear-gradient(135deg,#f59e0b,#ea580c); color: #fff; }
.btn-info { background: linear-gradient(135deg,#38bdf8,#0284c7); color: #fff; }
.btn-ghost { background: var(--bg-glass); color: var(--text); border: 1px solid var(--border-glass); }
.btn-ghost:hover { background: var(--bg-glass-2); }
.btn-sm { padding: 5px 9px; font-size: 11.5px; border-radius: 7px; }
.btn-sm .material-icons { font-size: 16px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn:hover { transform: translateY(-1px); }
.btn-danger:hover { box-shadow: 0 6px 18px rgba(239,68,68,.35); }

/* ---------------- Alerts ---------------- */
.mui-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 10px; margin-bottom: 16px;
  border: 1px solid; font-size: 13.5px;
}
.mui-alert-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: #4ade80; }
.mui-alert-error { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #f87171; }
.mui-alert-warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); color: #fbbf24; }
.mui-alert-info { background: rgba(56,189,248,.12); border-color: rgba(56,189,248,.3); color: #38bdf8; }

/* ---------------- Flash Toast (right-middle, auto-hide) ---------------- */
.flash-toast-wrap {
  position: fixed; right: 16px; top: 50%; z-index: 1300;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(400px, calc(100vw - 32px)); pointer-events: none;
  transform: translateY(-50%);
}
.flash-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid; border-radius: 10px;
  font-size: 13.5px; line-height: 1.45; font-weight: 500;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
  pointer-events: auto; animation: ftIn .25s ease-out;
}
.flash-toast .material-icons { font-size: 19px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.flash-toast-success { background: #f0fdf4; border-color: rgba(34,197,94,.4); color: #14532d; }
.flash-toast-success .material-icons { color: #16a34a; }
.flash-toast-error { background: #fef2f2; border-color: rgba(239,68,68,.4); color: #991b1b; }
.flash-toast-error .material-icons { color: #dc2626; }
.flash-toast-warning { background: #fffbeb; border-color: rgba(245,158,11,.4); color: #92400e; }
.flash-toast-warning .material-icons { color: #d97706; }
.flash-toast-info { background: #eff6ff; border-color: rgba(59,130,246,.4); color: #1e40af; }
.flash-toast-info .material-icons { color: #2563eb; }
.flash-toast.is-hiding { animation: ftOut .3s ease-in forwards; }
@keyframes ftIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes ftOut { to { opacity: 0; transform: translateX(26px); } }
@media (prefers-reduced-motion: reduce) {
  .flash-toast, .flash-toast.is-hiding { animation: none; }
}
@media (max-width: 600px) {
  .flash-toast-wrap {
    top: 50%; right: 10px; left: auto;
    max-width: min(260px, calc(100vw - 20px));
    gap: 8px;
  }
  .flash-toast {
    padding: 9px 11px; border-radius: 9px;
    font-size: 12px; line-height: 1.4; gap: 8px;
  }
  .flash-toast .material-icons { font-size: 17px; margin-top: 0; }
}

/* ---------------- Stacked contact cell (student / parent) ---------------- */
.mob-stack { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.mob-stack .mob-row { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; }
.mob-stack .mob-row .mob-tag { font-weight: 800; color: var(--text-muted); margin-right: 5px; font-size: 11px; letter-spacing: .03em; }
.mob-stack .mob-row.mob-parent { color: var(--text-muted); }
.mob-stack .mob-row.mob-parent .mob-tag { color: var(--text-muted); }
.mob-link { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.28); padding: 1px 1px; border-radius: 3px; transition: background-color .15s ease, border-color .15s ease, color .15s ease; -webkit-tap-highlight-color: rgba(99,102,241,.25); }
.mob-link:hover, .mob-link:focus { color: #93c5fd; border-bottom-color: #93c5fd; outline: none; background: rgba(147,197,253,.10); }
@media (hover: none) { .mob-link { border-bottom: none; } }
.mob-none { color: var(--text-muted); }

/* ---------------- Student cell — same width both tables ---------------- */
@media (max-width: 768px) {
  /* content-sized on phones (fees + students tables): avatar + name takes
     exactly what it needs, no extra slack, extra narrow columns stay narrow */
  .name-col { width: 1% !important; max-width: 1%; white-space: nowrap; }
}

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.form-control, input.mui-input, select.mui-input, textarea.mui-input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass-2);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 13.5px;
  transition: all .18s ease;
  font-family: inherit;
}
.form-control:focus, input.mui-input:focus, select.mui-input:focus, textarea.mui-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
/* Native dropdown popups are drawn by the OS, not by the page background.
   Without an explicit colour scheme the popup stays white while the option
   text inherits the (light) theme colour -> white-on-white, unreadable. */
select.form-control, select.mui-input { color-scheme: dark; }
select.form-control option, select.mui-input option { background: var(--bg-card-2); color: var(--text); }

/* period quick-filter chips */
.period-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.period-chips .chip {
  padding: 7px 14px; border-radius: 20px; cursor: pointer; user-select: none;
  background: var(--bg-glass); border: 1px solid var(--border-glass-2);
  color: var(--text-2); font-size: 13px; font-weight: 600; transition: all .18s ease;
}
.period-chips .chip:hover { border-color: var(--primary); color: var(--text); }
.period-chips .chip.chip-on {
  background: linear-gradient(135deg,#6366f1,#a855f7); border-color: transparent;
  color: #fff; box-shadow: 0 4px 14px rgba(139,92,246,.35);
}

/* date range grouped box */
.date-range-box {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: 100%;
  background: var(--bg-glass); border: 1px solid var(--border-glass-2);
  border-radius: 12px; padding: 6px 12px;
}
.date-range-box .dr-ic { font-size: 18px; color: var(--primary); }
.date-range-box .dr-f { display: flex; flex-direction: column; }
.date-range-box .dr-f label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  color: #9a9bb3; margin-bottom: 1px;
}
.date-range-box .dr-f input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 12.5px; font-family: inherit;
  width: 105px; cursor: pointer;
}
.date-range-box .dr-f input::-webkit-calendar-picker-indicator {
  filter: invert(.6); cursor: pointer;
}
.date-range-box .dr-sep { width: 1px; height: 26px; background: var(--border-glass-2); }

/* confirm delete modal */
.del-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(5,5,10,.72); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.del-overlay.show { display: flex; animation: delFade .18s ease; }
.del-box {
  background: linear-gradient(160deg, var(--bg-card-2), #101018);
  border: 1px solid var(--border-glass-2); border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6); padding: 30px 34px;
  width: 100%; max-width: 400px; text-align: center;
  animation: delPop .22s cubic-bezier(.2,.9,.3,1.25);
}
.del-icon {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%;
  background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.35);
  display: flex; align-items: center; justify-content: center;
}
.del-icon .material-icons { font-size: 30px; color: var(--danger); }
.del-title { font-size: 19px; font-weight: 800; color: var(--text); }
.del-msg { font-size: 13.5px; color: var(--text-2); margin: 10px auto 22px; max-width: 300px; line-height: 1.5; }
.del-actions { display: flex; gap: 10px; justify-content: center; }
.del-actions .btn { flex: 1; justify-content: center; }
@keyframes delFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes delPop { 0% { transform: scale(.88) translateY(14px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }

/* date inputs — clean theme match */
input[type="date"].mui-input,
input[type="month"].mui-input {
  color-scheme: dark;
  min-height: 40px;
  padding: 8px 10px 8px 14px;
  line-height: normal;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"].mui-input::-webkit-datetime-edit,
input[type="month"].mui-input::-webkit-datetime-edit {
  color: var(--text);
}
input[type="date"].mui-input::-webkit-datetime-edit-fields-wrapper,
input[type="month"].mui-input::-webkit-datetime-edit-fields-wrapper {
  background: transparent;
}
input[type="date"].mui-input::-webkit-calendar-picker-indicator,
input[type="month"].mui-input::-webkit-calendar-picker-indicator {
  opacity: .65;
  cursor: pointer;
  margin-left: 4px;
  transition: opacity .15s ease;
}
input[type="date"].mui-input:hover::-webkit-calendar-picker-indicator,
input[type="month"].mui-input:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}
.date-range-box input::-webkit-calendar-picker-indicator {
  filter: invert(.7);
  opacity: .9;
  cursor: pointer;
}
input[type="date"].mui-input::-webkit-datetime-edit { color: var(--text); }
.date-range-box input { color-scheme: dark; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 16px; }

/* ---------------- Tables ---------------- */
.mui-table-wrap { overflow-x: auto; }
.mui-table { width: 100%; border-collapse: collapse; }
.mui-table thead th {
  background: var(--bg-glass);
  color: var(--text-2);
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  padding: 13px 15px; text-align: left; white-space: nowrap;
  font-weight: 600;
}
.mui-table tbody td {
  padding: 12px 15px;
  border-top: 1px solid rgba(255,255,255,.05);
  font-size: 13.5px; vertical-align: middle;
}
.mui-table tbody tr:hover { background: var(--bg-glass); }
.mui-table tbody tr { transition: background .12s; }

/* Exams tables keep every column on one line; the wrapper scrolls if needed. */
.exams-table,
.exams-table th,
.exams-table td {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.mui-avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border-glass-2); background: var(--bg-glass);
}
.mui-badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge-active { background: rgba(34,197,94,.16); color: #4ade80; }
.badge-inactive { background: rgba(239,68,68,.16); color: #f87171; }
.badge-pending { background: rgba(245,158,11,.16); color: #fbbf24; }
.badge-info { background: rgba(56,189,248,.16); color: #38bdf8; }
.badge-btn { border: 0; cursor: pointer; font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; transition: filter .15s, box-shadow .15s; }
.badge-btn .material-icons { font-size: 13px; height: 13px; }
.badge-btn:hover { filter: brightness(1.3); box-shadow: 0 0 0 2px rgba(255,255,255,.09); }

/* ---------------- ON/OFF Switch ---------------- */
.sw { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; vertical-align: middle; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw-slider {
  position: absolute; inset: 0; border-radius: 22px;
  background: #565d6b;
  border: 1px solid #565d6b;
  transition: background .2s, border-color .2s;
}
.sw-slider:before {
  content: ""; position: absolute; height: 14px; width: 14px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; transition: transform .2s, background .2s;
}
.sw input:checked + .sw-slider { background: #0ea5e9; border-color: #0ea5e9; }
.sw input:checked + .sw-slider:before { transform: translateX(18px); background: #fff; }

/* ---------------- Login — technical 3D split ---------------- */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(8px, 1.8vh, 28px);
  overflow: hidden;
  background:
    radial-gradient(900px 620px at 12% 8%, rgba(34,211,238,.12), transparent 60%),
    radial-gradient(900px 620px at 92% 92%, rgba(59,130,246,.14), transparent 60%),
    #05080f;
}
/* blueprint grid, faded at the edges */
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 8%, transparent 74%);
  mask-image: radial-gradient(circle at 50% 45%, #000 8%, transparent 74%);
  pointer-events: none;
}
/* soft cyan glow behind the shell */
.login-page::after {
  content: '';
  position: absolute;
  width: 760px; height: 760px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(34,211,238,.10), transparent 62%);
  filter: blur(30px);
  pointer-events: none;
}
/* drifting star / node field */
.login-net {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%; max-width: 1040px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 40px 120px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.03) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: shellIn .75s cubic-bezier(.22,1,.36,1) both;
}
@keyframes shellIn {
  from { opacity: 0; transform: translateY(20px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
/* gradient accent line across the top */
.login-shell::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #22d3ee, #3b82f6, #8b5cf6, transparent);
  opacity: .85;
  z-index: 2;
}

/* ---- left visual ---- */
.login-visual {
  position: relative;
  padding: clamp(14px, 3.6vh, 40px) clamp(20px, 3vw, 40px);
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(148,163,184,.14);
  background:
    radial-gradient(520px 320px at 16% 0%, rgba(34,211,238,.10), transparent 62%),
    linear-gradient(160deg, rgba(8,14,26,.9), rgba(5,8,15,.45));
  overflow: hidden;
}
.lv-badge {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: clamp(5px, 1.2vh, 8px) clamp(8px, 1vw, 12px); border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #67e8f9;
  background: rgba(34,211,238,.07);
  border: 1px solid rgba(34,211,238,.25);
}
.lv-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: lvPulse 2s ease-in-out infinite;
}
@keyframes lvPulse { 50% { opacity: .35; transform: scale(.75); } }

.login-visual h2 {
  margin: clamp(6px, 1.8vh, 22px) 0 clamp(4px, 1vh, 10px);
  font-size: clamp(19px, 3.4vh, 36px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.02em;
}
.login-visual h2 span {
  background: linear-gradient(90deg, #22d3ee, #3b82f6 55%, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-visual > p { color: #94a3b8; font-size: 12.5px; max-width: 400px; }

.lv-stage {
  position: relative;
  flex: 1;
  min-height: clamp(92px, 21vh, 240px);
  display: grid; place-items: center;
  perspective: 900px;
  transform-style: preserve-3d;
  margin: clamp(2px, 1vh, 8px) 0;
}
.lv-glow {
  position: absolute;
  width: clamp(110px, 21vh, 230px); height: clamp(110px, 21vh, 230px); border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.20), transparent 62%);
  filter: blur(12px);
}
.cube {
  position: relative;
  --s: clamp(56px, 11vh, 118px);   /* cube edge */
  --z: calc(var(--s) / 2);         /* half edge, used by the faces */
  width: var(--s); height: var(--s);
  transform-style: preserve-3d;
  animation: cubeSpin 26s linear infinite;
}
.cube .fc {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Nirmala UI', 'Noto Sans Devanagari', 'Mangal', monospace;
  font-size: calc(var(--s) * .17); font-weight: 700;
  color: #7dd3fc;
  text-shadow: 0 0 14px rgba(34,211,238,.8);
  background: rgba(34,211,238,.05);
  border: 1px solid rgba(34,211,238,.45);
  box-shadow: 0 0 26px rgba(34,211,238,.10) inset;
}
.f1 { transform: translateZ(var(--z)); }
.f2 { transform: rotateY(180deg) translateZ(var(--z)); }
.f3 { transform: rotateY(90deg) translateZ(var(--z)); }
.f4 { transform: rotateY(-90deg) translateZ(var(--z)); }
.f5 { transform: rotateX(90deg) translateZ(var(--z)); }
.f6 { transform: rotateX(-90deg) translateZ(var(--z)); }
@keyframes cubeSpin {
  /* horizontal spin, with two diagonal tumbles woven in */
  0%   { transform: rotateX(-20deg) rotateY(0deg)   rotateZ(0deg); }
  15%  { transform: rotateX(-20deg) rotateY(54deg)  rotateZ(0deg); }
  26%  { transform: rotateX(-52deg) rotateY(94deg)  rotateZ(20deg); }
  38%  { transform: rotateX(-20deg) rotateY(137deg) rotateZ(0deg); }
  55%  { transform: rotateX(-20deg) rotateY(198deg) rotateZ(0deg); }
  66%  { transform: rotateX(-52deg) rotateY(238deg) rotateZ(-20deg); }
  78%  { transform: rotateX(-20deg) rotateY(281deg) rotateZ(0deg); }
  100% { transform: rotateX(-20deg) rotateY(360deg) rotateZ(0deg); }
}
.ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.r1 {
  width: clamp(104px, 20vh, 220px); height: clamp(104px, 20vh, 220px);
  border: 1px dashed rgba(56,189,248,.28);
  animation: ringA 16s linear infinite;
}
.r2 {
  width: clamp(136px, 27vh, 290px); height: clamp(136px, 27vh, 290px);
  border: 1px solid rgba(139,92,246,.16);
  animation: ringB 24s linear infinite;
}
@keyframes ringA {
  from { transform: rotateX(74deg) rotateZ(0deg); }
  to   { transform: rotateX(74deg) rotateZ(360deg); }
}
@keyframes ringB {
  from { transform: rotateY(72deg) rotateZ(0deg); }
  to   { transform: rotateY(72deg) rotateZ(360deg); }
}

.lv-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1vh, 10px);
}
.lv-stats > div {
  padding: clamp(5px, 1.2vh, 11px) clamp(8px, 1vw, 12px) clamp(4px, 1vh, 9px);
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.lv-stats b {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(13px, 2vh, 17px); line-height: 1.2; color: #e2e8f0;
}
.lv-stats span {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #64748b;
}

/* ---- right form card ---- */
.login-card {
  position: relative;
  padding: clamp(14px, 3.4vh, 40px) clamp(20px, 3vw, 40px);
  display: flex; flex-direction: column; justify-content: center;
  background: rgba(6,11,20,.55);
  overflow: hidden;
}
.login-card .login-glare {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%),
              rgba(34,211,238,.10), transparent 62%);
  opacity: 0;
  transition: opacity .25s ease;
}
.login-card:hover .login-glare { opacity: 1; }

.lc-head {
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
  text-align: center;
  margin-bottom: clamp(8px, 2.4vh, 24px);
}
.lc-head > div { text-align: center; }
.lc-head img {
  width: clamp(42px, 8vh, 80px); height: clamp(42px, 8vh, 80px);
  object-fit: contain;
  background: #fff;
  border-radius: clamp(12px, 1.9vh, 18px);
  padding: clamp(4px, .9vh, 7px);
  box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(34,211,238,.16);
  animation: logoFloat 5s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.lc-kicker {
  display: block;
  margin-top: clamp(4px, 1.4vh, 14px);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: #22d3ee;
}
.login-card h1 { font-size: clamp(17px, 2.6vh, 24px); line-height: 1.15; margin: clamp(2px, .6vh, 5px) 0 2px; }
.login-card .sub { color: #64748b; font-size: 12px; margin: 0; }

.login-card .form-group { margin-bottom: clamp(6px, 1.5vh, 14px); }
.login-card .form-group label {
  font-family: inherit;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: #7c8aa5;
  margin-bottom: clamp(3px, .7vh, 6px);
}
.login-card .form-control {
  padding: clamp(7px, 1.6vh, 12px) 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(148,163,184,.18);
}
.login-card .form-control:focus {
  border-color: rgba(34,211,238,.65);
  box-shadow: 0 0 0 4px rgba(34,211,238,.10), 0 8px 24px rgba(34,211,238,.08);
}
.login-card .btn {
  position: relative;
  display: block;
  width: 100%; padding: clamp(8px, 1.8vh, 13px);
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px;
  color: #04121f;
  border-radius: 12px;
  background: linear-gradient(135deg, #22d3ee, #38bdf8 55%, #6366f1);
  box-shadow: 0 12px 30px rgba(34,211,238,.28);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.login-card .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(34,211,238,.38);
}
.login-card .btn:active { transform: translateY(0) scale(.99); }
.login-card .btn::after {
  content: ''; position: absolute;
  top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  animation: loginShine 3.8s ease-in-out infinite;
}
@keyframes loginShine {
  0%, 62% { left: -60%; }
  100%    { left: 140%; }
}
.login-card .form-hint {
  text-align: center;
  margin-top: clamp(5px, 1.4vh, 12px);
  color: #64748b;
  font-size: 11.5px;
}
.lc-forgot { text-align: center; margin-top: clamp(3px, .7vh, 6px); }
.lc-forgot a { color: #22d3ee; font-size: 12.5px; }
.lc-forgot a:hover { color: #67e8f9; }

.lc-back {
  text-align: center;
  margin-top: clamp(6px, 1.8vh, 16px); padding-top: clamp(6px, 1.6vh, 14px);
  border-top: 1px solid rgba(148,163,184,.12);
}
.lc-back a { color: #7c8aa5; font-size: 12px; }
.lc-back a:hover { color: #67e8f9; }

@media (max-width: 900px) {
  /* phones: everything must fit one screen — no scrolling */
  .login-page {
    padding: 10px;
    min-height: 100vh;
    min-height: 100svh;
    align-items: center;
    align-items: safe center;
  }
  .login-shell { grid-template-columns: 1fr; max-width: 470px; }

  /* form first, 3D cube banner below */
  .login-card { order: 1; padding: clamp(16px, 3dvh, 28px) 20px; }
  .login-visual {
    order: 2;
    padding: 6px 20px clamp(8px, 2dvh, 22px);
    border-right: 0;
    border-bottom: 0;
    border-top: 1px solid rgba(148,163,184,.14);
    background:
      radial-gradient(340px 220px at 50% 100%, rgba(34,211,238,.10), transparent 62%),
      linear-gradient(200deg, rgba(5,8,15,.35), rgba(8,14,26,.9));
  }
  .lv-badge { align-self: center; font-size: 9px; padding: 5px 9px; letter-spacing: .14em; }
  .login-visual h2,
  .login-visual > p { display: none; }
  .lv-stage { flex: none; min-height: clamp(100px, 18dvh, 176px); margin: 0; }
  .lv-glow {
    width: clamp(108px, 22dvh, 180px);
    height: clamp(108px, 22dvh, 180px);
  }
  .cube { --s: clamp(56px, 11dvh, 92px); --z: calc(var(--s) / 2); }
  .r1 { width: clamp(100px, 21dvh, 176px); height: clamp(100px, 21dvh, 176px); }
  .r2 { width: clamp(128px, 27dvh, 226px); height: clamp(128px, 27dvh, 226px); }
  .lv-stats { display: none; }

  .lc-head { margin-bottom: clamp(8px, 2dvh, 20px); }
  .lc-head img {
    width: clamp(50px, 9dvh, 68px);
    height: clamp(50px, 9dvh, 68px);
    border-radius: 16px;
    padding: 6px;
  }
  .lc-kicker { margin-top: clamp(5px, 1.2dvh, 12px); font-size: 9.5px; }
  .login-card h1 { font-size: clamp(19px, 3.2dvh, 23px); }
  .login-card .sub { font-size: 12px; }

  .login-card .form-group { margin-bottom: clamp(7px, 1.5dvh, 16px); }
  .login-card .form-group label { margin-bottom: 5px; }
  .login-card .form-control { padding: clamp(8px, 1.5dvh, 13px) 13px; font-size: 14px; }
  .login-card .btn { padding: clamp(9px, 1.7dvh, 14px); }
  .login-card .form-hint { margin-top: clamp(5px, 1.3dvh, 14px); font-size: 11px; }
  .lc-forgot { margin-top: 4px; }
  .lc-forgot a { font-size: 12px; }
  .lc-back {
    margin-top: clamp(7px, 1.7dvh, 18px);
    padding-top: clamp(7px, 1.5dvh, 16px);
  }
  .lc-back a { font-size: 12px; }
}

/* short phones (iPhone SE, older Androids): squeeze further so nothing scrolls */
@media (max-width: 900px) and (max-height: 700px) {
  .login-card { padding: 12px 16px; }
  .lc-head { margin-bottom: 8px; }
  .lc-head img { width: 46px; height: 46px; border-radius: 13px; padding: 5px; }
  .lc-kicker { margin-top: 4px; font-size: 8.5px; letter-spacing: .12em; }
  .login-card h1 { font-size: 19px; margin: 4px 0 2px; }
  .login-card .sub { font-size: 11px; }
  .login-card .form-group { margin-bottom: 6px; }
  .login-card .form-group label { margin-bottom: 4px; font-size: 11.5px; }
  .login-card .form-control { padding: 8px 12px; font-size: 13.5px; }
  .login-card .btn { padding: 9px; font-size: 12px; }
  .login-card .form-hint { display: none; }
  .lc-forgot { margin-top: 3px; }
  .lc-back { margin-top: 6px; padding-top: 6px; }
  .lc-back a { font-size: 11.5px; }
  .login-visual { padding: 4px 16px 8px; }
  .lv-badge { font-size: 8px; padding: 4px 8px; }
  .lv-stage { min-height: 94px; }
  .lv-glow { width: 96px; height: 96px; }
  .cube { --s: 52px; --z: 26px; }
  .r1 { width: 94px; height: 94px; }
  .r2 { width: 120px; height: 120px; }
}

/* landscape phones: cube banner would force scrolling, so hide it */
@media (max-width: 900px) and (max-height: 480px) {
  .login-page { padding: 6px; }
  .login-visual { display: none; }
  .login-card { padding: 10px 16px; }
  .lc-head img { width: 40px; height: 40px; border-radius: 11px; padding: 4px; }
  .lc-head { margin-bottom: 6px; }
  .login-card .form-group { margin-bottom: 5px; }
  .lc-back { margin-top: 4px; padding-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-dot, .cube, .r1, .r2, .login-card .btn::after, .login-shell,
  .lc-head img { animation: none; }
  .login-card .login-glare, .login-card .btn { transition: none; }
}

/* ---------------- ID card ---------------- */
.idcard {
  width: 339px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, #1e1e33, #131320);
  border: 1px solid var(--border-glass-2);
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}
.idcard .id-top {
  padding: 22px 22px 14px;
  background: var(--accent);
  text-align: center; color:#fff;
}
.idcard .id-top .inst { font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.idcard .id-top .addr { font-size: 10px; opacity: .9; }
.idcard .id-body { padding: 20px 22px; display: flex; gap: 16px; align-items: center; }
.idcard.landscape { width: 640px; }
.idcard .id-photo {
  width: 92px; height: 112px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
  padding: 4px;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.idcard .id-info { flex: 1; }
.idcard .id-info .row { display: flex; margin-bottom: 6px; font-size: 12.5px; }
.idcard .id-info .row .k { width: 110px; color: var(--text-muted); }
.idcard .id-info .row .v { color: var(--text); font-weight: 600; }
.idcard .id-footer { padding: 10px 22px 18px; display: flex; justify-content: space-between; align-items: flex-end; }
.idcard .id-footer .sign { font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-glass); padding-top: 4px; }

.idcard2 {
  width: 100%; max-width: 360px; margin: 0 auto;
  border-radius: 16px; overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e2f0;
  box-shadow: var(--shadow-lg);
  color: #1a1a2e;
}
.idcard2 .id2-top {
  padding: 18px 20px;
  background: linear-gradient(135deg,#6366f1 0%,#a855f7 100%);
  text-align: center; color:#fff;
}
.idcard2 .id2-top .inst { font-size: 16px; font-weight: 800; letter-spacing:.3px; }
.idcard2 .id2-top .addr { font-size: 10px; opacity: .9; }
.idcard2 .id2-body {
  padding: 20px 20px 14px;
  display: flex; gap: 16px; align-items: center;
}
.idcard2 .id2-photo {
  width: 94px; height: 116px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
  padding: 3px;
  border: 3px solid #c7d2fe;
  box-shadow: 0 4px 14px rgba(99,102,241,.2);
  flex-shrink: 0;
}
.idcard2 .id2-info { flex: 1; }
.idcard2 .id2-info .row2 { display: flex; margin-bottom: 7px; font-size: 12.5px; }
.idcard2 .id2-info .row2 .k2 { width: 92px; color: #7c7c9a; font-size: 11px; text-transform: uppercase; letter-spacing:.4px; }
.idcard2 .id2-info .row2 .v2 { color: #1a1a2e; font-weight: 700; }
.idcard2 .id2-bar {
  margin: 0 20px 6px;
  border-top: 1px dashed #d6d6ea;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
}
.idcard2 .id2-bar .qrbox { flex: 1; }
.idcard2 .id2-bar .sign { font-size: 11px; color: #7c7c9a; text-align:right; padding-top: 14px; border-top: 1px solid #b6b6d4; }
.idcard2 .id2-bar .sign .sig-img { display:block; max-height:30px; max-width:120px; object-fit:contain; margin-left:auto; }
.idcard2 .id2-foot {
  background: linear-gradient(135deg,#6366f1 0%,#a855f7 100%);
  color:#fff; text-align:center; font-size:9px; letter-spacing:1px;
  padding: 5px 0;
}
.qrbox img.barcode { width: 160px; height: 44px; object-fit: contain; background:#fff; border-radius:6px; padding:4px; }

/* ---------------- Misc ---------------- */
.mui-page-head { margin-bottom: 22px; }
.mui-page-head h2 { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.mui-page-head p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
/* Page head with actions on the right: the title block stays on the left and
   the buttons sit on the same baseline row, collapsing to a full-width row on
   narrow screens instead of squeezing the heading. */
.mui-page-head.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mui-page-head.head-row > div:first-child { min-width: 0; flex: 1 1 260px; }
.mui-page-head .head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
@media (max-width: 560px) {
  .mui-page-head.head-row .head-actions { width: 100%; }
  .mui-page-head.head-row .head-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.mui-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.mui-toolbar .spacer { flex: 1; }
.mui-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-glass); border: 1px solid var(--border-glass-2);
  padding: 8px 14px; border-radius: 10px; min-width: 220px;
}
.mui-search input { background: none; border: none; outline: none; color: var(--text); font-size: 13.5px; flex: 1; }
.mui-search input::placeholder { color: var(--text-muted); }
.mui-empty { text-align: center; padding: 50px 20px; color: var(--text-muted); overflow-wrap: anywhere; }
  .mui-empty .ic { font-size: 60px; line-height: 1; display: block; width: 64px; height: 64px; margin: 0 auto 10px; overflow: hidden; opacity: .5; }
.mui-chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  font-size: 12px; color: var(--text-2);
}
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pagination a, .pagination span {
  padding: 6px 13px; border-radius: 8px; border: 1px solid var(--border-glass-2);
  color: var(--text-2); font-size: 13px;
}
.pagination a:hover { background: var(--bg-glass-2); color: var(--text); }
.pagination .current { background: var(--accent); color: #fff; border-color: transparent; }
.pagination .disabled { opacity: .45; }
.pagination .ellipsis { border-color: transparent; background: transparent; color: var(--text-2); }
.pagination-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.pagination-wrap .pagination { margin-top: 0; }
.pagination-wrap-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
/* Fee entry status pill — clickable toggle, green when active, dark red when inactive */
.fee-status {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font: inherit; font-size: 11.5px; font-weight: 700; line-height: 1.5;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: filter .15s, box-shadow .15s;
}
.fee-status:hover { filter: brightness(1.18); box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.fee-status:disabled { opacity: .55; cursor: wait; }
.fee-status-on  { background: rgba(34,197,94,.16); color: #4ade80; border-color: rgba(34,197,94,.38); }
.fee-status-off { background: rgba(153,27,27,.34); color: #fca5a5; border-color: rgba(239,68,68,.55); }

/* Plain-text marker on an inactive student's name in the fees list */
.st-txt { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700;
          letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; }
.st-txt-off { color: #fca5a5; }

.per-page { display: flex; align-items: center; gap: 8px; }
.per-page .pp-label { color: var(--text-2); font-size: 13px; }
.per-page .mui-input { width: 78px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-glass-2); background: var(--bg-glass); color: var(--text); font-size: 13px; cursor: pointer; }
.pager-summary { color: var(--text-2); font-size: 13px; margin-top: 16px; }
.pagination-wrap .pager-summary { margin-top: 0; }

/* ---- Responsive column helpers ---- */
@media (max-width: 640px) {
  .hide-mob { display: none !important; }
}
/* Mirror of .hide-mob, for TABLE CELLS: present in the markup everywhere,
   rendered only at <=640px. The students table keeps two Pending Fees cells and
   shows whichever sits in the right place for the viewport - ahead of Course on
   a phone, where the row scrolls sideways and that is the number worth reading
   first, and inside the fee group everywhere else. Exactly 10 of the 11 cells
   stay visible at any width, so the header and every row remain aligned. */
.show-mob { display: none !important; }
@media (max-width: 640px) {
  .show-mob { display: table-cell !important; }
}
/* Exam Results: Percentage stays visible on phones. Only the progress bar is
   dropped there so the last column remains compact in the scrolling table. */
@media (max-width: 640px) {
  .exam-pct-col { min-width: 62px; text-align: right; }
  .exam-pct-bar { display: none !important; }
}
@media (max-width: 900px) {
  .hide-tab { display: none !important; }
}
@media (max-width: 640px) {
  .pagination { justify-content: center; }
  .pagination-wrap { justify-content: center; }
  .pagination-wrap-inner { justify-content: center; }
  .pagination a, .pagination span { padding: 6px 10px; font-size: 12px; }
}
.q-suggest {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 340px; max-width: 460px; max-height: 320px; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border-glass-2);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.28); padding: 6px;
}
.q-suggest.open { display: block; }
.q-suggest .qs-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 9px; cursor: pointer; text-decoration: none; color: var(--text);
}
.q-suggest .qs-item:hover, .q-suggest .qs-item.active { background: var(--bg-glass-2); }
.q-suggest .qs-item img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 32px; }
.q-suggest .qs-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.q-suggest .qs-meta { font-size: 11.5px; color: var(--text-2); }
.q-suggest .qs-none { padding: 12px; font-size: 13px; color: var(--text-2); text-align: center; }
.q-suggest .qs-hint {
  padding: 7px 10px; font-size: 11.5px; color: var(--text-muted);
  border-top: 1px solid var(--border-glass-2); margin-top: 4px;
}
@media (max-width: 640px) {
  .q-suggest { min-width: 260px; max-width: 88vw; }
  .q-suggest .qs-item { padding: 8px 6px; }
}
.thumb-img {
  width: 64px; height: 46px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border-glass-2); background: var(--bg-glass);
}
.grid-media { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 16px; }
.media-card { border-radius: 12px; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-glass); }
.media-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.media-card .media-body { padding: 10px 12px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 1px; margin: 26px 0 12px; }

/* modal */
.mui-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center; z-index: 1200; padding: 20px;
}
.mui-overlay.show { display: flex; }
.mui-modal {
  background: var(--bg-card-2); border: 1px solid var(--border-glass-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
}
.mui-modal .m-head { padding: 18px 22px; border-bottom: 1px solid var(--border-glass); display: flex; justify-content: space-between; align-items: center; }
.mui-modal .m-body { padding: 22px; }
.mui-modal .m-close { background: none; border: none; color: var(--text-2); font-size: 22px; cursor: pointer; }
.mui-modal .m-close:hover { color: var(--text); }

/* profile detail grid */
.side-by-side { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.side-by-side > * { min-width: 0; }
.side-by-side .mui-table { min-width: 340px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 14px; }
.detail-grid .d-item { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 10px; padding: 12px 14px; }
.detail-grid .d-item .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }
.detail-grid .d-item .v { font-size: 14px; font-weight: 600; margin-top: 4px; word-break: break-word; }

@media (max-width: 900px) {
  .mui-grid-4 { grid-template-columns: repeat(2,1fr); }
  .mui-grid-3 { grid-template-columns: repeat(2,1fr); }
  .side-by-side { grid-template-columns: 1fr; }
  /* the fee/table column no longer needs a desktop floor on one-column layouts */
  .side-by-side .mui-table { min-width: 0; }
  .mui-sidebar { transform: translateX(-100%); }
  .mui-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.5); }
  /* On a phone the menu is taller than the screen, so the drawer scrolls — and
     Logout is the LAST item, which put it below the fold every single time.
     Pinning it to the bottom of the scrollport keeps it reachable without
     scrolling. `:has()` is already relied on elsewhere in this file, and
     selecting by href avoids touching the shared sidebar markup. */
  .mui-nav li:has(> a[href="logout.php"]) {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 8px 4px 0;
    padding-bottom: 12px;
    background: linear-gradient(to top, rgba(13,13,20,.99) 68%, rgba(13,13,20,0));
  }
  .mui-nav li:has(> a[href="logout.php"])::before {
    content: '';
    position: absolute;
    left: 12px; right: 12px; bottom: 12px;
    height: 1px;
    background: var(--border-glass);
  }
  .mui-nav li:has(> a[href="logout.php"]) > a.nav-link { position: relative; }
  .mui-main { margin-left: 0; }
  .mui-burger { display: block; }
  .mui-content { padding: 18px 16px; }
  .side-backdrop {
    position: fixed; inset: 0; z-index: 55;
    background: rgba(5,6,15,.6);
    opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility .22s;
  }
  .side-backdrop.show { opacity: 1; visibility: visible; }
  body.side-locked { overflow: hidden; }

  /* appbar: let the title truncate and the chip shrink instead of overflowing */
  .mui-appbar { min-height: 60px; padding: 10px 16px; gap: 10px; }
  .page-title { font-size: 16px; }
  .page-title .pt-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tools { flex: 0 0 auto; }
  .mui-user-chip .u-name { max-width: 96px; }

  /* page head + footer */
  .mui-page-head h2 { font-size: 19px; }
  .mui-footer { padding: 12px 16px; font-size: 12.5px; }
}

/* ---- tablet / large phone ---- */
/* Most page heads are a plain title + subtitle stack, so they must stay block.
   A few pages (student_view) instead put a button row + search box inside the
   head; those get their own class and are allowed to wrap. */
.mui-page-head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 760px) {
  /* toolbar children go full width so nothing is squeezed or clipped */
  .mui-toolbar > * { max-width: 100%; }
  .mui-toolbar .mui-search { flex: 1 1 100%; min-width: 0; }
  .mui-toolbar .mui-search input { width: 100%; }
  .mui-toolbar > .mui-input,
  .mui-toolbar > select.mui-input,
  .mui-toolbar > .form-control { flex: 1 1 140px; width: auto !important; min-width: 0; }
  .mui-toolbar .spacer { display: none; }
  .mui-toolbar .mui-chip { flex: 1 1 auto; text-align: center; }

  /* the date-range box was inline-flex with fixed 105px inputs and could not wrap */
  .date-range-box { flex-wrap: wrap; width: 100%; }
  .date-range-box .dr-f { flex: 1 1 120px; min-width: 0; }
  .date-range-box .dr-f input { width: 100%; min-width: 0; }
  .date-range-box .dr-sep { display: none; }

  /* card headers must wrap: long title + action buttons were squeezing */
  .mui-card .card-head { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  .mui-card .card-head h3 { font-size: 14px; }
  .mui-card .card-body { padding: 16px; }

  .stat-card { padding: 12px 14px; }
  .stat-val { font-size: 18px; }
}

@media (max-width: 640px) {
  /* table cell padding and avatars are too big on a phone */
  .mui-table th, .mui-table td { padding: 10px 10px; }
  .mui-table thead th { font-size: 11.5px; }
  .mui-table .mui-avatar { width: 30px; height: 30px; }
  .mui-table-wrap { -webkit-overflow-scrolling: touch; }

  .mui-modal { max-height: 92vh; }
  .mui-modal .m-head { padding: 14px 16px; }
  .mui-modal .m-body { padding: 16px; }

  .del-box { padding: 22px 18px; }
  .del-icon { width: 52px; height: 52px; font-size: 26px; }

  .per-page { width: auto; justify-content: center; margin: 0; }
  .pagination-wrap { flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
  .pagination-wrap-inner { flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: auto; }
  .pagination-wrap-inner .per-page { width: auto; justify-content: center; margin: 0; }
  .pagination-wrap-inner .pagination { justify-content: center; flex-wrap: wrap; gap: 6px; }

  .btn { padding: 9px 14px; }
  .btn-sm { padding: 7px 11px; font-size: 12px; }
  .app-logout { padding: 8px 12px; }

  .form-row { grid-template-columns: repeat(2, 1fr) !important; }
  .form-row .form-group > div,
  .form-row .form-group > p { display: none; }
  .form-single-row .form-row { grid-template-columns: 1fr !important; }
}

@media (max-width: 420px) {
  .mui-content { padding: 14px 12px; }
  .mui-appbar { padding: 9px 12px; }
  .page-title { font-size: 15px; }
  .page-title .dot { display: none; }
  .mui-user-chip .u-name { display: none; }
  .mui-toolbar { padding: 12px; }
  .mui-toolbar > .mui-input,
  .mui-toolbar > select.mui-input { flex: 1 1 100%; }
}

@media (max-width: 560px) {
  .mui-grid-4, .mui-grid-2 { grid-template-columns: 1fr; }
  .mui-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .idcard2 .id2-body { flex-wrap: wrap; justify-content: center; gap: 8px; padding: 16px 14px; }
  .idcard2 .id2-photo { width: 82px; height: 100px; }
  .idcard2 .id2-info { flex: 1 1 100%; min-width: 0; }
  .idcard2 .id2-info .row2 { flex-wrap: wrap; }
  .idcard2 .id2-info .row2 .k2 { width: 74px; flex-shrink: 0; }
  .idcard2 .id2-info .row2 .v2 { flex: 1 1 140px; min-width: 0; word-break: break-word; }
  .idcard2 .id2-bar { margin: 0 14px 6px; }
  .qrbox img.barcode { width: 120px; }
  .idcard2 .id2-top { padding: 14px 12px; }
  .idcard2 .id2-top .inst { font-size: 14px; }

  /* Dashboard stat cards keep TWO per row on a phone (the generic .mui-grid-4
     rule above drops to one). The number stays BESIDE the icon, like on
     desktop — only the icon and the type sizes shrink so both fit in a ~150px
     card. The caption is `.stat-sub` on the fee cards; it carries nowrap
     segments, so on a narrow card it breaks at the pipe instead of overflowing. */
  .dash-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dash-stats .stat-card { flex-direction: row; align-items: center; gap: 10px; padding: 12px 13px; }
  .dash-stats .stat-icon { width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
  /* A flex child defaults to min-width:auto, so the nowrap caption segments
     ("34 Students Paid") set a floor under this box and the whole text column
     got pushed out past the card's LEFT edge — clipped by .stat-card's
     overflow:hidden, so the page never showed a scrollbar to hint at it. */
  .dash-stats .stat-card > div:not(.stat-icon) { min-width: 0; }
  /* scale the figure with the viewport so a 9-digit amount like 6,187,716 still
     fits beside the icon in a ~140px card at 320px */
  .dash-stats .stat-val { font-size: clamp(15px, 4.6vw, 19px); }
  .dash-stats .stat-lbl { font-size: 10.5px; line-height: 1.32; }
  .dash-stats .stat-sub { font-size: 10px; }
  /* very narrow phones: trim the chrome around the icon so the caption keeps
     more room beside it */
  .dash-stats .stat-card { padding: 11px 10px; gap: 8px; }
  .dash-stats .stat-icon { width: 30px; height: 30px; font-size: 15px; }
}
/* Action cells hold nothing but icon buttons. Left alone they wrap onto two
   lines, because a wrappable cell's min-content width is only one button wide,
   so the browser is free to narrow the column until the pair breaks apart.
   `.act-cell` is set explicitly where the markup allows it; the `:has()` rule
   covers the other action cells without needing per-file edits. */
.act-cell { white-space: nowrap; }
.act-cell > .btn { vertical-align: middle; }
.mui-table tbody td:has(> .btn):not(:has(> *:not(.btn))) {
  white-space: nowrap;
}
.mui-table tbody td:has(> .btn):not(:has(> *:not(.btn))) > .btn { vertical-align: middle; }

/* ================= horizontal overflow control (page never scrolls) =================
   Only a table wrapper is allowed to scroll sideways.

   `overflow-x: clip` is preferred over `hidden` on purpose: `hidden` would turn
   <body> into a scroll container, which silently breaks every `position: sticky`
   descendant (the appbar, the pinned Student column, the swipe hint). `hidden`
   is kept first purely as a fallback for engines without `clip` support. */
html, body { overflow-x: hidden; }
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}

/* Flex and grid children default to `min-width: auto`, which lets one wide
   descendant stretch the whole page instead of scrolling inside its own box.
   These are the ancestors every table lives under. */
.mui-main,
.mui-content,
.mui-card,
.mui-toolbar,
.mui-table-wrap { min-width: 0; max-width: 100%; }

/* The single sanctioned scroll container. */
.mui-table-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

/* The dashboard grid stretches the shorter Recent Fees card to match its
   sibling. Let its table wrapper grow into that space so the horizontal
   scrollbar sits at the bottom of the card instead of floating above a blank
   strip. */
.recent-fees-card { display: flex; flex-direction: column; }
.recent-fees-card .mui-table-wrap { flex: 1 1 auto; min-height: 0; }

@media (max-width: 768px) {
  /* The sidebar already collapses into the burger menu at 900px and .mui-main
     drops its offset there, so the content column is full width by this point.

     Toolbar, every admin page: search / date-range / chips / buttons each take a
     full-width row, and the selects and inputs pair up two per row. Flex rather
     than grid on purpose — several toolbars use bare `.chip` pills as direct
     children, and grid would stretch every pill to half a row.
     This replaces the shared `flex: 1 1 100%` rule further up, which stacked
     six full-width rows and made a filter list taller than the screen itself. */
  .mui-toolbar {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
  }
  .mui-toolbar > * { min-width: 0; max-width: 100%; }
  .mui-toolbar > .mui-search,
  .mui-toolbar > .date-range-box,
  .mui-toolbar > .period-chips,
  .mui-toolbar > .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
  /* .mui-search ships with min-width:220px, enough to overflow a 320px phone */
  .mui-toolbar > .mui-search { min-width: 0; }
  .mui-toolbar > .mui-search input { width: 100%; min-width: 0; max-width: 100%; }
  /* beat the inline width="170px" / width="150px" attributes on the selects */
  .mui-toolbar > .mui-input,
  .mui-toolbar > select.mui-input,
  .mui-toolbar > .form-control {
    flex: 1 1 calc(50% - 5px);
    width: auto !important;
    min-width: 0;
    max-width: 100%;
  }
  /* pills keep their natural width and wrap onto the next line as needed */
  .mui-toolbar > .chip { flex: 0 0 auto; max-width: 100%; }
  .mui-toolbar > .spacer { display: none; }
  /* `input[type=date]` carries a large intrinsic minimum width in most engines */
  .mui-toolbar .date-range-box,
  .mui-toolbar input,
  .mui-toolbar select { max-width: 100%; }

  /* Keep columns legible rather than letting them collapse into unreadable
     slivers. The wrapper is what scrolls, never the page. The existing
     .hide-mob / .hide-tab rules still drop low-priority columns.
     `nowrap` is what makes this work: a cell that may wrap reports a tiny
     min-content width, so the browser happily squeezes the column until the
     text breaks across three lines. With nowrap the table grows to whatever its
     content actually needs and the wrapper scrolls instead. */
  .mui-table th,
  .mui-table td { white-space: nowrap; }
  .mui-table { min-width: 680px; }

  /* The single sanctioned horizontal scroll container. */
  .mui-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  /* Fees keeps a slightly higher floor: hide-mob drops 4 of its 11 columns. */
  .fees-table { min-width: 760px; }
}

@media (max-width: 360px) {
  .mui-toolbar > .mui-input,
  .mui-toolbar > select.mui-input,
  .mui-toolbar > .form-control { flex: 1 1 100%; }
}

/* ID Cards keeps its filter row two-up on a phone. The generic toolbar rules
   above hand every control a full-width row below 420px (and again below 360px),
   which turned Status / Batches / Cards / Search into four stacked bars. These
   selectors carry one extra class, so they win on specificity and the rest of
   the admin keeps its one-per-row phone layout. */
@media (max-width: 420px) {
  .mui-toolbar.idc-toolbar > .mui-input,
  .mui-toolbar.idc-toolbar > select.mui-input { flex: 1 1 calc(50% - 5px); }
  /* half a row is narrower than the shared .mui-search min-width:220px, which
     would refuse to shrink and push the row back to one control per line */
  .mui-toolbar.idc-toolbar > .mui-search { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 8px 10px; }
  .mui-toolbar.idc-toolbar > .mui-search input { width: 100%; min-width: 0; }
  /* the three print/export buttons share one row too. Each is a small icon with
     its label underneath, so all three fit a single phone row at equal width */
  .mui-toolbar.idc-toolbar > .btn { flex: 1 1 0; justify-content: center; min-width: 0; padding: 6px 4px; }
  .mui-toolbar.idc-toolbar > .btn.idc-btn { flex-direction: column; gap: 2px; line-height: 1; }
  .mui-toolbar.idc-toolbar > .btn.idc-btn .idc-btn-t {
    display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
}

@media print {
  .mui-sidebar, .mui-appbar, .mui-footer, .no-print, .mui-toolbar { display: none !important; }
  .mui-main { margin-left: 0; }
  body { background: #fff !important; color: #000 !important; }
  .mui-content { padding: 0 !important; }
  .idcard { box-shadow: none; border: 2px solid #000; }
  .idcard .id-top, .idcard2 .id2-top, .idcard2 .id2-foot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mui-table thead th, .idcard .id-footer .sign { color: #000 !important; }

  /* print only the ID card modal */
  body.print-id .mui-page-head,
  body.print-id .mui-grid,
  body.print-id .mui-toolbar { display: none !important; }
  body.print-id .mui-content { padding: 0 !important; }
  body.print-id #idModal {
    display: block !important;
    position: static;
    background: none;
    padding: 0;
  }
  body.print-id #idModal .mui-modal {
    max-width: none;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border: none;
    background: none;
    margin: 0 auto;
  }
  body.print-id #idModal .m-head { display: none; }
  body.print-id #idModal .m-body { padding: 0; }
}
@media (max-width: 600px) {
  .mui-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .btn-text { display: none; }
  .btn-info, .btn-ghost, .btn-danger { padding: 8px 8px; }
}

/* Course / Batch tabs: fixed width so switching pages never resizes them. */
.course-tabs { display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px; }
.course-tabs .course-tab {
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-width:132px;padding:8px 14px;border-radius:9px;
  font-size:13px;font-weight:700;line-height:1.2;
  text-decoration:none;box-sizing:border-box;border:1px solid transparent;
}
.course-tabs .course-tab .material-icons { font-size:17px; }
.course-tabs .course-tab.active { background:var(--accent);color:#fff;border-color:var(--accent); }
.course-tabs .course-tab:not(.active) { background:var(--bg-glass);color:var(--text);border-color:var(--border-glass); }
@media (max-width:640px) {
  .course-tabs .course-tab { min-width:0;flex:1 1 130px;padding:9px 8px; }
}