/* ============================================
   SRG ROSTER MANAGEMENT SYSTEM
   Victoria University Sydney
   Professional Design System v2.0
   ============================================ */

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

/* ============================================
   1. CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --panel: #ffffff;
  --panel-hover: #f8fafc;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --ring: rgba(37,99,235,.25);

  --brand1: #2563eb;
  --brand2: #4f46e5;
  --brand-light: #dbeafe;
  --brand-surface: rgba(37,99,235,.06);

  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --error: #dc2626;
  --error-light: #fee2e2;
  --info: #2563eb;
  --info-light: #dbeafe;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --maxw: 1200px;
  --header-h: 64px;
  --ease: cubic-bezier(.4,0,.2,1);
  --duration: .15s;
}

/* ============================================
   2. DARK THEME
   ============================================ */
body.dark {
  --bg: #0c1222;
  --bg-alt: #131c30;
  --panel: #182038;
  --panel-hover: #1e2844;
  --text: #e8edf5;
  --text-secondary: #b0bdd0;
  --muted: #7a8ba8;
  --border: #243049;
  --border-hover: #2e3e5a;
  --ring: rgba(96,165,250,.3);

  --brand-light: rgba(37,99,235,.18);
  --brand-surface: rgba(37,99,235,.1);
  --success-light: rgba(16,185,129,.15);
  --warning-light: rgba(245,158,11,.12);
  --error-light: rgba(239,68,68,.12);
  --info-light: rgba(59,130,246,.15);

  --shadow-xs: 0 1px 2px rgba(0,0,0,.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow: 0 4px 6px rgba(0,0,0,.25);
  --shadow-md: 0 10px 15px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 25px rgba(0,0,0,.35);
}

/* ============================================
   3. BASE RESET & TYPOGRAPHY
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ============================================
   4. LAYOUT
   ============================================ */
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: 24px; }
.row { display: flex; flex-wrap: wrap; margin: -0.75rem; }
.col { flex: 1 1 0%; padding: 0.75rem; min-width: 220px; }
.col-2 { flex: 0 0 50%; padding: 0.75rem; }
.col-3 { flex: 0 0 33.333%; padding: 0.75rem; }
.col-4 { flex: 0 0 25%; padding: 0.75rem; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }

/* ============================================
   5. DECORATIVE ELEMENTS (hidden for clean look)
   ============================================ */
.blob, .sparkle { display: none; }

/* ============================================
   6. HEADER / NAVIGATION
   ============================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.dark .header {
  background: rgba(12,18,34,.85);
}

.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
}
.brand .logo-light { height: 32px; display: block; }
.brand .logo-dark { height: 32px; display: none; }
body.dark .brand .logo-light { display: none; }
body.dark .brand .logo-dark { display: block; }
.brand-name {
  font-weight: 700; font-size: 1rem;
  letter-spacing: -0.01em; color: var(--text);
}

.menu { display: flex; align-items: center; gap: 4px; }
.menu a {
  color: var(--muted); font-weight: 500; font-size: .875rem;
  padding: 8px 14px; border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}
.menu a:hover { background: var(--brand-surface); color: var(--brand1); }
.menu a.active { color: var(--brand1); background: var(--brand-surface); font-weight: 600; }

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

.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text-secondary); font-weight: 600; font-size: .8rem;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--border-hover); background: var(--bg-alt); }

.hamburger {
  display: none; width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text);
  font-size: 1.25rem; place-items: center;
}
.mobile-drawer {
  display: none; background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.mobile-drawer a {
  display: block; padding: 12px 24px; color: var(--text);
  font-weight: 500; font-size: .95rem; border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}
.mobile-drawer a:hover { background: var(--brand-surface); }

/* ============================================
   7. TYPOGRAPHY
   ============================================ */
.page-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; color: var(--text);
  margin-bottom: 2rem; text-align: center;
}
.section-title {
  font-size: 1.375rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
  margin-bottom: 1.25rem;
}
.title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; color: var(--text);
  margin-bottom: 8px;
}
.sub { color: var(--muted); font-size: 1rem; line-height: 1.7; margin-bottom: 16px; }
.muted { color: var(--muted); }

