/* AfterClassroom Admin Dashboard CSS
   Premium SaaS Style (Linear/Notion/Stripe Inspired) */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Portal Theme - matches student/parent/teacher portals (student_portal.css) */
  --bg-app: #ECE9FB;
  --bg-sidebar: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #F1EEFF;
  --bg-surface-active: #EDEBFF;

  --border-color: #ECEAF6;
  --border-color-focus: #A5A0DD;

  --text-main: #191536;
  --text-muted: #77748F;
  --text-on-accent: #ffffff;

  /* Portal Indigo Accent */
  --accent-color: #4F46E5;
  --accent-hover: #4038C7;
  --accent-light: #EDEBFF;
  --accent-badge: #7C6FF0;

  /* Pipeline & Status States (portal pastels) */
  --new-bg: #E3F0FE;
  --new-text: #1d4ed8;

  --called-bg: #FEF3D9;
  --called-text: #b45309;

  --trial-bg: #F1EEFF;
  --trial-text: #6D28D9;

  --won-bg: #E4F8EC;
  --won-text: #16A34A;

  --lost-bg: #FDEAEE;
  --lost-text: #E11D48;

  --neutral-badge-bg: #F1F0F7;
  --neutral-badge-text: #77748F;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Borders & Shadows (softer, rounder - portal style) */
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-lg: 22px;
  --shadow-sm: 0 3px 12px rgba(58, 48, 133, 0.06);
  --shadow-md: 0 6px 24px rgba(58, 48, 133, 0.08);
  --shadow-lg: 0 14px 40px rgba(58, 48, 133, 0.14);
  --shadow-slideover: -12px 0 40px -5px rgba(58, 48, 133, 0.18);
  
  /* Layout Sizing */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens */
body.dark-theme {
  --bg-app: #0b0f19;
  --bg-sidebar: #111827;
  --bg-surface: #1f2937;
  --bg-surface-hover: #374151;
  --bg-surface-active: #4b5563;
  --border-color: #374151;
  --border-color-focus: #4b5563;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-light: rgba(99, 102, 241, 0.15);
  --neutral-badge-bg: #374151;
  --neutral-badge-text: #d1d5db;
  
  --new-bg: rgba(30, 64, 175, 0.2);
  --new-text: #60a5fa;
  
  --called-bg: rgba(146, 64, 14, 0.2);
  --called-text: #fbbf24;
  
  --trial-bg: rgba(107, 33, 168, 0.2);
  --trial-text: #c084fc;
  
  --won-bg: rgba(22, 101, 52, 0.2);
  --won-text: #4ade80;
  
  --lost-bg: rgba(153, 27, 27, 0.2);
  --lost-text: #f87171;
}

/* Core Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100vh;
  width: 100%;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  transition: background-color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ------------------------------------------------------------- */
/* Layout Structure */
/* ------------------------------------------------------------- */

.app-container {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Left Sidebar styling */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-color), #818cf8);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--accent-light);
  color: var(--accent-color);
  font-weight: 600;
}

.nav-item span.material-symbols-outlined {
  font-size: 20px;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background-color: var(--border-color);
  color: var(--text-muted);
}

.nav-item.active .nav-badge {
  background-color: var(--accent-color);
  color: white;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Panel */
.main-panel {
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-width: 0;
  overflow: visible;
  max-width: calc(100% - var(--sidebar-width));
}

/* Top bar navigation */
.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
  max-width: 480px;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.global-search-input {
  width: 100%;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px 8px 38px;
  outline: none;
  transition: all var(--transition-fast);
}

.global-search-input:focus {
  border-color: var(--accent-color);
  background-color: var(--bg-sidebar);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Role Selector Dropdown */
.role-switcher-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--border-color);
  padding-right: 16px;
}

