/* Profile Switcher Tabs */
  .profile-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 10px;
  }
  .profile-tab {
    border: 1.5px solid var(--border);
    background: #F8FAFC;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .profile-tab:hover {
    border-color: var(--sothik-blue);
    background: #EFF6FF;
  }
  .profile-tab.active {
    border-color: var(--brand-green);
    background: #F0FDF4;
    box-shadow: 0 4px 10px rgba(0, 106, 78, 0.1);
  }
  .pt-stage {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--sothik-blue);
  }
  .profile-tab.active .pt-stage { color: var(--brand-green); }
  .pt-name { font-size: 14px; font-weight: 700; color: var(--text-main); }
  .pt-meta { font-size: 11.5px; color: var(--text-muted); }

  /* Copilot Hero Banner */
  .copilot-hero {
    background: var(--sothik-navy);
    color: #fff;
    padding: 24px 28px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 4px 14px rgba(15, 45, 107, 0.12);
  }
  html.dark-mode .copilot-hero {
    background: #1E293B;
    border: 1px solid #334155;
  }
  .copilot-hero h2 { font-size: 23px; font-weight: 800; margin-bottom: 6px; }
  .copilot-hero p { font-size: 13.5px; opacity: 0.92; max-width: 740px; line-height: 1.55; }

  /* KPI Grid */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
  }
  .kpi-card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--sothik-blue);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .kpi-card.green { border-top-color: var(--brand-green); }
  .kpi-card.navy { border-top-color: var(--sothik-navy); }
  .kpi-card.magenta { border-top-color: var(--brand-magenta); }
  .kpi-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
  .kpi-val { font-size: 24px; font-weight: 800; color: var(--sothik-navy); }
  .kpi-sub { font-size: 12px; color: var(--brand-green); font-weight: 600; }

  /* Locker 2-Column Grid */
  .locker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .locker-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: 13px;
    gap: 12px;
  }
  .locker-row span:first-child { color: var(--text-muted); }
  .locker-row span:last-child { font-weight: 700; color: var(--text-main); text-align: right; }

  /* Unified Institutions Encyclopedia Split Layout */
  .inst-explorer-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
  }
  .inst-directory-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 760px;
    overflow-y: auto;
    padding-right: 4px;
  }
  .inst-list-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: #F8FAFC;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
  }
  .inst-list-btn:hover {
    border-color: var(--sothik-blue);
    background: #EFF6FF;
  }
  .inst-list-btn.active {
    border-color: var(--brand-green);
    background: #F0FDF4;
    box-shadow: 0 4px 10px rgba(0, 106, 78, 0.1);
  }

  /* Copilot Application Order Modal */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    /* solid backdrop */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
  }
  .modal-backdrop.open { display: flex; }
  .modal-box {
    background: #fff;
    width: 100%;
    max-width: 640px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }
  .modal-header {
    background: var(--sothik-navy);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .form-group { display: flex; flex-direction: column; gap: 6px; }
  .form-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
  .form-control {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-main);
    background: var(--input-bg);
  }
  .mfs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .mfs-option {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
  }
  .mfs-option.active {
    border-color: var(--brand-green);
    background: #F0FDF4;
    color: var(--brand-green);
  }

  /* Dark Mode Enhancements */
  html.dark-mode .profile-tab {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
  }
  html.dark-mode .profile-tab:hover {
    background: #0F172A;
    border-color: #60A5FA;
  }
  html.dark-mode .profile-tab.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10B981;
  }
  html.dark-mode .kpi-card {
    background: #1E293B;
    border-color: #334155;
  }
  html.dark-mode .inst-list-btn {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
  }
  html.dark-mode .inst-list-btn:hover {
    background: #0F172A;
    border-color: #60A5FA;
  }
  html.dark-mode .inst-list-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10B981;
  }
  html.dark-mode #inst-dossier-panel {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
  }
  html.dark-mode .modal-box {
    background: #1E293B;
    color: #F8FAFC;
  }
  html.dark-mode .mfs-option {
    border-color: #334155;
    background: #0F172A;
    color: #F8FAFC;
  }
  html.dark-mode .mfs-option.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10B981;
    color: #34D399;
  }
  /* Form Controls in Dark Mode */
  html.dark-mode .form-control,
  html.dark-mode input,
  html.dark-mode select,
  html.dark-mode textarea {
    background: #0B132B !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
  }
  html.dark-mode select option {
    background: #0B132B !important;
    color: #F8FAFC !important;
  }
  html.dark-mode input::placeholder,
  html.dark-mode textarea::placeholder {
    color: #64748B !important;
  }

  /* Institutions Dossier Tables in Dark Mode */
  html.dark-mode #inst-dossier-panel div[style*="background:#F8FAFC"] {
    background: #0B132B !important;
    border-color: #334155 !important;
    color: #93C5FD !important;
  }
  html.dark-mode #inst-dossier-panel tr[style*="background:#F1F5F9"] {
    background: #0B132B !important;
    color: #94A3B8 !important;
  }
  html.dark-mode #inst-dossier-panel tr[style*="border-bottom:1px solid #F1F5F9"] {
    border-bottom-color: #334155 !important;
  }
  html.dark-mode #inst-dossier-panel td {
    color: #F8FAFC !important;
    border-bottom-color: #334155 !important;
  }
  html.dark-mode #inst-dossier-panel td[style*="color:#0F2D6B"] {
    color: #93C5FD !important;
  }
  html.dark-mode #inst-dossier-panel td[style*="color:#475569"] {
    color: #94A3B8 !important;
  }
  html.dark-mode #inst-dossier-panel div[style*="background:#FEF2F2"] {
    background: rgba(225, 6, 19, 0.12) !important;
    border-color: #334155 !important;
    color: #FCA5A5 !important;
  }
  html.dark-mode #inst-dossier-panel tr[style*="background:#FFF5F5"] {
    background: #0B132B !important;
    color: #FCA5A5 !important;
  }
  html.dark-mode #inst-dossier-panel div[style*="border:1px solid #E2E8F0"],
  html.dark-mode #inst-dossier-panel div[style*="border:1px solid #FECACA"] {
    border-color: #334155 !important;
  }

  /* Headings in Dark Mode */
  html.dark-mode .card-title,
  html.dark-mode .topbar-title {
    color: #93C5FD !important;
  }

  @media (max-width: 992px) {
    .locker-grid { grid-template-columns: 1fr; }
    .inst-explorer-grid { grid-template-columns: 1fr; }
    .inst-directory-list { max-height: 280px; }
    .inst-dossier-split { grid-template-columns: 1fr !important; }
  }

