/* ==========================================================================
   STUDYFINER CRM - COMPREHENSIVE PREMIUM DESIGN SYSTEM
   Pixel-perfect, lightning-fast UI matching StudyFiner Brand Aesthetics:
   ========================================================================== */

/* ── ZERO-FOUT MATERIAL SYMBOLS FONT SYSTEM ─────────────────────────────── */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('../fonts/material-symbols-outlined.woff2') format('woff2'),
       url('https://fonts.gstatic.com/s/materialsymbolsoutlined/v369/kJEPBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzBwG-RpA6RzaxHMPdY40KH8nGzv3fzfVJO1Q.woff2') format('woff2');
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga' 1;
  -webkit-font-feature-settings: 'liga' 1;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  overflow: hidden;
  box-sizing: content-box;
}

:root {
  --brand-primary: #A5D420;
  --brand-light: #BDE04A;
  --brand-dark: #8AB81A;
  --brand-darker: #6E9315;
  --brand-50: #f4fae5;
  --brand-100: #e7f5cc;
  --brand-200: #d1ed99;
  
  --dark-950: #0f172a;
  --dark-900: #1e293b;
  --dark-800: #334155;
  --dark-700: #475569;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #f8fafc;
  --sidebar-hover: #f1f5f9;
  --sidebar-active-bg: #e7f5cc;
  --sidebar-active-text: #2d4a00;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-brand: #6E9315;
  
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-dark: #cbd5e1;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.08);
  
  --status-success: #16a34a;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #0284c7;
}

/* ── GLOBAL SCROLLBAR REMOVAL (ALL BROWSERS) ────────────────────────────── */
html, body, *, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Universal Invisible Scrollbars across all elements & browsers */
html, body, *, *::before, *::after {
  scrollbar-width: none !important;        /* Firefox */
  -ms-overflow-style: none !important;     /* IE 10+ and Edge Legacy */
}

*::-webkit-scrollbar,
*::before::-webkit-scrollbar,
*::after::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar,
div::-webkit-scrollbar,
nav::-webkit-scrollbar,
aside::-webkit-scrollbar,
main::-webkit-scrollbar,
section::-webkit-scrollbar,
textarea::-webkit-scrollbar,
ul::-webkit-scrollbar,
ol::-webkit-scrollbar,
table::-webkit-scrollbar,
tbody::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  opacity: 0 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* Typography Helpers */
.mono { font-family: 'JetBrains Mono', monospace; }
.lc {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
}
.dm {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 18px;
  font-weight: 500;
}
.dm-sm {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}
.dl {
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--dark-950);
}
.hm {
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--dark-950);
}
.hs {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: var(--dark-950);
}
.bl {
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
}
.bs {
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
}

