/* ==========================================================================
   스마트 송영 매칭 시스템 - Premium Vanilla CSS Design System
   ========================================================================== */

/* 1. 디자인 시스템 토큰 & 리셋 */
:root {
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', 'Noto Sans KR', sans-serif;

  /* Color Palette */
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --color-primary: #4f46e5;
  --color-primary-light: #818cf8;
  --color-primary-dark: #3730a3;
  --color-secondary: #0ea5e9;
  --color-secondary-light: #38bdf8;
  --color-accent: #f59e0b;
  --color-accent-light: #fbbf24;
  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-danger: #f43f5e;
  --color-danger-light: #fb7185;
  
  /* Text Colors */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Card & Glassmorphism */
  --bg-glass-card: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(226, 232, 240, 0.8);
  --shadow-premium: 0 10px 30px -10px rgba(79, 70, 229, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 40px -15px rgba(79, 70, 229, 0.15), 0 4px 6px rgba(0, 0, 0, 0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Vehicle Colors */
  --color-v1: #4f46e5;
  --color-v2: #0ea5e9;
  --color-v3: #10b981;
  --color-v4: #d946ef;
  --color-v5: #f97316;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

/* 2. Layout Structure */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Mode Selector */
.mode-selector {
  display: flex;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.mode-btn {
  border: none;
  background: none;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Date Navigator */
.date-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#current-date-text {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 150px;
  text-align: center;
}

.date-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.date-nav-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* App Body Grid Layout */
.app-body {
  display: grid;
  grid-template-columns: 280px 1fr 380px;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  flex: 1;
  height: calc(100vh - 75px);
  overflow: hidden;
}

@media (max-width: 1400px) {
  .app-body {
    grid-template-columns: 260px 1fr 340px;
  }
}

@media (max-width: 1200px) {
  .app-body {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }
}

/* 3. Cards & Glassmorphism */
.glass-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.glass-card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
}

/* Sidebar Left: Scheduler */
.sidebar-left {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-left .glass-card {
  height: 100%;
}

/* Badges */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-info {
  background-color: rgba(79, 70, 229, 0.1);
  color: var(--color-primary);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.badge-danger {
  background-color: rgba(244, 63, 94, 0.1);
  color: var(--color-danger);
}

/* Mini Calendar */
.mini-calendar {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  background: #ffffff;
  margin-bottom: 1.25rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.75rem;
}

.cal-day-label {
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.cal-day {
  padding: 0.35rem 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.cal-day:hover {
  background-color: #f1f5f9;
}

.cal-day.active {
  background-color: var(--color-primary);
  color: var(--text-inverse);
  font-weight: 600;
}

.cal-day.today {
  border: 1px solid var(--color-primary);
}

.cal-day.has-matching::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--color-success);
  border-radius: 50%;
}

/* Attendance Scroll Section */
.attendance-list-section {
  margin-bottom: 1.25rem;
}

.attendance-list-section h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.section-title-row h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.btn-mgmt-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-mgmt-link:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-primary-dark);
}

.attendance-scroll-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 2px;
}

/* Custom Scrollbar for Attendance list */
.attendance-scroll-list::-webkit-scrollbar {
  width: 4px;
}
.attendance-scroll-list::-webkit-scrollbar-track {
  background: transparent;
}
.attendance-scroll-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.attendance-scroll-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Switch UI */
.switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.switch-item:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.switch-item.absent {
  opacity: 0.65;
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.switch-item.absent:hover {
  transform: none;
  box-shadow: none;
}

.switch-label {
  display: flex;
  flex-direction: column;
}

.switch-subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Custom Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-success);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* 4. Central Dashboard */
.main-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.dashboard-action-bar {
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #f8fafc;
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--text-inverse);
}

.btn-accent:hover {
  background-color: #d97706;
}

.btn-kakao {
  background-color: #fee500;
  color: #191919;
}

.btn-kakao:hover {
  background-color: #fdd835;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

/* Pulse Animation for CTA Button */
.btn-pulse {
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 1rem;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 420px 500px;
    height: auto;
    overflow: visible;
  }
}

/* Map Card */
.map-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-body {
  padding: 0;
  background-color: #f8fafc;
  position: relative;
}

.map-legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-center { background-color: var(--color-danger); }
.dot-teacher { background-color: var(--color-primary); }
.dot-elder { background-color: #cbd5e1; }

.map-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

/* SVG Elements style */
#route-svg {
  background-color: #f8fafc;
}

.svg-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
  stroke-dasharray: 4,4;
}

.svg-route-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8,4;
  animation: moveRoute 15s linear infinite;
  opacity: 0.85;
}