/* Dossier & Theme Utilities */
.dossier-stat-box {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
html.dark-mode .dossier-stat-box {
  background: #0B132B !important;
  border-color: #334155 !important;
}
.dossier-info-green {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-radius: 12px;
  padding: 16px;
  color: #166534;
}
html.dark-mode .dossier-info-green {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #6EE7B7 !important;
}
.dossier-info-blue {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 16px;
  color: #1E40AF;
}
html.dark-mode .dossier-info-blue {
  background: rgba(59, 130, 246, 0.14) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #93C5FD !important;
}
.dossier-dept-pill {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}
html.dark-mode .dossier-dept-pill {
  background: #0B132B !important;
  border-color: #475569 !important;
  color: #F8FAFC !important;
}
.intake-pricing-box {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--text-main);
}
html.dark-mode .intake-pricing-box {
  background: #0B132B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}
.intake-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  background: var(--input-bg);
  padding: 16px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  margin-bottom: 20px;
}
html.dark-mode .intake-terms-label {
  background: #0B132B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}
.auth-modal-summary {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
}
html.dark-mode .auth-modal-summary {
  background: #0B132B !important;
  border-color: #334155 !important;
  color: #93C5FD !important;
}

/* ========================================================
   Sothik App-Like Mobile Ergonomics & Hidden Overtexts
   ======================================================== */

/* Info Pill Buttons (Tuck long overtexts behind clean modal windows) */
.info-pill-btn {
  background: var(--tag-bg);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  line-height: 1.3;
}
.info-pill-btn:hover {
  border-color: var(--brand-magenta);
  color: var(--brand-magenta);
  background: #FDF4FF;
  transform: translateY(-1px);
}
html.dark-mode .info-pill-btn {
  background: #0B132B;
  border-color: #475569;
  color: #F8FAFC;
}
html.dark-mode .info-pill-btn:hover {
  border-color: #F472B6;
  color: #F472B6;
  background: rgba(192, 38, 211, 0.15);
}

/* Clean Streamlined Terms & Agreement Bar */
.intake-terms-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
html.dark-mode .intake-terms-bar {
  background: #0B132B !important;
  border-color: #334155 !important;
}
.intake-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  min-width: 220px;
}
.intake-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-magenta);
  cursor: pointer;
}

