:root{
  --primary:#6C5CE7; --primary-dark:#4834d4; --accent:#e84393;
  --sidebar:linear-gradient(180deg,#2d2a4a 0%,#3b3564 100%);
  --surface:#f4f5fb; --gradient:linear-gradient(135deg,#6C5CE7,#8f7bff);
  --card-radius:18px; --dashboard-card-radius:var(--card-radius); --shadow:0 10px 30px rgba(26,26,64,.08);
  --shadow-sm:0 4px 14px rgba(26,26,64,.06);
  --app-font:'Quicksand',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --bs-font-sans-serif:var(--app-font);
  --bs-body-font-family:var(--app-font);
}
/* ---------- GLOBAL TYPEFACE ----------
   Quicksand is the single application font. The universal selector keeps
   dynamically injected markup on it too; its zero specificity means the icon
   fonts (Font Awesome's .fa-* classes, Bootstrap Icons' .bi::before) still
   win for their own glyphs. */
*{font-family:var(--app-font)}
html,body{font-family:var(--app-font)}
/* Form controls and buttons do not inherit the document font by default. */
button,input,select,textarea,optgroup,option{font-family:var(--app-font)}
::placeholder{font-family:var(--app-font)}
::-webkit-input-placeholder{font-family:var(--app-font)}
.form-control,.form-select,.btn,.input-group-text,.dropdown-menu,.modal,.tooltip,.popover,.toast,.alert,.table,.card,.nav,.navbar,.badge,.list-group{font-family:var(--app-font)}
body{background:var(--surface);color:#2b2b3a;margin:0}
a{text-decoration:none}
.text-primary{color:var(--primary)!important}
.btn-primary{background:var(--primary);border-color:var(--primary)}
.btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.btn-accent{background:var(--accent);color:#fff}
.badge-soft{background:rgba(108,92,231,.12);color:var(--primary);font-weight:600}

/* ---------- PUBLIC NAVBAR ---------- */
.navbar-glass{backdrop-filter:blur(10px);background:rgba(255,255,255,.85);
  box-shadow:0 4px 20px rgba(0,0,0,.05)}
.brand-gradient{font-weight:700;background:linear-gradient(90deg,#6C5CE7,#e84393,#00b894);
  -webkit-background-clip:text;background-clip:text;color:transparent}
.navbar-glass .nav-link{font-weight:500;color:#41415a}
.navbar-glass .nav-link:hover{color:var(--primary)}

/* ---------- NAV PILLS & TABS ---------- */
.nav-pills .nav-link{font-weight:600;color:#4b5563;transition:all .15s ease}
.nav-pills .nav-link:hover{color:var(--primary,#0d6efd);background-color:rgba(13,110,253,.08)}
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link{
  color:#ffffff!important;
  background-color:var(--primary,#0d6efd)!important;
}
.nav-pills .nav-link.active i{
  color:#ffffff!important;
}

/* Specific student roster tab high-contrast styling */
#studentRosterTabs .nav-link{
  color:#4b5563;
  font-weight:600;
}
#studentRosterTabs .nav-link.active{
  color:#ffffff!important;
  background-color:var(--primary,#0d6efd)!important;
}
#studentRosterTabs #tab-at-risk.active{
  color:#ffffff!important;
  background-color:var(--primary,#0d6efd)!important;
}
#studentRosterTabs #tab-at-risk.active i{
  color:#fef08a!important; /* bright amber warning icon on blue for high contrast */
}
#studentRosterTabs #tab-at-risk.active .badge{
  background-color:#ef4444!important;
  color:#ffffff!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.35);
}
#studentRosterTabs #tab-top-students.active{
  color:#ffffff!important;
  background-color:var(--primary,#0d6efd)!important;
}
#studentRosterTabs #tab-top-students.active i{
  color:#fef08a!important;
}
#studentRosterTabs #tab-top-students.active .badge{
  background-color:#10b981!important;
  color:#ffffff!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.35);
}

/* ---------- HERO ---------- */
.hero{background:radial-gradient(1200px 500px at 80% -10%,rgba(108,92,231,.18),transparent),
  linear-gradient(180deg,#f7f7ff,#eef1fb);padding:90px 0 70px;overflow:hidden}
.hero h1{font-weight:700;font-size:3rem;line-height:1.1}
.hero .highlight{background:linear-gradient(90deg,#6C5CE7,#e84393);-webkit-background-clip:text;
  background-clip:text;color:transparent}
.blob{position:absolute;border-radius:50%;filter:blur(60px);opacity:.5;z-index:0}

.feature-card,.stat-tile,.course-card,.dash-card{transition:transform .25s,box-shadow .25s}
.feature-card:hover,.course-card:hover{transform:translateY(-6px);box-shadow:var(--shadow)}
.icon-circle{width:58px;height:58px;border-radius:16px;display:grid;place-items:center;
  color:#fff;font-size:1.4rem}

/* ---------- STAT TILES (thumbnail style) ---------- */
.stat-tile{border:none;border-radius:var(--card-radius);color:#fff;padding:22px 24px;
  position:relative;overflow:hidden;box-shadow:var(--shadow-sm)}
.stat-tile .val{font-size:2rem;font-weight:700;line-height:1}
.stat-tile .lbl{opacity:.92;font-weight:600;letter-spacing:.3px;text-transform:uppercase;font-size:.72rem}
.stat-tile .ghost{position:absolute;right:-6px;bottom:-12px;font-size:5rem;opacity:.18}
.stat-tile .delta{font-size:.78rem;opacity:.95}
.dashboard-panel{border-radius:var(--dashboard-card-radius);border:1px solid rgba(229,229,240,.9);box-shadow:var(--shadow-sm);background:#fff;}
.dashboard-empty{border:1px dashed #cfd2e1;border-radius:var(--dashboard-card-radius);padding:2.5rem 1rem;text-align:center;color:#73778a;background:rgba(244,245,251,.55)}
.hod-actions .card{border:0!important;overflow:hidden;position:relative;box-shadow:var(--shadow-sm);transition:transform .22s ease,box-shadow .22s ease;background:linear-gradient(135deg,#fff,#f7f8fc)}
.hod-actions .card:hover{transform:translateY(-4px);box-shadow:0 14px 30px rgba(26,26,64,.14)}
.hod-actions .card .icon-circle{box-shadow:0 8px 18px rgba(26,26,64,.08)}
.hod-actions .card:nth-child(1){background:linear-gradient(135deg,#eef0ff,#fff)}
.hod-actions .card:nth-child(2){background:linear-gradient(135deg,#e8faf4,#fff)}
.hod-actions .card:nth-child(3){background:linear-gradient(135deg,#e8f7ff,#fff)}
@media (min-width:1200px){.dashboard-five-cards .col-xl-3{flex:0 0 20%;max-width:20%}}

/* ---------- DASHBOARD SHELL ---------- */
.app{display:flex;min-height:100vh;--rail:260px}
.sidebar{width:var(--rail);background:var(--sidebar);color:#fff;position:fixed;top:0;bottom:0;left:0;
  padding:0 0 20px;overflow-y:auto;overflow-x:hidden;z-index:1040;
  transition:transform .3s,width .22s ease}
.sidebar .brand{display:flex;align-items:center;gap:10px;padding:20px 20px;font-weight:700}
.sidebar .brand .logo{width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,.15);
  display:grid;place-items:center;font-size:1.2rem}
.sidebar .brand-name{font-size:1.05rem;background:linear-gradient(90deg,#fff,#d7d0ff);
  -webkit-background-clip:text;background-clip:text;color:transparent}
.sidebar .profile{display:flex;align-items:center;gap:12px;padding:14px 20px;margin:6px 14px 14px;
  background:rgba(255,255,255,.08);border-radius:14px}
.sidebar .profile img{width:44px;height:44px;border-radius:50%;border:2px solid rgba(255,255,255,.5)}
.sidebar .menu-label{font-size:.68rem;text-transform:uppercase;letter-spacing:1px;opacity:.55;
  padding:14px 22px 6px}
/* .item covers both the <a> nav links and the <button> inside the logout form,
   which must be a real form submission rather than a GET link. */
.sidebar .item{display:flex;align-items:center;gap:12px;color:rgba(255,255,255,.82);
  padding:11px 22px;font-weight:500;border-left:3px solid transparent;
  background:none;border-top:0;border-right:0;border-bottom:0;width:100%;
  text-align:left;font-family:inherit;font-size:inherit;cursor:pointer}
.sidebar .item i{width:20px;text-align:center}
.sidebar .item:hover{background:rgba(255,255,255,.08);color:#fff}
.sidebar .item:focus-visible{outline:2px solid #fff;outline-offset:-2px;color:#fff}
.sidebar .item.active{background:rgba(255,255,255,.14);color:#fff;border-left-color:#fff}
.sidebar-logout{margin:0}
.sidebar .pill-new{margin-left:auto;background:#00b894;color:#fff;font-size:.6rem;
  padding:2px 8px;border-radius:20px;font-weight:700}
.sidebar .nav-group{margin-bottom:3px}
.sidebar .item-toggle{cursor:pointer;position:relative;display:flex;align-items:center;user-select:none}
.sidebar .item-toggle .chevron{margin-left:auto;font-size:.72rem;transition:transform .2s ease;opacity:.8}
.sidebar .item-toggle[aria-expanded="true"] .chevron{transform:rotate(90deg);opacity:1}
.sidebar .submenu{padding:4px 0 4px 8px;background:rgba(0,0,0,.15);border-radius:8px;margin:2px 12px 6px;border-left:2px solid rgba(255,255,255,.14)}
.sidebar .submenu .sub-item{padding:8px 12px;font-size:.83rem;border-left:2px solid transparent;border-radius:6px;gap:10px;color:rgba(255,255,255,.82)}
.sidebar .submenu .sub-item:hover{background:rgba(255,255,255,.09);color:#fff}
.sidebar .submenu .sub-item i{width:16px;font-size:.82rem;text-align:center;opacity:.9}
.sidebar .submenu .sub-item.active{background:rgba(255,255,255,.18);border-left-color:#fff;color:#fff;font-weight:600}
.sidebar .text-muted{color:rgba(255,255,255,.65)!important}
.sidebar small{color:rgba(255,255,255,.65)}
.sidebar .pill-soon,
.sidebar .badge-soon{
  margin-left:auto;
  background:rgba(255,255,255,.16);
  color:rgba(255,255,255,.9);
  font-size:.62rem;
  padding:2px 7px;
  border-radius:12px;
  font-weight:600;
  letter-spacing:.3px;
  border:1px solid rgba(255,255,255,.15);
  white-space:nowrap;
  display:inline-block;
  line-height:1.2;
}
.sidebar .item:hover .pill-soon,
.sidebar .item:hover .badge-soon{
  background:rgba(255,255,255,.24);
  color:#fff;
}
html.sidebar-collapsed .sidebar .submenu{display:none!important}
html.sidebar-collapsed .sidebar .chevron{display:none!important}
html.sidebar-collapsed .sidebar .pill-soon{display:none!important}

.main{flex:1;margin-left:var(--rail);min-width:0;transition:margin-left .22s ease}
.topbar{background:#fff;padding:12px 26px;display:flex;align-items:center;gap:18px;
  position:sticky;top:0;z-index:1030;box-shadow:0 2px 12px rgba(0,0,0,.04)}
.topbar .search{flex:1;max-width:420px;position:relative}
.topbar .search input{border:none;background:#f1f2f7;border-radius:12px;padding:10px 40px 10px 16px;width:100%}
.topbar .search i{position:absolute;right:14px;top:12px;color:#9aa0b4}
.topbar .brand-mid{font-weight:700}
.topbar .icon-btn{width:40px;height:40px;border-radius:12px;background:#f1f2f7;display:grid;
  place-items:center;color:#5a6072;position:relative}
.topbar .icon-btn .dot{position:absolute;top:6px;right:7px;width:16px;height:16px;border-radius:50%;
  background:#e84393;color:#fff;font-size:.6rem;display:grid;place-items:center}
.content{padding:26px}
.page-head{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:20px}
.page-head h4{font-weight:700;margin:0}
.breadcrumb-chip{background:#fff;border-radius:30px;padding:6px 16px;box-shadow:var(--shadow-sm);
  font-size:.85rem;color:#6b7280}

.card-ums{background:#fff;border:none;border-radius:var(--card-radius);box-shadow:var(--shadow-sm)}
.card-ums .card-header{background:transparent;border-bottom:1px solid #eef0f6;font-weight:700}
.dash-card{border:none;border-radius:var(--card-radius);box-shadow:var(--shadow-sm)}

.avatar-sm{width:38px;height:38px;border-radius:50%}
.table thead th{color:#8a90a6;font-size:.72rem;text-transform:uppercase;letter-spacing:.5px;border:0}
.table td{vertical-align:middle}
.status{padding:3px 12px;border-radius:20px;font-size:.72rem;font-weight:700}
.status.PAID,.status.PRESENT,.status.P,.status.GRADED,.status.ACTIVE{background:#e6f8f1;color:#0d9488}
.status.UNPAID,.status.ABSENT,.status.A,.status.PENDING,.status.DROPPED{background:#fdecef;color:#e6488a}
.status.PARTIAL,.status.LATE,.status.L,.status.SUBMITTED{background:#fff5e6;color:#e08e0b}

.system-ticker-stack{display:grid;gap:10px;margin-bottom:20px;max-width:100%;overflow:hidden}
.system-ticker{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;
  width:100%;max-width:100%;min-width:0;overflow:hidden;border-radius:8px;padding:8px 12px;
  color:#fff;background:linear-gradient(90deg,var(--primary-dark),var(--primary));box-shadow:var(--shadow-sm)}
.system-ticker-high{background:linear-gradient(90deg,#9a5b00,#d97706)}
.system-ticker-critical{background:linear-gradient(90deg,#9f1239,#e11d48)}
.system-ticker-low{background:linear-gradient(90deg,#2563eb,#0891b2)}
.system-ticker-label{display:flex;align-items:center;gap:8px;min-width:150px;font-weight:800;text-transform:uppercase;
  letter-spacing:0;font-size:.78rem;white-space:nowrap}
.system-ticker-label i{font-size:.9rem}
.system-ticker-viewport{position:relative;min-width:0;overflow:hidden;white-space:nowrap}
.system-ticker-track{display:inline-flex;align-items:center;gap:18px;min-width:max-content;
  animation:umsTicker var(--ticker-duration,28s) linear infinite;will-change:transform}
.system-ticker-track a,.system-ticker-action{color:#fff;font-weight:800;text-decoration:underline;text-underline-offset:3px}
.system-ticker-action{white-space:nowrap;font-size:.84rem}
.system-ticker:hover .system-ticker-track,.system-ticker:focus-within .system-ticker-track{animation-play-state:paused}
.system-ticker-static .system-ticker-track{animation:none;transform:none;min-width:0;white-space:normal}
.system-ticker-static .system-ticker-viewport{white-space:normal}
.system-ticker .btn-close{position:static;filter:none;opacity:.85;flex:none}
@keyframes umsTicker{from{transform:translateX(100%)}to{transform:translateX(-100%)}}
.system-ticker-track-reverse{animation-name:umsTickerReverse}
@keyframes umsTickerReverse{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
@media(max-width:767px){
  .system-ticker{grid-template-columns:1fr auto;gap:8px;padding:10px}
  .system-ticker-label{min-width:0;grid-column:1/-1;font-size:.72rem}
  .system-ticker-viewport{grid-column:1/2}
  .system-ticker-action{grid-column:1/2}
}
@media(prefers-reduced-motion:reduce){
  .system-ticker-track{animation:none!important;transform:none!important;min-width:0;white-space:normal}
  .system-ticker-viewport{white-space:normal}
}

.progress{height:8px;border-radius:20px;background:#eef0f6}
.ai-fab{position:fixed;right:26px;bottom:26px;width:60px;height:60px;border-radius:50%;
  background:var(--gradient);color:#fff;display:grid;place-items:center;font-size:1.5rem;
  box-shadow:0 12px 30px rgba(108,92,231,.5);z-index:1050;border:none}
.chip{display:inline-block;background:#eef0fb;color:var(--primary);border:1px solid #e0e0f7;
  padding:6px 14px;border-radius:30px;font-size:.82rem;margin:4px 4px 0;cursor:pointer}
.chip:hover{background:var(--primary);color:#fff}
.chat-bubble{max-width:80%;padding:12px 16px;border-radius:16px;margin-bottom:10px;line-height:1.45}
.chat-bubble.bot{background:#fff;box-shadow:var(--shadow-sm)}
.chat-bubble.me{background:var(--gradient);color:#fff;margin-left:auto}

.footer{background:#161427;color:#c9c9db;padding:50px 0 24px}
.footer a{color:#c9c9db}.footer a:hover{color:#fff}

@media(max-width:991px){
  .sidebar{transform:translateX(-100%)}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0}
  .hero h1{font-size:2.2rem}
  .topbar .brand-mid{display:none}
}


/* ============================================================
   ACCOUNT MENU  — header profile chip + dropdown
   Shared by the dashboard and public headers; the .acct-*-public
   modifiers in public.css only adjust colours, never layout.
   ============================================================ */
.acct{position:relative}

.acct-trigger{
  display:flex;align-items:center;gap:10px;padding:4px 10px 4px 4px;
  background:#f1f2f7;border:1px solid transparent;border-radius:40px;
  cursor:pointer;font-family:inherit;color:#2b2b3a;transition:background .18s,border-color .18s;
}
.acct-trigger:hover{background:#e7e9f3}
.acct-trigger:focus-visible{outline:none;border-color:var(--primary);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 28%,transparent)}
.acct-trigger[aria-expanded="true"]{background:#e7e9f3;border-color:var(--primary)}

.acct-avatar{width:38px;height:38px;border-radius:50%;overflow:hidden;flex:none;
  display:grid;place-items:center}
.acct-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.acct-initials{width:100%;height:100%;display:grid;place-items:center;
  background:var(--gradient);color:#fff;font-weight:700;font-size:.85rem;letter-spacing:.5px}
.acct-avatar-lg{width:52px;height:52px}
.acct-avatar-lg .acct-initials{font-size:1.05rem}

.acct-trigger-text{flex-direction:column;align-items:flex-start;line-height:1.15;max-width:150px}
.acct-trigger-name{font-weight:600;font-size:.86rem;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;max-width:150px}
.acct-trigger-role{font-size:.7rem;opacity:.65}
.acct-caret{font-size:.68rem;opacity:.55;transition:transform .18s}
.acct-trigger[aria-expanded="true"] .acct-caret{transform:rotate(180deg)}

.acct-menu{
  position:absolute;top:calc(100% + 10px);right:0;width:245px;z-index:1080;
  background:#fff;border-radius:14px;box-shadow:0 14px 40px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);
  border:1px solid #e2e8f0;overflow:hidden;
  animation:acctIn .16s ease-out;
}
@keyframes acctIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  .acct-menu{animation:none}
  .acct-caret{transition:none}
}

.acct-role-section{padding:14px 14px 10px}
.acct-role-label{
  display:block;font-size:.72rem;font-weight:700;color:#64748b;
  letter-spacing:.05em;text-transform:uppercase;margin-bottom:7px;
}
.acct-role-select{
  width:100%;padding:7px 28px 7px 12px;font-size:.92rem;font-weight:500;
  color:#1e293b;background-color:#fff;
  border:2px solid #0066cc;border-radius:8px;outline:none;cursor:pointer;
  font-family:inherit;appearance:none;-webkit-appearance:none;-moz-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23334155' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;background-size:13px 13px;
  transition:border-color .15s,box-shadow .15s;
}
.acct-role-select:focus{
  border-color:#0052a3;box-shadow:0 0 0 3px rgba(0,102,204,.2);
}

.acct-divider{height:1px;background:#eef0f6;margin:4px 0}

.acct-links{padding:4px 8px}
.acct-menu .acct-item{
  display:flex;align-items:center;gap:12px;width:100%;
  padding:9px 12px;border-radius:8px;border:0;background:none;
  color:#334155;font-family:inherit;font-size:.9rem;font-weight:500;
  text-align:left;cursor:pointer;text-decoration:none;transition:background .15s,color .15s;
}
.acct-menu .acct-item i{width:18px;text-align:center;color:#475569;font-size:.92rem}
.acct-menu .acct-item:hover{background:#f8fafc;color:#0f172a}
.acct-menu .acct-item:focus-visible{outline:none;background:#f8fafc;box-shadow:inset 0 0 0 2px #0066cc}
.acct-menu .acct-item:active{background:#e7e9f3}

.acct-logout{margin:0;padding:4px 8px 8px}
.acct-menu .acct-item-logout{color:#dc2626}
.acct-menu .acct-item-logout i{color:#dc2626}
.acct-menu .acct-item-logout:hover{background:#fef2f2;color:#b91c1c}
.acct-menu .acct-item-logout:focus-visible{background:#fef2f2;box-shadow:inset 0 0 0 2px #dc2626;color:#b91c1c}

/* Keep backwards-compatible helpers */
.acct-menu .acct-item-danger{color:#dc2626}
.acct-menu .acct-item-danger i{color:#dc2626}
.acct-menu .acct-item-danger:hover{background:#fef2f2;color:#b91c1c}

.acct-ip{font-size:.74rem;color:#3b4055;background:#eef0f6;padding:1px 7px;border-radius:6px}

@media (max-width:575px){
  .acct-menu{width:calc(100vw - 28px);right:-6px}
}


/* ============================================================
   COLLAPSIBLE SIDEBAR  — icon-only rail
   The state class sits on <html> so it can be restored before first
   paint. Rail styles are desktop-only: below 991px the sidebar is
   already an off-canvas drawer driven by .open, and collapsing a
   drawer that is not on screen makes no sense.
   ============================================================ */
@media (min-width:992px){
  html.sidebar-collapsed .app{--rail:78px}

  /* Brand: centre the mark once its wordmark is gone. */
  html.sidebar-collapsed .sidebar .brand{justify-content:center;padding:20px 0;gap:0}

  /* Profile card shrinks to just the avatar. */
  html.sidebar-collapsed .sidebar .profile{justify-content:center;padding:12px 0;margin:6px 14px 14px}
  html.sidebar-collapsed .sidebar .profile img{width:38px;height:38px}

  /* Every text label — nav items, brand wordmark, profile block. */
  html.sidebar-collapsed .sidebar .item-label{display:none}
  html.sidebar-collapsed .sidebar .pill-new{display:none}

  /* Section headings become a divider rule rather than vanishing, so the
     grouping the labels conveyed is not lost entirely. */
  html.sidebar-collapsed .sidebar .menu-label{
    height:1px;padding:0;margin:16px 20px 10px;overflow:hidden;
    background:rgba(255,255,255,.16);font-size:0;letter-spacing:0;opacity:1;
  }

  /* Items become centred icon targets; the active marker stays on the left
     edge so the current page is still obvious in the rail. */
  html.sidebar-collapsed .sidebar .item{justify-content:center;padding:13px 0;gap:0}
  html.sidebar-collapsed .sidebar .item i{width:auto;font-size:1.05rem}

  html.sidebar-collapsed .topbar .brand-mid{display:none}
  html.sidebar-collapsed #sidebarToggle i{transform:rotate(180deg)}
}

#sidebarToggle{border:0;cursor:pointer}
#sidebarToggle i{transition:transform .22s ease}

@media (prefers-reduced-motion:reduce){
  .sidebar,.main,#sidebarToggle i{transition:none}
}

/* ============================================================
   SITE CMS  — manager UI
   ============================================================ */
.cms-nav{display:flex;flex-wrap:wrap;gap:.5rem}
.cms-nav a{
  display:inline-flex;align-items:center;gap:.5rem;padding:.5rem .95rem;
  border-radius:30px;background:#fff;border:1px solid #e7e9f3;color:#5a6072;
  font-size:.86rem;font-weight:600;text-decoration:none;transition:.15s;
}
.cms-nav a:hover{border-color:var(--primary);color:var(--primary)}
.cms-nav a.active{background:var(--primary);border-color:var(--primary);color:#fff}
.cms-nav a i{font-size:.85rem}

.cms-block-row{
  display:flex;align-items:center;gap:12px;padding:12px;border-radius:12px;
  border:1px solid #eef0f6;margin-bottom:8px;background:#fff;
}
.cms-block-row:hover{border-color:var(--primary)}
.cms-block-row.is-hidden{opacity:.6;background:#fafbfe}
.cms-block-order{display:flex;flex-direction:column;gap:4px}
.cms-block-order form{margin:0}
.cms-block-order .btn{padding:1px 7px;line-height:1.2;border-radius:6px}
.min-w-0{min-width:0}

/* ---------- public rendering ---------- */
.cms-prose{line-height:1.7}
.cms-prose p{margin-bottom:1rem}
.cms-prose ul,.cms-prose ol{margin-bottom:1rem;padding-left:1.3rem}
.cms-prose h2,.cms-prose h3,.cms-prose h4{font-weight:700;margin:1.5rem 0 .75rem}
.cms-hero{min-height:520px}
.cms-image-full img{display:block;object-fit:cover;max-height:520px}
.pub-shield-logo{width:42px;height:42px;object-fit:contain;margin-bottom:4px}

/* ---------- CARD FOOTER & PAGINATION ---------- */
.card-ums .card-footer{
  background:#fff;
  border-top:1px solid #eef0f6;
  border-bottom-left-radius:var(--card-radius);
  border-bottom-right-radius:var(--card-radius);
}
.pagination{
  --bs-pagination-color:#41415a;
  --bs-pagination-hover-color:var(--primary);
  --bs-pagination-hover-bg:rgba(108,92,231,.08);
  --bs-pagination-hover-border-color:rgba(108,92,231,.3);
  --bs-pagination-focus-color:var(--primary);
  --bs-pagination-focus-box-shadow:0 0 0 0.25rem rgba(108,92,231,.2);
  --bs-pagination-active-color:#fff;
  --bs-pagination-active-bg:var(--primary);
  --bs-pagination-active-border-color:var(--primary);
  --bs-pagination-disabled-color:#a0a0b2;
  --bs-pagination-disabled-bg:transparent;
  --bs-pagination-disabled-border-color:#e5e5f0;
  font-family:var(--app-font);
}
.pagination .page-link{
  font-weight:600;
  font-size:.86rem;
  transition:all .15s ease-in-out;
}
.pagination .page-item.active .page-link{
  box-shadow:0 4px 12px rgba(108,92,231,.35);
}

/* ==========================================================================
   SYSTEM ENHANCEMENTS SUITE: UI POLISH, ANALYTICS & INTERACTIVITY
   ========================================================================== */

/* ---------- GLASSMORPHISM & ELEVATION ---------- */
.topbar{
  background:rgba(255,255,255,.92)!important;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(229,229,240,.75);
}
.card-ums{
  transition:transform .22s cubic-bezier(.2,.8,.2,1),box-shadow .22s cubic-bezier(.2,.8,.2,1),border-color .2s;
}
.card-ums:hover{
  box-shadow:0 12px 32px rgba(26,26,64,.1);
}
.card-lift:hover{
  transform:translateY(-3px);
}
.glass-panel{
  background:rgba(255,255,255,.85);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border:1px solid rgba(255,255,255,.6);
  box-shadow:0 8px 32px rgba(31,38,135,.07);
}

/* ---------- SEARCH BAR SHORTCUT BADGE ---------- */
.search{
  position:relative;
  display:flex;
  align-items:center;
}
.search-shortcut-badge{
  position:absolute;
  right:12px;
  background:rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.08);
  color:#6c757d;
  font-size:.7rem;
  font-weight:700;
  padding:2px 6px;
  border-radius:6px;
  pointer-events:none;
  display:inline-flex;
  align-items:center;
  gap:2px;
}

/* ---------- TABLE ENHANCEMENTS & LIVE SEARCH ---------- */
.table-ums th.sortable{
  cursor:pointer;
  user-select:none;
  position:relative;
  transition:background .15s,color .15s;
}
.table-ums th.sortable:hover{
  background:rgba(108,92,231,.07);
  color:var(--primary);
}
.table-ums th.sortable .sort-caret{
  margin-left:6px;
  font-size:.75rem;
  opacity:.4;
  transition:opacity .15s,transform .15s;
}
.table-ums th.sortable.asc .sort-caret{
  opacity:1;
  color:var(--primary);
}
.table-ums th.sortable.desc .sort-caret{
  opacity:1;
  color:var(--primary);
}
.table-ums tr.is-selected{
  background:rgba(108,92,231,.08)!important;
}
.table-ums tr{
  transition:background .15s;
}
.ums-highlight{
  background:#fff3b0;
  color:#2b2b3a;
  padding:1px 3px;
  border-radius:3px;
  font-weight:600;
}
.table-scroll-container{
  position:relative;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* ---------- CHART CONTROLS & HEADER ACTIONS ---------- */
.chart-actions{
  display:flex;
  align-items:center;
  gap:6px;
}
.chart-filter-btn{
  font-size:.72rem;
  padding:3px 10px;
  border-radius:20px;
  border:1px solid #e2e8f0;
  background:#f8fafc;
  color:#64748b;
  font-weight:600;
  cursor:pointer;
  transition:all .18s ease;
}
.chart-filter-btn:hover{
  border-color:var(--primary);
  color:var(--primary);
  background:#fff;
}
.chart-filter-btn.active{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
  box-shadow:0 2px 6px rgba(108,92,231,0.28);
}
.btn-chart-export{
  font-size:.72rem;
  padding:3px 9px;
  border-radius:20px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#64748b;
  font-weight:500;
  display:inline-flex;
  align-items:center;
  gap:4px;
  cursor:pointer;
  transition:all .18s ease;
}
.btn-chart-export:hover{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
  box-shadow:0 2px 6px rgba(108,92,231,0.25);
  transform:translateY(-1px);
}

/* ---------- FLOATING BULK ACTIONS BAR ---------- */
.bulk-actions-bar{
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%) translateY(150%);
  background:#232238;
  color:#fff;
  border-radius:50px;
  padding:8px 18px;
  display:flex;
  align-items:center;
  gap:16px;
  box-shadow:0 14px 40px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.15);
  z-index:1060;
  transition:transform .3s cubic-bezier(.175,.885,.32,1.275),opacity .2s;
  opacity:0;
  pointer-events:none;
}
.bulk-actions-bar.visible{
  transform:translateX(-50%) translateY(0);
  opacity:1;
  pointer-events:auto;
}
.bulk-count-badge{
  background:var(--primary);
  color:#fff;
  font-size:.78rem;
  font-weight:700;
  padding:4px 10px;
  border-radius:20px;
}
.bulk-actions-bar .btn-bulk{
  background:rgba(255,255,255,.1);
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
  font-size:.8rem;
  font-weight:600;
  padding:6px 14px;
  border-radius:30px;
  transition:background .15s,transform .1s;
  display:inline-flex;
  align-items:center;
  gap:6px;
  text-decoration:none;
}
.bulk-actions-bar .btn-bulk:hover{
  background:rgba(255,255,255,.22);
  color:#fff;
}
.bulk-actions-bar .btn-bulk.btn-bulk-danger:hover{
  background:#e84393;
  border-color:#e84393;
}
.bulk-actions-bar .btn-bulk-close{
  background:none;
  border:none;
  color:rgba(255,255,255,.6);
  font-size:1.1rem;
  cursor:pointer;
  padding:4px 8px;
  line-height:1;
  transition:color .15s;
}
.bulk-actions-bar .btn-bulk-close:hover{
  color:#fff;
}

/* ---------- COMMAND PALETTE (CMD+K / CTRL+K) ---------- */
.cmd-palette-backdrop{
  position:fixed;
  inset:0;
  background:rgba(20,20,35,.55);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  z-index:1070;
  display:grid;
  place-items:center;
  padding:16px;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
}
.cmd-palette-backdrop.open{
  opacity:1;
  pointer-events:auto;
}
.cmd-palette-modal{
  width:100%;
  max-width:620px;
  background:#fff;
  border-radius:20px;
  box-shadow:0 24px 60px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.08);
  overflow:hidden;
  transform:scale(.95) translateY(-10px);
  transition:transform .2s cubic-bezier(.2,.8,.2,1);
}
.cmd-palette-backdrop.open .cmd-palette-modal{
  transform:scale(1) translateY(0);
}
.cmd-palette-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 20px;
  border-bottom:1px solid #eef0f6;
}
.cmd-palette-header i.fa-magnifying-glass{
  font-size:1.15rem;
  color:var(--primary);
}
.cmd-palette-input{
  border:none;
  outline:none;
  font-size:1.05rem;
  width:100%;
  font-weight:500;
  background:transparent;
  color:#2b2b3a;
}
.cmd-palette-badge{
  font-size:.72rem;
  background:#f0f1f8;
  color:#6c757d;
  padding:3px 8px;
  border-radius:6px;
  font-weight:700;
  border:1px solid #e2e4ef;
}
.cmd-palette-list{
  max-height:380px;
  overflow-y:auto;
  padding:8px;
}
.cmd-group-label{
  font-size:.68rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.8px;
  color:#8d92a5;
  padding:10px 14px 4px;
}
.cmd-item{
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 14px;
  border-radius:12px;
  color:#333647;
  text-decoration:none;
  cursor:pointer;
  transition:background .12s,color .12s;
}
.cmd-item:hover,.cmd-item.active{
  background:rgba(108,92,231,.09);
  color:var(--primary);
}
.cmd-item-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  background:#f0f1f8;
  display:grid;
  place-items:center;
  font-size:.95rem;
  color:#5a6072;
  transition:background .12s,color .12s;
  flex-shrink:0;
}
.cmd-item:hover .cmd-item-icon,.cmd-item.active .cmd-item-icon{
  background:var(--primary);
  color:#fff;
}
.cmd-item-body{
  flex-grow:1;
  min-width:0;
}
.cmd-item-title{
  font-weight:600;
  font-size:.88rem;
  line-height:1.2;
}
.cmd-item-sub{
  font-size:.74rem;
  color:#8d92a5;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cmd-palette-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 18px;
  background:#fafbfe;
  border-top:1px solid #eef0f6;
  font-size:.72rem;
  color:#8d92a5;
}
.cmd-shortcut-hints{
  display:flex;
  gap:12px;
}

/* ---------- TOAST NOTIFICATION ENGINE ---------- */
.ums-toast-container{
  position:fixed;
  top:20px;
  right:20px;
  z-index:1090;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:380px;
  pointer-events:none;
}
.ums-toast{
  background:#fff;
  border-radius:14px;
  box-shadow:0 10px 30px rgba(26,26,64,.15),0 0 0 1px rgba(0,0,0,.06);
  padding:14px 16px;
  display:flex;
  align-items:flex-start;
  gap:12px;
  pointer-events:auto;
  position:relative;
  overflow:hidden;
  animation:umsToastSlideIn .25s cubic-bezier(.2,.8,.2,1);
  transition:transform .2s,opacity .2s;
}
.ums-toast.hiding{
  opacity:0;
  transform:translateX(50px);
}
@keyframes umsToastSlideIn{
  from{transform:translateX(50px);opacity:0}
  to{transform:translateX(0);opacity:1}
}
.ums-toast-icon{
  font-size:1.15rem;
  line-height:1;
  margin-top:2px;
}
.ums-toast.toast-success .ums-toast-icon{color:#00b894}
.ums-toast.toast-danger .ums-toast-icon{color:#e84393}
.ums-toast.toast-warning .ums-toast-icon{color:#f0932b}
.ums-toast.toast-info .ums-toast-icon{color:var(--primary)}
.ums-toast.toast-critical{background:#fff5f5;border-left:4px solid #c0392b;box-shadow:0 10px 30px rgba(192,57,43,.22),0 0 0 1px rgba(192,57,43,.18)}
.ums-toast.toast-critical .ums-toast-icon{color:#c0392b}
.ums-toast.toast-critical .ums-toast-title{color:#c0392b}

/* Critical-severity system banner: visually distinct from routine Error/Warning
   alerts and intentionally not dismissible -- it must stay visible for the
   duration of the underlying critical condition. */
.alert-critical{background:#fff5f5;color:#7a1f14;border-left:4px solid #c0392b!important}
.alert-critical strong{color:#c0392b}
.alert-critical .fa-circle-exclamation{color:#c0392b}
.ums-toast-body{
  flex-grow:1;
  min-width:0;
}
.ums-toast-title{
  font-weight:700;
  font-size:.85rem;
  color:#2b2b3a;
  margin-bottom:2px;
}
.ums-toast-msg{
  font-size:.78rem;
  color:#5a6072;
  line-height:1.35;
}
.ums-toast-close{
  background:none;
  border:none;
  color:#8d92a5;
  font-size:.9rem;
  cursor:pointer;
  padding:2px;
  line-height:1;
}
.ums-toast-close:hover{color:#2b2b3a}
.ums-toast-progress{
  position:absolute;
  bottom:0;
  left:0;
  height:3px;
  background:var(--primary);
  width:100%;
}
.ums-toast.toast-success .ums-toast-progress{background:#00b894}
.ums-toast.toast-danger .ums-toast-progress{background:#e84393}
.ums-toast.toast-warning .ums-toast-progress{background:#f0932b}

/* ---------- MOBILE RESPONSIVE DRAWER & SCRIM ---------- */
.sidebar-backdrop{
  position:fixed;
  inset:0;
  background:rgba(20,20,35,.5);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  z-index:1035;
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
}
.sidebar-backdrop.active{
  opacity:1;
  pointer-events:auto;
}
@media(max-width:991.98px){
  .sidebar{
    transform:translateX(-100%);
    box-shadow:none;
  }
  .sidebar.open{
    transform:translateX(0);
    box-shadow:0 0 50px rgba(0,0,0,.4);
  }
  .app{
    --rail:0px;
  }
  .main{
    margin-left:0;
    width:100%;
  }
  .bulk-actions-bar{
    width:calc(100% - 32px);
    border-radius:18px;
    padding:10px 14px;
    flex-wrap:wrap;
    justify-content:center;
  }
}

/* ---------- REPORTS HUB ADVANCED SEARCH & FILTERS ---------- */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.search-icon-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary, #6C5CE7);
  font-size: 1rem;
  pointer-events: none;
  z-index: 2;
}
.search-input-field {
  padding-left: 42px !important;
  padding-right: 70px !important;
  height: 46px;
  border-radius: 12px !important;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1.5px solid rgba(108, 92, 231, 0.22) !important;
  background: #ffffff !important;
  transition: all 0.2s ease;
  width: 100%;
}
.search-input-field:focus {
  border-color: var(--primary, #6C5CE7) !important;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15) !important;
  outline: none;
}
.search-clear-btn {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  padding: 4px 6px;
  border-radius: 50%;
  z-index: 2;
  transition: color 0.15s;
}
.search-clear-btn:hover {
  color: #e84393;
}
.search-kbd-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  padding: 2px 7px;
  background: #f1f2f6;
  border: 1px solid #dfe6e9;
  border-radius: 6px;
  color: #718096;
  pointer-events: none;
  z-index: 2;
}

.filter-panel {
  background: #ffffff;
  border: 1px solid rgba(108, 92, 231, 0.12);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.cat-pill-btn {
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #4a5568;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  line-height: 1.3;
}
.cat-pill-btn:hover {
  border-color: var(--primary, #6C5CE7);
  color: var(--primary, #6C5CE7);
  transform: translateY(-1px);
}
.cat-pill-btn.active {
  background: var(--primary, #6C5CE7) !important;
  border-color: var(--primary, #6C5CE7) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.28);
}
.cat-pill-btn .pill-count {
  background: rgba(0,0,0,0.07);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}
.cat-pill-btn.active .pill-count {
  background: rgba(255,255,255,0.28);
  color: #ffffff;
}

.report-card-item {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.07);
  position: relative;
  overflow: hidden;
  background: #ffffff;
}
.report-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(108, 92, 231, 0.12);
  border-color: rgba(108, 92, 231, 0.3);
}
.report-card-item .card-strip {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(108, 92, 231, 0.09);
  color: var(--primary, #6C5CE7);
  border: 1px solid rgba(108, 92, 231, 0.22);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.active-filter-chip .chip-remove {
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.active-filter-chip .chip-remove:hover {
  opacity: 1;
  color: #e84393;
}

.highlight-match {
  background-color: #fff3bf;
  color: #2d3436;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}

.view-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #718096;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  cursor: pointer;
}
.view-btn.active {
  background: var(--primary, #6C5CE7);
  border-color: var(--primary, #6C5CE7);
  color: #fff;
}

/* ---------- ACADEMIC PERFORMANCE DASHBOARD SECTION ---------- */
.academic-perf-section {
  position: relative;
}
.academic-perf-section .custom-perf-select {
  font-size: 0.82rem;
  padding: 0.35rem 2rem 0.35rem 0.85rem;
  border: 1px solid #e2e4ef;
  background-color: #ffffff;
  color: #2d3436;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 135px;
}
.academic-perf-section .custom-perf-select:hover {
  border-color: var(--primary, #6C5CE7);
}
.academic-perf-section .custom-perf-select:focus {
  border-color: var(--primary, #6C5CE7);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.grade-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}
.grade-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Shared typography for the interface and generated university documents. */
@font-face { font-family: 'Quicksand'; src: url('../fonts/quicksand/Quicksand.ttf') format('truetype'); font-weight: 400 550; font-style: normal; font-display: swap; }
@font-face { font-family: 'Quicksand'; src: url('../fonts/quicksand/Quicksand-Bold.ttf') format('truetype'); font-weight: 600 700; font-style: normal; font-display: swap; }
.document-viewer { max-width: 1440px; margin-inline: auto; }
.document-viewer-bar { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; color: #1e293b; background: #fff; border-bottom: 1px solid #e2e8f0; font-size: .85rem; font-weight: 600; }
.document-frame-container { background: #1e293b; padding: 14px 14px 18px; border-radius: 0 0 16px 16px; }
.document-frame-container iframe { display: block; width: 100%; height: 82vh; min-height: 560px; border: none; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.35); }
.academic-record-table { font-variant-numeric: tabular-nums; font-weight: 500; }
.academic-record-table th { font-size: .8rem; font-weight: 700; letter-spacing: .02em; white-space: normal; color: #0f172a; }
.academic-record-table td { padding-top: .85rem; padding-bottom: .85rem; color: #0f172a; }
.result-metrics { display: flex; flex-wrap: wrap; gap: .7rem 1.5rem; padding: 1rem 1.25rem; background: #f8f9fe; border-block: 1px solid #e2e8f0; border-radius: 12px; }
.result-metrics span { display: grid; gap: .15rem; }
.result-metrics small { color: #64748b; font-weight: 600; text-transform: uppercase; font-size: .72rem; }
.result-metrics strong { font-variant-numeric: tabular-nums; font-size: 1.15rem; }
@media (max-width: 640px) {
  .document-viewer-bar { flex-direction: column; gap: .5rem; }
  .document-frame-container iframe { min-height: 400px; height: 70vh; }
  .report-paper { padding: 1rem !important; }
}

/* ============================================================
   SYSTEM-WIDE RESPONSIVE DESIGN FIXES
   ============================================================ */

/* 1. Global Typography & Spacing */
@media (max-width: 767.98px) {
  html { font-size: 14px; }
  .content { padding: 16px; }
  .page-head h4 { font-size: 1.35rem; }
  .card-body { padding: 16px; }
}

/* 2. Table Responsiveness */
.table-responsive, .table-scroll-container {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-ums th, .table-ums td {
  white-space: nowrap; /* Prevent cramped multi-line text */
}

/* 3. Modals & Popups */
@media (max-width: 767.98px) {
  .modal-dialog {
    max-width: 96vw !important;
    margin: 8px auto;
  }
  .modal-content {
    max-height: calc(100vh - 16px);
    overflow-y: auto;
  }
}

/* 4. Dashboards & Cards */
.dash-card, .card-ums {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 991.98px) {
  .dashboard-five-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  .chart-container, canvas {
    max-width: 100% !important;
    height: auto !important;
  }
}
@media (max-width: 575.98px) {
  .dashboard-five-cards {
    grid-template-columns: 1fr !important;
  }
}

/* 5. Topbar & Header */
@media (max-width: 575.98px) {
  .topbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .acct-trigger-name {
    max-width: 90px;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn, .form-select, .form-control {
    width: 100%;
    margin-bottom: 6px;
  }
  /* Only stretch buttons inside forms/actions, keep icon-btns intact */
  .icon-btn, .btn-close { width: auto; }
}

/* 6. Document/Report Previews */
.document-viewer {
  max-width: 100%;
  overflow-x: auto;
}

/* ---------- PREMIUM TIMETABLE UI ---------- */
.tt-filter-toggle {
  background: #fff;
  border: 1px solid #eef0f6;
  border-radius: 30px;
  padding: 8px 18px;
  font-weight: 600;
  color: #5a6072;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}
.tt-filter-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(108,92,231,0.12);
}
.tt-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(108,92,231,0.08);
  color: var(--primary);
  border: 1px solid rgba(108,92,231,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.tt-session-card {
  position: relative;
  border-radius: 12px;
  border: 1px solid #eef0f6;
  background: #fff;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.tt-session-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(26,26,64,0.08);
  border-color: rgba(108,92,231,0.3);
}
.tt-session-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: #cbd5e1;
}
.tt-session-card.status-draft .tt-session-strip { background: #f59e0b; }
.tt-session-card.status-published .tt-session-strip { background: #10b981; }

.tt-time-badge {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tt-time-badge i { color: var(--primary); }

.tt-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.tt-meta-badge i { color: #94a3b8; }

.tt-actions {
  opacity: 0.6;
  transition: opacity 0.2s;
}
.tt-session-card:hover .tt-actions {
  opacity: 1;
}

/* ---------- WEEKLY TIMETABLE GRID ---------- */
.tt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5a6072;
}
.tt-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

.tt-grid {
  display: flex;
  overflow-x: auto;
  border: 1px solid #eef0f6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(26,26,64,0.04);
}
.tt-grid-time-col {
  flex: 0 0 60px;
  border-right: 1px solid #eef0f6;
}
.tt-grid-day-col {
  flex: 1 0 150px;
  min-width: 150px;
  border-right: 1px solid #eef0f6;
  position: relative;
}
.tt-grid-day-col:last-child { border-right: none; }
.tt-grid-day-header {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #334155;
  border-bottom: 1px solid #eef0f6;
  background: #f8fafc;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}
.tt-grid-time-body,
.tt-grid-day-body {
  position: relative;
  height: 900px;
}
.tt-hour-label {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  font-size: 0.66rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
}
.tt-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #f1f5f9;
}
.tt-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 8px;
  padding: 6px 8px;
  overflow: hidden;
  font-size: 0.7rem;
  line-height: 1.25;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: default;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  z-index: 1;
}
.tt-block:hover {
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}
.tt-block-lecture { background: linear-gradient(135deg, #6C5CE7, #8b7ef8); }
.tt-block-tutorial { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.tt-block-lab { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #3a2a00; }
.tt-block-seminar { background: linear-gradient(135deg, #10b981, #34d399); }
.tt-block-draft {
  opacity: 0.6;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.18), rgba(255,255,255,0.18) 6px, transparent 6px, transparent 12px);
}
.tt-block-time { font-weight: 700; opacity: 0.9; }
.tt-block-code { font-weight: 800; font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-block-room { opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-block-room i { font-size: 0.62rem; }
.tt-block-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tt-block:hover .tt-block-actions { opacity: 1; }
.tt-block-actions a,
.tt-block-actions button {
  background: rgba(255,255,255,0.28);
  border: none;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 0.58rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tt-block-actions a:hover,
.tt-block-actions button:hover { background: rgba(255,255,255,0.5); }

@media (max-width: 767px) {
  .tt-grid-time-body, .tt-grid-day-body { height: 720px; }
}

/* ---------- Scroll Progress Bar (Global) ---------- */
.pub-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #8a1a34 0%, #b23a54 50%, #c5a059 100%);
  z-index: 9999999;
  transition: width 0.08s ease-out;
  box-shadow: 0 1px 6px rgba(138, 26, 52, 0.45);
  pointer-events: none;
}

/* ---------- Back to Top Floating Button (Global) ---------- */
.pub-back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8a1a34 0%, #5c1122 100%);
  color: #ffffff !important;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 25px rgba(138, 26, 52, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease;
  outline: none;
}
.pub-back-to-top .pub-progress-ring {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
  pointer-events: none;
}
.pub-back-to-top .pub-ring-fill {
  transition: stroke-dashoffset 0.1s linear;
}
.pub-back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.pub-back-to-top:hover {
  background: linear-gradient(135deg, #a12340 0%, #4a0d1b 100%);
  color: #ffffff !important;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 30px rgba(138, 26, 52, 0.55);
}
.pub-back-to-top:active {
  transform: translateY(-1px) scale(0.96);
}
/* When AI FAB or dashboard floating widgets are present */
body:has(.ai-fab) .pub-back-to-top,
.ai-fab ~ .pub-back-to-top {
  bottom: 96px;
  right: 32px;
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; color: #0f172a !important; font-size: 9.5pt !important; }
  .sidebar, .topbar, .ai-fab, .cmd-palette-backdrop, .bulk-actions-bar,
  .no-print, .document-viewer-bar, .exam-nav, .alert, .btn, .pagination,
  .search, .breadcrumb-chip, .ums-toast-container { display: none !important; }
  .main, .content, .app { margin: 0 !important; padding: 0 !important; width: 100% !important; background: #fff !important; }
  .card, .exam-card, .report-paper {
    break-inside: avoid;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
  }
  .card-header, .exam-card h5, .exam-card h6 { break-after: avoid; }
  .table { width: 100% !important; font-size: 8.5pt !important; border-collapse: collapse !important; }
  .table th, .table td { padding: 4px 6px !important; border: 1px solid #cbd5e1 !important; }
  thead, .exam-table thead { display: table-header-group !important; }
  tr, .exam-table tr { break-inside: avoid !important; page-break-inside: avoid !important; }
  .table-responsive { overflow: visible !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