.svg-route-path.inactive {
  stroke: #cbd5e1 !important;
  opacity: 0.3;
}

@keyframes moveRoute {
  to {
    stroke-dashoffset: -120;
  }
}

.map-node {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.map-node:hover {
  transform: scale(1.3);
}

.map-node-label {
  font-size: 8px;
  font-weight: 600;
  fill: var(--text-main);
  text-anchor: middle;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(255,255,255,0.8));
}

/* Vehicle details (right column equal height) */
.routes-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.routes-body {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-content: start;
  flex: 1;
  min-height: 0;
  padding-bottom: 0.5rem;
}

.no-data-placeholder {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
}

.no-data-placeholder i {
  font-size: 3rem;
  color: #cbd5e1;
}

/* Vehicle Route Card Item */
.vehicle-route-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s;
  position: relative;
  border-top-width: 4px; /* Color-coded based on vehicle */
}

.vehicle-route-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.05);
}

.vehicle-route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.vehicle-route-header:hover {
  background-color: #f8fafc;
}

.vehicle-name-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.vehicle-name-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.driver-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.driver-tag-absent {
  font-size: 0.7rem;
  color: var(--color-danger);
  font-weight: 600;
}

.capacity-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.capacity-nums {
  font-size: 0.8rem;
  font-weight: 600;
}

.capacity-bar {
  width: 60px;
  height: 4px;
  background-color: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  background-color: var(--color-success);
  transition: width 0.3s ease;
}

.capacity-fill.danger {
  background-color: var(--color-danger);
}

/* Elders List within vehicle */
.vehicle-elders-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 80px;
  background-color: #f8fafc;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
}

.vehicle-elders-list.drag-over {
  background-color: #e0e7ff;
  border-color: var(--color-primary);
}

/* Elder Item Card */
.elder-route-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: grab;
  user-select: none;
  transition: all 0.15s;
}

.elder-route-item:active {
  cursor: grabbing;
}

.elder-route-item:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.elder-route-item.drag-over-above {
  border-top: 3px solid var(--color-primary) !important;
  margin-top: -1px;
}

.elder-route-item.drag-over-below {
  border-bottom: 3px solid var(--color-primary) !important;
  margin-bottom: -1px;
}

.elder-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.elder-sequence {
  width: 18px;
  height: 18px;
  background-color: #e2e8f0;
  color: var(--text-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
}

.elder-name-text {
  font-weight: 600;
}

.badge-stability-changed {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fef3c7;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
}

.elder-item-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.elder-eta {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.75rem;
}

.btn-move-elder {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem;
}

.btn-move-elder:hover {
  color: var(--color-primary);
}

.vehicle-route-footer {
  display: none;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: 0.5rem;
}

.vehicle-route-card.show-stats .vehicle-route-footer {
  display: flex !important;
  animation: slideDownStats 0.2s ease-out;
}

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

/* 5. Right Tab Panel */
.sidebar-right {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.right-tabs-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Tabs Nav */
.tab-nav {
  display: flex;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 0.75rem 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-main);
  background-color: rgba(255,255,255,0.4);
}

.tab-btn.active {
  color: var(--color-primary);
  background-color: #ffffff;
  border-bottom: 2px solid var(--color-primary);
}

.tab-content {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.tab-content.hidden,
.fs-tab-content.hidden,
.hidden {
  display: none !important;
}

.tab-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.tab-actions-row h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.section-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Results Content */
.results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

.preview-box {
  margin-top: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.preview-box h5 {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#kakao-preview-text {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  flex: 1;
}

/* Management Lists / Search Box */
.search-box {
  margin-bottom: 0.75rem;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.8rem;
}

.table-wrapper {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
  max-height: 400px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: #f1f5f9;
}

.btn-table-action {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.1rem 0.25rem;
}

.btn-table-action:hover {
  color: var(--color-primary);
}

.btn-table-delete:hover {
  color: var(--color-danger);
}

/* Settings Form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-group label strong {
  color: var(--color-primary);
}

.form-group input[type="range"] {
  width: 100%;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.9rem;
  background-color: #f8fafc;
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
  border-color: var(--color-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.range-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.settings-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* 6. Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(15, 23, 42, 0.4); /* slate-900 with 40% opacity */
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1010;
  transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: var(--radius-lg); /* 16px */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden; /* To clip header/footer backgrounds */
  border: 1px solid rgba(226, 232, 240, 0.8);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  background-color: #ffffff;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  margin: 0;
}

.modal-close {
  background: #f1f5f9;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: #f8fafc;
}

/* 7. Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1020;
}

.toast {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.50rem;
  font-size: 0.85rem;
  font-weight: 500;
  animation: toastSlideIn 0.3s ease-out, toastFadeOut 0.3s ease-in 2.7s forwards;
  border-left: 4px solid var(--color-primary);
}

.toast.toast-success { border-left-color: var(--color-success); }
.toast.toast-danger { border-left-color: var(--color-danger); }
.toast.toast-info { border-left-color: var(--color-secondary); }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastFadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* Avoidance Checklist styles */
.avoid-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.6rem;
  background-color: #f8fafc;
  margin-top: 0.25rem;
}

.avoid-list-container::-webkit-scrollbar {
  width: 4px;
}
.avoid-list-container::-webkit-scrollbar-track {
  background: transparent;
}
.avoid-list-container::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 2px;
}

