/* Conductores y Vehículos (07/11/2026): listado y ficha. Ver js/flota.js y DESIGN.md. */

.fl-pagina { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.fl-pagina > .segmento-cab { align-self: flex-start; margin-bottom: 0; }

/* Barra: buscador y filtro en una fila; en el móvil, uno debajo del otro. */
.fl-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fl-buscar { position: relative; flex: 1 1 280px; max-width: 420px; display: block; }
.fl-buscar > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }
.fl-buscar input { width: 100%; height: 44px; padding-left: 40px; border-radius: var(--radius-full); }
.fl-n { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 500; }
.fl-barra .segmento > button { min-height: 44px; }
.fl-barra .segmento > button[aria-pressed="true"] .fl-n { color: var(--text-primary); }

/* Lista: una tarjeta, filas separadas por una línea suave. */
.fl-lista { list-style: none; margin: 0; padding: 0; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-md); overflow: hidden; }
.fl-lista > li + li { border-top: 1px solid var(--border-subtle); }
.fl-fila { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto 20px; align-items: center; gap: 14px; width: 100%; min-height: 72px;
           padding: 12px 16px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
           transition: background-color .15s ease; touch-action: manipulation; }
.fl-fila:hover { background: var(--bg-card-hover); }
.fl-fila:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.fl-fila > .ico { color: var(--text-secondary); }
.fl-avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
             background: var(--bg-elevated); color: var(--text-primary); font-weight: 700; font-size: var(--letra-md); flex: none; }