.role-switcher-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.role-switcher-select {
  border: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.role-switcher-select:focus {
  border-color: var(--accent-color);
}

/* Notifications Bell */
.notification-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.notification-bell:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

/* ------------------------------------------------------------- */
/* Content Windows / Views */
/* ------------------------------------------------------------- */

.view-container {
  flex-grow: 1;
  padding: 32px;
  display: none;
  min-height: calc(100vh - var(--topbar-height));
}

.view-container.active {
  display: flex;
  flex-direction: column;
}

/* Module Header standard structure */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.view-header-title h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.view-header-title p {
  color: var(--text-muted);
  font-size: 14px;
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-color);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
}

.btn-danger {
  background-color: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

.btn-danger:hover {
  background-color: rgba(185, 28, 28, 0.15);
}

.btn-icon-only {
  padding: 8px;
  border-radius: var(--border-radius-sm);
}

/* Empty State Styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  background-color: var(--bg-sidebar);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius);
  text-align: center;
  max-width: 480px;
  margin: 32px auto;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* ------------------------------------------------------------- */
/* MODULE 1: CRM Lead pipeline (Kanban) */
/* ------------------------------------------------------------- */

/* KPI Ribbon */
.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-app);
  color: var(--accent-color);
}

.kpi-card:nth-child(2) .kpi-icon-wrap { background-color: var(--new-bg); color: var(--new-text); }
.kpi-card:nth-child(3) .kpi-icon-wrap { background-color: var(--trial-bg); color: var(--trial-text); }
.kpi-card:nth-child(4) .kpi-icon-wrap { background-color: var(--won-bg); color: var(--won-text); }

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
}

/* CRM Filters toolbar */
.crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 16px;
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-select {
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  outline: none;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--accent-color);
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-app);
  padding: 2px;
}

.view-toggle-btn {
  border: none;
  background: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-toggle-btn.active {
  background-color: var(--bg-sidebar);
  color: var(--accent-color);
  box-shadow: var(--shadow-sm);
}

/* Kanban Board Container */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  flex-grow: 1;
  align-items: flex-start;
  min-height: 500px;
}

.kanban-column {
  flex-shrink: 0;
  width: 280px;
  background-color: var(--bg-app);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 350px);
}

.kanban-column-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.column-badge {
  font-size: 11px;
  padding: 2px 6px;
  background-color: var(--border-color);
  color: var(--text-muted);
  border-radius: 10px;
  font-weight: 600;
}

/* Stage-specific headers */
.kanban-column:nth-child(1) .column-badge { background-color: var(--new-bg); color: var(--new-text); }
.kanban-column:nth-child(2) .column-badge { background-color: #f1f5f9; color: #475569; }
.kanban-column:nth-child(3) .column-badge { background-color: var(--called-bg); color: var(--called-text); }
.kanban-column:nth-child(4) .column-badge { background-color: var(--trial-bg); color: var(--trial-text); }
.kanban-column:nth-child(5) .column-badge { background-color: var(--trial-bg); color: var(--trial-text); }
.kanban-column:nth-child(6) .column-badge { background-color: var(--won-bg); color: var(--won-text); }
.kanban-column:nth-child(7) .column-badge { background-color: var(--lost-bg); color: var(--lost-text); }

.kanban-cards-wrapper {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
  min-height: 100px;
}

/* Kanban Cards styling */
.lead-card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-badge);
}

.lead-card:active {
  cursor: grabbing;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title {
  font-weight: 700;
  font-size: 13.5px;
}

.flag-icon {
  font-size: 14px;
  border-radius: 2px;
}

.card-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-curriculum {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.badge-subject {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

.badge-source {
  background-color: #f1f5f9;
  color: #475569;
  font-style: italic;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 11.5px;
  color: var(--text-muted);
}

.card-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-time span.material-symbols-outlined {
  font-size: 14px;
}

/* Card Hover actions shortcut */
.card-actions-hover {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  display: none;
  align-items: center;
  box-shadow: var(--shadow-md);
  padding: 2px;
}

.lead-card:hover .card-actions-hover {
  display: flex;
}

.card-action-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 3px;
  transition: all var(--transition-fast);
}

.card-action-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--accent-color);
}

/* Slide-over details panel style */
.slideover-panel {
  position: fixed;
  top: 0;
  right: -460px; /* Hidden initially */
  width: 460px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-slideover);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slideover-panel.open {
  right: 0;
}