/* Custom Scroll Container (Clean, Invisible Scrollbars) */
.csb {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.csb::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sb {
  width: 260px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
}

/* Collapsed Mini / Icon-only Sidebar Mode */
body.sb-collapsed .sb {
  width: 76px;
}
body.sb-collapsed .sb-logo {
  padding: 0 16px 18px;
  justify-content: center;
}
body.sb-collapsed .sb-logo img {
  height: 32px;
}
body.sb-collapsed .sb-cta {
  padding: 12px 10px 6px;
}
body.sb-collapsed .sb-cta button, body.sb-collapsed .sb-cta .btn-p {
  padding: 10px 0;
  justify-content: center;
  font-size: 0;
}
body.sb-collapsed .sb-cta button .material-symbols-outlined, 
body.sb-collapsed .sb-cta .btn-p .material-symbols-outlined {
  margin: 0 !important;
}
body.sb-collapsed .sb-nav .lc, body.sb-collapsed .sb-item .lc {
  display: none !important;
}
body.sb-collapsed .sb-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}
body.sb-collapsed .sb-badge {
  display: none;
}
body.sb-collapsed .sb-badge:not(.hidden) {
  display: block !important;
  position: absolute;
  top: 8px;
  right: 18px;
  width: 9px;
  height: 9px;
  min-width: 9px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  background: #ef4444;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
body.sb-collapsed .mw {
  margin-left: 76px;
}

/* Sidebar Overlay Backdrop for Mobile / Tablet drawer */
.sb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.sb-overlay.open {
  opacity: 1;
  visibility: visible;
  display: block;
}


.sb-logo {
  padding: 0 20px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}
.sb-logo img {
  height: 38px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.sb-cta {
  padding: 16px 14px 6px;
}
.sb-cta button, .sb-cta .btn-p {
  width: 100%;
  background: var(--brand-primary);
  color: #172554 !important;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.15s ease;
}
.sb-cta button:hover, .sb-cta .btn-p:hover {
  background: var(--brand-light);
}
.sb-cta button .material-symbols-outlined, .sb-cta .btn-p .material-symbols-outlined {
  font-size: 18px;
  color: #172554;
}

.sb-nav {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-nav .lc {
  padding: 12px 10px 6px;
  color: #64748b;
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.sb-item:hover {
  background: var(--sidebar-hover);
  color: var(--dark-950);
}
.sb-item.active {
  color: var(--sidebar-active-text);
  font-weight: 700;
  background: var(--sidebar-active-bg);
  border: 1px solid var(--brand-200);
}
.sb-item.active .material-symbols-outlined {
  color: var(--brand-darker);
  font-variation-settings: 'FILL' 1;
}
.sb-item .material-symbols-outlined {
  font-size: 19px;
  color: #64748b;
}

.sb-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.sb-bottom {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ==========================================================================
   MAIN WRAPPER & TOPBAR
   ========================================================================== */
.mw {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-app);
  overflow-x: hidden;
  transition: margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tb {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 9990;
  flex-shrink: 0;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.tb-tabs {
  display: flex;
  gap: 12px;
}
.tb-tab {
  cursor: pointer;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.tb-tab.active {
  color: var(--dark-950);
  background: var(--brand-100);
}
.tb-tab:hover:not(.active) {
  color: var(--dark-950);
  background: var(--border-subtle);
}

.tb-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tb-search {
  position: relative;
  width: 260px;
}
.tb-search .material-symbols-outlined {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}
.tb-search input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 7px 14px 7px 36px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}
.tb-search input:focus {
  border-color: var(--brand-dark);
  background: #ffffff;
}

.tb-sep {
  width: 1px;
  height: 20px;
  background: var(--border-light);
}

.tb-icon {
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.tb-icon:hover {
  background: var(--border-subtle);
  color: var(--dark-950);
  border-color: #cbd5e1;
}

.tb-btn {
  background: #ffffff;
  color: var(--dark-950);
  border: 1px solid var(--border-light);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.tb-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--brand-darker);
}
.tb-btn .material-symbols-outlined {
  font-size: 17px;
  color: var(--brand-darker);
}

.tb-approve {
  background: var(--brand-primary);
  color: #172554;
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
}
.tb-approve:hover {
  background: var(--brand-light);
}

.tb-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--brand-primary);
  background: #f1f5f9;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   CONTENT AREA & STABLE CONTAINERS
   ========================================================================== */
.ct, .page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.anim {
  animation: sfFadeUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.anim.d1 { animation-delay: 0.04s; }
.anim.d2 { animation-delay: 0.08s; }
.anim.d3 { animation-delay: 0.12s; }
.anim.d4 { animation-delay: 0.16s; }
.anim.d5 { animation-delay: 0.20s; }

@keyframes sfFadeUp {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes simpleFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Ledger Card */
.ledger {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: visible;
  margin-bottom: 24px;
}
.ledger:has(table):not(:has(.sf-select-wrap)):not(:has(select)) {
  overflow: hidden;
}
.ledger:last-child {
  margin-bottom: 0;
}

.ledger-head {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 16px 20px;
}
.ledger-body {
  padding: 20px;
}

/* Dashboard KPI Grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.kpi-val {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--dark-950);
  letter-spacing: -0.02em;
}
.kpi-trend {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.kpi-trend.up {
  color: var(--status-success);
}
.kpi-trend.neutral {
  color: var(--text-secondary);
}

.dash-chart-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-wrap {
  height: 200px;
  position: relative;
}

/* Conversion Funnel */
.funnel-track {
  width: 100%;
  height: 10px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.funnel-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Stamps / Status Badges */
.stamp {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 700;
  border-radius: var(--radius-full);
}
.stamp-approved {
  background: var(--brand-100);
  color: var(--brand-darker);
  border: 1px solid var(--brand-200);
}
.stamp-rejected {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.stamp-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.stamp-info {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Modern Data Table */
.lt {
  width: 100%;
  border-collapse: collapse;
}
.lt thead tr {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}
.lt th {
  padding: 12px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.lt td {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.lt tbody tr {
  transition: background-color 0.15s ease;
}
.lt tbody tr:hover {
  background: #f8fafc;
}

/* Form Groups (fg) - Universal Precision */
.fg {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}
.fg label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.fg input, .fg select, .fg textarea, select, select.sel {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.fg input[type="radio"],
.fg input[type="checkbox"] {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  accent-color: var(--brand-darker);
}

select, .fg select, select.sel {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  padding: 12px 42px 12px 16px !important;
  font-size: 14.5px !important;
  cursor: pointer;
  border-radius: var(--radius-md);
  min-height: 46px;
}

.fg input:hover, .fg select:hover, .fg textarea:hover, select:hover, select.sel:hover {
  border-color: #cbd5e1;
}

.fg input:focus, .fg select:focus, .fg textarea:focus, select:focus, select.sel:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(165, 212, 32, 0.25);
  background-color: #ffffff !important;
}

/* ==========================================================================
   STUDYFINER ULTRA-PREMIUM CUSTOM DROPDOWN (Soft Rounded, Fluid Hover)
   ========================================================================== */
/* ==========================================================================
   GLOBAL DROPDOWN & FILTER BOX ELEVATION (Never clip or go under cards)
   ========================================================================== */
.courses-filter-box,
.filter-card,
.raw-lead-filter-bar,
.fbar,
.filter-col,
.ledger:has(.sf-select-wrap),
.ledger:has(select),
.ledger:has(form),
.has-open-dropdown {
  position: relative !important;
  z-index: 850 !important;
  overflow: visible !important;
}

.has-open-dropdown {
  z-index: 9999 !important;
  overflow: visible !important;
}

.sf-select-wrap {
  position: relative;
  width: 100%;
  user-select: none;
  z-index: 1;
}
.sf-select-trigger {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--dark-950);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.18s ease;
  min-height: 46px;
}
.sf-select-trigger:hover {
  border-color: #cbd5e1;
}
.sf-select-wrap.open {
  z-index: 99999 !important;
}
.sf-select-wrap.open .sf-select-trigger {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3.5px rgba(165, 212, 32, 0.25);
}
.sf-select-arrow {
  font-size: 22px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  pointer-events: none;
}
.sf-select-wrap.open .sf-select-arrow {
  transform: rotate(180deg);
  color: var(--brand-darker);
}

.sf-select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22), 0 3px 10px rgba(15, 23, 42, 0.08);
  padding: 8px;
  z-index: 999999 !important;
  max-height: min(340px, calc(100vh - 130px));
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out, visibility 0.18s ease-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sf-select-wrap.open .sf-select-dropdown,
.sf-select-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Searchable filter container & inputs */
.sf-select-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.sf-select-search-wrap:focus-within {
  border-color: var(--brand-dark);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.22);
}
.sf-select-search-wrap .sf-select-search-icon {
  font-size: 18px;
  color: #94a3b8;
  flex-shrink: 0;
  pointer-events: none;
}
.sf-select-search-input {
  width: 100%;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  font-size: 13px !important;
  color: var(--dark-950) !important;
  outline: none !important;
  box-shadow: none !important;
}
.sf-select-search-input::placeholder {
  color: #94a3b8;
}
.sf-select-search-clear {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  margin: 0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.12s ease;
}
.sf-select-search-clear:hover {
  color: #ef4444;
  background: #fee2e2;
}

.sf-select-options-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
}

.sf-select-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Fixed-position mode: dropdown detached from flow at trigger coords so no
   ancestor card, grid, or overflow rule can ever clip or cover it */
.sf-select-fixed {
  position: fixed !important;
  z-index: 1000000 !important;
}

.sf-select-wrap.drop-up .sf-select-dropdown {
  top: auto;
  bottom: calc(100% + 8px);
  box-shadow: 0 -16px 38px rgba(15, 23, 42, 0.22), 0 -3px 10px rgba(15, 23, 42, 0.08);
  transform: translateY(8px);
}
.sf-select-wrap.drop-up.open .sf-select-dropdown,
.sf-select-dropdown.is-open.drop-up {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sf-select-option {
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--dark-950);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
  line-height: 1.4;
  flex-shrink: 0;
}
.sf-select-option:hover,
.sf-select-option.highlighted {
  background: #f4fae5;
  color: #2d4a00;
  font-weight: 600;
  transform: translateX(3px);
}
.sf-select-option.selected {
  background: #e7f5cc;
  color: #2d4a00;
  font-weight: 700;
}
.sf-select-option.selected::after {
  content: "✓";
  font-size: 15px;
  color: var(--brand-darker);
  font-weight: 800;
  flex-shrink: 0;
}
.fg textarea {
  resize: vertical;
}

/* Buttons */
.btn-p {
  background: var(--dark-950);
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn-p:hover {
  background: #1e293b;
}

.btn-lime {
  background: var(--brand-primary);
  color: #0f172a !important;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  padding: 9px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.btn-lime:hover {
  background: #b2e026;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(165, 212, 32, 0.35);
}

.btn-s {
  background: #ffffff;
  color: var(--dark-950);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
  text-decoration: none;
}
.btn-s:hover {
  background: var(--border-subtle);
  border-color: #cbd5e1;
}

/* Filter Bar */
.fbar {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
  align-items: center;
}
.fbar-search {
  position: relative;
  flex: 1;
}
.fbar-search .material-symbols-outlined {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}
.fbar-search input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 14px 8px 38px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}
.fbar-search input:focus {
  border-color: var(--brand-dark);
  background: #ffffff;
}

/* Pagination Footer & Custom Nav Controls */
.pagi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 12px;
}

/* Pagination container */
.pagi-foot nav, .pagi nav {
  display: flex;
  align-items: center;
}

/* Fix huge raw SVGs from default pagination */
.pagi-foot svg, .pagi svg, nav[role="navigation"] svg {
  width: 14px !important;
  height: 14px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Clean Pill Pagination List */
ul.pagination, .pagination {
  display: inline-flex !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 6px !important;
  align-items: center !important;
}

.page-item, li.page-item {
  display: inline-flex !important;
}

.page-link, .page-item .page-link, a.page-link, span.page-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 32px !important;
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}

.page-link:hover, .page-item:not(.active):not(.disabled) .page-link:hover {
  background: var(--border-subtle) !important;
  color: var(--dark-950) !important;
  border-color: #cbd5e1 !important;
}

.page-item.active .page-link, .page-item.active span.page-link {
  background: var(--dark-950) !important;
  color: #ffffff !important;
  border-color: var(--dark-950) !important;
  font-weight: 700 !important;
}

.page-item.disabled .page-link, .page-item.disabled span.page-link {
  color: var(--text-muted) !important;
  background: #f8fafc !important;
  border-color: var(--border-light) !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

/* Hide redundant duplicate pagination text */
nav[role="navigation"] > div:first-child:not(:only-child) {
  display: none !important;
}

/* ==========================================================================
   UNIVERSITY DIRECTORY CARDS (High UX Responsive Grid)
   ========================================================================== */
.uni-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1024px) {
  .uni-card-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .uni-card-container {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .uni-main-card,
  .uni-card {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   STUDYFINER EXACT UNIVERSITY CARDS (MATCHING LIVE SITE)
   ========================================================================== */
.uni-main-card,
.uni-card,
.dash-kpi-card,
.lead-card,
.kcard,
.partner-card {
  position: relative;
  z-index: 1;
}

.uni-main-card {
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease;
  position: relative;
  z-index: 1;
}
.uni-main-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand-primary);
  box-shadow: 0 16px 36px -6px rgba(165, 212, 32, 0.22), 0 4px 14px -2px rgba(0, 0, 0, 0.05);
  z-index: 5;
}

.uni-logo-box {
  width: 100%;
  height: 140px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.6);
}
.uni-main-card:hover .uni-logo-box {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.uni-logo-img {
  max-width: 86%;
  max-height: 76px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.uni-main-card:hover .uni-logo-img {
  transform: scale(1.05);
}

.uni-fallback-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #15803d;
  letter-spacing: 0.02em;
}

.uni-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 8px;
}

.uni-country-badge {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 3.5px 12px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
}

.uni-rank-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 3.5px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.uni-rank-badge .trophy-icon {
  font-size: 13.5px;
  color: var(--brand-darker);
  display: inline-flex;
  align-items: center;
}

.uni-main-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 14px;
  margin-bottom: 6px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  transition: color 0.2s ease;
}
.uni-main-card:hover .uni-main-title {
  color: var(--brand-darker);
}

.uni-location-row {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 400;
}
.uni-location-row .loc-pin {
  font-size: 16px;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
}

/* Key Metrics Row inside University Card */
.uni-card-specs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding: 10px 8px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  text-align: center;
}
.uni-spec-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.uni-spec-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.uni-spec-val-sm {
  font-size: 13px;
  font-weight: 800;
  color: var(--dark-950);
}
.uni-spec-val-sm.highlight {
  color: var(--brand-darker);
}

.uni-intakes-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px dashed var(--border-medium);
  border-radius: 10px;
  font-size: 12px;
}
.uni-intakes-lbl {
  font-weight: 800;
  font-size: 9.5px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.uni-intakes-val {
  font-weight: 700;
  color: var(--brand-darker);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.uni-card-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #edf2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.uni-foot-count {
  color: #64748b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.uni-foot-action {
  color: var(--brand-darker);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}
.uni-main-card:hover .uni-foot-action {
  transform: translateX(3px);
}

/* Course Card Badges & Thumbnail */
.course-degree-badge {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3.5px 10px;
  border-radius: 8px;
  letter-spacing: 0.03em;
}
.course-level-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.course-level-pill.level-postgrad {
  color: #2d4a00;
  background: #e7f5cc;
  border: 1px solid #d1ed99;
}
.course-level-pill.level-undergrad {
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}
.course-level-pill.level-foundation {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.course-uni-thumb {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #edf2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  text-decoration: none;
}
.course-uni-thumb:hover {
  transform: scale(1.08);
  border-color: var(--brand-primary);
  box-shadow: 0 4px 14px rgba(165, 212, 32, 0.25);
}
.course-uni-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.course-uni-fallback {
  width: 100%;
  height: 100%;
  background: #f4fae5;
  color: #2d4a00;
  font-size: 12.5px;
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.course-uni-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.course-uni-fallback {
  width: 100%;
  height: 100%;
  background: #ecfdf5;
  color: #15803d;
  font-size: 12.5px;
  font-weight: 800;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

/* Course Bulk Selection Floating Action Bar */
.course-bulk-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 40px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
.course-bulk-bar.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.course-bulk-btn {
  background: var(--brand-primary);
  color: #1a3300;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.course-bulk-btn:hover {
  background: var(--brand-light);
}
.course-bulk-btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.course-bulk-btn-danger:hover {
  background: #b91c1c;
}
.course-uni-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.course-uni-fallback {
  width: 100%;
  height: 100%;
  background: #ecfdf5;
  color: #15803d;
  font-size: 12.5px;
  font-weight: 800;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

/* General / Existing Uni Card Styles */
.uni-card {
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease;
}
.uni-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: 0 16px 36px -6px rgba(165, 212, 32, 0.2), 0 4px 14px -2px rgba(0, 0, 0, 0.04);
}

.uni-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.uni-card-flag-badge {
  width: 48px;
  height: 48px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.uni-card-title-group {
  flex: 1;
  min-width: 0;
}
.uni-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-950);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uni-card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12.5px;
}
.uni-loc-icon {
  font-size: 16px;
  color: var(--brand-dark);
}

.uni-card-metrics {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.uni-metric-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.uni-metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.uni-metric-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark-950);
}
.uni-metric-val.highlight {
  color: var(--brand-darker);
}
.uni-metric-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
  margin: 0 12px;
}

.uni-card-specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0;
}
.uni-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.uni-spec-key {
  color: var(--text-secondary);
  font-weight: 500;
}
.uni-spec-val {
  font-weight: 700;
  color: var(--dark-950);
}
.uni-intake-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.uni-intake-pill {
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.uni-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   KANBAN BOARD & CARDS
   ========================================================================== */
.kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto !important;
  overflow-y: hidden;
  padding-bottom: 18px;
  min-height: 540px;
  scroll-behavior: smooth;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}
.kanban.is-panning {
  cursor: grabbing !important;
  user-select: none !important;
}
.kcol {
  min-width: 290px;
  width: 290px;
  flex-shrink: 0;
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--border-light);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.kcol.drag-over {
  background: #e2e8f0;
  border-color: var(--brand-darker) !important;
  box-shadow: 0 0 0 2px rgba(175, 248, 52, 0.45) !important;
}
.kcol.drag-over .kcards {
  background: rgba(175, 248, 52, 0.04);
}
.kcol-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}
.kcol-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--dark-950);
}
.kcol-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-dark);
}
.kcol-count {
  font-size: 11px;
  font-weight: 700;
  background: #ffffff;
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}
.kcol-add {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.kcards {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kcard {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}
.kcard:active {
  cursor: grabbing;
}
.kcard.is-dragging {
  opacity: 0.4 !important;
  transform: scale(0.98) !important;
  transition: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12) !important;
  border: 1.5px dashed var(--brand-darker) !important;
}
.kcard:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.kcard:hover .kcard-name {
  color: var(--brand-darker);
}
.kcard-menu {
  position: absolute;
  top: 10px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.kcard-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark-950);
  margin-bottom: 2px;
  padding-right: 20px;
}
.kcard-course {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.kcard-uni {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.kcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 4px;
}
.kcard-counselor {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-darker);
}
.kcard-acts button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
}