.avoid-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.avoid-item:hover {
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.avoid-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-danger);
  cursor: pointer;
}

/* 7.5 Kakao Map Custom Styling & Placeholder */
.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  background-color: #f8fafc;
  color: var(--text-muted);
  text-align: center;
  gap: 0.75rem;
}

.map-placeholder i {
  font-size: 3.5rem;
  color: var(--color-primary-light);
  opacity: 0.6;
  animation: floatIcon 3s ease-in-out infinite;
}

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

.map-placeholder p {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 320px;
}

.placeholder-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.placeholder-tip strong {
  color: var(--color-primary);
}

/* Kakao CustomOverlay Label Styles */
.map-overlay-label {
  position: relative;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.map-overlay-label::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
}

.map-overlay-label.center {
  background-color: var(--color-danger);
  color: #ffffff;
  border-color: var(--color-danger);
}

.map-overlay-label.center::after {
  border-color: var(--color-danger) transparent;
}

.map-overlay-label.driver {
  background-color: var(--color-primary-dark);
  color: #ffffff;
  border-color: var(--color-primary-dark);
}

.map-overlay-label.driver::after {
  border-color: var(--color-primary-dark) transparent;
}

/* 8. Print Layout Styles */
.print-only-layout {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  .print-only-layout, .print-only-layout * {
    visibility: visible;
  }
  .print-only-layout {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    color: #000000;
    background-color: #ffffff;
    padding: 2cm;
  }
  .print-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #000;
    padding-bottom: 1rem;
  }
  .print-header h1 {
    font-size: 24px;
    margin-bottom: 0.5rem;
  }
  .print-header p {
    font-size: 14px;
    color: #555;
  }
  .print-vehicle-section {
    margin-bottom: 2rem;
    page-break-inside: avoid;
  }
  .print-vehicle-title {
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
  }
  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .print-table th {
    border: 1px solid #aaa;
    padding: 0.5rem;
    text-align: left;
  }
  .print-table th {
    background-color: #f0f0f0;
  }
}

/* ==========================================================================
   New Premium Styling: Month Navigation, Buttons, Fullscreen Management
   ========================================================================== */

/* 1. Header and Navigation Buttons */
.btn-success {
  background: linear-gradient(135deg, var(--color-success), var(--color-success-light)) !important;
  color: var(--text-inverse) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  border: none;
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  filter: brightness(1.05);
}
.btn-info {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light)) !important;
  color: var(--text-inverse) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  border: none;
}
.btn-info:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
  filter: brightness(1.05);
}

/* 2. Calendar Month Navigation */
.mini-calendar .calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}
.cal-nav-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cal-nav-btn:hover {
  background-color: var(--color-primary-light);
  color: var(--text-inverse);
  border-color: var(--color-primary-light);
}
.calendar-selects select {
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
}

/* 3. Fullscreen Management Dashboard */
.mgmt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f8fafc;
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.25s ease-out forwards;
}

.mgmt-overlay.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.mgmt-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mgmt-logo-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mgmt-logo-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.mgmt-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.mgmt-sidebar {
  width: 250px;
  background: rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mgmt-side-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.mgmt-side-btn:hover {
  background-color: rgba(79, 70, 229, 0.07);
  color: var(--color-primary);
  border-left-color: var(--color-primary-light);
  transform: translateX(3px);
}
.mgmt-side-btn.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(129, 140, 248, 0.08)) !important;
  color: var(--color-primary-dark) !important;
  font-weight: 700;
  border-left-color: var(--color-primary) !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}
.mgmt-side-btn.active i {
  color: var(--color-primary);
}

.mgmt-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background-color: #f8fafc;
}

.mgmt-tab-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: slideIn 0.3s ease-out forwards;
}

.mgmt-tab-section.hidden {
  display: none !important;
}

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