.slideover-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slideover-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.slideover-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.info-val {
  font-weight: 600;
}

/* Timeline Activity */
.timeline-activity {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 16px;
  margin-left: 8px;
}

.timeline-activity::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
  border: 2px solid var(--bg-sidebar);
}

.timeline-item.important-log .timeline-dot {
  background-color: var(--accent-color);
}

.timeline-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-text {
  background-color: var(--bg-app);
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  border: 1px solid var(--border-color);
}

/* ------------------------------------------------------------- */
/* MODULE 2: Student profiles & learning data */
/* ------------------------------------------------------------- */

/* Standard Table view styles */
.data-table-wrapper {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

#class-logs-table {
  table-layout: fixed;
}

#class-logs-table th,
#class-logs-table td {
  overflow-wrap: anywhere;
}

.data-table th, .data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-app);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

.student-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
}

.credits-meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credits-bar {
  flex-grow: 1;
  max-width: 100px;
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.credits-progress {
  height: 100%;
  background-color: var(--accent-color);
  border-radius: 3px;
}

.credits-progress.low {
  background-color: var(--lost-text);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.status-pill.active {
  background-color: var(--won-bg);
  color: var(--won-text);
}

.status-pill.inactive {
  background-color: #f1f5f9;
  color: #64748b;
}

.status-pill.critical {
  background-color: var(--lost-bg);
  color: var(--lost-text);
}

.status-pill.warning {
  background-color: var(--called-bg);
  color: var(--called-text);
}

.status-pill.settled {
  background-color: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
}

/* Student Detail view screen */
.student-profile-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}

.profile-card-sidebar {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), #818cf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  border: 4px solid var(--bg-app);
  box-shadow: var(--shadow-md);
}

.profile-sidebar-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-sidebar-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.profile-sidebar-stats {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: 16px;
  gap: 8px;
}

.sidebar-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-stat-val {
  font-size: 18px;
  font-weight: 700;
}

.sidebar-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.share-link-wrapper {
  margin-top: 24px;
  width: 100%;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  text-align: left;
}

.share-link-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.share-link-input-group {
  display: flex;
  gap: 6px;
}

.share-link-input {
  flex-grow: 1;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: monospace;
  outline: none;
  min-width: 0;
}

/* Learning profile section */
.learning-profile-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-section-card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.profile-section-card h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.weak-areas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.weak-area-tag {
  background-color: var(--lost-bg);
  color: var(--lost-text);
  border: 1px solid var(--lost-border);
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 600;
}

/* Tiny quiz chart mock */
.quiz-trend-chart-wrapper {
  height: 160px;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 20px 10px 0;
  border-left: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 12px;
}

.chart-bar-col {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 8px;
}

.chart-bar {
  width: 100%;
  max-width: 44px;
  background-color: var(--accent-badge);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  position: relative;
  min-height: 20px;
}

.chart-bar:hover {
  background-color: var(--accent-color);
}

.chart-bar-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
}

.chart-bar-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------- */
/* MODULE 3: Class scheduling & credits */
/* ------------------------------------------------------------- */

/* Calendar schedule weekly grids */
.schedule-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.week-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--border-radius);
  font-weight: 600;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.calendar-day-col {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.day-col-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  background-color: var(--bg-app);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.day-col-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.day-col-date {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
}

.day-col-header.today {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

.day-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

/* Calendar Card Slots styling */
.class-slot-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px;
  font-size: 12px;
  position: relative;
  transition: all var(--transition-fast);
}

.class-slot-card:hover {
  border-color: var(--accent-color);
  background-color: var(--accent-light);
}

.class-slot-card.attended {
  border-left: 3px solid var(--won-text);
  background-color: var(--won-bg);
}

.class-slot-card.absent {
  border-left: 3px solid var(--lost-text);
  background-color: var(--lost-bg);
}

.class-slot-card.scheduled {
  border-left: 3px solid var(--accent-color);
}

.slot-time {
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.slot-student {
  font-weight: 700;
}

.slot-teacher {
  font-style: italic;
  color: var(--text-muted);
  margin-top: 2px;
}

.slot-zoom {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-color);
  font-weight: 600;
}

.slot-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 4px;
}