/* ============================================
   8. BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; font-weight: 600; font-size: .875rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--brand1); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  line-height: 1.5;
}
.btn:hover { background: #1d4ed8; box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }

.btn.secondary { background: #475569; color: #fff; }
.btn.secondary:hover { background: #334155; }

.btn.success { background: var(--success); color: #fff; }
.btn.success:hover { background: #047857; }

.btn.warning { background: var(--warning); color: #fff; }
.btn.warning:hover { background: #b45309; }

.btn.danger { background: var(--error); color: #fff; }
.btn.danger:hover { background: #b91c1c; }

.btn.outline {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.btn.outline:hover { background: var(--bg-alt); border-color: var(--border-hover); }

.btn-glow { box-shadow: 0 0 0 3px var(--ring), var(--shadow-sm) !important; }

.btn.sm { padding: 6px 14px; font-size: .8rem; }
.btn.primary { background: var(--brand1); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }

.cta-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; font-weight: 600; font-size: .875rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--panel); color: var(--text);
  box-shadow: var(--shadow-xs); transition: all var(--duration) var(--ease);
}
.cta-outline:hover { background: var(--bg-alt); border-color: var(--border-hover); }

/* ============================================
   9. CARDS & PANELS
   ============================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.feature {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-xs);
  transition: all var(--duration) var(--ease);
}
.feature:hover { border-color: var(--border-hover); box-shadow: var(--shadow); transform: translateY(-2px); }
.feature h3 { font-size: 1rem; font-weight: 700; margin: 12px 0 6px; color: var(--text); }
.feature p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.6; }

.icon { width: 22px; height: 22px; color: var(--brand1); }

/* ============================================
   10. FORMS
   ============================================ */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-weight: 600;
  font-size: .875rem; color: var(--text);
}
.form-row { display: flex; gap: 1rem; }

.form-input, .form-select {
  width: 100%; padding: 10px 14px;
  font-size: .875rem; line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text);
  transition: all var(--duration) var(--ease);
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--brand1);
  box-shadow: 0 0 0 3px var(--ring);
}
.form-input::placeholder { color: var(--muted); }
.form-input.error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.form-input.success { border-color: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,.12); }