/* Context Menu (Hidden by default) */
.ctx {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 100;
  min-width: 160px;
  display: none;
}
.ctx.open {
  display: block;
}
.ctx button {
  width: 100%;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctx button:hover {
  background: #f1f5f9;
}
.ctx button.danger {
  color: #ef4444;
}
.ctx-sep {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* Modals */
.modal-ov {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-ov.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex !important;
}
.modal-box {
  background: #ffffff;
  width: 760px;
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border-light);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}
.modal-box > form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
  overflow: hidden;
  margin: 0;
}
.modal-box > form > .modal-body,
.modal-box > .modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-box > form > .modal-foot,
.modal-box > .modal-foot {
  flex-shrink: 0;
  margin-top: auto;
}
.modal-ov.open .modal-box {
  transform: translateY(0) scale(1);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}
.modal-head h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-950);
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s ease;
}
.modal-close:hover {
  background: var(--border-light);
  color: var(--dark-950);
}
.modal-body {
  padding: 24px 28px;
  overflow: visible;
}
.modal-body.has-scroll {
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: visible;
}
/* Modal scrollbars: keep scroll functionality but hide the visible scrollbar
   (the modal is drag/scroll/wheel navigable; the bar itself is visual noise). */
.modal-box {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legacy */
}
.modal-box::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* Chrome/Safari/Edge */
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
  border-radius: 0 0 20px 20px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Notification Badge & Panel */
