/* ==========================================================================
   DESTINOS DOCENTES CV - HOJA DE ESTILOS MODERNA
   ========================================================================== */

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-border: #bae6fd;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #38bdf8;
  
  --vacante-bg: #ecfdf5;
  --vacante-border: #a7f3d0;
  --vacante-text: #065f46;
  --vacante-badge: #059669;

  --indet-bg: #eff6ff;
  --indet-border: #bfdbfe;
  --indet-text: #1e40af;
  --indet-badge: #2563eb;

  --det-bg: #fffbeb;
  --det-border: #fde68a;
  --det-text: #92400e;
  --det-badge: #d97706;

  --itinerante-badge: #7c3aed;
  --itinerante-bg: #f5f3ff;
  
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-main: #0b1120;
  --bg-card: #1e293b;
  --bg-card-hover: #26354a;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --border: #334155;
  --border-focus: #38bdf8;
  
  --primary-light: #032b45;
  --primary-border: #075985;
  
  --vacante-bg: #064e3b26;
  --vacante-border: #065f46;
  --vacante-text: #34d399;

  --indet-bg: #1e3a8a26;
  --indet-border: #1d4ed8;
  --indet-text: #60a5fa;

  --det-bg: #78350f26;
  --det-border: #92400e;
  --det-text: #fbbf24;

  --itinerante-bg: #4c1d9526;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.3);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-official {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

[data-theme="dark"] .badge-official {
  background: #064e3b33;
  border-color: #065f46;
  color: #34d399;
}

.badge-date {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Layout container */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  width: 100%;
  flex: 1;
}

/* Location Card / Hero */
.hero-location-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-location-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #2563eb);
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.hero-title-area h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.location-input-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 900px) {
  .location-input-row {
    grid-template-columns: 1fr;
  }
}

.location-picker {
  position: relative;
}

.location-picker label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--primary);
  pointer-events: none;
  font-size: 1.1rem;
}

.input-with-icon input,
.input-with-icon select {
  width: 100%;
  padding: 0.7rem 0.75rem 0.7rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition: all 0.15s ease;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background: var(--bg-card);
}

.btn-gps {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all 0.15s ease;
  height: 44px;
  align-self: flex-end;
}

.btn-gps:hover {
  background: #bae6fd;
  transform: translateY(-1px);
}

.distance-slider-box {
  display: flex;
  flex-direction: column;
}

.distance-slider-box label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.distance-val {
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
}

.range-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
  margin-top: 0.5rem;
}

.origin-status-bar {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.origin-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.origin-info strong {
  color: var(--primary);
}

/* Filter Section */
.filters-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  transition: all 0.15s ease;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background: var(--bg-card);
}

/* Pill buttons for types */
.pill-options {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.pill-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pill-btn:hover {
  background: var(--bg-card-hover);
}

.pill-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.pill-btn.active.vacante {
  background: var(--vacante-badge);
  border-color: var(--vacante-badge);
}

.pill-btn.active.indet {
  background: var(--indet-badge);
  border-color: var(--indet-badge);
}

.pill-btn.active.det {
  background: var(--det-badge);
  border-color: var(--det-badge);
}

.filters-bottom-row {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.active-filters-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-weight: bold;
}

.btn-reset-filters {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.btn-reset-filters:hover {
  color: var(--text-main);
}

/* Control Bar: View Switcher & Sorting */
.view-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-counter {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.results-counter span {
  color: var(--primary);
}

.view-controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

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

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.sort-select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
}

/* Plazas Grid */
.plazas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1rem;
}

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

/* Plaza Card */
.plaza-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.plaza-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-border);
}

.plaza-card.vacante-border {
  border-left: 5px solid var(--vacante-badge);
}

.plaza-card.indet-border {
  border-left: 5px solid var(--indet-badge);
}

.plaza-card.det-border {
  border-left: 5px solid var(--det-badge);
}

