/* Estilos canónicos para el Planificador visual de husos horarios y reuniones */

:root {
  --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: var(--font-main);
  --font-title: var(--font-heading);

  /* Paleta corporativa modo claro */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-alt: #e2e8f0;
  --border-color: #e2e8f0;
  --border-color-focus: #38bdf8;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --color-primary: #0284c7;
  --color-primary-hover: #0369a1;
  --color-primary-bg: #e0f2fe;

  /* Códigos cromáticos ergonómicos por franja horaria */
  --cell-work-bg: #dcfce7;
  --cell-work-border: #86efac;
  --cell-work-text: #14532d;

  --cell-free-bg: #fef3c7;
  --cell-free-border: #fcd34d;
  --cell-free-text: #78350f;

  --cell-night-bg: #f1f5f9;
  --cell-night-border: #cbd5e1;
  --cell-night-text: #475569;

  /* Selección y resalte activo */
  --cell-selected-bg: rgba(2, 132, 199, 0.22);
  --cell-selected-border: #0284c7;
  --cell-selected-glow: 0 0 0 2px rgba(2, 132, 199, 0.4);

  /* Semáforos de calidad */
  --status-safe-bg: #ecfdf5;
  --status-safe-border: #a7f3d0;
  --status-safe-text: #065f46;

  --status-warning-bg: #fffbeb;
  --status-warning-border: #fde68a;
  --status-warning-text: #92400e;

  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;
  --status-danger-text: #991b1b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #151d2c;
  --bg-card-subtle: #1c2638;
  --bg-card-alt: #243248;
  --border-color: #243248;
  --border-color-focus: #38bdf8;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-primary: #38bdf8;
  --color-primary-hover: #7dd3fc;
  --color-primary-bg: rgba(56, 189, 248, 0.15);

  /* Códigos cromáticos en modo oscuro */
  --cell-work-bg: #064e3b;
  --cell-work-border: #059669;
  --cell-work-text: #a7f3d0;

  --cell-free-bg: #78350f;
  --cell-free-border: #d97706;
  --cell-free-text: #fde68a;

  --cell-night-bg: #0f172a;
  --cell-night-border: #1e293b;
  --cell-night-text: #64748b;

  --cell-selected-bg: rgba(56, 189, 248, 0.3);
  --cell-selected-border: #38bdf8;
  --cell-selected-glow: 0 0 0 2px rgba(56, 189, 248, 0.5);

  --status-safe-bg: rgba(6, 78, 59, 0.35);
  --status-safe-border: #059669;
  --status-safe-text: #6ee7b7;

  --status-warning-bg: rgba(120, 53, 15, 0.35);
  --status-warning-border: #d97706;
  --status-warning-text: #fcd34d;

  --status-danger-bg: rgba(127, 29, 29, 0.35);
  --status-danger-border: #dc2626;
  --status-danger-text: #fca5a5;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.timeline-scrubbing {
  user-select: none;
  cursor: ew-resize;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  margin-top: 0;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

.mono {
  font-family: var(--font-mono);
}

/* Layout canónico */
.tool-layout {
  max-width: 1240px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Tarjeta principal contenedora */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

/* Hero introductorio */
.planner-hero {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.planner-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.planner-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 860px;
}

/* Barra de control superior */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.control-group-left,
.control-group-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

/* Selector de fecha */
.date-selector-box {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}

.input-date-styled {
  border: none;
  background: transparent;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  min-height: 38px;
}

.btn-date-nav {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-date-nav:hover {
  background: var(--bg-card-alt);
  color: var(--text-main);
}

.btn-date-today {
  font-weight: 600;
  color: var(--color-primary);
}

/* Selectores de formulario */
.select-styled {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 2.25rem 0.45rem 0.75rem;
  font-size: 0.88rem;
  min-height: 40px;
  cursor: pointer;
  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='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.select-styled option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Botones genéricos de acción */
.btn-action-primary {
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  transition: background 0.15s ease, transform 0.1s ease;
}

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

.btn-action-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  transition: all 0.15s ease;
}

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

/* Leyenda cromática explicativa */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

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

.legend-color-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-work { background: var(--cell-work-bg); border-color: var(--cell-work-border); }
.legend-free { background: var(--cell-free-bg); border-color: var(--cell-free-border); }
.legend-night { background: var(--cell-night-bg); border-color: var(--cell-night-border); }

/* Presets rápidos de equipos */
.presets-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.presets-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-preset-team {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.btn-preset-team:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ==========================================================================
   CUADRÍCULA INTERACTIVA DE 24 HORAS (WORLD TIME BUDDY STYLE)
   ========================================================================== */
.timeline-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.timeline-table {
  display: flex;
  flex-direction: column;
  min-width: 1220px; /* Ancho suficiente para 24 casillas con holgura */
}

.timeline-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  min-height: 52px;
  position: relative;
}

.timeline-row:last-child {
  border-bottom: none;
}

/* Columna izquierda fija para datos de la ciudad */
.timeline-city-col {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  background: var(--bg-card);
  border-right: 2px solid var(--border-color);
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  position: sticky;
  left: 0;
  z-index: 5;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.04);
}

.timeline-row-ref .timeline-city-col {
  background: var(--bg-card-subtle);
  border-left: 3px solid var(--color-primary);
}

.timeline-city-header {
  background: var(--bg-card-subtle);
  font-weight: 600;
  font-size: 0.85rem;
}

.city-header-content {
  display: flex;
  flex-direction: column;
}

.city-header-title {
  font-weight: 600;
  color: var(--text-main);
}

.city-header-sub {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 500;
}

/* Tarjeta compacta de ciudad dentro de la columna */
.city-card-compact {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.city-top-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.city-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.city-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.badge-base-tag {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.city-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
}

.btn-city-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 3px;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.btn-city-action:hover {
  background: var(--bg-card-alt);
  color: var(--text-main);
}

.btn-remove-city:hover {
  color: #ef4444;
}

.city-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.city-live-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.city-offset-badge {
  background: var(--bg-card-alt);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 500;
}

/* Pista de casillas de 24 horas */
.timeline-cells-track {
  display: flex;
  flex: 1;
}

.timeline-cell,
.timeline-header-cell {
  flex: 1 0 0;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
  transition: filter 0.1s ease;
  user-select: none;
}

.timeline-cell:last-child,
.timeline-header-cell:last-child {
  border-right: none;
}

.timeline-cell:hover,
.timeline-header-cell:hover {
  filter: brightness(0.95);
}

/* Cabecera de horas */
.timeline-row-header {
  background: var(--bg-card-subtle);
  min-height: 44px;
}

.timeline-header-cell {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.3rem 0;
}

.header-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 2px;
}

.badge-overlap-perfect .header-status-indicator { background: #10b981; }
.badge-overlap-viable .header-status-indicator { background: #f59e0b; }
.badge-overlap-night .header-status-indicator { background: #64748b; opacity: 0.5; }

/* Contenido de cada celda horaria */
.cell-hour-number {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.1;
}

.cell-type-icon {
  font-size: 0.75rem;
  margin-top: 2px;
  line-height: 1;
}

.cell-day-shift {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.08rem 0.25rem;
  border-radius: 3px;
  line-height: 1;
}

.badge-shift-next {
  background: #3b82f6;
  color: #ffffff;
}

.badge-shift-prev {
  background: #f97316;
  color: #ffffff;
}

/* Códigos cromáticos de las celdas */
.hour-work {
  background-color: var(--cell-work-bg);
  color: var(--cell-work-text);
  border-color: var(--cell-work-border);
}

.hour-free {
  background-color: var(--cell-free-bg);
  color: var(--cell-free-text);
  border-color: var(--cell-free-border);
}

.hour-night {
  background-color: var(--cell-night-bg);
  color: var(--cell-night-text);
  border-color: var(--cell-night-border);
}

/* Estados de selección vertical */
.timeline-cell.is-selected {
  position: relative;
  background-color: var(--cell-selected-bg) !important;
  box-shadow: inset 0 2px 0 var(--cell-selected-border), inset 0 -2px 0 var(--cell-selected-border);
}

.timeline-cell.is-selected.is-range-start {
  box-shadow: inset 2px 0 0 var(--cell-selected-border), inset 0 2px 0 var(--cell-selected-border), inset 0 -2px 0 var(--cell-selected-border);
}

.timeline-cell.is-selected.is-range-end {
  box-shadow: inset -2px 0 0 var(--cell-selected-border), inset 0 2px 0 var(--cell-selected-border), inset 0 -2px 0 var(--cell-selected-border);
}

.timeline-header-cell.is-selected-head {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
}

.timeline-header-cell.is-selected-head .header-status-indicator {
  background: #ffffff !important;
}

/* ==========================================================================
   PANEL DE RESUMEN DE LA REUNIÓN SELECCIONADA
   ========================================================================== */
.meeting-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

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

.summary-title-area {
  flex: 1;
  min-width: 250px;
}

.meeting-title-input {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.4rem;
  width: 100%;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.meeting-title-input:hover,
.meeting-title-input:focus {
  background: var(--bg-card-subtle);
  border-color: var(--border-color);
}

.summary-quality-badge {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.quality-safe {
  background: var(--status-safe-bg);
  color: var(--status-safe-text);
  border: 1px solid var(--status-safe-border);
}

.quality-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.quality-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

/* Lista de ciudades y horas correspondientes */
.summary-city-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.summary-city-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-city-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.summary-city-flag {
  font-size: 1.25rem;
}

.summary-city-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.summary-city-offset {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.summary-city-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: right;
}

.summary-city-time .time-range {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.summary-day-shift {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.summary-day-shift.next { background: #3b82f6; color: #fff; }
.summary-day-shift.prev { background: #f97316; color: #fff; }

.status-chip {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Botonera de exportación */
.export-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* ==========================================================================
   MODAL ACCESIBLE DE BÚSQUEDA DE CIUDADES
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-window {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.btn-modal-close:hover {
  background: var(--bg-card-alt);
  color: var(--text-main);
}

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

.search-input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.input-city-search {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  min-height: 44px;
}

.input-city-search:focus {
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.search-icon-decor {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Filtros por región dentro del modal */
.modal-region-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.filter-region-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.filter-region-pill:hover,
.filter-region-pill.active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* Resultados de búsqueda */
.city-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
}

.city-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.12s ease;
}

.city-result-item:hover:not(.is-added) {
  border-color: var(--color-primary);
  background: var(--bg-card-subtle);
}

.city-result-item.is-added {
  opacity: 0.6;
  cursor: default;
}

.city-result-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.city-result-flag {
  font-size: 1.4rem;
}

.city-result-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.city-result-country {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.city-result-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.city-result-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.city-result-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-add-result {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-add-result.btn-added {
  background: var(--bg-card-alt);
  color: var(--text-muted);
  cursor: default;
}

/* Notificaciones Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10000;
  pointer-events: none;
}

.fijate-toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  border-left: 4px solid var(--color-primary);
}

.fijate-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   GUÍA TÉCNICA Y SEO INFORMATIVO
   ========================================================================== */
.technical-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.guide-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

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

.guide-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.guide-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.guide-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   ADAPTABILIDAD RESPONSIVA (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 768px) {
  .tool-layout {
    padding: 0 0.65rem;
    margin: 1rem auto 2rem;
  }

  .card-main {
    padding: 1rem;
  }

  .control-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
  }

  .control-group-left,
  .control-group-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .date-selector-box {
    width: 100%;
    justify-content: space-between;
  }

  .btn-action-primary,
  .btn-action-secondary,
  .select-styled {
    width: 100%;
    justify-content: center;
  }

  .timeline-city-col {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    padding: 0.45rem 0.55rem;
  }

  .city-name {
    font-size: 0.8rem;
  }

  .city-live-time {
    font-size: 0.7rem;
  }

  .summary-city-list {
    grid-template-columns: 1fr;
  }

  .export-actions-bar {
    flex-direction: column;
  }

  .export-actions-bar button {
    width: 100%;
    justify-content: center;
  }
}