.class-slot-card:hover .slot-actions {
  display: flex;
}

.attendance-btn {
  border: none;
  background-color: var(--bg-sidebar);
  color: var(--text-muted);
  padding: 2px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.attendance-btn:hover {
  background-color: var(--accent-color);
  color: white;
}

/* ------------------------------------------------------------- */
/* MODULE 4: Teacher management */
/* ------------------------------------------------------------- */

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.teacher-card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.teacher-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.teacher-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.teacher-card-title {
  display: flex;
  flex-direction: column;
}

.teacher-card-name {
  font-weight: 700;
  font-size: 15px;
}

.teacher-card-specialties {
  font-size: 12px;
  color: var(--text-muted);
}

.teacher-load-meter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teacher-load-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.teacher-load-bar {
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.teacher-load-progress {
  height: 100%;
  background-color: #f59e0b;
  border-radius: 3px;
}

/* Mobile Simulation view */
.mobile-sim-container {
  display: flex;
  justify-content: center;
  padding: 32px 0;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.mobile-phone-frame {
  width: 360px;
  height: 640px;
  background-color: #000000;
  border-radius: 36px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.mobile-phone-screen {
  background-color: #ffffff;
  width: 100%;
  height: 100%;
  border-radius: 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  color: #334155;
}

.mobile-app-header {
  background: linear-gradient(135deg, var(--accent-color), #818cf8);
  color: white;
  padding: 20px 16px;
  text-align: center;
  border-radius: 26px 26px 0 0;
}

.mobile-app-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.mobile-app-header p {
  font-size: 11px;
  opacity: 0.8;
}

.mobile-app-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.mobile-input {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  outline: none;
  font-size: 13px;
}

.mobile-input:focus {
  border-color: var(--accent-color);
}

/* ------------------------------------------------------------- */
/* Cross-Cutting Components */
/* ------------------------------------------------------------- */

/* Standard Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-content.student-profile-modal {
  max-width: 620px;
  max-height: calc(100vh - 48px);
}

.modal-content.import-logs-modal {
  max-width: 960px;
  max-height: calc(100vh - 48px);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.student-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}

.student-search-dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.student-search-dropdown-item:hover {
  background-color: var(--bg-surface-hover);
}

.student-profile-modal .modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 178px);
  padding: 24px 28px;
}

.import-logs-modal .modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 178px);
  padding: 22px 28px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--bg-app);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  outline: none;
  font-size: 13.5px;
  background-color: var(--bg-sidebar);
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-color);
}

.subject-teacher-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subject-teacher-row {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  background-color: var(--bg-app);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.subject-teacher-row .form-group {
  gap: 5px;
}

.subject-teacher-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.subject-rate-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.import-logs-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.import-logs-help {
  font-size: 12px;
  color: var(--text-muted);
}

.import-logs-grid {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: auto;
  background-color: var(--bg-sidebar);
}

.import-log-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.import-log-table th,
.import-log-table td {
  border-bottom: 1px solid var(--border-color);
  padding: 8px;
  vertical-align: top;
}

.import-log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--bg-app);
  color: var(--text-muted);
  font-size: 12px;
  text-align: left;
}

.import-log-table .form-input {
  width: 100%;
  min-width: 0;
  background-color: var(--bg-sidebar);
}

.import-log-table .import-date { min-width: 110px; }
.import-log-table .import-hours { min-width: 64px; }
.import-log-table .import-topic { min-width: 260px; }

.import-log-table .import-row-note {
  color: var(--called-text);
  font-size: 12px;
  min-width: 130px;
}

.import-log-table tr.has-warning {
  background-color: var(--called-bg);
}

@media (max-width: 720px) {
  .modal-content.student-profile-modal {
    max-width: 100%;
  }

  .subject-teacher-row,
  .subject-rate-grid {
    grid-template-columns: 1fr;
  }
}

/* Skeleton Loading styles */
.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.skeleton-item {
  height: 20px;
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-surface-hover) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Role-based CSS filters:
   Admin Dashboard blocks elements with the class 'founder-only' if the current role is 'ops'. */
body.role-ops .founder-only {
  display: none !important;
}

body.role-ops .founder-only-readonly {
  pointer-events: none !important;
  opacity: 0.6;
}

/* ------------------------------------------------------------- */
/* Component Library & Nav Map Showcase Styling */
/* ------------------------------------------------------------- */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.docs-card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.docs-card h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.color-swatch-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.color-swatch-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-swatch-box {
  height: 60px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.color-swatch-lbl {
  font-size: 11px;
  font-weight: 700;
}

.color-swatch-hex {
  font-size: 10px;
  color: var(--text-muted);
}

/* Navigation flow layout */
.nav-flow-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-app);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.flow-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.flow-step-details {
  display: flex;
  flex-direction: column;
}

.flow-step-title {
  font-weight: 700;
}

.flow-step-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------- */
/* AI Insights (Zoom sync + OpenAI 2nd Brain) - UI preview block */
/* ------------------------------------------------------------- */

.modal-content.ai-insight-modal {
  max-width: 560px;
  max-height: calc(100vh - 48px);
}

.ai-insight-modal .modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 178px);
}

.ai-mock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
  margin-left: 8px;
  vertical-align: middle;
}

.ai-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ai-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
}

.ai-tag-strength {
  background-color: var(--won-bg);
  color: var(--won-text);
}

.ai-tag-weakness {
  background-color: var(--lost-bg);
  color: var(--lost-text);
}

.ai-tag-focus {
  background-color: var(--trial-bg);
  color: var(--trial-text);
}

.ai-insight-narrative {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px 14px;
}

.ai-meeting-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.ai-meeting-list-item:last-child {
  border-bottom: none;
}

.ai-quiz-item {
  font-size: 12.5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.ai-quiz-item:last-child {
  border-bottom: none;
}

.ai-quiz-option {
  padding: 5px 8px;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
}

.ai-quiz-option.correct {
  background-color: var(--won-bg);
  border-color: var(--won-text);
  color: var(--won-text);
  font-weight: 600;
}

.ai-flashcard-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin-bottom: 6px;
}

/* ------------------------------------------------------------- */
/* Tablet & Mobile Responsiveness queries */
/* ------------------------------------------------------------- */

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 72px; /* Collapsed sidebar on tablet */
  }
  
  .brand-name, .user-info, .nav-badge, .nav-item-lbl {
    display: none !important;
  }
  
  .sidebar-header, .sidebar-footer {
    justify-content: center;
    padding: 0;
  }
  
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  
  .student-profile-layout {
    grid-template-columns: 1fr;
  }
  
  .kpi-ribbon {
    grid-template-columns: 1fr 1fr;
  }
  
  .kanban-board {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }

  .app-container {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100vw;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 8px;
    overflow-x: auto;
    gap: 8px;
  }

  .nav-item {
    padding: 8px;
    white-space: nowrap;
    width: auto;
  }

  .main-panel {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    height: auto;
    overflow: visible;
  }

  .topbar {
    padding: 0 16px;
  }

  .view-container {
    padding: 16px;
    height: auto;
    overflow: visible;
  }

  .kpi-ribbon {
    grid-template-columns: 1fr;
  }

  .calendar-week-grid {
    grid-template-columns: 1fr;
  }

  .teacher-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------- */
