
:root {
  /* Color System - Warm Editorial Palette (Light Mode) */
  --bg: #F8F5EC;
  --bg-2: #FFFFFF;
  --bg-3: #F1E9D8;
  --border: #E3D8C4;
  --border-light: #E3D8C4;
  --text: #1C1A1A;
  --text-muted: #5E544A;
  --text-dim: #8B7B6F;
  --accent: #8B1A1A;
  --accent-dim: rgba(139, 26, 26, 0.08);
  --accent-hover: #A63030;
  --accent-secondary: #C8A243;
  --btn-primary-text: #FFFFFF;
  --danger: #C85555;
  --danger-dim: rgba(200, 85, 85, 0.1);
  --success: #4A7C59;
  --success-dim: rgba(74, 124, 89, 0.1);
  --sidebar-w-expanded: 230px;
  --sidebar-w-collapsed: 76px;
  --sidebar-w: var(--sidebar-w-expanded);
  --radius: 6px;
  --font-display: 'Nunito', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-mono: 'Nunito', sans-serif;
}

:root.dark-mode {
  /* Dark Mode - Premium Minimal SaaS Dashboard */
  --bg: #0A0C10;           /* Near-black with subtle cool tint */
  --bg-2: #12151C;         /* Main cards, slightly lighter */
  --bg-3: #1A1D27;         /* Elevates elements, table headers */
  --border: #242936;       /* Clean structured borders */
  --border-light: #2D3343; /* Hover boundaries */
  
  /* Text Contrast - Maximum legibility */
  --text: #F1F5F9;         /* Off-white for headings, primary stats */
  --text-muted: #94A3B8;   /* Neutral slate for general labels & reading */
  --text-dim: #64748B;     /* Subdued grey for subtle details */
  
  /* Primary Actions & Highlights */
  --accent: #f0a500;       /* Amber for prime actions (the Add Student button) */
  --accent-dim: rgba(240, 165, 0, 0.1); 
  --accent-hover: #ffb81c; /* Bright pure yellow on hover */
  --btn-primary-text: #000000;
  
  /* Secondary / Structural Tones - Reduced blue intensity */
  --accent-secondary: #475569; 
  --badge-bg: #1E293B;     /* Subtle tag background */
  --badge-text: #CBD5E1;   /* Subtle tag text */
  
  /* Status Colors */
  --danger: #EF4444;       
  --danger-dim: rgba(239, 68, 68, 0.1);
  --success: #10B981;
  --success-dim: rgba(16, 185, 129, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
}

/* Mobile sidebar overlay backdrop */
@media (max-width: 980px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.3s ease, pointer-events 0.3s ease;
    z-index: 99;
  }
  
  body.sidebar-open::before {
    background: rgba(0, 0, 0, 0.25);
    pointer-events: all;
  }
}

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

.universal-footer {
  position: fixed;
  bottom: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  font-family: var(--font-body);
  z-index: 100;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.universal-footer:hover {
  opacity: 1;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(28, 26, 26, 0.05);
  overflow: hidden;
}

.sidebar.collapsed {
  --sidebar-w: var(--sidebar-w-collapsed);
}

.sidebar.hidden {
  transform: translateX(-100%);
}

.sidebar.mobile-drawer {
  position: fixed;
  width: 100%;
  max-width: 320px;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.sidebar.mobile-drawer.visible {
  transform: translateX(0);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  flex-shrink: 0;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 16px;
  gap: 0;
  position: relative;
  height: 72px;
}

.sidebar-brand-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-brand-info {
  flex: 0;
  gap: 0;
  justify-content: center;
  align-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s;
}

.sidebar.collapsed .brand-text {
  display: none;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  color: var(--accent);
}

.sidebar-toggle:active {
  background: var(--accent-dim);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar.collapsed .sidebar-toggle {
  position: absolute;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  top: 16px;
  left: 16px;
}

.sidebar.collapsed .sidebar-brand:hover .sidebar-toggle {
  opacity: 1;
  pointer-events: all;
}

.sidebar.collapsed .sidebar-toggle:hover {
  color: #FFFFFF;
}

.brand-mark {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-brand:hover .brand-logo {
  opacity: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
}

.sidebar-nav {
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.sidebar.collapsed .sidebar-nav {
  padding: 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.2s;
  cursor: pointer;
}

.sidebar.collapsed .nav-item {
  padding: 9px 16px;
  justify-content: center;
  gap: 0;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-item-label {
  display: none;
}

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

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(139, 26, 26, 0.2);
}

.sidebar.collapsed .nav-item {
  border: none;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 8px;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar.collapsed .api-status {
  justify-content: center;
  gap: 4px;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.logout-btn:hover {
  color: var(--danger);
}

.logout-text {
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: opacity 0.2s;
}

.sidebar.collapsed .logout-text {
  display: none;
}

.sidebar-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar.collapsed .sidebar-footer-content {
  flex-direction: column;
  justify-content: center;
}

.status-text {
  transition: opacity 0.2s;
}

.sidebar.collapsed .status-text {
  display: none;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s;
}

.api-status.online .status-dot { background: var(--success); }
.api-status.online .status-text { color: var(--success); }
.api-status.offline .status-dot { background: var(--danger); }
.api-status.offline .status-text { color: var(--danger); }

/* Theme Switcher Section */
.theme-switcher-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar.collapsed .theme-switcher-section {
  padding: 12px 8px;
}

.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.sidebar.collapsed .theme-toggle-container {
  flex-direction: column;
  gap: 6px;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: opacity 0.3s, transform 0.3s;
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(-180deg);
  position: absolute;
}

:root.dark-mode .theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(180deg);
  position: absolute;
}

:root.dark-mode .theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
  position: static;
}

.theme-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: opacity 0.2s;
  white-space: nowrap;
}

.sidebar.collapsed .theme-label {
  display: none;
}

.main-content {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  padding: 24px 32px;
  min-height: 100vh;
  box-sizing: border-box;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
  margin-left: 0;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: flex-start;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  position: relative;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: absolute;
  left: 0;
  top: 0;
}

.mobile-menu-toggle:hover {
  background: var(--bg-3);
  color: var(--accent);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

.back-link {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: block;
  margin-bottom: 8px;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}

.back-link:hover { color: var(--accent); }

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
  font-family: var(--font-body);
  font-weight: 500;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #c94444;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(28, 26, 26, 0.03);
}

.stat-card:hover {
  border-color: var(--text-dim);
  box-shadow: 0 2px 4px rgba(28, 26, 26, 0.06);
}

.stat-card.loading .stat-value {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 1px 2px rgba(28, 26, 26, 0.03);
}

.chart-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 7px 12px;
  font-size: 13.5px;
  font-family: var(--font-body);
  cursor: pointer;
  min-width: 150px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.2);
}

.table-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

.data-table th {
  background: var(--bg-3);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 2px solid var(--border); /* Slightly thicker border for separation */
  font-weight: 600;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background 0.15s;
}

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

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
  font-family: var(--font-mono);
  font-size: 13px;
}

.roll-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(240, 165, 0, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
}

.year-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.branch-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(240, 165, 0, 0.2);
}

