/* ============================================
   ASB Admin Web Dashboard — Design System
   ============================================ */

/* --- CSS Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- Light Theme (default) --- */
:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #DBEAFE;
  --primary-dark: #1E40AF;
  --primary-gradient: linear-gradient(135deg, #2563EB, #7C3AED);

  --secondary: #10B981;
  --secondary-light: #D1FAE5;
  --accent: #F59E0B;
  --accent-light: #FEF3C7;

  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface-elevated: #F8FAFC;
  --surface-hover: #F1F5F9;

  --text: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --outline: #CBD5E1;

  --success: #10B981;
  --success-light: #D1FAE5;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  --att-present: #10B981;
  --att-absent: #EF4444;
  --att-late: #F59E0B;
  --att-ill: #8B5CF6;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --header-height: 64px;

  --transition: 0.2s ease;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --primary: #60A5FA;
  --primary-hover: #3B82F6;
  --primary-light: #1E3A5F;
  --primary-dark: #93C5FD;

  --secondary: #34D399;
  --secondary-light: #064E3B;
  --accent: #FBBF24;
  --accent-light: #78350F;

  --bg: #0F172A;
  --surface: #1E293B;
  --surface-elevated: #1E293B;
  --surface-hover: #334155;

  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0F172A;

  --border: #334155;
  --border-light: #1E293B;
  --outline: #475569;

  --success-light: #064E3B;
  --error-light: #7F1D1D;
  --warning-light: #78350F;
  --info-light: #1E3A5F;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

/* --- Base --- */
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app {
  min-height: 100vh;
}

/* --- Typography --- */
.text-xs { font-size: 12px; font-weight: 500; }
.text-sm { font-size: 13px; font-weight: 500; }
.text-base { font-size: 14px; font-weight: 400; }
.text-lg { font-size: 16px; font-weight: 600; }
.text-xl { font-size: 18px; font-weight: 700; }
.text-2xl { font-size: 22px; font-weight: 800; }
.text-3xl { font-size: 28px; font-weight: 900; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* --- Layout --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* --- Spacing --- */
.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-flat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-clickable {
  cursor: pointer;
}
.card-clickable:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(37,99,235,0.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--outline);
}
.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #DC2626;
  transform: translateY(-1px);
}
.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover:not(:disabled) {
  background: #059669;
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* --- Inputs --- */
.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.input::placeholder {
  color: var(--text-muted);
}
.input-lg {
  padding: 14px 18px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}
textarea.input {
  resize: vertical;
  min-height: 80px;
}
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-error {
  font-size: 12px;
  color: var(--error);
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-error { background: var(--error-light); color: var(--error); }
.badge-warning { background: var(--warning-light); color: var(--accent); }
.badge-info { background: var(--info-light); color: var(--info); }

/* --- Chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.chip:hover {
  background: var(--surface-hover);
  border-color: var(--outline);
}
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Toggle --- */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle.active {
  background: var(--primary);
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle.active::after {
  transform: translateX(20px);
}

/* --- Avatar --- */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  background: var(--primary-gradient);
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }

.header-icon-btn,
.header-profile-button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}
.header-icon-btn:hover,
.header-profile-button:hover { color: var(--primary); }
.notification-count {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--error);
  color: white;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 800;
}
.notification-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.notification-row {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.notification-row:hover { background: var(--bg); }
.notification-row.unread { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.notification-row-icon { color: var(--primary); width: 24px; text-align: center; padding-top: 2px; }
.notification-row-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notification-row-copy strong { font-size: 13px; }
.notification-row-copy span { font-size: 13px; color: var(--text-secondary); }
.notification-row-copy small { font-size: 11px; color: var(--text-muted); }

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.6s ease;
}
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--accent); }

/* --- Sidebar Layout --- */
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 900;
}
.sidebar-logo-text {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 12px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-link svg,
.sidebar-link i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-detail {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* --- Main Content Area --- */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.main-content {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* --- Mobile Sidebar Overlay --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 39;
}
.sidebar-overlay.visible {
  display: block;
}

/* --- Mobile Hamburger --- */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text);
}
.hamburger:hover {
  background: var(--surface-hover);
}
.hamburger svg {
  width: 24px;
  height: 24px;
}

