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

:root {
  /* Colors */
  --bg-main: hsl(224, 71%, 4%);
  --bg-surface: hsla(223, 47%, 10%, 0.7);
  --bg-surface-hover: hsla(223, 47%, 14%, 0.85);
  --border-color: hsla(223, 30%, 20%, 0.5);
  --border-focus: hsla(250, 89%, 65%, 0.4);
  
  --primary: hsl(250, 89%, 65%);
  --primary-glow: hsla(250, 89%, 65%, 0.15);
  --secondary: hsl(174, 90%, 41%);
  --secondary-glow: hsla(174, 90%, 41%, 0.15);
  
  --success: hsl(142, 72%, 40%);
  --success-glow: hsla(142, 72%, 40%, 0.15);
  --warning: hsl(37, 90%, 51%);
  --warning-glow: hsla(37, 90%, 51%, 0.15);
  --danger: hsl(350, 89%, 60%);
  --danger-glow: hsla(350, 89%, 60%, 0.15);
  
  --text-primary: hsl(0, 0%, 98%);
  --text-secondary: hsl(218, 12%, 70%);
  --text-muted: hsl(218, 8%, 50%);
  --metric-gradient: linear-gradient(to right, #fff, #bbb);
  
  /* Fonts */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: blur(12px);
}

:root[data-theme="light"] {
  --bg-main: hsl(220, 20%, 97%);
  --bg-surface: hsla(0, 0%, 100%, 0.85);
  --bg-surface-hover: hsla(220, 20%, 93%, 0.9);
  --border-color: hsla(220, 20%, 80%, 0.4);
  --border-focus: hsla(250, 89%, 65%, 0.5);
  
  --primary-glow: hsla(250, 89%, 65%, 0.1);
  --secondary-glow: hsla(174, 90%, 41%, 0.1);
  
  --success-glow: hsla(142, 72%, 40%, 0.1);
  --warning-glow: hsla(37, 90%, 51%, 0.1);
  --danger-glow: hsla(350, 89%, 60%, 0.1);
  
  --text-primary: hsl(224, 71%, 4%);
  --text-secondary: hsl(220, 10%, 30%);
  --text-muted: hsl(220, 8%, 52%);
  --metric-gradient: linear-gradient(to right, var(--text-primary), var(--text-secondary));
}

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

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 10% 20%, hsla(242, 85%, 20%, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 80%, hsla(174, 90%, 20%, 0.1) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Main Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 24px 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-info h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-links {
  list-style: none;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
  transition: var(--transition-fast);
}

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

.nav-link:hover svg {
  stroke: var(--text-primary);
}

.nav-link.active {
  background-color: var(--primary-glow);
  color: var(--primary);
  border-color: var(--border-focus);
}

.nav-link.active svg {
  stroke: var(--primary);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.top-header {
  height: 80px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: hsla(224, 71%, 4%, 0.5);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  flex-shrink: 0;
}

.page-title-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.header-widgets {
  display: flex;
  align-items: center;
  gap: 20px;
}

.live-period-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.period-badge {
  background: linear-gradient(135deg, var(--primary), hsla(250, 89%, 65%, 0.7));
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px var(--primary-glow);
}

.period-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.clock-widget {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.clock-widget svg {
  width: 18px;
  height: 18px;
  stroke: var(--secondary);
}

/* Tab Panels */
.tab-content {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s var(--transition-normal);
}

.tab-panel.active {
  display: block;
}

/* Grid Layouts & Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-surface-hover);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient, linear-gradient(to right, var(--primary), var(--secondary)));
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.metric-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--glow-bg, var(--primary-glow));
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-box svg {
  width: 20px;
  height: 20px;
  stroke: var(--icon-color, var(--primary));
  stroke-width: 2;
  fill: none;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 16px;
  background: var(--metric-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-sub.positive {
  color: var(--success);
}

/* Dashboard Widgets Split */
.dashboard-split {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

.card-widget {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

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

.card-widget-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

/* Teacher Grid */
.teachers-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.teacher-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-normal);
}

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

.teacher-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.teacher-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, hsla(250, 89%, 65%, 0.2), hsla(174, 90%, 41%, 0.2));
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.teacher-meta h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.teacher-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.subject-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-hover);
  color: var(--text-secondary);
}

.subject-badge.csc { background-color: rgba(250, 89, 65, 0.15); color: hsl(250, 89%, 75%); }
.subject-badge.gsc { background-color: rgba(174, 90, 41, 0.15); color: hsl(174, 90%, 55%); }
.subject-badge.pt { background-color: rgba(142, 72, 40, 0.15); color: hsl(142, 72%, 60%); }
.subject-badge.geosst { background-color: rgba(37, 90, 51, 0.15); color: hsl(37, 90%, 65%); }
.subject-badge.islmq { background-color: rgba(350, 89, 60, 0.15); color: hsl(350, 89%, 75%); }
.subject-badge.nazra { background-color: rgba(200, 160, 40, 0.15); color: hsl(45, 90%, 65%); }

.teacher-status-bar {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.status-btn {
  flex-grow: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
  background-color: var(--bg-surface-hover);
  color: var(--text-muted);
  text-align: center;
}

.status-btn.present-btn:hover, .status-btn.present-btn.active {
  background-color: var(--success-glow);
  color: var(--success);
  border-color: var(--success);
}

.status-btn.absent-btn:hover, .status-btn.absent-btn.active {
  background-color: var(--danger-glow);
  color: var(--danger);
  border-color: var(--danger);
}

.status-btn.leave-btn:hover, .status-btn.leave-btn.active {
  background-color: var(--warning-glow);
  color: var(--warning);
  border-color: var(--warning);
}

.cover-needed-banner {
  background-color: var(--danger-glow);
  border: 1px dashed var(--danger);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.cover-btn {
  background: var(--danger);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.7rem;
}

.cover-btn:hover {
  background: hsl(350, 89%, 50%);
}

.cover-assigned-banner {
  background-color: var(--success-glow);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--success);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

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

.modal-card {
  width: 100%;
  max-width: 650px;
  background-color: hsl(223, 47%, 9%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.95);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.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-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.close-modal-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

.close-modal-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-secondary);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Smart Substitution UI */
.sub-period-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.sub-period-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
}

.sub-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-surface-hover);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.sub-item:hover {
  border-color: var(--primary);
}

.sub-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-match-score {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--secondary-glow);
  color: var(--secondary);
  font-weight: 700;
}