.plaza-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.distance-badge-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.distance-badge {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.25rem 0.55rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.rush-hour-badge {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  padding: 0.25rem 0.6rem;
  border-radius: 16px;
  font-size: 0.785rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.rush-hour-badge strong {
  font-weight: 850;
  color: #9a3412;
}

.rush-hour-badge .rush-label {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.9;
}

.fluid-time-badge {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 0.25rem 0.5rem;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.fluid-time-badge .fluid-label {
  font-size: 0.68rem;
  opacity: 0.85;
}

[data-theme="dark"] .rush-hour-badge {
  background: #7c2d1226;
  color: #fb923c;
  border-color: #9a3412;
}

[data-theme="dark"] .rush-hour-badge strong {
  color: #fdba74;
}

[data-theme="dark"] .fluid-time-badge {
  background: #14532d26;
  color: #4ade80;
  border-color: #166534;
}

.time-estimate {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.plaza-meta-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
}

.center-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

.center-code-badge {
  font-family: monospace;
  font-size: 0.75rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.center-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tag-tipo {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tag-tipo.vacante {
  background: var(--vacante-bg);
  border: 1px solid var(--vacante-border);
  color: var(--vacante-text);
}

.tag-tipo.indeterminada {
  background: var(--indet-bg);
  border: 1px solid var(--indet-border);
  color: var(--indet-text);
}

.tag-tipo.determinada {
  background: var(--det-bg);
  border: 1px solid var(--det-border);
  color: var(--det-text);
}

.tag-hours {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-hours.parcial {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .tag-hours.parcial {
  background: #450a0a33;
  border-color: #7f1d1d;
  color: #f87171;
}

.tag-itinerante {
  background: var(--itinerante-bg);
  border: 1px solid #ddd6fe;
  color: var(--itinerante-badge);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-req {
  background: #fdf4ff;
  border: 1px solid #f5d0fe;
  color: #86198f;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-req.tag-req-ingles {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

[data-theme="dark"] .tag-req.tag-req-ingles {
  background: #1e3a8a2a;
  border-color: #1e40af;
  color: #60a5fa;
}

/* Etiquetas de Jornada del Centro (Conselleria) */
.tag-jornada {
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-jornada.continua {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}

[data-theme="dark"] .tag-jornada.continua {
  background: #78350f33;
  border-color: #92400e;
  color: #fde047;
}

.tag-jornada.partida {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="dark"] .tag-jornada.partida {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.tag-jornada.ies {
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
}

[data-theme="dark"] .tag-jornada.ies {
  background: #2e106533;
  border-color: #6b21a8;
  color: #c084fc;
}

/* Controles de Reordenación de Favoritos / Petición */
.fav-priority-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary);
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.fav-order-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-move-fav {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  user-select: none;
  padding: 0;
}

.btn-move-fav:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-move-fav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.fav-card-draggable {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fav-card-draggable.dragging {
  opacity: 0.4;
  border-style: dashed !important;
}

.fav-card-draggable.drag-over {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--primary-light) !important;
}

.observaciones-box {
  background: var(--bg-main);
  border-left: 3px solid #38bdf8;
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Shared centers accordion */
.shared-centers-box {
  background: var(--itinerante-bg);
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}

[data-theme="dark"] .shared-centers-box {
  border-color: #581c87;
}

.shared-title {
  font-weight: 700;
  color: var(--itinerante-badge);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.shared-center-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #e9d5ff;
}

.shared-center-item:last-child {
  border-bottom: none;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.btn-route {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-route:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-favorite {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
}

.btn-favorite:hover {
  color: #eab308;
  border-color: #fde047;
}

.btn-favorite.active {
  background: #fef9c3;
  border-color: #facc15;
  color: #ca8a04;
}

/* Map Container */
.map-view-container {
  display: none;
  height: 650px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  margin-bottom: 1.5rem;
}

.map-view-container.visible {
  display: block;
}

#map {
  width: 100%;
  height: 100%;
}

/* Stats view */
.stats-view-container {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.stats-view-container.visible {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.stat-box-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-box-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 1rem;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-light);
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.empty-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 450px;
  margin: 0 auto;
}

/* Drawer / Modal for Favorites */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.favorites-drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 100%;
  max-width: 520px;
  height: 100%;
  background: var(--bg-card);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.active .favorites-drawer {
  right: 0;
}

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

.drawer-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

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

.drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
}

/* Footer */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

.app-footer a {
  color: var(--primary);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* Botón de Café / Donación */
.btn-coffee {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.825rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-coffee:hover {
  background: #fde68a;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(217, 119, 6, 0.2);
}

[data-theme="dark"] .btn-coffee {
  background: #78350f33;
  color: #fde047;
  border-color: #92400e;
}

/* Banner de Promoción Cruzada */
.cross-promo-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow);
}

[data-theme="dark"] .cross-promo-card {
  background: linear-gradient(135deg, #1e293b 0%, #172554 100%);
  border-color: #1e40af;
}

.cross-promo-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cross-promo-icon {
  width: 46px;
  height: 46px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

[data-theme="dark"] .cross-promo-icon {
  background: #0f172a;
}

.cross-promo-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 0.2rem;
}

[data-theme="dark"] .cross-promo-tag {
  color: #60a5fa;
}

.cross-promo-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.cross-promo-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.btn-cross-promo {
  background: #2563eb;
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-cross-promo:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .cross-promo-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-cross-promo {
    width: 100%;
    justify-content: center;
  }
}

/* Modal de Donación */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.donate-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-backdrop.active .donate-modal {
  transform: translateY(0);
}

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

.donate-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-main);
}

.donate-modal-body {
  padding: 1.25rem;
}

.donate-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.donate-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.donate-option-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.donate-option-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.donate-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.donate-option-info {
  flex: 1;
}

.donate-option-title {
  font-size: 0.9rem;
  font-weight: 750;
  color: var(--text-main);
}

.donate-option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.donate-arrow {
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1rem;
}

.donate-option-card.share-card {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

[data-theme="dark"] .donate-option-card.share-card {
  background: #064e3b26;
  border-color: #065f46;
}

/* ==========================================================================
   PRINT STYLES - Hoja de Impresión A4 Optimizada para Mi Selección
   ========================================================================== */
#printDoc {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 10mm 12mm;
  }

  /* Reset global y forzado de fondo blanco y texto oscuro */
  html, body {
    display: block !important;
    min-height: auto !important;
    height: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 8.5pt !important;
    line-height: 1.3 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar toda la interfaz web interactiva */
  body > *:not(#printDoc) {
    display: none !important;
    visibility: hidden !important;
  }

  /* Mostrar exclusivamente el documento maquetado para papel */
  #printDoc {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #printDoc * {
    visibility: visible !important;
  }

  .print-header {
    border-bottom: 2px solid #0284c7;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .print-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
  }

  .print-title {
    font-size: 13pt !important;
    font-weight: 800 !important;
    color: #0369a1 !important;
    margin: 0 0 3px 0 !important;
    line-height: 1.2 !important;
  }

  .print-subtitle {
    font-size: 8pt !important;
    color: #475569 !important;
  }

  .print-badge-total {
    background: #e0f2fe !important;
    border: 1.5px solid #7dd3fc !important;
    color: #0369a1 !important;
    font-weight: 800 !important;
    font-size: 9pt !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }

  .print-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 8pt;
  }

  .print-meta-item strong {
    color: #0f172a;
  }

  /* Tabla de Peticiones */
  .print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 10px !important;
    font-size: 8pt !important;
  }

  .print-table thead {
    display: table-header-group;
  }

  .print-table th {
    background: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 7pt !important;
    letter-spacing: 0.04em;
    padding: 6px 5px !important;
    border: 1px solid #0284c7 !important;
    text-align: left;
  }

  .print-table td {
    padding: 6px 6px !important;
    border: 1px solid #cbd5e1 !important;
    vertical-align: middle !important;
  }

  .print-table tr:nth-child(even) {
    background: #f8fafc !important;
  }

  .print-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-order-num {
    font-weight: 800 !important;
    font-size: 10pt !important;
    text-align: center;
    color: #0284c7 !important;
  }

  .print-code {
    font-family: 'Consolas', 'Courier New', monospace !important;
    font-weight: 800 !important;
    font-size: 8.5pt !important;
    color: #1e293b !important;
    white-space: nowrap;
  }

  .print-center-name {
    font-weight: 750 !important;
    font-size: 8.5pt !important;
    color: #0f172a !important;
    line-height: 1.2;
  }

  .print-center-sub {
    font-size: 7.2pt !important;
    color: #475569 !important;
    margin-top: 1px;
  }

  .print-tag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 6.5pt;
    font-weight: 700;
  }

  .print-tag-vacante {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
  }

  .print-tag-indet {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1e40af !important;
  }

  .print-tag-det {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
  }

  .print-tag-continua {
    background: #fef3c7 !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
  }

  .print-tag-partida {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
  }

  .print-tag-ies {
    background: #ede9fe !important;
    border: 1px solid #ddd6fe !important;
    color: #5b21b6 !important;
  }

  .print-check-box {
    width: 15px;
    height: 15px;
    border: 1.5px solid #475569 !important;
    border-radius: 3px;
    margin: 0 auto;
    background: #ffffff !important;
  }

  .print-notes-section {
    margin-top: 14px;
    border: 1px dashed #94a3b8;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fafafa !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-notes-title {
    font-weight: 700;
    font-size: 7.5pt;
    color: #475569;
    margin-bottom: 6px;
  }

  .print-line {
    border-bottom: 1px dotted #cbd5e1;
    height: 18px;
  }

  .print-footer {
    margin-top: 14px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    font-size: 6.8pt;
    color: #64748b;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