.action-btns {
  display: flex;
  gap: 6px;
}

.form-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 800px;
  box-shadow: 0 1px 2px rgba(28, 26, 26, 0.03);
}

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

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

.form-group-full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.required { color: var(--accent); }

.form-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder { color: var(--text-dim); }

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background: var(--success-dim);
  border: 1px solid rgba(62, 207, 142, 0.3);
  color: var(--success);
}

.alert-error {
  background: var(--danger-dim);
  border: 1px solid rgba(224, 85, 85, 0.3);
  color: var(--danger);
}

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 9px 14px;
  font-size: 12.5px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}

.tab-btn:hover { color: var(--text); }

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: block; }
.tab-panel.hidden { display: none; }

.section-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(28, 26, 26, 0.03);
}

.section-card.hidden { display: none; }

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

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.info-label {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.info-value {
  font-size: 14px;
  color: var(--text);
}

.info-value.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.bool-yes {
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 12px;
}

.bool-no {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.no-data {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 0;
}

.sem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sem-block {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}

.sem-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.sem-block .form-group {
  gap: 4px;
}

.sem-block .form-label {
  font-size: 10.5px;
}

.sem-block .form-input {
  padding: 6px 8px;
  font-size: 12.5px;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.item-row {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(28, 26, 26, 0.02);
}

.item-info {
  flex: 1;
}

.item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.item-meta {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 26, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(28, 26, 26, 0.15);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.modal-text {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.student-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
}

.student-photo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.upload-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.upload-title {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 14px;
}

input[type="file"].form-input {
  padding: 7px 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12.5px;
}

input[type="file"].form-input::-webkit-file-upload-button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 10px;
  font-family: var(--font-body);
}

.upload-success {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--success);
  margin-top: 6px;
}

@media (max-width: 1200px) {
  .main-content {
    padding: 20px 24px;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    width: 100%;
    max-width: 280px;
    background-color: var(--bg-2) !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    --sidebar-w: 100%;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .sidebar.visible {
    transform: translateX(0);
  }
  
  .sidebar.collapsed {
    --sidebar-w: 100%;
  }
  
  .sidebar-nav {
    padding: 12px 8px;
  }
  
  .nav-item-label {
    display: inline;
  }
  
  .sidebar.collapsed .nav-item-label {
    display: inline;
  }
  
  .sidebar.collapsed .nav-item {
    padding: 9px 12px;
    justify-content: flex-start;
    gap: 10px;
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .sidebar.collapsed .sidebar-toggle {
    display: flex;
  }
  
  .sidebar-brand-info {
    display: flex;
  }
  
  .sidebar.collapsed .sidebar-brand-info {
    display: flex;
  }
  
  .status-text {
    display: inline;
  }
  
  .sidebar.collapsed .status-text {
    display: inline;
  }
  
  .main-content {
    margin-left: 0;
    width: 100vw;
    padding: 24px 20px;
  }
  
  .page-header {
    justify-content: center;
    text-align: center;
    padding-left: 36px;
  }
  
  .header-left {
    width: 100%;
  }
  
  .universal-footer {
    bottom: 14px;
    right: 14px;
    font-size: 10.5px;
  }
  
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .sem-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Modal backdrop for sidebar overlay */
  .sidebar.visible::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: -1;
  }
}

@media (max-width: 600px) {
  .main-content { 
    padding: 20px 16px; 
  }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group-full { grid-column: 1; }
  .page-title {
    font-size: 24px;
  }
  .page-header {
    margin-bottom: 20px;
    justify-content: center;
    text-align: center;
    padding-left: 36px;
  }
  .universal-footer {
    bottom: 12px;
    right: 12px;
    font-size: 10px;
  }
}