/* Mobile App Bottom Navigation Bar (Fixed at bottom on <= 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
  z-index: 990;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
}
.mobile-nav-item:hover, .mobile-nav-item.active {
  color: var(--sothik-navy);
}
.mobile-nav-fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--sothik-navy);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 800;
  margin-top: -18px;
  cursor: pointer;
  flex: 1;
}
.fab-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sothik-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(15, 45, 107, 0.28);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.mobile-nav-fab:hover .fab-circle {
  transform: scale(1.08);
  background: #1976D2;
}

html.dark-mode .mobile-bottom-nav {
  background: #0F172A;
  border-top-color: #1E293B;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
}
html.dark-mode .mobile-nav-item {
  color: #94A3B8;
}
html.dark-mode .mobile-nav-item:hover, html.dark-mode .mobile-nav-item.active {
  color: #93C5FD;
}
html.dark-mode .mobile-nav-fab {
  color: #93C5FD;
}
html.dark-mode .fab-circle {
  background: #2563EB;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
html.dark-mode .mobile-nav-item:hover, html.dark-mode .mobile-nav-item.active {
  color: #93C5FD;
}

/* General Hero Admission Card */
.hero-admission-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-main) !important;
  border-radius: 16px !important;
  padding: 26px 30px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
  margin-bottom: 24px !important;
}
html.dark-mode .hero-admission-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

/* Mobile Responsive Optimization (<= 768px) */
@media (max-width: 768px) {
  /* Single-Line Native Mobile Topbar */
  .topbar {
    min-height: 52px !important;
    padding: 8px 12px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
  }
  .topbar-left {
    flex: 1 !important;
    min-width: 0 !important;
    gap: 8px !important;
  }
  .topbar-title {
    font-size: 15.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .topbar-actions {
    flex-shrink: 0 !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  /* On mobile topbar, hide redundant buttons so it never wraps */
  .topbar-actions a.btn-green,
  .topbar-actions a.btn-magenta {
    display: none !important;
  }
  .topbar-actions .btn-sm {
    padding: 5px 10px !important;
    font-size: 12px !important;
  }

  /* Modals on Mobile: Perfectly centered with safe clearance above bottom nav */
  .modal-backdrop {
    padding: 12px !important;
    z-index: 9999 !important;
  }
  .modal-box {
    max-height: 84vh !important;
    margin-bottom: 20px !important;
  }
  .modal-header {
    padding: 14px 18px !important;
  }
  .modal-body {
    padding: 16px 18px !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }
  .dashboard-body {
    padding-bottom: 84px !important;
  }
  
  /* Hero Card Mobile Simplification */
  .hero-admission-card {
    padding: 20px 16px !important;
    border-radius: 14px !important;
  }
  .hero-main-heading {
    font-size: 20px !important;
    line-height: 1.25 !important;
    margin-bottom: 4px !important;
  }
  .hero-lead-text {
    display: none !important; /* Tucked cleanly under Hub Details ℹ button */
  }
  .hero-actions {
    width: 100% !important;
    flex-direction: row !important;
    gap: 8px !important;
  }
  .hero-actions .btn {
    flex: 1 !important;
    padding: 11px 14px !important;
    font-size: 13px !important;
  }
  .hero-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 14px !important;
    padding-top: 12px !important;
  }
  .hero-stat-box {
    padding: 8px 12px !important;
  }
  .stat-box-label {
    font-size: 9.5px !important;
  }
  .stat-box-val {
    font-size: 16px !important;
  }

  /* Circulars Catalog Mobile Card Ergonomics */
  #catalog .table-wrap {
    overflow-x: visible;
  }
  #catalog table, 
  #catalog tbody {
    display: block;
    width: 100%;
  }
  #catalog thead {
    display: none;
  }
  #catalog tbody tr {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease;
  }
  #catalog tbody td {
    display: block;
    padding: 0;
    border: none;
  }
  #catalog tbody td:first-child {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
  }
  #catalog tbody td small {
    display: none !important; /* Hide long summary text from card surface; revealed via Details ℹ modal */
  }
  #catalog tbody tr:hover {
    border-color: var(--brand-magenta);
  }

  /* Intake Form 1-Column on Mobile */
  #public-intake-form > div {
    grid-template-columns: 1fr !important;
  }
  #public-intake-form .form-group {
    grid-column: span 1 !important;
  }

  /* Full-width Responsive Search & Filter Bars in Headers */
  .card-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .card-header input,
  .card-header select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Exam Schedule & Clash Detector Mobile Cards */
  #clash-detector .table-wrap {
    overflow-x: visible;
  }
  #clash-detector table,
  #clash-detector tbody {
    display: block;
    width: 100%;
  }
  #clash-detector thead {
    display: none;
  }
  #clash-detector tbody tr {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  #clash-detector tbody td {
    display: block;
    padding: 0;
    border: none;
  }
  #clash-detector tbody td:first-child {
    font-weight: 800;
    color: var(--sothik-navy);
    font-size: 13.5px;
  }
  #clash-detector tbody td:nth-child(2) {
    font-weight: 700;
    color: var(--text-main);
    font-size: 13px;
  }
  #clash-detector tbody td:last-child {
    font-size: 12px;
    color: var(--text-muted);
  }
}

