:root {
  /* Tech Blue Color Palette */
  --primary-navy: #1E3A8A;
  --primary-blue: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --accent-cyan: #0284C7;
  --accent-teal: #0D9488;
  
  /* Status Colors */
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #3B82F6;
  
  /* Neutral Colors */
  --bg-app: #F8FAFC;
  --surface: #FFFFFF;
  --surface-subtle: #F1F5F9;
  --border: #E2E8F0;
  --border-focus: #93C5FD;
  
  /* Typography */
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;
  
  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(37, 99, 235, 0.08);
  --shadow-lg: 0 10px 25px rgba(30, 58, 138, 0.12);
  
  /* Layout */
  --max-width: 540px;
  --desktop-max-width: 1024px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #0F172A;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Demo Role Banner Header */
.demo-bar {
  width: 100%;
  background: linear-gradient(90deg, #0F172A 0%, #1E3A8A 100%);
  color: #E2E8F0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.demo-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.demo-badge {
  background: rgba(37, 99, 235, 0.4);
  color: #93C5FD;
  border: 1px solid rgba(147, 197, 253, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
}

.demo-roles {
  display: flex;
  gap: 6px;
}

.role-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.role-btn:hover, .role-btn.active {
  background: var(--primary-blue);
  border-color: #60A5FA;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* App Main Container */
.app-container {
  width: 100%;
  max-width: var(--max-width);
  background-color: var(--bg-app);
  min-height: calc(100vh - 45px);
  padding-bottom: 80px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.app-container.desktop-wide {
  max-width: var(--desktop-max-width);
}

/* Header Navbar */
.main-header {
  background: var(--surface);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-blue) 100%);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary-navy);
  letter-spacing: -0.5px;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-subtle);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.user-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

/* Common Page Container */
.page {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography Helpers */
.title-lg {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.4px;
}

.title-md {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Component Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card.highlight {
  border-left: 4px solid var(--primary-blue);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

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

/* Buttons & Touch Targets */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-navy) 100%);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:active {
  background: var(--border);
}

.btn-success {
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Chips & Selectors */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.chip-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 72px;
}

.chip-btn .icon {
  font-size: 22px;
}

.chip-btn .label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
}

.chip-btn.selected {
  border-color: var(--primary-blue);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.chip-btn.selected .label {
  color: var(--primary-blue);
}

/* Checkpoint Stepper Bar */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.step-item.active {
  color: var(--primary-blue);
}

.step-item.active .step-number {
  background: var(--primary-blue);
  color: white;
}

.step-item.completed {
  color: var(--success);
}

.step-item.completed .step-number {
  background: var(--success);
  color: white;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
}

.step-line.active {
  background: var(--primary-blue);
}

/* Student Exception List Item */
.student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.student-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #DBEAFE;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.student-name {
  font-weight: 600;
  font-size: 14px;
}

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

.toggle-opt {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
}

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

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

.toggle-opt.active-highlight {
  background: var(--primary-light);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.badge-blue {
  background: var(--primary-light);
  color: var(--primary-blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-green {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-amber {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Stats Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-navy);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 90;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-item.active {
  color: var(--primary-blue);
}

.nav-item .nav-icon {
  font-size: 20px;
}

/* Responsive grid for desktop dashboard view */
@media (min-width: 768px) {
  .dashboard-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
  }
}
