/* ======================================================
   Section Selection Tool — Styles
   Dark-first design, CSS custom properties, glassmorphism
   ====================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Dark theme (default) */
  --bg-primary: #0f1117;
  --bg-secondary: #181b24;
  --bg-card: #1e222d;
  --bg-card-hover: #252a37;
  --bg-input: #252a37;
  --bg-glass: rgba(30, 34, 45, 0.75);
  --border: #2a2f3d;
  --border-hover: #3a4055;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0b0;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

body.light {
  --bg-primary: #f3f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f1f5;
  --bg-input: #f0f1f5;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --border: #e0e2e8;
  --border-hover: #c8cbd4;
  --text-primary: #1a1c24;
  --text-secondary: #5a6070;
  --text-muted: #9aa0b0;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-glow: rgba(79, 70, 229, 0.18);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
button { cursor: pointer; font-family: inherit; }
select, input { font-family: inherit; }

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

/* ---------- Top Bar ---------- */
#top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-left h1 {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.credit-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}

.credit-badge svg { width: 16px; height: 16px; color: var(--accent); }
.credit-badge.warning { border-color: var(--warning); color: var(--warning); }
.credit-badge.warning svg { color: var(--warning); }
.credit-badge.danger { border-color: var(--danger); color: var(--danger); animation: pulse-danger 1.5s infinite; }
.credit-badge.danger svg { color: var(--danger); }

@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.icon-btn:hover { background: var(--bg-card-hover); border-color: var(--border-hover); color: var(--text-primary); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }
.hidden { display: none !important; }

/* ---------- Main ---------- */
#app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}

/* ---------- Upload Section ---------- */
#upload-section {
  margin-bottom: 24px;
}

.drop-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.drop-zone:hover::before, .drop-zone.drag-over::before { opacity: 1; }

.drop-zone-content {
  position: relative;
  text-align: center;
  padding: 32px;
  z-index: 1;
}

.upload-icon {
  width: 52px;
  height: 52px;
  color: var(--accent);
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.drop-zone-content h2 { font-size: 1.25rem; margin-bottom: 6px; }
.drop-zone-content p { color: var(--text-secondary); font-size: 0.95rem; }
.drop-zone-content p strong { color: var(--accent); }
.drop-zone-hint { display: block; margin-top: 10px; font-size: 0.8rem; color: var(--text-muted); }

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--success-bg);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 12px;
  animation: slide-in 0.3s ease;
}

.file-info svg { width: 20px; height: 20px; color: var(--success); flex-shrink: 0; }
#file-name { font-weight: 600; }
#file-rows { color: var(--text-secondary); }
.text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin-left: auto;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-btn:hover { color: var(--accent-hover); }

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

/* ---------- How It Works ---------- */
.how-it-works {
  margin-bottom: 28px;
  text-align: center;
}

.how-it-works > h2 {
  font-size: 1.15rem;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px 16px;
  text-align: center;
  transition: all 0.25s ease;
  position: relative;
}

.step-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.step-card h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.step-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.step-card p strong {
  color: var(--accent);
  font-weight: 600;
}

.shortcuts-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.shortcut-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'Inter', monospace;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 580px) {
  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-wrapper {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-wrapper input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}

.search-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group select {
  padding: 10px 32px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa0b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- Content Grid ---------- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.panel-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Panel ---------- */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 { font-size: 1rem; }
.panel-header-actions { display: flex; gap: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
}
.badge.danger { background: var(--danger); }

.section-subject-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.placeholder-text {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Subject List ---------- */
.subject-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}

.subject-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  gap: 10px;
}

.subject-item:hover { background: var(--bg-card-hover); }
.subject-item.active { background: var(--accent-glow); border-left: 3px solid var(--accent); }

.subject-item-info { display: flex; flex-direction: column; min-width: 0; }
.subject-item-code { font-weight: 700; font-size: 0.87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-item-title { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-item-meta { font-size: 0.73rem; color: var(--text-muted); white-space: nowrap; }
.subject-item-selected-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

/* ---------- Section List ---------- */
.section-list {
  padding: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.section-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg-secondary);
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.section-card:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.section-card.selected { border-color: var(--success); background: var(--success-bg); }
.section-card.conflict-highlight { border-color: var(--danger); background: var(--danger-bg); animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.section-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.section-credit {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
}

.section-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.section-detail-grid span strong {
  color: var(--text-primary);
  font-weight: 600;
}

.section-faculty {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.faculty-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.section-status-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-status-icon.check { background: var(--success); color: #fff; }

/* ---------- Selected List ---------- */
.selected-list {
  padding: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg-secondary);
  transition: all var(--transition);
  animation: slide-in 0.25s ease;
}

.selected-card-info { display: flex; flex-direction: column; min-width: 0; }
.selected-card-code { font-weight: 700; font-size: 0.87rem; }
.selected-card-detail { font-size: 0.78rem; color: var(--text-secondary); }
.selected-card-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.selected-card .remove-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
}
.selected-card .remove-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.selected-card .remove-btn svg { width: 14px; height: 14px; }

.selected-card.has-conflict { border-color: var(--danger); }

/* ---------- Conflict Panel ---------- */
.conflict-panel { border-color: var(--danger); }
.conflict-list { padding: 8px; max-height: 200px; overflow-y: auto; }

.conflict-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--danger-bg);
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--danger);
  line-height: 1.4;
}

.conflict-item svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }

/* ---------- Small Button ---------- */
.small-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
}
.small-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.small-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.small-btn svg { width: 14px; height: 14px; }

/* ---------- Timetable ---------- */
.timetable-panel { overflow: visible; }

.timetable-grid {
  display: grid;
  grid-template-columns: 80px repeat(6, 1fr);
  grid-template-rows: auto;
  gap: 1px;
  background: var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  font-size: 0.78rem;
}

.tt-header {
  background: var(--bg-card-hover);
  padding: 10px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tt-time-label {
  background: var(--bg-card);
  padding: 6px 8px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.72rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 48px;
}

.tt-cell {
  background: var(--bg-card);
  min-height: 48px;
  position: relative;
  padding: 2px;
}

.tt-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: pop-in 0.3s ease;
}

.tt-block:hover { transform: scale(1.03); z-index: 5; box-shadow: var(--shadow); }
.tt-block-code { font-weight: 700; }
.tt-block-section { opacity: 0.85; font-weight: 500; }

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Soft color palette for course blocks */
.color-0 { background: rgba(99,102,241,0.25); color: #a5b4fc; border-left: 3px solid #6366f1; }
.color-1 { background: rgba(168,85,247,0.25); color: #c4b5fd; border-left: 3px solid #a855f7; }
.color-2 { background: rgba(236,72,153,0.25); color: #f9a8d4; border-left: 3px solid #ec4899; }
.color-3 { background: rgba(20,184,166,0.25); color: #5eead4; border-left: 3px solid #14b8a6; }
.color-4 { background: rgba(245,158,11,0.25); color: #fcd34d; border-left: 3px solid #f59e0b; }
.color-5 { background: rgba(34,197,94,0.25); color: #86efac; border-left: 3px solid #22c55e; }
.color-6 { background: rgba(59,130,246,0.25); color: #93c5fd; border-left: 3px solid #3b82f6; }
.color-7 { background: rgba(239,68,68,0.25); color: #fca5a5; border-left: 3px solid #ef4444; }
.color-8 { background: rgba(251,146,60,0.25); color: #fdba74; border-left: 3px solid #fb923c; }
.color-9 { background: rgba(6,182,212,0.25); color: #67e8f9; border-left: 3px solid #06b6d4; }

body.light .color-0 { background: rgba(99,102,241,0.12); color: #4338ca; }
body.light .color-1 { background: rgba(168,85,247,0.12); color: #7c3aed; }
body.light .color-2 { background: rgba(236,72,153,0.12); color: #be185d; }
body.light .color-3 { background: rgba(20,184,166,0.12); color: #0f766e; }
body.light .color-4 { background: rgba(245,158,11,0.12); color: #b45309; }
body.light .color-5 { background: rgba(34,197,94,0.12); color: #15803d; }
body.light .color-6 { background: rgba(59,130,246,0.12); color: #1d4ed8; }
body.light .color-7 { background: rgba(239,68,68,0.12); color: #b91c1c; }
body.light .color-8 { background: rgba(251,146,60,0.12); color: #c2410c; }
body.light .color-9 { background: rgba(6,182,212,0.12); color: #0e7490; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.3s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 { font-size: 1.15rem; margin-bottom: 10px; }
.modal p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; }

#conflict-modal-details {
  padding: 12px 14px;
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-xs);
  font-size: 0.83rem;
  color: var(--danger);
  margin-bottom: 16px;
  line-height: 1.5;
}

#conflict-suggestions h4 { font-size: 0.9rem; margin-bottom: 8px; }

#suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.suggestion-item:hover { border-color: var(--success); background: var(--success-bg); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.modal-btn {
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}

.modal-btn.secondary { background: var(--bg-input); color: var(--text-primary); }
.modal-btn.secondary:hover { background: var(--bg-card-hover); }
.modal-btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.modal-btn.danger:hover { background: #dc2626; }

/* ---------- Toasts ---------- */
#toast-container {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-in 0.35s ease;
  max-width: 380px;
}

.toast.success { border-color: var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.warning { border-color: var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error { border-color: var(--danger); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info { border-color: var(--accent); }
.toast.info .toast-icon { color: var(--accent); }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.removing {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(40px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
  #app { padding: 16px; }
}

@media (max-width: 640px) {
  #top-bar { padding: 10px 16px; }
  .top-bar-left h1 { font-size: 1rem; }
  .filter-bar { flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-group select { flex: 1; }
  .timetable-grid { font-size: 0.68rem; grid-template-columns: 50px repeat(6, 1fr); }
}