/* Operator Chat & Escalation Modal Dark Mode */
html.dark-mode #operator-chat-modal .modal-box {
  background: #0F172A !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}
html.dark-mode #operator-chat-modal #oc-body {
  background: #0B1120 !important;
}
html.dark-mode #operator-chat-modal #oc-body > div {
  background: #1E293B !important;
  border-color: #334155 !important;
}
html.dark-mode #operator-chat-modal .modal-box > div:nth-child(2) {
  background: #1E293B !important;
  border-color: #334155 !important;
}
html.dark-mode #oc-message-form {
  background: #0F172A !important;
  border-color: #334155 !important;
}
html.dark-mode #oc-text-input,
html.dark-mode #oc-urgency-select {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}


/* Circular Deadline & Urgency Display */
.circular-deadline-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 135px;
}
.circular-deadline-date {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.circular-deadline-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  width: fit-content;
}
.deadline-urgent {
  background: #FEE2E2 !important;
  color: #991B1B !important;
  border: 1px solid #F87171 !important;
}
.deadline-near {
  background: #FEF3C7 !important;
  color: #92400E !important;
  border: 1px solid #FBBF24 !important;
}
.deadline-open {
  background: #DCFCE7 !important;
  color: #166534 !important;
  border: 1px solid #86EFAC !important;
}
.deadline-closed {
  background: #F1F5F9 !important;
  color: #64748B !important;
  border: 1px solid #CBD5E1 !important;
}
html.dark-mode .deadline-urgent {
  background: rgba(220, 38, 38, 0.25) !important;
  color: #FCA5A5 !important;
  border: 1px solid #DC2626 !important;
}
html.dark-mode .deadline-near {
  background: rgba(217, 119, 6, 0.25) !important;
  color: #FCD34D !important;
  border: 1px solid #D97706 !important;
}
html.dark-mode .deadline-open {
  background: rgba(22, 101, 52, 0.25) !important;
  color: #86EFAC !important;
  border: 1px solid #16A34A !important;
}
html.dark-mode .deadline-closed {
  background: rgba(51, 65, 85, 0.3) !important;
  color: #94A3B8 !important;
  border: 1px solid #475569 !important;
}