.nf-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px #ffffff;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}
.nf-badge.hidden {
  display: none !important;
}
.nf-panel {
  width: 380px;
  max-width: min(380px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 45px -8px rgba(15, 23, 42, 0.22), 0 6px 16px -2px rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nf-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.nf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.nf-mark-read-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: #6e9315;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.nf-mark-read-btn:hover {
  text-decoration: underline;
  background: rgba(110, 147, 21, 0.08);
}
.nf-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}
.nf-tab {
  flex: 1;
  padding: 11px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-secondary);
}
.nf-tab.active {
  color: var(--dark-950);
  border-bottom: 2px solid var(--brand-darker);
}
.nf-list {
  max-height: 340px;
  overflow-y: auto;
}
.nf-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}
.nf-item:hover {
  background: #f1f5f9;
}
.nf-item.unread {
  background: #f0fdf4;
  border-left: 3px solid #a5d420;
}
.nf-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}
.nf-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.nf-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
}
.nf-footer button {
  font-size: 11px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.nf-footer button:hover {
  color: var(--dark-950);
}

/* Toast Notification System */
#toast-c {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto;
  background: #0f172a;
  color: #ffffff;
  padding: 13px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.toast-success {
  border-left: 4px solid #84cc16;
}
.toast.toast-success .toast-icon {
  color: #84cc16;
}
.toast.toast-error {
  border-left: 4px solid #ef4444;
}
.toast.toast-error .toast-icon {
  color: #ef4444;
}
.toast.toast-info {
  border-left: 4px solid #38bdf8;
}
.toast.toast-info .toast-icon {
  color: #38bdf8;
}
.toast-body {
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}
.toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s;
}
.toast-close:hover {
  color: #ffffff;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.toast-notif {
  border-left: 4px solid #1a73e8;
  background: #0f172a;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease;
}
.toast.toast-notif:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.4), 0 8px 12px -4px rgba(0, 0, 0, 0.25);
}