/* --- Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: var(--surface-hover);
}
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.data-table th.sortable:hover {
  color: var(--primary);
}
.data-table th.sorted {
  color: var(--primary);
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.empty-state-text {
  font-size: 14px;
  max-width: 320px;
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 50%, #7C3AED 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 40%);
  animation: loginBgPulse 20s ease-in-out infinite;
}
@keyframes loginBgPulse {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 2%) scale(1.02); }
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}
.login-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
}
.google-btn:hover {
  background: var(--surface-hover);
  border-color: var(--outline);
  box-shadow: var(--shadow-md);
}
.google-btn svg {
  width: 20px;
  height: 20px;
}
.student-login-toggle {
  width: 100%;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
}
.student-login-toggle:hover {
  text-decoration: underline;
}

/* --- Stat Card --- */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-card-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card-value {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}
.stat-card-value.primary { color: var(--primary); }
.stat-card-value.success { color: var(--success); }
.stat-card-value.warning { color: var(--accent); }
.stat-card-value.error { color: var(--error); }

/* --- Quick Action Card --- */
.action-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.action-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.action-card.primary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.action-card.primary:hover {
  background: var(--primary);
  color: white;
}
.action-card.success {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}
.action-card.success:hover {
  background: var(--success);
  color: white;
}

/* --- List Link Card (for dashboard sections) --- */
.list-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}
.list-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.list-link-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.list-link-content {
  flex: 1;
  min-width: 0;
}
.list-link-title {
  font-size: 14px;
  font-weight: 600;
}
.list-link-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-link-arrow {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* --- Section Header --- */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* --- Announcement Card --- */
.announcement-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
}
.announcement-card.critical {
  border-color: var(--error);
  background: var(--error-light);
}
.announcement-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.announcement-icon.critical {
  background: var(--error-light);
  color: var(--error);
}
.announcement-icon.normal {
  background: var(--primary-light);
  color: var(--primary);
}