/* PORTAL THEME REFRESH (2026-07-05)
   Cosmetic layer matching the student/parent/teacher portals.
   Selectors only restyle existing classes - no structural change. */
/* ------------------------------------------------------------- */

/* Sidebar & nav: rounded indigo pill for the active item */
.brand-logo {
  border-radius: 12px;
  width: 34px;
  height: 34px;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.35);
}

.nav-item {
  border-radius: 13px;
  font-weight: 600;
  padding: 10px 14px;
}

.nav-item:hover {
  color: var(--accent-color);
  background-color: var(--bg-surface-hover);
}

.nav-item.active {
  background-color: var(--accent-color);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.nav-item.active .nav-badge {
  background-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Buttons: chunkier, rounder, portal shadows */
.btn {
  border-radius: 12px;
  font-weight: 700;
}

.btn-primary {
  background-color: var(--accent-color);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

/* Cards: borderless, soft-shadow, rounder */
.docs-card,
.kpi-card,
.chart-card,
.kanban-column,
.teacher-card {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--border-radius-lg);
}

.docs-card h3 {
  border-bottom: none;
  padding-bottom: 0;
}

/* Tables */
.data-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table th {
  font-size: 10.5px;
  letter-spacing: 0.6px;
}

.data-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

/* Pills / badges rounder */
.status-pill,
.nav-badge {
  border-radius: 99px;
  font-weight: 700;
}

/* Inputs: portal-style focus */
input, select, textarea {
  border-radius: 10px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-color) !important;
  outline: none;
}

/* Modals & slideovers rounder */
.modal-content {
  border-radius: var(--border-radius-lg);
  border: none;
}

.slideover-panel {
  border-left: none;
}

/* Desktop: blend the topbar into the lilac canvas (portal look) */
.topbar {
  background-color: var(--bg-app);
  border-bottom: none;
}

.search-box-wrapper {
  background-color: var(--bg-surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  border: none;
}

.global-search-input {
  background: transparent;
  border: none;
}

.role-switcher-select,
.notification-bell {
  background-color: var(--bg-surface);
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
}

.view-header-title h1 {
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* KPI cards: portal stat-card look */
.kpi-card {
  gap: 14px;
}

.kpi-icon-wrap {
  border-radius: 14px;
}

.kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.kpi-value {
  font-weight: 800;
}

/* Sidebar: portal look */
.sidebar {
  border-right: none;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  border-bottom: none;
}

/* =============================================================
   MOBILE (<= 768px): portal-style app layout
   Floating bottom nav bar (like the student/parent/teacher
   portals), decluttered topbar, 2-up actions and stat cards.
   ============================================================= */
@media (max-width: 768px) {

  /* --- Floating bottom nav bar --- */
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    height: auto;
    border-radius: 24px;
    border-bottom: none;
    box-shadow: 0 10px 30px rgba(30, 22, 90, 0.18);
    z-index: 40;
  }

  .sidebar-header { display: none; }
  .sidebar-footer { display: none; }

  .sidebar-nav {
    flex-direction: row;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar { display: none; }

  /* Dev-only views stay off phones */
  #nav-components, #nav-navmap { display: none; }

  .nav-item {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 4px 8px;
    width: auto;
    min-width: 62px;
    flex-shrink: 0;
    background: none;
    border-radius: 14px;
    font-size: 10px;
    font-weight: 600;
    box-shadow: none;
  }

  .nav-item .nav-item-lbl {
    display: block !important;
    font-size: 10px;
    white-space: nowrap;
  }

  .nav-item span.material-symbols-outlined {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
    transition: all 0.18s ease;
  }

  .nav-item.active {
    background: none;
    color: var(--accent-color);
    box-shadow: none;
  }

  .nav-item.active span.material-symbols-outlined {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.4);
  }

  /* Room for the floating bar */
  .main-panel {
    padding-bottom: 104px;
  }

  /* --- Decluttered topbar: search + icons only --- */
  .topbar {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 12px 16px;
    height: auto;
  }

  .topbar-left { flex: 1; min-width: 0; }

  .search-box-wrapper { width: 100%; }

  .role-switcher-wrapper { display: none; }

  /* --- Headers & quick actions --- */
  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .view-header-title h1 { font-size: 22px; }

  .view-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .view-header-actions .btn {
    justify-content: center;
    padding: 11px 10px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  /* --- Stat cards 2-up, portal style --- */
  .kpi-ribbon {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
  }

  .kpi-value { font-size: 22px; }

  /* --- Cards, tables, overlays --- */
  .docs-card { padding: 16px; }

  .docs-grid { grid-template-columns: 1fr !important; }

  .modal-content {
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 20px;
  }

  .slideover-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .view-container { padding: 14px 14px 0; }
}