@keyframes notifPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}
.nf-badge-pulse {
  animation: notifPulse 2.5s infinite ease-in-out;
}

/* ==========================================================================
   WHATSAPP-STYLE MODERN CHAT BUBBLE & THREAD SYSTEM
   ========================================================================== */
.msg-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: calc(100vh - 120px);
  min-height: 550px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
}

.msg-layout.single-col {
  grid-template-columns: 1fr !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 980px;
  margin: 0 auto;
}
.msg-layout.single-col .msg-chat {
  width: 100% !important;
  flex: 1 !important;
}

.msg-list {
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  background: #ffffff;
}
.msg-list-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
}
.msg-list-body {
  flex: 1;
  overflow-y: auto;
}
.msg-thread {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}
.msg-thread:hover {
  background: #f8fafc;
}
.msg-thread.active {
  background: var(--brand-50);
  border-left: 3px solid var(--brand-darker);
}

.msg-chat {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  height: 100%;
  position: relative;
}
.msg-chat-head {
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.msg-chat-body, #inline-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

/* Center Date Dividers like WhatsApp */
.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0 10px;
  width: 100%;
}
.chat-date-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* WhatsApp Style Message Bubble Container */
.msg-bubble {
  display: flex;
  width: 100%;
  margin-bottom: 2px;
}
.msg-bubble.left {
  justify-content: flex-start;
}
.msg-bubble.right {
  justify-content: flex-end;
}