.assign-sub-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.assign-sub-btn:hover {
  background-color: hsl(250, 89%, 55%);
}

.no-options {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
}

/* Active Covers Widget */
.active-covers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.active-cover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-hover);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--secondary);
}

.cover-details h5 {
  font-size: 0.9rem;
  font-weight: 600;
}

.cover-details p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cancel-cover-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Interactive Timetables Grid */
.timetable-filter-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.select-input, .text-input {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  min-width: 180px;
}

.select-input:focus, .text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.timetable-grid-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
}

.timetable-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.timetable-table th {
  background-color: hsl(223, 47%, 8%);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.timetable-table td {
  padding: 14px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  width: 11%;
}

.timetable-table td:first-child {
  background-color: hsl(223, 47%, 8%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  width: 8%;
  border-right: 1px solid var(--border-color);
}

.timetable-cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cell-subject {
  font-weight: 700;
  font-size: 0.85rem;
}

.cell-subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Class Register styling */
.student-register-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.register-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.register-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.register-btn:hover {
  background-color: hsl(250, 89%, 55%);
}

.register-btn.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.register-btn.btn-outline:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.register-btn.btn-success {
  background-color: var(--success);
}

.register-btn.btn-success:hover {
  background-color: hsl(142, 72%, 32%);
}

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

.student-table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.student-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.student-row:hover {
  background-color: var(--bg-surface-hover);
}

.roll-no {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-muted);
}

.student-name {
  font-weight: 500;
}

.attendance-toggle-group {
  display: flex;
  gap: 6px;
}

.toggle-opt {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.toggle-opt.opt-p.active {
  background-color: var(--success-glow);
  color: var(--success);
  border-color: var(--success);
}

.toggle-opt.opt-a.active {
  background-color: var(--danger-glow);
  color: var(--danger);
  border-color: var(--danger);
}

.toggle-opt.opt-l.active {
  background-color: var(--warning-glow);
  color: var(--warning);
  border-color: var(--warning);
}

/* Reports */
.reports-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.chart-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: 300px;
  display: flex;
  flex-direction: column;
}

.chart-container {
  flex-grow: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-top: 20px;
}

.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 40px;
}