.mgmt-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.mgmt-section-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  position: relative;
  padding-left: 0.75rem;
}
.mgmt-section-header h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.mgmt-search-row {
  margin-bottom: 1.25rem;
}
.mgmt-search-row .search-box {
  max-width: 450px;
  position: relative;
}
.mgmt-search-row .search-box i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.mgmt-search-row .search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.25rem;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  background-color: #ffffff;
  transition: all 0.2s ease;
}
.mgmt-search-row .search-box input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.mgmt-table-wrapper {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  overflow-x: auto;
  margin-bottom: 2rem;
  flex: 1;
}

.mgmt-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.mgmt-data-table th, .mgmt-data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}
.mgmt-data-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}
.mgmt-data-table tbody tr:hover {
  background-color: #f8fafc;
}
.mgmt-data-table td {
  color: var(--text-main);
  vertical-align: middle;
}

/* Table Labels and Badges */
.badge-seat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background-color: #f1f5f9;
  color: var(--text-main);
}
.badge-seat.front {
  background-color: rgba(245, 158, 11, 0.15);
  color: #d97706;
}
.badge-seat.no-inner {
  background-color: rgba(244, 63, 94, 0.15);
  color: #e11d48;
}

.badge-avoid-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 200px;
}
.badge-avoid-item {
  padding: 0.15rem 0.35rem;
  background-color: rgba(244, 63, 94, 0.08);
  color: var(--color-danger);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Settings Form fullscreen grid */
.mgmt-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.mgmt-settings-grid .card {
  padding: 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.mgmt-settings-grid h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mgmt-system-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.mgmt-settings-footer {
  display: flex;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #e2e8f0;
}

/* Help Screens */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.help-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.help-step-number {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background-color: var(--color-primary-light);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.help-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  padding-right: 2.25rem;
}
.help-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.help-card strong {
  color: var(--text-main);
}
.help-card em {
  font-style: normal;
  color: var(--color-secondary);
}

/* Empty State Styling */
.empty-state-text {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  border: 1px dashed rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.3);
}
.table-empty-row {
  text-align: center !important;
  color: var(--text-muted);
  padding: 3rem !important;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ========== Fullscreen Panel (Map & Routes) ========== */
.fullscreen-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f8fafc;
  z-index: 998;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.22s ease-out forwards;
}

.fullscreen-panel.hidden {
  display: none !important;
}

.fullscreen-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  gap: 1rem;
  flex-shrink: 0;
}

.fullscreen-panel-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Expand button on card headers */
.btn-expand-panel {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-expand-panel:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}



/* ========== Routes Quick Select Filter Bar ========== */
.routes-quick-select {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  min-height: 2.5rem;
}

.quick-select-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-select-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.quick-select-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.quick-select-divider {
  width: 1px;
  height: 1.5rem;
  background: rgba(226, 232, 240, 0.9);
  flex-shrink: 0;
}

/* Chip Buttons */
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-muted);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.chip-btn:hover {
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  border-color: rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}

.chip-btn.chip-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.chip-btn.chip-teacher-active {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

/* vehicle card dim when filtered out */
.vehicle-route-card.filtered-out {
  opacity: 0.18;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.vehicle-route-card {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ========== Drag & Drop Sidebar Items & Fullscreen Sidebar ========== */
.sidebar-drag-item {
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-drag-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--color-primary-light);
}

.sidebar-drag-item:active {
  cursor: grabbing;
}

/* Attending / Working / Running active states */
.sidebar-drag-item.attending {
  border-left: 4px solid var(--color-primary);
}

.sidebar-drag-item.working {
  border-left: 4px solid var(--color-secondary);
}

.sidebar-drag-item.running {
  border-left: 4px solid var(--color-success);
}

/* Absent / Off / Idle grayed out states */
.sidebar-drag-item.absent,
.sidebar-drag-item.off,
.sidebar-drag-item.idle {
  opacity: 0.65;
  background: rgba(248, 250, 252, 0.7);
  border-left: 4px solid #94a3b8;
}

/* Drag over highlights */
.vehicle-route-card.drag-over-card {
  border: 2px dashed var(--color-primary) !important;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.15) !important;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

/* Fullscreen Drag Sidebar */
.fs-drag-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fs-tab-btn {
  color: var(--text-muted);
  border-bottom: 2px solid transparent !important;
  transition: all 0.2s ease;
}

.fs-tab-btn:hover {
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.04);
}

.fs-tab-btn.active {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary) !important;
  background: #ffffff;
}

.fs-tab-content-wrap {
  background: #f8fafc;
}

/* Viewport PC/Mobile Toggle Bottom Button */
.viewport-toggle-container {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  width: 100%;
}

.viewport-toggle-container button {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.55rem 1.1rem;
  border-radius: 30px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.viewport-toggle-container button:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

@media (max-width: 1024px) {
  .viewport-toggle-container {
    display: flex;
  }
}