.msg-bubble > div {
  max-width: 72%;
  min-width: 110px;
}

/* Bubble Content Box */
.msg-content {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 18px 18px 18px 4px;
  padding: 9px 14px 7px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
  position: relative;
  word-wrap: break-word;
}
.msg-content.sent {
  background: #e7f5cc;
  color: #1a1c16;
  border: 1px solid #d1ed99;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 6px rgba(101, 163, 13, 0.12);
}

/* Sender Name Header */
.msg-sender {
  font-size: 11px;
  font-weight: 700;
  color: #4d7c0f;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Message Body & Inline Time on the Right (WhatsApp Style) */
.msg-inner-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.msg-text {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
  flex: 1;
  word-break: break-word;
}
.msg-content:not(.sent) .msg-text {
  color: #0f172a !important;
}
.msg-content.sent .msg-text {
  color: #1a1c16 !important;
}

.msg-time {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  margin-bottom: -1px;
  font-family: 'JetBrains Mono', monospace;
}
.msg-content.sent .msg-time {
  color: #65a30d;
}

.msg-attachment {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 8px 12px;
}
.msg-content.sent .msg-attachment {
  background: rgba(101, 163, 13, 0.1);
  border-color: rgba(101, 163, 13, 0.2);
}

@media (max-width: 840px) {
  .msg-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 140px);
  }
  .msg-list {
    display: none;
  }
}

/* Mobile Responsiveness */
.mobile-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .sb {
    transform: translateX(-100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  }
  .sb.open {
    transform: translateX(0);
  }
  .sb-overlay.open {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .mw {
    margin-left: 0;
  }
  .mobile-menu {
    display: block;
    color: var(--dark-950);
  }
  .settings-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-chart-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   STUDENT PROFILE TABS & CARDS DESIGN SYSTEM
   ========================================================================== */
.stu-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-bottom: 22px;
  overflow-x: auto;
}
.stu-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}
.stu-tab-btn:hover {
  color: var(--dark-950);
  background: #f1f5f9;
}
.stu-tab-btn.active {
  color: #ffffff;
  background: var(--dark-950);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}
.stu-tab-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: var(--text-secondary);
  line-height: 1;
}
.stu-tab-btn.active .stu-tab-badge {
  background: var(--brand-primary);
  color: #172554;
}

/* Student Profile Cards */
.stu-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  padding: 20px 22px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.stu-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.stu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.stu-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #334155;
  margin: 0;
}
.stu-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
}
.stu-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 9999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.stu-prop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.stu-prop-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.stu-prop-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}
.stu-doc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.stu-doc-box:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.stu-action-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.stu-action-icon-btn:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}
.stu-action-btn-sm {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.stu-action-btn-sm:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* ==========================================================================
   CHAT MESSAGING & WHATSAPP-STYLE TICKS & TYPING SYSTEM
   ========================================================================== */
.msg-tick-icon {
  vertical-align: middle;
  transition: color 0.2s ease;
}
.msg-tick-icon[data-status="seen"] {
  color: #0284c7 !important;
}
.msg-tick-icon[data-status="delivered"],
.msg-tick-icon[data-status="sent"] {
  color: #94a3b8 !important;
}

/* Typing wave dots */
.typing-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 14px;
}
.typing-wave .dot {
  width: 4px;
  height: 4px;
  background: #64748b;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-wave .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-wave .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Chat Input Bar Component */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 6px 12px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-input-bar:focus-within {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 2px rgba(20, 23, 14, 0.08);
}
.chat-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.chat-attach-btn:hover {
  background: #e2e8f0;
  color: var(--dark-950);
}
.chat-input-field {
  flex: 1;
  min-width: 0;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: var(--dark-950);
  padding: 4px 6px;
  max-height: 120px;
  line-height: 1.4;
  box-sizing: border-box;
}
.chat-input-field::placeholder {
  color: var(--text-muted);
}
.chat-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 20px;
  height: 36px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   GLOBAL COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 1024px) {
  .msg-layout {
    grid-template-columns: 280px 1fr;
  }

  /* Responsive Off-Canvas Sidebar Navigation */
  .sb {
    width: 270px !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    transform: translateX(-100%) !important;
    box-shadow: none !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease !important;
  }
  .sb.open {
    transform: translateX(0) !important;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.35) !important;
  }

  /* Main Wrapper expands to 100% full width */
  .mw {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }
  body.sb-collapsed .mw {
    margin-left: 0 !important;
  }

  /* Top bar responsiveness */
  .tb {
    padding: 0 16px !important;
  }

  /* Tables horizontal scrolling prevention */
  .ledger:has(.lt), .ledger:has(table) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}