.form-helper { font-size: .8rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.form-error { font-size: .8rem; color: var(--error); margin-top: 4px; display: none; }
.form-error.show { display: block; animation: slideDown .2s var(--ease); }
.form-help { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.input-group { position: relative; }
.input-indicator {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity .2s var(--ease); font-size: 1rem;
}
.input-indicator.show { opacity: 1; }
.input-indicator.success { color: var(--success); }
.input-indicator.error { color: var(--error); }
.input-indicator { pointer-events: none; }

/* Sign-in page field/ctrl style */
.field { margin: 14px 0; }
.ctrl {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel);
  transition: all var(--duration) var(--ease);
}
.ctrl:focus-within { border-color: var(--brand1); box-shadow: 0 0 0 3px var(--ring); }
.ctrl input {
  border: 0; outline: 0; background: transparent;
  flex: 1; font-size: .875rem; color: var(--text);
}
.ctrl input::placeholder { color: var(--muted); }
.ctrl svg { opacity: .5; color: var(--muted); }

/* ============================================
   11. TABS
   ============================================ */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.tab {
  padding: 12px 20px;
  background: none; border: none;
  cursor: pointer;
  font-size: .875rem; font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  border-radius: 0;
  position: relative;
}
.tab:hover { color: var(--text); background: var(--brand-surface); }
.tab.active {
  color: var(--brand1); font-weight: 600;
  border-bottom-color: var(--brand1);
  background: transparent;
}
.tab-content { display: none; padding: 0; }
.tab-content.active { display: block; }

/* ============================================
   12. ALERTS
   ============================================ */
.alert {
  padding: 16px 20px; border-radius: var(--radius);
  margin-bottom: 1.5rem; font-size: .875rem;
  border: 1px solid transparent; line-height: 1.6;
}
.alert h3, .alert h4 {
  margin: 0 0 6px; font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; gap: 8px;
}
.alert p { margin: 0; }
.alert ul { margin: 6px 0 0; padding-left: 1.25rem; }
.alert li { margin-bottom: 2px; }

.alert.success { background: var(--success-light); color: var(--success); border-color: rgba(5,150,105,.15); }
.alert.info { background: var(--info-light); color: var(--info); border-color: rgba(37,99,235,.15); }
.alert.warning { background: var(--warning-light); color: var(--warning); border-color: rgba(217,119,6,.15); border-left: 3px solid var(--warning); }
.alert.error { background: var(--error-light); color: var(--error); border-color: rgba(220,38,38,.15); }

/* ============================================
   13. STATUS MESSAGE (toast)
   ============================================ */
.status-message {
  position: fixed; top: 80px; right: 20px; z-index: 200;
  padding: 14px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: .875rem;
  transform: translateX(calc(100% + 40px));
  transition: transform .3s var(--ease);
  max-width: 380px; box-shadow: var(--shadow-lg);
}
.status-message.show { transform: translateX(0); }
.status-message.success { background: var(--success); color: #fff; }
.status-message.error { background: var(--error); color: #fff; }

/* ============================================
   14. METRIC CARDS
   ============================================ */
.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all var(--duration) var(--ease);
  position: relative; overflow: hidden;
}
.metric-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
}
.metric-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.metric-value {
  font-size: 2rem; font-weight: 800; margin-bottom: 4px;
  color: var(--brand1); letter-spacing: -0.02em;
}
.metric-label {
  color: var(--muted); font-size: .8rem; font-weight: 500;
  display: flex; align-items: center; gap: 6px; justify-content: center;
}

/* ============================================
   15. PROGRESS
   ============================================ */
.progress-container { margin: 1.5rem 0; }
.progress-label { font-weight: 600; margin-bottom: 8px; font-size: .95rem; color: var(--text); }
.progress-bar {
  width: 100%; height: 8px;
  background: var(--bg-alt); border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand1), var(--success));
  transition: width .6s var(--ease);
  border-radius: var(--radius-full);
}

/* ============================================
   16. ACHIEVEMENT BADGES
   ============================================ */
.achievement-badge {
  background: var(--brand1); color: #fff;
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 600;
  display: inline-block; margin: 4px;
  transition: all var(--duration) var(--ease);
}
.achievement-badge:hover { background: var(--brand2); transform: translateY(-1px); }

/* ============================================
   17. CALENDAR
   ============================================ */