/* Circular Lifecycle Milestones, Badges, & Responsive Stepper */
.deadline-pending {
  background: #FEF3C7 !important;
  color: #92400E !important;
  border: 1px solid #F59E0B !important;
}
.deadline-exam {
  background: #F3E8FF !important;
  color: #6B21A8 !important;
  border: 1px solid #C084FC !important;
}
.deadline-published {
  background: #EEF2FF !important;
  color: #3730A3 !important;
  border: 1px solid #818CF8 !important;
}
.deadline-upcoming {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #CBD5E1 !important;
}

html.dark-mode .deadline-pending {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #FDE68A !important;
  border: 1px solid #D97706 !important;
}
html.dark-mode .deadline-exam {
  background: rgba(147, 51, 234, 0.25) !important;
  color: #E9D5FF !important;
  border: 1px solid #9333EA !important;
}
html.dark-mode .deadline-published {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #C7D2FE !important;
  border: 1px solid #6366F1 !important;
}
html.dark-mode .deadline-upcoming {
  background: rgba(51, 65, 85, 0.3) !important;
  color: #94A3B8 !important;
  border: 1px solid #475569 !important;
}

.badge-session {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: #E0E7FF;
  color: #3730A3;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #C7D2FE;
  letter-spacing: 0.02em;
}
html.dark-mode .badge-session {
  background: rgba(99, 102, 241, 0.2);
  color: #C7D2FE;
  border-color: rgba(99, 102, 241, 0.4);
}

.activity-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 600;
}
.activity-banner-pending {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}
.activity-banner-exam {
  background: #FAF5FF;
  color: #6B21A8;
  border: 1px solid #E9D5FF;
}
.activity-banner-published {
  background: #EEF2FF;
  color: #3730A3;
  border: 1px solid #C7D2FE;
}
.activity-banner-open {
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
}
.activity-banner-upcoming {
  background: #F8FAFC;
  color: #334155;
  border: 1px solid #E2E8F0;
}

html.dark-mode .activity-banner-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #FDE68A;
  border-color: rgba(245, 158, 11, 0.35);
}
html.dark-mode .activity-banner-exam {
  background: rgba(147, 51, 234, 0.15);
  color: #E9D5FF;
  border-color: rgba(147, 51, 234, 0.35);
}
html.dark-mode .activity-banner-published {
  background: rgba(99, 102, 241, 0.15);
  color: #C7D2FE;
  border-color: rgba(99, 102, 241, 0.35);
}
html.dark-mode .activity-banner-open {
  background: rgba(22, 101, 52, 0.15);
  color: #86EFAC;
  border-color: rgba(22, 101, 52, 0.35);
}
html.dark-mode .activity-banner-upcoming {
  background: rgba(51, 65, 85, 0.2);
  color: #94A3B8;
  border-color: rgba(71, 85, 105, 0.35);
}

.mini-stepper {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  font-size: 9.5px;
  color: #64748B;
  user-select: none;
}
.mini-step {
  padding: 1px 5px;
  border-radius: 3px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  line-height: 1.3;
}
.mini-step.active {
  background: #0F2D6B;
  color: #FFFFFF;
  font-weight: 700;
  border-color: #0F2D6B;
}
.mini-step.past {
  background: #E2E8F0;
  color: #475569;
  text-decoration: line-through;
  opacity: 0.8;
}
.mini-step-arrow {
  font-size: 8px;
  color: #94A3B8;
}

html.dark-mode .mini-step {
  background: rgba(30, 41, 59, 0.6);
  border-color: #334155;
  color: #94A3B8;
}
html.dark-mode .mini-step.active {
  background: #38BDF8;
  color: #0F172A;
  border-color: #38BDF8;
}
html.dark-mode .mini-step.past {
  background: rgba(51, 65, 85, 0.4);
  color: #64748B;
}