/* --- Student Portal --- */
.portal-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
.portal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.portal-tab {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.portal-tab:hover {
  color: var(--text);
}
.portal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.portal-content {
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
}

/* --- Hero Card (Student Progress) --- */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}
.hero-stat {
  text-align: center;
}
.hero-stat-value {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}
.hero-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Trip Progress --- */
.trip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.trip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.trip-card-name {
  font-size: 15px;
  font-weight: 700;
}
.trip-card-location {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.modal-body {
  padding: 20px 24px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 20px;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

/* --- Loading / Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Grid --- */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.page-enter { animation: slideInUp 0.25s ease-out; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .hamburger {
    display: flex;
  }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-header {
    padding: 0 16px;
  }
  .main-content {
    padding: 16px;
  }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .login-card { padding: 28px; }
}

@media (max-width: 480px) {
  .main-content { padding: 12px; }
  .card { padding: 14px; }
  .btn { padding: 8px 16px; }
}

/* --- Utility: Copy Button --- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  cursor: pointer;
  transition: all var(--transition);
}
.copy-btn:hover {
  background: var(--primary);
  color: white;
}

/* --- Tab Content --- */
.tab-content {
  animation: fadeIn 0.2s ease;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* ============================================
   Professional Discord-inspired UI Refresh
   ============================================ */

:root {
  --primary: #5865F2;
  --primary-hover: #4752C4;
  --primary-light: #E7E9FF;
  --primary-dark: #3C45A5;
  --primary-gradient: linear-gradient(135deg, #5865F2, #3BA55D);

  --secondary: #23A55A;
  --secondary-light: #DFF6E8;
  --accent: #F0B232;
  --accent-light: #FFF2D2;

  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-elevated: #F6F7F8;
  --surface-hover: #EDEFF2;

  --text: #1E1F22;
  --text-secondary: #4E5058;
  --text-muted: #80848E;
  --text-inverse: #FFFFFF;

  --border: #DCDDDF;
  --border-light: #ECEDEF;
  --outline: #B5BAC1;

  --success: #23A55A;
  --success-light: #DFF6E8;
  --error: #DA373C;
  --error-light: #FDE4E5;
  --warning: #F0B232;
  --warning-light: #FFF2D2;
  --info: #5865F2;
  --info-light: #E7E9FF;

  --shadow-sm: 0 1px 2px rgba(30, 31, 34, 0.06);
  --shadow: 0 1px 3px rgba(30, 31, 34, 0.08), 0 8px 24px rgba(30, 31, 34, 0.04);
  --shadow-md: 0 8px 24px rgba(30, 31, 34, 0.10);
  --shadow-lg: 0 18px 48px rgba(30, 31, 34, 0.18);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --sidebar-width: 288px;
  --header-height: 68px;
}

[data-theme="dark"] {
  --primary: #5865F2;
  --primary-hover: #6D74F7;
  --primary-light: rgba(88, 101, 242, 0.18);
  --primary-dark: #DDE0FF;

  --secondary: #23A55A;
  --secondary-light: rgba(35, 165, 90, 0.18);
  --accent: #F0B232;
  --accent-light: rgba(240, 178, 50, 0.18);

  --bg: #313338;
  --surface: #2B2D31;
  --surface-elevated: #383A40;
  --surface-hover: #404249;

  --text: #F2F3F5;
  --text-secondary: #DBDEE1;
  --text-muted: #949BA4;
  --text-inverse: #1E1F22;

  --border: #1E1F22;
  --border-light: #383A40;
  --outline: #4E5058;

  --success-light: rgba(35, 165, 90, 0.18);
  --error-light: rgba(218, 55, 60, 0.18);
  --warning-light: rgba(240, 178, 50, 0.18);
  --info-light: rgba(88, 101, 242, 0.18);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 220px),
    var(--bg);
}

[data-theme="dark"] body {
  background: var(--bg);
}

.layout,
.main {
  background: var(--bg);
}

.sidebar {
  width: var(--sidebar-width);
  background: #2B2D31;
  border-right: 0;
  color: #DBDEE1;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.2);
}

.sidebar-logo {
  min-height: 68px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(30, 31, 34, 0.72);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #5865F2;
  box-shadow: none;
}

.sidebar-logo-text {
  color: #F2F3F5;
  font-size: 18px;
  letter-spacing: 0;
}

.sidebar-nav {
  padding: 12px 10px;
}

.sidebar-section-label {
  color: #949BA4;
  font-size: 11px;
  letter-spacing: 0.6px;
  padding: 16px 10px 6px;
}

.sidebar-link {
  position: relative;
  color: #B5BAC1;
  border-radius: 6px;
  padding: 9px 10px;
  font-weight: 600;
}

.sidebar-link:hover {
  background: #35373C;
  color: #DBDEE1;
}

.sidebar-link.active {
  background: #404249;
  color: #FFFFFF;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #FFFFFF;
}

.sidebar-footer {
  border-top: 1px solid rgba(30, 31, 34, 0.72);
  background: #232428;
  padding: 10px;
}

.sidebar-user {
  color: #DBDEE1;
  border-radius: 8px;
}

.sidebar-user:hover {
  background: #35373C;
}

.sidebar-user-name {
  color: #F2F3F5;
}

.sidebar-user-detail {
  color: #8E9297;
  font-size: 11px;
}

.main {
  margin-left: var(--sidebar-width);
}

.main-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(30, 31, 34, 0.03);
}

[data-theme="dark"] .main-header {
  background: rgba(49, 51, 56, 0.9);
}

.main-content {
  padding: 28px;
}

.page-header {
  margin-bottom: 20px;
}

.page-title {
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.page-subtitle {
  color: var(--text-muted);
}

.card,
.card-flat,
.stat-card,
.list-link,
.announcement-card,
.trip-card,
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card:hover,
.card-clickable:hover,
.list-link:hover,
.announcement-card:hover,
.trip-card:hover {
  border-color: var(--outline);
  box-shadow: var(--shadow);
}

.btn {
  min-height: 40px;
  border-radius: 6px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn-primary {
  background: var(--primary);
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 8px 18px rgba(88, 101, 242, 0.24);
  transform: none;
}

.btn-secondary {
  background: var(--surface-elevated);
  border-color: transparent;
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled),
.hamburger:hover {
  background: var(--surface-hover);
  border-color: transparent;
}

.btn-danger {
  background: var(--error);
}

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

.btn-icon {
  border-radius: 8px;
}

.input {
  min-height: 42px;
  background: var(--surface-elevated);
  border-color: transparent;
  border-radius: 6px;
}

.input:hover {
  background: var(--surface-hover);
}

.input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}

.badge {
  border-radius: 4px;
  letter-spacing: 0;
}

.chip {
  background: var(--surface-elevated);
  border-color: transparent;
  border-radius: 6px;
}

.chip:hover {
  background: var(--surface-hover);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
}

.avatar {
  background: #5865F2;
  border-radius: 50%;
  box-shadow: inset 0 -10px 22px rgba(30, 31, 34, 0.14);
}

.stat-card {
  padding: 18px;
}

.stat-card-label {
  color: var(--text-muted);
  letter-spacing: 0;
}

.stat-card-value {
  font-size: 34px;
  letter-spacing: 0;
}

.action-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.action-card:hover {
  transform: none;
}

.action-card.primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.action-card.primary:hover {
  background: var(--primary-hover);
}

.action-card.success {
  background: var(--success);
  color: #FFFFFF;
  border-color: var(--success);
}

.list-link {
  padding: 14px;
}

.list-link-icon {
  border-radius: 8px;
}

.list-link-title {
  color: var(--text);
  font-weight: 700;
}

.list-link-arrow {
  color: var(--text-muted);
  font-size: 18px;
}

.section-label {
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

.data-table {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table th {
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0;
}

.data-table td {
  border-bottom: 1px solid var(--border-light);
}

.data-table tr:hover td {
  background: var(--surface-elevated);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--outline);
  border-radius: var(--radius-lg);
}

.modal-overlay {
  background: rgba(30, 31, 34, 0.72);
  backdrop-filter: blur(4px);
}

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding-top: 22px;
}

.modal-close {
  border-radius: 6px;
}

.toast {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.login-page {
  align-items: stretch;
  justify-content: center;
  background: #313338;
  padding: 32px;
}

.login-page::before {
  display: none;
}

.login-card {
  align-self: center;
  background: #2B2D31;
  border: 1px solid #1E1F22;
  border-radius: 14px;
  color: #F2F3F5;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.login-logo-icon {
  background: #5865F2;
  border-radius: 16px;
  box-shadow: none;
}

.login-title {
  color: #FFFFFF;
  letter-spacing: 0;
}

.login-subtitle,
.login-card .form-label,
.login-card .form-hint {
  color: #B5BAC1;
}

.login-card .input {
  background: #1E1F22;
  color: #F2F3F5;
}

.login-card .input:hover,
.login-card .input:focus {
  background: #232428;
}

.google-btn {
  background: #F2F3F5;
  border: 0;
  border-radius: 8px;
  color: #1E1F22;
}

.google-btn:hover {
  background: #FFFFFF;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.student-login-toggle {
  color: #C9CDFB;
}

@media (max-width: 1024px) {
  .main {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }

  .main-header {
    padding: 0 16px;
  }

  .login-page {
    padding: 20px;
  }
}

/* Register Sections */
.register-section {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 12px;
  overflow: hidden;
}

.register-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.register-section-header:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.register-section-content {
  padding: 0 16px 16px 16px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 2000px;
  opacity: 1;
}

.register-section.collapsed .register-section-content {
  max-height: 0;
  opacity: 0;
  padding: 0 16px;
  overflow: hidden;
}

.register-section.collapsed .section-toggle {
  transform: rotate(-90deg);
}

.section-toggle {
  transition: transform 0.2s ease;
  color: var(--text-secondary, #6c757d);
}