.calendar-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px; margin: 1.5rem 0;
}
.calendar-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding: 0;
}
.calendar-nav-btn {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px; cursor: pointer;
  font-weight: 600; font-size: .8rem;
  transition: all var(--duration) var(--ease);
  display: flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-xs);
}
.calendar-nav-btn:hover { background: var(--bg-alt); border-color: var(--border-hover); }
.calendar-title { font-size: 1.125rem; font-weight: 700; color: var(--text); }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
}
.calendar-day-header {
  background: var(--bg-alt); color: var(--text-secondary);
  padding: 10px 6px; text-align: center;
  font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.calendar-day {
  background: var(--panel); min-height: 100px;
  padding: 8px; position: relative;
  cursor: pointer; transition: background var(--duration) var(--ease);
  display: flex; flex-direction: column;
}
.calendar-day:hover { background: var(--brand-surface); }
.calendar-day.other-month { background: var(--bg-alt); opacity: .5; }
.calendar-day.selected { background: var(--brand-light); outline: 2px solid var(--brand1); outline-offset: -2px; }
.calendar-day.past-selected { background: var(--warning-light); outline: 2px solid var(--warning); outline-offset: -2px; }
.calendar-day.disabled { background: var(--bg-alt); opacity: .4; cursor: not-allowed !important; }
.calendar-day.disabled:hover { background: var(--bg-alt); }
.calendar-day-number { font-weight: 600; font-size: .8rem; margin-bottom: 4px; color: var(--text); }
.calendar-day-events { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.calendar-status {
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}
.calendar-status.status-success { color: var(--success); }
.calendar-status.status-warning { color: var(--warning); }
.calendar-status.status-error { color: var(--error); }

.calendar-event {
  padding: 2px 6px; border-radius: 4px;
  font-size: .65rem; font-weight: 600;
  color: #fff; background: var(--success);
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
  transition: all var(--duration) var(--ease);
}
.calendar-event.pending { background: var(--brand2); }
.calendar-event.declined { background: var(--error); }
.calendar-event:hover { transform: scale(1.02); box-shadow: var(--shadow-xs); }

.calendar-event-more {
  padding: 2px 6px; border-radius: 4px;
  font-size: .65rem; font-weight: 600;
  color: #fff; background: var(--brand1);
  cursor: pointer; text-align: center;
  margin-top: 2px;
}
.calendar-event-more:hover { background: #1d4ed8; }

/* Lecturer calendar styles */
.day-header {
  background: var(--bg-alt); color: var(--text-secondary);
  padding: 10px 6px; text-align: center;
  font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.day-number { font-weight: 600; font-size: .8rem; margin-bottom: 4px; color: var(--text); }
.shift-event {
  padding: 3px 6px; margin: 2px 0; border-radius: 4px;
  font-size: .65rem; font-weight: 500; color: #fff;
  background: var(--success); cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.shift-event:hover { transform: scale(1.03); box-shadow: var(--shadow-xs); }
.shift-event.pending { background: var(--brand2); }
.shift-event.declined { background: var(--error); }
.shift-event.custom { background: #7c3aed; border-left: 2px solid #5b21b6; }
.today { background: var(--brand-surface) !important; outline: 2px solid var(--brand1); outline-offset: -2px; }
.weekend { background: var(--bg-alt); }
.other-month { opacity: .4; }

/* ============================================
   18. TABLES
   ============================================ */
.data-table {
  width: 100%; border-collapse: collapse; margin: 1rem 0;
  background: var(--panel); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}
.data-table th, .data-table td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: .875rem;
}
.data-table th {
  background: var(--bg-alt); color: var(--text-secondary);
  font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.data-table tr { transition: background var(--duration) var(--ease); }
.data-table tr:hover { background: var(--brand-surface); }
.data-table tr:last-child td { border-bottom: none; }

/* ============================================
   19. EXPANDERS (Accordion)
   ============================================ */
.expander {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 0.5rem 0; overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow-xs);
  transition: all var(--duration) var(--ease);
}
.expander:hover { border-color: var(--border-hover); }
.expander-header {
  background: var(--panel); padding: 16px 20px;
  cursor: pointer; font-weight: 600; font-size: .875rem;
  display: flex; justify-content: space-between; align-items: center;
  transition: all var(--duration) var(--ease);
}
.expander-header:hover { background: var(--brand-surface); }
.expander-content {
  padding: 0; max-height: 0; overflow: hidden;
  transition: all .3s var(--ease);
  border-top: 1px solid var(--border);
}
.expander-content.active { max-height: 3000px; padding: 20px; }

/* ============================================
   20. MODALS
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-lg);
  max-width: 520px; width: calc(100% - 32px);
  animation: modalIn .2s var(--ease);
  max-height: 85vh; overflow-y: auto;
}
.modal-title {
  font-size: 1.25rem; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
}
.modal-content { color: var(--muted); margin-bottom: 24px; line-height: 1.6; font-size: .875rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes modalIn { from { opacity:0; transform: scale(.96) translateY(8px); } to { opacity:1; transform: scale(1) translateY(0); } }

/* ============================================
   21. SHIFT ITEMS (Lecturer)
   ============================================ */
.shift-item {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  transition: background var(--duration) var(--ease);
}
.shift-item:hover { background: var(--brand-surface); }
.shift-item:last-child { border-bottom: none; }
.shift-info { flex: 1; min-width: 200px; }
.shift-status { flex: 0 0 160px; }
.shift-actions { flex: 0 0 240px; display: flex; gap: 6px; flex-wrap: wrap; }

.custom-shift-badge {
  background: #7c3aed; color: #fff;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: .65rem; font-weight: 600; margin-left: 6px;
}

.user-header-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }

/* ============================================
   22. LECTURER EXTRAS
   ============================================ */
.db-error-banner {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--error); color: #fff;
  padding: 10px 20px; text-align: center;
  z-index: 10000; font-weight: 600; font-size: .875rem;
}
.time-range-display {
  background: var(--brand-surface);
  border: 1px solid rgba(37,99,235,.15);
  border-radius: var(--radius-sm);
  padding: 14px; margin: 12px 0;
  text-align: center; color: var(--brand1); font-weight: 500; font-size: .875rem;
}
.time-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.password-display {
  background: var(--warning-light);
  border: 1px solid rgba(217,119,6,.2);
  border-radius: var(--radius); padding: 20px; margin: 1rem 0; text-align: center;
}
.password-field {
  background: var(--panel); border: 2px solid var(--brand1);
  border-radius: var(--radius-sm); padding: 12px;
  font-family: 'Courier New', monospace; font-size: 1.125rem;
  font-weight: 700; letter-spacing: 2px; text-align: center;
  color: var(--brand1); margin: 12px 0; user-select: all;
  cursor: pointer; width: 100%; outline: none;
}
.password-field:focus { box-shadow: 0 0 0 3px var(--ring); }
.copy-button {
  background: var(--success); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 6px 14px;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: all var(--duration) var(--ease); margin: 4px;
}
.copy-button:hover { background: #047857; }

/* ============================================
   23. STUDENT PORTAL EXTRAS
   ============================================ */
.login-section {
  max-width: 580px; margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem; box-shadow: var(--shadow);
}
.availability-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin: 1rem 0;
  box-shadow: var(--shadow-xs);
}
.time-slot-selector {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px;
  align-items: end; margin-bottom: 12px;
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--brand-surface); border: 1px solid rgba(37,99,235,.1);
}

/* ============================================
   24. INDEX / LANDING PAGE
   ============================================ */
.hero { padding: 60px 0 40px; position: relative; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.srg-pill {
  margin-top: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); font-weight: 700; font-size: .85rem;
  box-shadow: var(--shadow-xs);
}
.srg-media { position: relative; aspect-ratio: 16/10; }
.srg-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vu-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px 14px 0; padding: 6px 12px;
  border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--panel); color: var(--text);
  font-weight: 600; font-size: .8rem;
}
.vu-chip img { height: 16px; }
.only-light { display: inline; }
.only-dark { display: none; }
body.dark .only-light { display: none; }
body.dark .only-dark { display: inline; }