/* Responsive screen tuning across resolutions */
@media (max-width: 1024px) {
  .circular-deadline-block {
    min-width: 120px;
  }
  .activity-banner {
    font-size: 11px;
    padding: 3px 8px;
  }
}
@media (max-width: 768px) {
  .circular-deadline-block {
    min-width: 100%;
    gap: 4px;
  }
  .mini-stepper {
    flex-wrap: wrap;
    font-size: 9px;
  }
  .activity-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
@media (max-width: 480px) {
  .activity-banner {
    font-size: 10.5px;
  }
  .circular-deadline-date {
    font-size: 12px;
  }
  .circular-deadline-pill {
    font-size: 10.5px;
    padding: 2px 7px;
  }
}



/* Human Time Filter Pills */
.human-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.time-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.time-pill-btn:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}
.time-pill-btn.active {
  background: #0F2D6B;
  color: #FFFFFF;
  border-color: #0F2D6B;
  box-shadow: 0 2px 6px rgba(15, 45, 107, 0.25);
}
.time-pill-btn .pill-count {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
}
.time-pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

html.dark-mode .time-pill-btn {
  background: #1E293B;
  color: #E2E8F0;
  border-color: #334155;
}
html.dark-mode .time-pill-btn:hover {
  background: #334155;
}
html.dark-mode .time-pill-btn.active {
  background: #38BDF8;
  color: #0F172A;
  border-color: #38BDF8;
}
html.dark-mode .time-pill-btn.active .pill-count {
  background: rgba(0, 0, 0, 0.2);
  color: #0F172A;
}

/* Pulsating Extreme Urgent Red */
@keyframes urgentPulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.pill-extreme-urgent {
  background: #FEF2F2 !important;
  color: #991B1B !important;
  border: 1.5px solid #DC2626 !important;
  font-weight: 800 !important;
  animation: urgentPulseGlow 2s infinite !important;
}
html.dark-mode .pill-extreme-urgent {
  background: rgba(220, 38, 38, 0.3) !important;
  color: #FCA5A5 !important;
  border: 1.5px solid #EF4444 !important;
}

/* Urgency Surge & Growth Spike Gauge */
.urgency-spike-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  width: 100%;
  max-width: 150px;
}
.urgency-spike-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
}
.urgency-spike-track {
  height: 5px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
html.dark-mode .urgency-spike-track {
  background: #334155;
}
.urgency-spike-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.spike-extreme {
  background: #DC2626;
}
.spike-high {
  background: #D97706;
}
.spike-moderate {
  background: #16A34A;
}
.spike-early {
  background: #64748B;
}

/* Calendar Date-Wise Agenda Grid */
.calendar-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
.cal-filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cal-filter-btn:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}
.cal-filter-btn.active {
  background: #006A4E;
  color: #FFFFFF;
  border-color: #006A4E;
}
html.dark-mode .cal-filter-btn {
  background: #1E293B;
  color: #E2E8F0;
  border-color: #334155;
}
html.dark-mode .cal-filter-btn:hover {
  background: #334155;
}
html.dark-mode .cal-filter-btn.active {
  background: #38BDF8;
  color: #0F172A;
  border-color: #38BDF8;
}

