/* ================================================================
   Design System — AI AC/DC Assessment Center Platform
   All pages import this file for unified visual language.
   ================================================================ */

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

/* ── CSS Variables (Light Theme — Default) ── */
:root {
  /* Colors — Light */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #f8fafc;
  --bg-elevated: #eef2f7;
  --bg-input: #ffffff;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  --accent-primary: #e11d48;
  --accent-secondary: #be185d;
  --accent-gradient: linear-gradient(135deg, #e11d48, #be185d);
  --accent-gradient-hover: linear-gradient(135deg, #be185d, #9f1239);

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.08);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --info: #0891b2;
  --info-bg: rgba(8, 145, 178, 0.08);

  --border-default: #e5e7eb;
  --border-subtle: #f3f4f6;
  --border-hover: #e11d48;
  --border-focus: #e11d48;

  /* Typography — 가독성 개선 (살짝 키움) */
  --font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Pretendard', sans-serif;
  --font-size-xs: 13px;
  --font-size-sm: 14.5px;
  --font-size-base: 16.5px;
  --font-size-md: 18px;
  --font-size-lg: 21px;
  --font-size-xl: 28px;
  --font-size-2xl: 36px;
  --font-size-3xl: 46px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.35;
  --line-height-normal: 1.65;
  --line-height-relaxed: 1.85;

  /* Spacing — 약간 넉넉하게 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 14px;
  --space-base: 18px;
  --space-lg: 22px;
  --space-xl: 28px;
  --space-2xl: 36px;
  --space-3xl: 52px;
  --space-4xl: 72px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows — 라이트 모드용 부드러운 그림자 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.09);
  --shadow-xl: 0 14px 44px rgba(0, 0, 0, 0.11);
  --shadow-glow: 0 0 16px rgba(225, 29, 72, 0.08);
  --shadow-glow-accent: 0 0 24px rgba(225, 29, 72, 0.12);
  --shadow-glow-secondary: 0 0 24px rgba(190, 24, 93, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-modal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  /* Chat UI */
  --chat-panel-bg: rgba(245, 247, 250, 0.9);
  --chat-overlay-bg: rgba(0, 0, 0, 0.3);
  --chat-modal-bg: var(--bg-secondary);

  /* Semantic Light Variants (for gradients) */
  --success-light: #34d399;
  --accent-primary-light: #fb7185;
  --warning-light: #fbbf24;
  --danger-light: #f87171;

  /* Grade Colors */
  --grade-s: #f59e0b;
  --grade-a: #10b981;
  --grade-b: #3b82f6;
  --grade-c: #8b5cf6;
  --grade-d: #ef4444;
  --grade-s-bg: rgba(245, 158, 11, 0.15);
  --grade-a-bg: rgba(16, 185, 129, 0.15);
  --grade-b-bg: rgba(59, 130, 246, 0.15);
  --grade-c-bg: rgba(139, 92, 246, 0.15);
  --grade-d-bg: rgba(239, 68, 68, 0.15);

  /* Overlay Backgrounds */
  --overlay-modal-bg: rgba(0, 0, 0, 0.5);
  --overlay-loading-bg: rgba(0, 0, 0, 0.4);
  --overlay-briefing-bg: rgba(0, 0, 0, 0.65);

  /* Accent Alpha (accent-primary at various opacities) */
  --accent-primary-alpha-05: rgba(225, 29, 72, 0.05);
  --accent-primary-alpha-10: rgba(225, 29, 72, 0.1);
  --accent-primary-alpha-15: rgba(225, 29, 72, 0.15);

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ── Sepia Theme ── */
[data-theme="sepia"] {
  --bg-primary: #f4f0e8;
  --bg-secondary: #faf8f3;
  --bg-card: #f0ece3;
  --bg-elevated: #e8e3d8;
  --bg-input: #faf8f3;

  --text-primary: #3d3229;
  --text-secondary: #6b5d50;
  --text-muted: #7a6b5c;
  --text-inverse: #faf8f3;

  --accent-primary: #9f1239;
  --accent-secondary: #881337;
  --accent-gradient: linear-gradient(135deg, #9f1239, #881337);
  --accent-gradient-hover: linear-gradient(135deg, #8b1034, #751130);

  --success: #3d7a3d;
  --success-bg: rgba(61, 122, 61, 0.1);
  --warning: #b45309;
  --warning-bg: rgba(180, 83, 9, 0.1);
  --danger: #b91c1c;
  --danger-bg: rgba(185, 28, 28, 0.1);
  --info: #1e6a7a;
  --info-bg: rgba(30, 106, 122, 0.1);

  --border-default: #e0d9cc;
  --border-subtle: #ebe6db;
  --border-hover: #9f1239;
  --border-focus: #9f1239;

  --shadow-sm: 0 1px 3px rgba(80, 60, 30, 0.06);
  --shadow-md: 0 4px 14px rgba(80, 60, 30, 0.08);
  --shadow-lg: 0 8px 28px rgba(80, 60, 30, 0.1);
  --shadow-xl: 0 14px 44px rgba(80, 60, 30, 0.12);
  --shadow-glow: 0 0 16px rgba(159, 18, 57, 0.08);
  --shadow-glow-accent: 0 0 24px rgba(159, 18, 57, 0.12);
  --shadow-glow-secondary: 0 0 24px rgba(136, 19, 55, 0.1);

  --success-light: #6b9f6b;
  --accent-primary-light: #e11d48;
  --warning-light: #d9a441;
  --danger-light: #d45454;

  --grade-s: #d97706;
  --grade-a: #3d7a3d;
  --grade-b: #2563eb;
  --grade-c: #7c3aed;
  --grade-d: #b91c1c;
  --grade-s-bg: rgba(217, 119, 6, 0.15);
  --grade-a-bg: rgba(61, 122, 61, 0.15);
  --grade-b-bg: rgba(37, 99, 235, 0.15);
  --grade-c-bg: rgba(124, 58, 237, 0.15);
  --grade-d-bg: rgba(185, 28, 28, 0.15);

  --chat-panel-bg: rgba(244, 240, 232, 0.9);
  --chat-overlay-bg: rgba(0, 0, 0, 0.25);
  --chat-modal-bg: #faf8f3;

  /* Overlay Backgrounds */
  --overlay-modal-bg: rgba(0, 0, 0, 0.45);
  --overlay-loading-bg: rgba(0, 0, 0, 0.35);
  --overlay-briefing-bg: rgba(0, 0, 0, 0.6);

  /* Accent Alpha (accent-primary at various opacities) */
  --accent-primary-alpha-05: rgba(159, 18, 57, 0.05);
  --accent-primary-alpha-10: rgba(159, 18, 57, 0.1);
  --accent-primary-alpha-15: rgba(159, 18, 57, 0.15);
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-elevated: #1e293b;
  --bg-input: #0f172a;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #8393a7;
  --text-inverse: #0a0f1a;

  --accent-primary: #fb7185;
  --accent-secondary: #f472b6;
  --accent-gradient: linear-gradient(135deg, #fb7185, #f472b6);
  --accent-gradient-hover: linear-gradient(135deg, #e11d48, #db2777);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.12);

  --border-default: #1e293b;
  --border-subtle: #162032;
  --border-hover: #fb7185;
  --border-focus: #fb7185;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 16px rgba(251, 113, 133, 0.15);
  --shadow-glow-accent: 0 0 24px rgba(251, 113, 133, 0.25);
  --shadow-glow-secondary: 0 0 24px rgba(244, 114, 182, 0.2);

  --success-light: #6ee7b7;
  --accent-primary-light: #fda4af;
  --warning-light: #fcd34d;
  --danger-light: #fca5a5;

  --grade-s: #fbbf24;
  --grade-a: #34d399;
  --grade-b: #60a5fa;
  --grade-c: #a78bfa;
  --grade-d: #f87171;
  --grade-s-bg: rgba(251, 191, 36, 0.15);
  --grade-a-bg: rgba(52, 211, 153, 0.15);
  --grade-b-bg: rgba(96, 165, 250, 0.15);
  --grade-c-bg: rgba(167, 139, 250, 0.15);
  --grade-d-bg: rgba(248, 113, 113, 0.15);

  --chat-panel-bg: rgba(10, 15, 26, 0.9);
  --chat-overlay-bg: rgba(0, 0, 0, 0.7);
  --chat-modal-bg: #111827;

  /* Overlay Backgrounds */
  --overlay-modal-bg: rgba(0, 0, 0, 0.6);
  --overlay-loading-bg: rgba(0, 0, 0, 0.5);
  --overlay-briefing-bg: rgba(0, 0, 0, 0.75);

  /* Accent Alpha (accent-primary at various opacities) */
  --accent-primary-alpha-05: rgba(251, 113, 133, 0.05);
  --accent-primary-alpha-10: rgba(251, 113, 133, 0.1);
  --accent-primary-alpha-15: rgba(251, 113, 133, 0.15);
}

/* ── Global Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* ── SVG Icon Utility ── */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 48px; height: 48px; }

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, .hero-title, .page-title {
  font-family: var(--font-display);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-family);
}

input, select, textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select {
  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='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

::selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

/* ── Theme Toggle ── */
.theme-toggle-btn {
  cursor: pointer;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

/* 테마 토글 아이콘은 JS에서 동적 설정 */

/* ── 등급 색상 통일 (모든 페이지 공통) ── */
.grade-S, .grade-badge-s, .grade-s { color: var(--grade-s); }
.grade-A, .grade-badge-a, .grade-a { color: var(--grade-a); }
.grade-B, .grade-badge-b, .grade-b { color: var(--grade-b); }
.grade-C, .grade-badge-c, .grade-c { color: var(--grade-c); }
.grade-D, .grade-badge-d, .grade-d { color: var(--grade-d); }

/* ── 접근성: 모션 감소 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

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

/* ── Accessibility: Focus Visible ── */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Global Navigation ── */
.global-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.nav-logo-text {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.3px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

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

/* ── Card Component ── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.card-elevated {
  background: var(--bg-elevated);
}

/* ── Badge Component ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-accent {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-primary);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-secondary);
}

/* ── Button Components ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-glow-accent);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.08);
  color: var(--accent-secondary);
  border: 1px solid rgba(139, 92, 246, 0.2);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-ghost:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.4);
}

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-size-md);
  border-radius: var(--radius-md);
}

/* ── Status Dot ── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.status-dot.loading {
  background: var(--warning);
  animation: statusBlink 1s infinite;
}

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

.status-dot.inactive {
  background: var(--text-muted);
}

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

/* ── Page Enter Animation ── */
.page-enter {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Loading Spinner ── */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.loading-spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.loading-spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading overlay for sections */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-sm);
  min-width: 320px;
  max-width: 520px;
  animation: toastIn 0.3s ease-out;
  color: var(--text-primary);
}

.toast.toast-exit {
  animation: toastOut 0.25s ease-in forwards;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-info {
  border-left: 3px solid var(--info);
}

.toast-icon {
  flex-shrink: 0;
  font-size: var(--font-size-md);
}

.toast-message {
  flex: 1;
}

.toast-close {
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  font-size: var(--font-size-sm);
  background: none;
  border: none;
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-modal-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease-out;
  opacity: 1;
  transition: opacity var(--transition-base);
}

.modal-overlay.closing {
  opacity: 0;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 32px;
}

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

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 18px;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.modal-body {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
}

/* ── Form Group ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--danger);
}

/* ── Tag Component ── */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xs);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(59, 130, 246, 0.12);
  white-space: nowrap;
}

/* ── Divider ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-default);
  margin: 24px 0;
}

/* ── Section Title ── */
.section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Toggle Switch ── */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition-base);
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-track::after {
  left: 20px;
  background: var(--accent-primary);
}

.toggle-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-description {
  font-size: var(--font-size-sm);
  max-width: 480px;
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Confirmation Dialog ── */
.confirm-dialog .modal-content {
  max-width: 520px;
}

.confirm-message {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: 24px;
}

/* ── Pending Session Banner ── */
.pending-banner {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: slideDown 0.3s ease-out;
}

.pending-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-sm);
  color: var(--warning);
}

.pending-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Utility: Container ── */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-sm {
  max-width: 960px;
}

.container-lg {
  max-width: 1600px;
}

/* ── Mobile Breakpoints ── */
@media (max-width: 768px) {
  .container {
    padding: 0 18px;
  }

  .card {
    padding: 18px;
  }

  .modal-content {
    max-width: 90vw;
  }

  .btn {
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  :root {
    --font-size-2xl: 26px;
    --font-size-3xl: 32px;
  }

  .global-nav {
    padding: 12px 16px;
  }

  .nav-logo-text {
    font-size: var(--font-size-base);
  }

  .container {
    padding: 0 16px;
  }

  .card {
    padding: 16px;
  }

  .modal-content {
    padding: 20px;
    margin: 12px;
    max-height: 90vh;
  }

  .toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  .pending-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pending-banner-actions {
    justify-content: center;
  }

  .theme-toggle-btn {
    width: 44px;
    height: 44px;
  }

  .modal-close,
  .toast-close {
    min-width: 44px;
    min-height: 44px;
  }

  .btn-sm {
    min-height: 44px;
  }
}

@media (max-width: 375px) {
  :root {
    --font-size-2xl: 22px;
    --font-size-3xl: 28px;
    --font-size-xl: 20px;
  }

  .container {
    padding: 0 12px;
  }

  .card {
    padding: 14px;
  }

  .modal-content {
    padding: 16px;
    margin: 8px;
  }
}

@media (max-width: 1024px) {
  .container-lg {
    max-width: 100%;
  }
}

/* ── Print Styles ── */
@media print {
  .global-nav,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