.srg-text { padding: 14px 18px 20px; color: var(--muted); font-size: .875rem; line-height: 1.7; }

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

section { padding: 60px 0; }

.footer {
  border-top: 1px solid var(--border); background: var(--panel); color: var(--muted);
}
.footer .row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding: 20px 0; font-size: .825rem;
}

/* ============================================
   25. SIGN-IN PAGE
   ============================================ */
.wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.wrap > .card {
  width: min(880px, 95vw);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.left { padding: 40px 36px; }
.right { position: relative; padding: 24px; display: grid; place-items: center; background: var(--bg-alt); }

.preview {
  width: min(480px, 90%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; background: var(--panel);
  box-shadow: var(--shadow);
}
.preview img { display: block; width: 100%; height: auto; }
.chip-row { display: flex; gap: 8px; padding: 12px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-weight: 700; font-size: .75rem;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
}
.chip img { height: 16px; }
.footer-links { margin-top: 16px; font-size: .85rem; color: var(--muted); text-align: center; }
.footer-links a { font-weight: 700; color: var(--brand1); text-decoration: underline; }

/* Sign-in role selector */
.role {
  display: flex; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 4px; gap: 4px; width: max-content; margin: 10px 0 20px;
}
.role button {
  border: 0; border-radius: var(--radius-full);
  padding: 8px 18px; font-weight: 700; font-size: .85rem;
  cursor: pointer; background: transparent; color: var(--muted);
  transition: all var(--duration) var(--ease);
}
.role button.active {
  background: var(--brand1); color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Sign-in error */
.error:not(.form-input):not(.alert) {
  margin-top: 12px; color: #fff;
  background: var(--error); border-radius: var(--radius-sm);
  padding: 12px 16px; font-weight: 600; font-size: .875rem;
}

/* ============================================
   26. REGISTER PAGE
   ============================================ */
.register-page {
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(79,70,229,.12), transparent 35%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
}
.register-shell {
  width: 100%; max-width: 880px;
}
.register-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  padding: 2rem; position: relative; z-index: 1; overflow: hidden;
}
.register-container::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
}
.register-container .header { text-align: center; margin-bottom: 2.5rem; border: none; position: static; box-shadow: none; background: transparent; }
.register-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  margin-bottom: 2rem;
}
.register-panel-header .page-title {
  text-align: left;
  margin-bottom: .75rem;
}
.register-panel-header .page-subtitle {
  max-width: 640px;
}
.register-eyebrow {
  display: inline-flex; align-items: center;
  padding: 7px 12px; border-radius: var(--radius-full);
  background: var(--brand-surface); color: var(--brand1);
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 14px;
}
.register-panel-links {
  display: grid; gap: 10px; justify-items: end;
  min-width: 180px;
}
.register-panel-link {
  color: var(--brand1); font-weight: 700; font-size: .9rem;
}
.register-panel-link:hover { text-decoration: underline; }
.muted-link { color: var(--muted); font-weight: 600; }
.register-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.75rem;
}
.register-summary-item {
  display: grid; gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--bg-alt), var(--panel));
  border: 1px solid var(--border);
}
.register-summary-item strong {
  font-size: .9rem; color: var(--text);
}
.register-summary-item span {
  font-size: .84rem; line-height: 1.55; color: var(--muted);
}
.registration-form {
  display: grid; gap: 6px;
}
.registration-form .form-group {
  margin-bottom: 1rem;
}
.registration-form .form-input {
  min-height: 48px;
  padding-right: 14px;
}
.registration-form .form-input,
.registration-form .form-select {
  background: linear-gradient(180deg, var(--panel), var(--bg));
}
.registration-form .form-input:hover,
.registration-form .form-select:hover {
  border-color: var(--border-hover);
}
.register-submit-btn {
  margin-top: .5rem;
  justify-content: center;
  min-height: 52px;
  font-size: .95rem;
}
.page-subtitle { color: var(--muted); font-size: 1rem; line-height: 1.6; }