.calendar-month-block {
  margin-bottom: 32px;
}
.calendar-month-title {
  font-family: 'Dosis', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #0F2D6B;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid #E2E8F0;
}
html.dark-mode .calendar-month-title {
  color: #38BDF8;
  border-color: #334155;
}
.calendar-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.cal-event-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
html.dark-mode .cal-event-card {
  background: #1E293B;
  border-color: #334155;
}
.cal-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 45, 107, 0.08);
  border-color: #CBD5E1;
}
.cal-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 58px;
  border-radius: 10px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  font-weight: 800;
  text-align: center;
  flex-shrink: 0;
}
html.dark-mode .cal-date-badge {
  background: #0F172A;
  border-color: #334155;
}
.cal-date-day {
  font-size: 19px;
  line-height: 1;
  color: #0F2D6B;
}
html.dark-mode .cal-date-day {
  color: #38BDF8;
}
.cal-date-month {
  font-size: 10px;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.cal-event-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-event-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
}
.cal-tag-deadline { background: #FEE2E2; color: #991B1B; border: 1px solid #F87171; }
.cal-tag-exam { background: #F3E8FF; color: #6B21A8; border: 1px solid #D8B4FE; }
.cal-tag-viva { background: #FEF3C7; color: #92400E; border: 1px solid #FBBF24; }
.cal-tag-result { background: #EEF2FF; color: #3730A3; border: 1px solid #A5B4FC; }



/* ========================================================
   IN-APP ALERT SYSTEM (Top Banner, Topbar Bell & Toast)
   ======================================================== */

.topbar-alert-wrap {
  position: relative;
  display: inline-flex;
}
.topbar-alert-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #DC2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--card-bg, #fff), 0 2px 6px rgba(220, 38, 38, 0.4);
}
.topbar-alert-badge.pulse {
  animation: urgentPulseGlow 1.8s infinite;
}

.alert-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--card-bg, #FFFFFF);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  z-index: 1060;
  overflow: hidden;
  animation: alertDropdownFade 0.2s ease-out;
}
@keyframes alertDropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-dropdown-header {
  padding: 12px 16px;
  background: var(--tag-bg, #F8FAFC);
  border-bottom: 1px solid var(--border, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alert-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted, #64748B);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.alert-clear-btn:hover {
  color: #DC2626;
  background: #FEE2E2;
}

.alert-dropdown-body {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.alert-item-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.15s ease;
  cursor: pointer;
}
.alert-item-card:hover {
  background: var(--tag-bg, #F8FAFC);
}
.alert-item-card.extreme {
  border-left: 4px solid #DC2626;
  background: #FEF2F2;
}
html.dark-mode .alert-item-card.extreme {
  background: rgba(220, 38, 38, 0.12);
}
.alert-item-card.high {
  border-left: 4px solid #D97706;
}
.alert-item-card.amber {
  border-left: 4px solid #B45309;
}
.alert-item-card.purple {
  border-left: 4px solid #7C3AED;
}
.alert-item-card.green {
  border-left: 4px solid #006A4E;
}

.alert-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.alert-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main, #0F172A);
  line-height: 1.35;
}
.alert-item-desc {
  font-size: 11.5px;
  color: var(--text-muted, #64748B);
  line-height: 1.4;
}
.alert-item-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
}
.alert-dropdown-footer {
  padding: 10px 16px;
  background: var(--tag-bg, #F8FAFC);
  border-top: 1px solid var(--border, #E2E8F0);
  text-align: center;
}

/* 2. In-App Urgent Alert Banner */
.in-app-alert-banner {
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.08);
  animation: bannerSlideDown 0.3s ease-out;
}
html.dark-mode .in-app-alert-banner {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}
@keyframes bannerSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.alert-beacon-wrap {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.alert-beacon-dot {
  position: absolute;
  inset: 2px;
  background: #DC2626;
  border-radius: 50%;
}
.alert-beacon-ping {
  position: absolute;
  inset: -1px;
  border: 2px solid #DC2626;
  border-radius: 50%;
  animation: beaconPing 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes beaconPing {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.alert-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-main, #0F172A);
}
.alert-banner-tag {
  background: #FEE2E2;
  color: #DC2626;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
html.dark-mode .alert-banner-tag {
  background: rgba(220, 38, 38, 0.3);
  color: #F87171;
}
.alert-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.alert-banner-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #94A3B8;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.alert-banner-close:hover {
  color: #DC2626;
  background: rgba(220, 38, 38, 0.1);
}

/* 3. In-App Floating Toast Alert */
.in-app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  z-index: 1200;
  max-width: 420px;
  animation: toastSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast-beacon {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.toast-dot {
  position: absolute;
  inset: 0;
  background: #EF4444;
  border-radius: 50%;
  box-shadow: 0 0 10px #EF4444;
}
.toast-content {
  flex: 1;
  min-width: 0;
}
.toast-title {
  font-size: 13px;
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.25;
}
.toast-msg {
  font-size: 11.5px;
  color: #94A3B8;
  line-height: 1.35;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.toast-action-btn {
  background: #DC2626;
  color: #fff;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.toast-action-btn:hover {
  background: #B91C1C;
}
.toast-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}
.toast-close-btn:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .in-app-alert-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
  }
  .alert-banner-actions {
    width: 100%;
    justify-content: space-between;
  }
  .in-app-toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }
}