.chart-bar {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(to top, var(--primary), var(--secondary));
  transition: height 0.6s ease;
  min-height: 5px;
}

.chart-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-value-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Quick schedule list */
.schedule-quick-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-quick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
}

.schedule-quick-item.active {
  border-color: var(--primary);
  background-color: var(--primary-glow);
}

.time-slot {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  background-color: var(--bg-surface);
  border-radius: 4px;
  color: var(--text-secondary);
}

.schedule-quick-item.active .time-slot {
  background-color: var(--primary);
  color: white;
}

.slot-details {
  flex-grow: 1;
}

.slot-details h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.slot-details p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive elements */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
    width: 100%;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }
  
  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 16px;
    gap: 8px;
  }
  
  .nav-link {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .main-content {
    height: auto;
    overflow: visible;
  }
  
  .top-header {
    padding: 16px;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .header-widgets {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .live-period-widget, .clock-widget {
    flex-grow: 1;
    justify-content: center;
  }
  
  .tab-content {
    padding: 16px;
    overflow: visible;
    height: auto;
  }

  /* Make filter bars stack vertically on mobile */
  .timetable-filter-bar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }

  .timetable-filter-bar .select-input,
  .timetable-filter-bar button,
  .timetable-filter-bar input {
    width: 100% !important;
    min-width: 0 !important;
    text-align: center;
  }

  /* Make dialog overlays and cards scrollable on mobile */
  .modal-overlay {
    padding: 16px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .modal-card {
    margin: 20px auto;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
  }

  .modal-body {
    overflow-y: auto;
    flex-grow: 1;
  }
}

/* User Profile Card */
.user-profile-card {
  margin: 16px 0 8px 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-normal);
}

.user-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px var(--primary-glow);
  flex-shrink: 0;
}

.user-details {
  flex-grow: 1;
  overflow: hidden;
}

.user-details h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Restricted Overlay */
.restricted-overlay {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  animation: fadeIn 0.4s var(--transition-normal);
}

.restricted-overlay h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.restricted-overlay p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 420px;
  line-height: 1.6;
}

.read-only-warning {
  background-color: var(--warning-glow);
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* User Badge Roles */
.user-badge {
  background-color: var(--success-glow);
  color: var(--success);
  border: 1px solid var(--success);
}
:root[data-theme="light"] .user-badge {
  background-color: hsla(142, 72%, 40%, 0.1);
  color: hsl(142, 72%, 30%);
}

/* Settings Panels layout */
.settings-sub-panel {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}
.settings-sub-panel.active {
  display: block;
}

/* Sub-navigation active tab design */
.timetable-filter-bar button.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Input Fields styling updates */
input[type="date"].text-input,
input[type="time"].text-input,
input[type="color"].text-input {
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

/* Class Period Log styling */
.class-period-status-box strong {
  color: var(--text-primary);
}

.timetable-table select.select-input {
  min-width: 100%;
  padding: 4px;
  height: auto;
  border-radius: 4px;
  background-color: var(--bg-surface-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
  font-size: 0.75rem;
}

/* Theme tweaks for light mode table headers */
:root[data-theme="light"] .timetable-table th,
:root[data-theme="light"] .timetable-table td:first-child {
  background-color: hsl(220, 20%, 92%);
  color: var(--text-primary);
}

:root[data-theme="light"] .top-header {
  background-color: hsla(220, 20%, 97%, 0.7);
}

:root[data-theme="light"] .modal-card {
  background-color: hsl(0, 0%, 100%);
  color: var(--text-primary);
  border-color: hsla(220, 20%, 80%, 0.6);
}

/* Matrix attendance badges */
.matrix-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}
.matrix-badge.ran {
  background-color: var(--success-glow);
  color: var(--success);
}
.matrix-badge.not-ran {
  background-color: var(--danger-glow);
  color: var(--danger);
}
.matrix-badge.cover {
  background-color: var(--warning-glow);
  color: var(--warning);
}
.matrix-badge.pending {
  background-color: var(--bg-surface-hover);
  color: var(--text-muted);
}