.success-popup {
  position: fixed; top: 50%; left: 50%; z-index: 1002;
  transform: translate(-50%, -50%) scale(.8);
  background: var(--success); color: #fff;
  padding: 2.5rem; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); text-align: center;
  min-width: 400px; opacity: 0;
  transition: all .4s cubic-bezier(.68,-.55,.265,1.55);
}
.success-popup.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.success-popup .icon { font-size: 3rem; margin-bottom: .75rem; display: block; }
.success-popup .title { font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; }
.success-popup .message { font-size: .95rem; line-height: 1.6; opacity: .95; margin-bottom: 1.5rem; }
.success-actions { display: flex; gap: .75rem; justify-content: center; margin-top: 1.5rem; }
.success-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; border: none;
  font-size: .875rem; font-family: inherit;
  min-width: 120px; justify-content: center;
  transition: all var(--duration) var(--ease);
}
.success-btn.primary {
  background: rgba(255,255,255,.2); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}
.success-btn.primary:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.success-btn.secondary {
  background: transparent; color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.3);
}
.success-btn.secondary:hover { background: rgba(255,255,255,.1); }

.back-link {
  text-align: center; margin-top: 2rem;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.back-link a {
  color: var(--brand1); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}
.back-link a:hover { background: var(--brand-surface); }

/* ============================================
   27. AI POPUP
   ============================================ */
.ai-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: all .25s var(--ease);
}
.ai-popup-overlay.show { opacity: 1; visibility: visible; }