@media (max-width: 768px) {
  /* Layout & Spacing */
  .ct, .page-content {
    padding: 12px 10px !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }
  .mw {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  /* Top Navigation Bar */
  .tb {
    padding: 0 10px !important;
    height: 54px !important;
    gap: 8px !important;
  }
  .tb-left {
    gap: 6px !important;
  }
  .tb-left .lc {
    font-size: 12.5px !important;
    letter-spacing: 0.05em !important;
  }
  .tb-right {
    gap: 6px !important;
  }
  .tb-user-badge {
    padding: 3px 8px !important;
    gap: 6px !important;
  }

  /* Chat Thread & Messaging */
  .msg-layout {
    display: flex !important;
    flex-direction: column !important;
    border-radius: 12px !important;
    height: calc(100vh - 78px) !important;
    max-height: calc(100vh - 78px) !important;
  }
  .msg-list {
    display: none !important;
  }
  .msg-chat {
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px !important;
  }
  .msg-chat-head {
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .msg-chat-head h2 {
    font-size: 14px !important;
  }
  .msg-chat-body {
    padding: 10px 10px !important;
  }
  .msg-bubble {
    max-width: 88% !important;
  }
  .msg-compose {
    padding: 8px 10px !important;
  }
  .chat-input-bar {
    padding: 4px 8px !important;
    gap: 6px !important;
    border-radius: 20px !important;
  }
  .chat-input-field {
    font-size: 13px !important;
  }
  .chat-send-btn {
    height: 34px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  /* Student Show & Tabs */
  .stu-tabs-bar {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    gap: 6px !important;
  }
  .stu-tab-btn {
    padding: 7px 12px !important;
    font-size: 12px !important;
  }
  .dash-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .stu-card {
    padding: 14px !important;
  }

  /* Tables & Ledger Scrolling */
  .tb-wrap, .tbl-wrap, .ledger:has(.lt), .ledger:has(table) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
    max-width: 100% !important;
  }
  .lt, .tbl {
    min-width: 580px !important;
  }
  .tbl th, .tbl td, .lt th, .lt td {
    padding: 10px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }

  /* Courses Filter Box on Mobile */
  .courses-filter-box {
    padding: 14px 14px !important;
  }
  .courses-filter-box form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .courses-filter-box .fbar-search,
  .courses-filter-box .filter-col {
    width: 100% !important;
    min-width: 100% !important;
    flex: none !important;
  }

  /* Course Bulk Bar on Mobile */
  .course-bulk-bar {
    width: 94vw !important;
    max-width: 94vw !important;
    bottom: 16px !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  /* 2-column detail grids collapse to 1 column */
  .dash-kpi-grid,
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1.2fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Modals */
  .modal-box {
    width: 96vw !important;
    max-width: 96vw !important;
    margin: 8px auto !important;
    border-radius: 16px !important;
    max-height: 94vh !important;
    overflow-y: auto !important;
  }
  .modal-head {
    padding: 14px 18px !important;
  }
  .modal-head h3 {
    font-size: 16px !important;
  }
  .modal-body {
    padding: 16px 18px !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
  }
  .modal-foot {
    padding: 12px 18px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .modal-foot button {
    flex: 1 1 auto !important;
  }

  /* Cards & Forms */
  .ledger-head {
    padding: 12px 14px !important;
  }
  .ledger-body {
    padding: 14px !important;
  }
}

@media (max-width: 640px) {
  /* Modal inner 2-column grids collapse to 1-column on mobile */
  .modal-body div[style*="grid-template-columns:1fr 1fr"],
  .modal-body div[style*="grid-template-columns: 1fr 1fr"],
  .modal-body div[style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Filter bar inputs full width on mobile */
  .fbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .fbar-search {
    width: 100% !important;
    min-width: 100% !important;
  }
  .fbar select, .fbar button, .fbar a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Dash KPI Grid */
  .dash-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

@media (max-width: 768px) {
  .tb {
    padding: 0 16px !important;
  }
  .tb-user-pill {
    padding: 3px 8px !important;
  }
  .nf-panel {
    position: fixed !important;
    top: 68px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    transform-origin: top center !important;
  }
}

@media (max-width: 480px) {
  .tb {
    padding: 0 12px !important;
  }
  .tb-user-name {
    display: none !important;
  }
  .tb-role-pill {
    display: none !important;
  }
  .chat-send-label {
    display: none !important;
  }
  .chat-send-btn {
    padding: 0 10px !important;
    width: 36px !important;
  }
  .chat-attach-btn {
    width: 30px !important;
    height: 30px !important;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Universal Flatpickr Isolation Guard & Theme: Prevents unstyled calendars from appearing in page flow */
.flatpickr-calendar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.15), 0 6px 12px -2px rgba(15, 23, 42, 0.06) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  padding: 10px !important;
  width: 320px !important;
  box-sizing: border-box !important;
  z-index: 999999 !important;
}

.flatpickr-calendar:not(.open):not(.inline) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.flatpickr-calendar.open {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after {
  border-bottom-color: #ffffff !important;
}

.flatpickr-months {
  background: #f8fafc !important;
  border-radius: 8px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 4px !important;
  position: relative !important;
  border: 1px solid #f1f5f9 !important;
}

.flatpickr-months .flatpickr-month {
  height: 38px !important;
  color: #0f172a !important;
  fill: #0f172a !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.flatpickr-current-month {
  position: relative !important;
  left: auto !important;
  width: auto !important;
  height: 38px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  outline: none !important;
  border: none !important;
}

.flatpickr-current-month .cur-month {
  font-weight: 700 !important;
  color: #0f172a !important;
  outline: none !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.flatpickr-current-month .numInputWrapper {
  width: 58px !important;
  display: inline-flex !important;
  align-items: center !important;
  outline: none !important;
  border: none !important;
}

.flatpickr-current-month input.cur-year {
  font-weight: 700 !important;
  color: #0f172a !important;
  font-size: 13.5px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  outline: none !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  position: static !important;
  height: 28px !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  border-radius: 6px !important;
  padding: 0 !important;
  margin: 0 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #475569 !important;
  fill: #475569 !important;
  cursor: pointer !important;
  background: transparent !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  fill: #0f172a !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg,
.flatpickr-calendar .flatpickr-prev-month svg,
.flatpickr-calendar .flatpickr-next-month svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  box-sizing: content-box !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.flatpickr-weekdays {
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  border-bottom: 1px solid #f1f5f9 !important;
  margin: 6px 0 4px !important;
  padding: 0 !important;
}

.flatpickr-weekdaycontainer {
  display: flex !important;
  width: 100% !important;
}

span.flatpickr-weekday {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  flex: 1 !important;
}

.flatpickr-days {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}

.dayContainer {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-around !important;
  padding: 0 !important;
}

.flatpickr-day {
  max-width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  margin: 1px 0 !important;
  transition: all 0.12s ease !important;
}

.flatpickr-day:hover {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

.flatpickr-day.today {
  border-color: #6e9315 !important;
  font-weight: 700 !important;
  color: #49630c !important;
}

.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: #6e9315 !important;
  border-color: #6e9315 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  color: #cbd5e1 !important;
}

/* ==========================================================================
   PWA APP INSTALLATION STYLES (Android & iOS)
   ========================================================================== */
@media (min-width: 769px) {
  .pwa-install-banner,
  .pwa-install-pill,
  .pwa-guide-modal,
  #sb-install-app-btn {
    display: none !important;
  }
}

/* Clean App Install Button (Below Card / Footer) */
.pwa-install-clean-wrap {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid #f1f5f9 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px 0 0 0 !important;
  margin: 14px 0 0 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

.btn-install-app-clean {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 10px 18px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-decoration: none !important;
  width: 100% !important;
  max-width: 280px !important;
  box-sizing: border-box !important;
}

.btn-install-app-clean .material-symbols-outlined {
  color: #65a30d !important;
  font-size: 18px !important;
  transition: transform 0.2s ease !important;
}

.btn-install-app-clean:hover {
  background: #ffffff !important;
  border-color: #a5d420 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(165, 212, 32, 0.2) !important;
  transform: translateY(-1px) !important;
}

.btn-install-app-clean:active {
  transform: translateY(0) !important;
}

.pwa-install-banner {
  background: linear-gradient(135deg, #14170e 0%, #23271a 100%);
  border: 1px solid rgba(175, 248, 52, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  color: #ffffff;
}

.pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.pwa-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.pwa-banner-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #aff834;
  letter-spacing: -0.01em;
}

.pwa-banner-desc {
  font-size: 11.5px;
  color: #a1a1aa;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-btn {
  background: #aff834 !important;
  color: #14170e !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 12px rgba(175, 248, 52, 0.3) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.pwa-install-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(175, 248, 52, 0.4) !important;
}

/* Modal Bottom-Sheet Guide for iOS & Android */
.pwa-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: none;
}

.pwa-guide-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pwa-guide-sheet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  padding: 24px;
  box-sizing: border-box;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-guide-modal.open .pwa-guide-overlay {
  opacity: 1;
}

.pwa-guide-modal.open .pwa-guide-sheet {
  transform: translateX(-50%) translateY(0);
}

.pwa-guide-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.pwa-guide-close {
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-guide-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.pwa-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pwa-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #14170e;
  color: #aff834;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-step-txt {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  padding-top: 2px;
}

.pwa-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
  vertical-align: middle;
}

.pwa-guide-footer {
  padding-top: 8px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Responsive: Staff Internal Notes rows (students.show)
   The single-line "audit log" layout (note text + nowrap author/date meta
   side by side) collapses the note text to a ~1-character column on narrow
   screens because the meta block is white-space:nowrap + flex-shrink:0.
   Stack the meta under the note text on mobile instead.
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .staff-note-row {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 10px 12px !important;
  }
  /* Note text takes the full row width */
  .staff-note-row > div:first-child {
    flex: none !important;
    width: 100% !important;
  }
  /* Author / role / date meta wraps onto as many lines as it needs */
  .staff-note-row > div:last-child {
    flex-wrap: wrap !important;
    white-space: normal !important;
    row-gap: 3px !important;
    font-size: 11px !important;
  }
}