.fl-avatar--icono { color: var(--accent-primary); background: var(--accent-primary-dim); }
.fl-avatar--grande { width: 56px; height: 56px; font-size: var(--letra-xl); background: var(--bg-base); }
.fl-avatar--grande.fl-avatar--icono { background: var(--accent-primary-dim); }
.fl-cuerpo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fl-titulo { font-size: var(--letra-lg); font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-sub { font-size: var(--letra-sm); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-matricula { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-primary); }
.fl-dato { font-size: var(--letra-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.fl-estado { display: flex; justify-content: flex-end; min-width: 0; }
.fl-etq { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: var(--radius-full); background: var(--accent-primary-dim);
          color: var(--accent-primary); font-size: var(--letra-xs); font-weight: 600; vertical-align: 2px; }
.fl-ficha-cab .fl-etq { margin-left: 0; }

/* Insignias con significado: rojo caducado o grave, naranja por renovar, gris informativo. */
.fl-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 380px; padding: 4px 12px; border-radius: var(--radius-full);
           font-size: var(--letra-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-chip--rojo { background: var(--accent-red-dim); color: #FF8A80; }
.fl-chip--naranja { background: var(--accent-orange-dim); color: #FFB74D; }
.fl-chip--gris { background: rgba(148, 163, 184, .14); color: var(--text-secondary); }
.fl-chip-mas { opacity: .85; font-weight: 500; }

.fl-grupo { margin: 8px 0 -4px; font-size: var(--letra-md); font-weight: 600; color: var(--text-primary); }
.fl-grupo span { color: var(--text-secondary); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Vacío, sin resultados y error. */
.fl-vacio { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 24px; text-align: center;
            background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-md); }
.fl-vacio > .ico { width: 32px; height: 32px; color: var(--text-secondary); }
.fl-vacio h2 { margin: 4px 0 0; font-size: var(--letra-xl); font-weight: 700; color: var(--text-primary); text-wrap: balance; }
.fl-vacio p { margin: 0 0 8px; max-width: 46ch; color: var(--text-secondary); font-size: var(--letra-md); line-height: 1.5; }
.fl-vacio--corto { padding: 24px; }
.fl-vacio--corto p { margin: 0; }

/* Esqueleto de carga: bloques planos del tamaño real, sin brillo. */
.fl-hueso { display: block; border-radius: 8px; background: var(--bg-elevated); opacity: .55; }
.fl-fila--hueso { cursor: default; }
.fl-fila--hueso:hover { background: none; }

/* ── Ficha ─────────────────────────────────────────────────────────────── */
.fl-ficha { display: flex; flex-direction: column; gap: 20px; text-align: left; }
.fl-ficha-cab { display: flex; align-items: center; gap: 16px; padding-right: 40px; }
.fl-ficha-cab h2 { margin: 0; font-size: var(--letra-2xl); font-weight: 700; line-height: 1.2; color: var(--text-primary); text-wrap: balance; overflow-wrap: anywhere; }
.fl-ficha-cab p { margin: 4px 0 0; font-size: var(--letra-md); color: var(--text-secondary); }
.fl-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-seccion { display: flex; flex-direction: column; gap: 10px; }
.fl-seccion-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.fl-seccion-cab h3 { margin: 0; font-size: var(--letra-md); font-weight: 600; color: var(--text-primary); }
.fl-nota { margin: 0; font-size: var(--letra-sm); color: var(--text-secondary); line-height: 1.5; }
.fl-gris { color: var(--text-secondary); font-weight: 400; }

.fl-cifras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border-card);
             border: 1px solid var(--border-card); border-radius: var(--radius-md); overflow: hidden; }
.fl-cifras--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fl-cifra { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--bg-base); }
.fl-cifra span { font-size: var(--letra-xs); color: var(--text-secondary); }
.fl-cifra strong { font-size: var(--letra-xl); font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Lista clave-valor (documentos, datos, trayectos). */
.fl-datos { list-style: none; margin: 0; padding: 0 14px; background: var(--bg-base); border-radius: var(--radius-md); }
.fl-datos li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 8px 0; font-size: var(--letra-md); }
.fl-datos li + li { border-top: 1px solid var(--border-subtle); }
.fl-datos li > span { color: var(--text-secondary); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fl-datos li > strong { color: var(--text-primary); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
                        display: inline-flex; align-items: center; gap: 4px; }
.fl-ruta { color: var(--text-primary); font-weight: 600; }
.fl-doc--rojo { color: #FF8A80 !important; }
.fl-doc--naranja { color: #FFB74D !important; }
.fl-lapiz { min-height: 32px; padding: 0 8px; }
.fl-trayectos:empty { display: none; }

/* Lo que pide atención, con su arreglo al lado. */
.fl-avisos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fl-aviso { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md); }
.fl-aviso--rojo { background: var(--accent-red-dim); }
.fl-aviso--naranja { background: var(--accent-orange-dim); }
.fl-aviso > .ico { align-self: start; margin-top: 2px; }
.fl-aviso--rojo > .ico { color: #FF8A80; }
.fl-aviso--naranja > .ico { color: #FFB74D; }
.fl-aviso strong { display: block; color: var(--text-primary); font-size: var(--letra-md); }
.fl-aviso span { display: block; margin-top: 2px; color: var(--text-secondary); font-size: var(--letra-sm); line-height: 1.45; }

/* Ajustes: fila con título, explicación de una línea e interruptor. */
.fl-ajustes { background: var(--bg-base); border-radius: var(--radius-md); padding: 0 14px; }
.fl-ajuste { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 10px 0; cursor: pointer; }
.fl-ajuste + .fl-ajuste { border-top: 1px solid var(--border-subtle); }
.fl-ajuste-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fl-ajuste-txt strong { color: var(--text-primary); font-size: var(--letra-md); font-weight: 600; }
.fl-ajuste-txt span { color: var(--text-secondary); font-size: var(--letra-sm); }
div.fl-ajuste { cursor: default; }
.fl-switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border-radius: var(--radius-full);
             background: #475569; cursor: pointer; touch-action: manipulation; transition: background-color .2s ease; }
.fl-switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.fl-switch:checked { background: var(--accent-primary); }
.fl-switch:checked::before { transform: translateX(20px); }
.fl-switch:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.fl-switch:disabled { opacity: .5; cursor: not-allowed; }

/* Plegable de datos personales y ficha técnica. */
.fl-plegable { border-radius: var(--radius-md); background: var(--bg-base); }
.fl-plegable > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 14px;
                         list-style: none; cursor: pointer; touch-action: manipulation; font-size: var(--letra-md); font-weight: 600; color: var(--text-primary); border-radius: var(--radius-md); }
.fl-plegable > summary:hover { background: var(--bg-card-hover); }
.fl-plegable > summary::-webkit-details-marker { display: none; }
.fl-plegable > summary .ico { color: var(--text-secondary); transition: transform .2s ease; }
.fl-plegable[open] > summary .ico { transform: rotate(90deg); }
.fl-plegable > summary:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.fl-plegable > .fl-datos { background: none; border-top: 1px solid var(--border-subtle); border-radius: 0; }

.fl-peligros { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px solid var(--border-subtle); }
.fl-peligro { color: #FF8A80 !important; }

/* Tableta: la cifra de rutas pasa a la línea de abajo. */
@media (max-width: 900px) {
  .fl-fila { grid-template-columns: 40px minmax(0, 1fr) auto 20px; }
  .fl-fila > .fl-dato { display: none; }
}

/* Móvil: la insignia, debajo del nombre; cifras de dos en dos. */
@media (max-width: 520px) {
  .fl-buscar { max-width: none; flex-basis: 100%; }
  .fl-barra .segmento { width: 100%; }
  .fl-barra .segmento > button { flex: 1 1 0; padding: 0 10px; }
  .fl-pagina > .segmento-cab { align-self: stretch; display: flex; flex-wrap: nowrap; }
  .fl-pagina > .segmento-cab > button { flex: 1 1 auto; min-width: 0; padding: 0 8px; min-height: 44px; }
  .fl-pagina > .segmento-cab .ico { display: none; }
  .fl-fila { grid-template-columns: 40px minmax(0, 1fr) 20px; row-gap: 6px; padding: 12px 14px; }
  .fl-fila > .fl-estado { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .fl-fila > .fl-estado:empty { display: none; }
  .fl-fila > .ico { grid-column: 3; grid-row: 1 / span 2; }
  .fl-chip { max-width: 100%; white-space: normal; }
  .fl-cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fl-ficha-cab .fl-avatar--grande { width: 48px; height: 48px; }
  .fl-ficha-cab h2 { font-size: var(--letra-xl); }
  .fl-acciones > .btn { flex: 1 1 auto; }
  .fl-aviso { grid-template-columns: 20px minmax(0, 1fr); }
  .fl-aviso > .btn { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .fl-fila, .fl-switch, .fl-switch::before, .fl-plegable > summary .ico { transition: none; }
}