.ai-popup {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 460px; width: 92%;
  transform: scale(.95) translateY(12px);
  transition: all .25s var(--ease);
}
.ai-popup-overlay.show .ai-popup { transform: scale(1) translateY(0); }

.ai-popup-hero {
  height: 180px; overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}
.ai-popup-hero-image { width: 100%; height: 100%; object-fit: cover; display: block; }

.ai-popup-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.ai-popup-title {
  font-size: 1.125rem; font-weight: 700;
  color: var(--text); display: flex; align-items: center; gap: 10px; margin: 0;
}
.ai-popup-close {
  width: 32px; height: 32px; border: none;
  background: var(--error); border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; transition: all var(--duration) var(--ease);
}
.ai-popup-close:hover { background: #b91c1c; transform: scale(1.08); }

.ai-popup-content { padding: 20px; }
.ai-popup-description { color: var(--muted); line-height: 1.6; margin-bottom: 16px; font-size: .875rem; }

.ai-popup-features { display: grid; gap: 8px; margin-bottom: 20px; }
.ai-popup-feature {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--brand-surface);
  border: 1px solid rgba(37,99,235,.1);
  border-radius: var(--radius-sm); color: var(--text); font-size: .875rem;
}
.ai-popup-feature-icon { width: 18px; height: 18px; color: var(--brand1); }

.ai-popup-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-popup-btn {
  flex: 1; min-width: 130px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .875rem;
  text-align: center; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--duration) var(--ease); text-decoration: none;
}
.ai-popup-btn-primary { background: var(--brand1); color: #fff; box-shadow: var(--shadow-sm); }
.ai-popup-btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.ai-popup-btn-secondary {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border);
}
.ai-popup-btn-secondary:hover { background: var(--bg-alt); }

.ai-popup-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--success); color: #fff;
  border-radius: var(--radius-full); font-size: .8rem; font-weight: 700;
  margin-bottom: 14px;
}
.ai-popup-value-text {
  font-size: 1.75rem; font-weight: 900;
  margin: 0 0 16px; color: var(--warning);
  text-align: center;
}

/* ============================================
   28. ANIMATIONS
   ============================================ */
@keyframes float { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-15px); } }
@keyframes drift { 0%,100%{ transform: translate(0,0); } 50%{ transform: translate(20px,-12px); } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes glow { from { opacity: .7; } to { opacity: 1; } }
@keyframes bounce { 0%,20%,50%,80%,100%{ transform: translateY(0); } 40%{ transform: translateY(-12px); } 60%{ transform: translateY(-6px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rotate { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ============================================
   29. RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .container { padding-inline: 20px; }
  .nav { padding: 0 20px; }
  .features { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   30. RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 768px) {
  :root { --header-h: 56px; }

  .menu, .auth:not(:has(.theme-toggle)) { display: none; }
  .hamburger { display: inline-grid; }

  .hero { padding: 36px 0 24px; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .features { grid-template-columns: 1fr; }
  .footer .row { flex-direction: column; text-align: center; gap: 8px; }

  /* Sign-in */
  .wrap > .card { grid-template-columns: 1fr; }
  .right { order: -1; padding: 20px; }
  .left { padding: 28px 24px; }

  /* Register */
  .register-page { padding: 1.5rem 1rem; align-items: flex-start; }
  .register-shell { max-width: 100%; }
  .register-panel-header { flex-direction: column; }
  .register-panel-links { justify-items: start; min-width: 0; }
  .register-summary { grid-template-columns: 1fr; }
  body > .register-container, .register-container { padding: 1.75rem 1.25rem; }
  .form-row { flex-direction: column; gap: 0; }
  .success-popup { min-width: auto; width: 90%; padding: 2rem; }
  .success-actions { flex-direction: column; gap: .5rem; }
  .success-btn { min-width: auto; }

  /* Layout */
  .container { padding-inline: 16px; }
  .row { flex-direction: column; margin: -0.5rem; }
  .col, .col-2, .col-3, .col-4 { flex: 1 1 100%; padding: 0.5rem; }

  /* Cards */
  .page-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
  .section-title { font-size: 1.125rem; }

  /* Tabs */
  .tabs { gap: 0; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 14px; font-size: .8rem; }
  .tab svg { display: none; }

  /* Calendar */
  .calendar-container {
    padding: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .calendar-grid {
    min-width: 820px;
    grid-template-columns: repeat(7, minmax(112px, 1fr));
  }
  .calendar-day { min-height: 88px; padding: 5px; }
  .calendar-day-number { font-size: .78rem; }
  .calendar-day-events { gap: 1px; }
  .calendar-event { font-size: .56rem; padding: 1px 3px; }
  .calendar-status { font-size: .64rem; }
  .calendar-header { flex-wrap: wrap; gap: 10px; justify-content: center; }
  .calendar-nav-btn { padding: 6px 12px; font-size: .75rem; }
  .calendar-title { font-size: 1rem; }

  /* Shifts */
  .shift-item { flex-direction: column; align-items: stretch; gap: 10px; }
  .shift-info, .shift-status, .shift-actions { flex: 1 1 100%; }
  .shift-actions { justify-content: flex-start; }

  /* Metrics */
  .metric-card { padding: 16px; }
  .metric-value { font-size: 1.5rem; }
  .metric-label { font-size: .75rem; }

  /* Forms */
  .form-input, .form-select { padding: 10px 12px; font-size: .875rem; }
  .login-section { padding: 2rem 1.5rem; }
  .time-slot-selector { grid-template-columns: 1fr; }
  .time-inputs { grid-template-columns: 1fr; }

  /* Cards on mobile */
  .card[style*="padding: 2rem"] { padding: 1.25rem !important; }
  .alert h3, .alert h4 { font-size: .85rem; }
  .text-muted { font-size: .9rem !important; }

  /* Buttons */
  .btn { padding: 10px 18px; font-size: .85rem; }
  .btn.sm { padding: 6px 12px; }

  /* Navbar */
  .nav { padding: 0 16px; }
  .brand-name { font-size: .85rem; }
  .theme-toggle { padding: 6px 10px; font-size: .75rem; }

  /* Modal */
  .modal { padding: 20px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }

  /* AI Popup */
  .ai-popup { width: 95%; max-width: 380px; }
  .ai-popup-hero { height: 140px; }
  .ai-popup-value-text { font-size: 1.5rem; }
  .ai-popup-cta { flex-direction: column; }
  .ai-popup-btn { min-width: auto; width: 100%; }
}

/* ============================================
   31. RESPONSIVE — SMALL MOBILE
   ============================================ */
@media (max-width: 480px) {
  .container { padding-inline: 12px; }
  .page-title { font-size: 1.25rem; }
  .section-title { font-size: 1rem; }

  .calendar-grid { min-width: 760px; }
  .calendar-day { min-height: 82px; }
  .calendar-event { font-size: .5rem; }
  .calendar-status { font-size: .6rem; }
  .calendar-day-header, .day-header { font-size: .62rem; padding: 6px 2px; }

  .tab { padding: 8px 10px; font-size: .75rem; }
  .btn { padding: 8px 14px; font-size: .8rem; }
  .form-input, .form-select { padding: 8px 10px; font-size: .8rem; }
  .alert { padding: 12px 14px; font-size: .8rem; }

  .nav { height: 50px; padding: 0 12px; }
  .brand .logo-light, .brand .logo-dark { height: 24px; }
  .brand-name { font-size: .75rem; }

  .ai-popup { width: 98%; margin: 8px; }
  .ai-popup-hero { height: 110px; }
  .ai-popup-content { padding: 14px; }
  .ai-popup-header { padding: 14px 14px 10px; }
  .ai-popup-feature { padding: 8px; font-size: .8rem; }
}

/* ============================================
   32. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================
   33. PRINT
   ============================================ */
@media print {
  .header, .footer, .theme-toggle, .blob, .sparkle,
  .ai-popup-overlay, .hamburger, .mobile-drawer { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel, .metric-card { box-shadow: none; border: 1px solid #ddd; }
}
