/* Driver Tacho — estilos del nuevo flujo (driver-tacho-flow.js). */

.driver-tacho-page #root {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  overflow: visible;
}

.dtf-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 24px;
}
@media (max-width: 768px) {
  .dtf-stepper { display: none; }
}
.dtf-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(11, 79, 159, .18);
  border-radius: 999px;
  color: #1a2540;
  font-size: .92rem;
  font-weight: 600;
  transition: background .2s, border-color .2s, color .2s;
}
.dtf-chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #e2eaf5;
  border-radius: 50%;
  font-weight: 700;
  font-size: .8rem;
}
/* Icono del chip de paso (USB, descarga, informe). Hereda currentColor
   para acompañar el cambio de color cuando el chip pasa a is-active /
   is-done. */
.dtf-chip-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.dtf-chip.is-active {
  background: #0b4f9f;
  border-color: #0b4f9f;
  color: #fff;
}
.dtf-chip.is-active .dtf-chip-num {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}
.dtf-chip.is-done {
  background: #e8f4eb;
  border-color: #6ab080;
  color: #1f5c33;
}

.dtf-step {
  margin: 0 0 28px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--ds-line, rgba(11, 79, 159, .14));
  border-radius: 14px;
  box-shadow: var(--ds-shadow-sm, 0 4px 18px rgba(11, 79, 159, .06));
  box-sizing: border-box;
}
.dtf-step-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #0b4f9f;
}
.dtf-step-sub {
  margin: 0 0 18px;
  color: #4a5568;
  line-height: 1.5;
}

.dtf-connect-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.dtf-connect-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  text-align: left;
  background: linear-gradient(180deg, rgba(11, 79, 159, .04) 0%, rgba(11, 79, 159, 0) 100%);
  border: 1px solid rgba(11, 79, 159, .18);
  border-radius: 12px;
  color: #1a2540;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
}
.dtf-connect-card:hover {
  border-color: #0b4f9f;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(11, 79, 159, .12);
}
.dtf-connect-card[data-dtf-disabled="1"] {
  opacity: .68;
  cursor: not-allowed;
}
.dtf-connect-card[data-dtf-disabled="1"]:hover {
  transform: none;
  box-shadow: none;
}
.dtf-connect-badge {
  align-self: flex-start;
  padding: 3px 10px;
  background: #f1f5f9;
  border-radius: 999px;
  color: #475569;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.dtf-connect-title {
  font-size: 1.05rem;
  font-weight: 700;
}
.dtf-connect-desc {
  color: #4a5568;
  font-size: .92rem;
  line-height: 1.5;
}

/* Pip "① Paso 1 de 3" en cada card activa */
.dtf-connect-step-pip {
  align-self: flex-start;
  padding: 2px 8px;
  background: #0b4f9f;
  color: #fff;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* CTA "Pulsar aquí para conectar →" al pie de cada card activa */
.dtf-connect-cta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(11, 79, 159, .20);
  color: #0b4f9f;
  font-size: .88rem;
  font-weight: 700;
}
.dtf-connect-cta-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Breadcrumb de progreso debajo del grid de conexión */
.dtf-flow-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid rgba(11, 79, 159, .10);
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
  color: #0b4f9f;
}
.dtf-flow-trail-step.is-current {
  color: #0b4f9f;
  font-weight: 700;
}
.dtf-flow-trail-step.is-done {
  color: #16a34a;
}
.dtf-flow-trail-arrow {
  color: #cbd5e1;
}

.dtf-file-uploader {
  margin-top: 16px;
  padding: 16px;
  background: #f7fafc;
  border: 1px dashed #b9d4f5;
  border-radius: 10px;
}
.dtf-file-label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}
.dtf-file-label input[type="file"] {
  font: inherit;
}
.dtf-file-hint {
  margin: 8px 0 0;
  color: #56627a;
  font-size: .85rem;
}
.dtf-inline-notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: .9rem;
  /* Soporte para mensajes multilínea con \n y para textos largos como
     ATR en hex que no caben en una sola línea del móvil. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}
/* Variante éxito: mismos colores que .dtf-chip.is-done para que el aviso
   "Tarjeta leída correctamente" entronque visualmente con el chip del
   stepper que pasa a estado done. */
.dtf-inline-notice.is-success {
  background: #e8f4eb;
  border-color: #6ab080;
  color: #1f5c33;
}

/* ─── Progreso (spinner + barra %) durante la extracción ─────────── */
.dtf-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 0;
  padding: 14px 16px;
  background: #f0f7ff;
  border: 1px solid #b9d4f5;
  border-radius: 10px;
  color: #0b3a7a;
}
.dtf-progress-spinner {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(11, 79, 159, .18);
  border-top-color: #0b4f9f;
  border-radius: 50%;
  animation: dtf-spin .9s linear infinite;
}
.dtf-progress-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.dtf-progress-label {
  font-size: .92rem;
  font-weight: 600;
  color: #083b7a;
}
.dtf-progress-bar {
  height: 6px;
  background: rgba(11, 79, 159, .12);
  border-radius: 999px;
  overflow: hidden;
}
.dtf-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0b4f9f 0%, #2f80ed 100%);
  border-radius: 999px;
  width: 0%;
  transition: width .25s ease;
}
@keyframes dtf-spin {
  to { transform: rotate(360deg); }
}

/* ─── Cabecera de paso con botón de reset ───────────────────────── */
.dtf-step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dtf-step-header .dtf-step-title {
  margin: 0 0 8px;
  flex: 1 1 auto;
}
.dtf-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--ds-blue);
  border: none;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 108, 255, .26);
  transition: background .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.dtf-reset-btn:hover,
.dtf-reset-btn:focus {
  background: var(--ds-blue-600);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 108, 255, .38);
  outline: none;
}
.dtf-reset-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Selector de rango de fechas (paso 2) ──────────────────────── */
.dtf-range-selector {
  margin-top: 18px;
  padding: 16px 18px;
  background: #f7fafc;
  border: 1px solid #e3eaf3;
  border-radius: 12px;
}
.dtf-range-title {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #0b4f9f;
}
.dtf-range-hint {
  margin: 0 0 14px;
  color: #56627a;
  font-size: .88rem;
  line-height: 1.5;
}
.dtf-range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 600px) {
  .dtf-range-grid { grid-template-columns: 1fr; }
}
.dtf-range-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: .85rem;
  color: #2c3a52;
}
.dtf-range-field input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  background: #fff;
  color: #1f2937;
}
.dtf-range-field input[type="date"]:focus {
  outline: none;
  border-color: #0b4f9f;
  box-shadow: 0 0 0 3px rgba(11, 79, 159, .12);
}
.dtf-range-end-readonly {
  align-self: stretch;
}
.dtf-range-end-value {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  background: #eef3fa;
  border: 1px dashed #b9d4f5;
  border-radius: 8px;
  font-weight: 600;
  color: #0b4f9f;
}
.dtf-range-end-value small {
  margin-left: 6px;
  font-weight: 400;
  color: #56627a;
}
.dtf-range-apply {
  min-height: 38px;
  white-space: nowrap;
}
.dtf-range-feedback {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-size: .88rem;
}
.dtf-range-feedback-error {
  background: #fff5f5;
  border-color: #fecaca;
  color: #991b1b;
}

/* ─── Banner promocional del Driver Solution Helper ─────────────── */
.dtf-helper-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #eef5ff 0%, #f6fbff 100%);
  border: 1px solid #c7dafb;
  border-radius: 12px;
  color: #0b3a7a;
}
.dtf-helper-banner-body {
  flex: 1 1 320px;
  font-size: .92rem;
  line-height: 1.5;
}
.dtf-helper-banner-body strong {
  color: #083b7a;
}
.dtf-helper-banner-actions {
  flex: 0 0 auto;
}
.dtf-helper-banner-actions .ds-btn {
  white-space: nowrap;
}

/* ─── Guía rápida "Cómo extraer tu TGD" ─────────────────────────── */
.dtf-guide {
  margin-top: 20px;
  background: #fbfcfe;
  border: 1px solid #e3eaf3;
  border-radius: 12px;
  overflow: hidden;
}
.dtf-guide[open] {
  background: #fff;
  box-shadow: 0 1px 4px rgba(11, 79, 159, .06);
}
.dtf-guide-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-weight: 600;
  color: #0b4f9f;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.dtf-guide-summary::-webkit-details-marker {
  display: none;
}
.dtf-guide-summary:hover {
  background: #f5f8fc;
}
.dtf-guide-caret {
  display: inline-block;
  color: var(--ds-blue, #0b4f9f);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform .2s ease;
}
.dtf-guide[open] .dtf-guide-caret {
  transform: rotate(90deg);
}
.dtf-guide-title {
  flex: 1;
  min-width: 0;
}
.dtf-guide-cta {
  margin-left: auto;
  font-size: .78rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ds-blue, #0b4f9f);
  color: #fff;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .15s;
}
.dtf-guide:hover .dtf-guide-cta {
  background: var(--ds-blue-600, #063372);
}
.dtf-guide[open] .dtf-guide-cta-label::after {
  content: "Cerrar";
}
.dtf-guide:not([open]) .dtf-guide-cta-label::after {
  content: "Abrir";
}
.dtf-guide-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #0b4f9f;
}
.dtf-guide-body {
  padding: 0 18px 18px;
  color: #2c3a52;
  font-size: .92rem;
  line-height: 1.55;
}
.dtf-guide-intro {
  margin: 0 0 14px;
}
.dtf-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.dtf-guide-card {
  padding: 14px;
  background: #f7fafc;
  border: 1px solid #e3eaf3;
  border-radius: 10px;
}
.dtf-guide-card-title {
  margin: 0 0 6px;
  font-size: .95rem;
  color: #0b4f9f;
}
.dtf-guide-card-desc {
  margin: 0 0 10px;
  font-size: .85rem;
  color: #56627a;
}
.dtf-guide-link {
  display: inline-block;
  font-weight: 600;
  font-size: .85rem;
  color: #0b4f9f;
  text-decoration: none;
}
.dtf-guide-link:hover {
  text-decoration: underline;
}
.dtf-guide-link-disabled {
  display: inline-block;
  font-size: .85rem;
  color: #94a3b8;
  font-style: italic;
}
.dtf-guide-steps {
  margin: 0 0 18px;
  padding-left: 22px;
}
.dtf-guide-steps li {
  margin-bottom: 8px;
}
.dtf-guide-steps code {
  padding: 1px 6px;
  background: #eef3fa;
  border-radius: 4px;
  font-size: .85em;
}

/* ─── Acordeón por SO dentro de "¿No tienes aún el archivo TGD?" ───── */
.dtf-os-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
}
.dtf-os-block {
  background: #f7fafc;
  border: 1px solid #e3eaf3;
  border-radius: 10px;
  overflow: hidden;
}
.dtf-os-block[open] {
  background: #eef5ff;
  border-color: #c7dafb;
}
.dtf-os-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: #0b3a7a;
  user-select: none;
}
.dtf-os-summary::-webkit-details-marker { display: none; }
.dtf-os-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: #0b4f9f;
  flex-shrink: 0;
}
.dtf-os-icon svg {
  width: 100%;
  height: 100%;
}
.dtf-os-label {
  flex: 1;
  font-size: .95rem;
}
.dtf-os-chevron {
  width: 18px;
  height: 18px;
  color: #56627a;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.dtf-os-block[open] .dtf-os-chevron {
  transform: rotate(180deg);
}
.dtf-os-body {
  padding: 4px 16px 16px;
  border-top: 1px solid rgba(11, 79, 159, .08);
  background: #fff;
}
.dtf-os-recommend {
  margin: 12px 0 10px;
  padding: 10px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: .9rem;
  color: #065f46;
  line-height: 1.5;
}
.dtf-os-recommend em {
  font-style: normal;
  font-weight: 600;
}
.dtf-os-actions {
  margin: 0 0 14px;
}
.dtf-os-alt {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 4px;
  font-size: .85rem;
  color: #475569;
  line-height: 1.5;
}
.dtf-guide-note {
  margin: 0;
  padding: 12px 14px;
  background: #f0f9ff;
  border-left: 3px solid #0b4f9f;
  border-radius: 6px;
  font-size: .85rem;
  color: #1f3a5f;
}

.dtf-extract-dl {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: #f7fafc;
  border-radius: 10px;
}
.dtf-extract-row {
  display: grid;
  grid-template-columns: minmax(180px, 32%) 1fr;
  gap: 12px;
  align-items: baseline;
}
.dtf-extract-row dt {
  color: #4a5568;
  font-size: .9rem;
}
.dtf-extract-row dd {
  margin: 0;
  color: #1a2540;
  font-weight: 600;
  /* Los nombres de fichero del tacógrafo (p.ej.
     "C_E43700194X000001_E____20260525_082...TGD") no tienen espacios y
     desbordaban el ancho del card en móvil. overflow-wrap:anywhere
     permite partir por cualquier carácter si hace falta. */
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dtf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dtf-report {
  position: relative;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--ds-line, rgba(11, 79, 159, .14));
  border-radius: 12px;
  color: #1a2540;
  line-height: 1.55;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
.dtf-report.is-locked {
  position: relative;
  max-height: 600px;
  overflow: hidden;
}
.dtf-report.is-locked::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 200px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 80%);
  pointer-events: none;
}

.dtf-report-head { margin-bottom: 20px; border-bottom: 1px solid var(--ds-line, rgba(11, 79, 159, .14)); padding-bottom: 16px; }
.dtf-report-kicker {
  margin: 0 0 6px;
  color: #0b4f9f;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dtf-report-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: #0b4f9f;
}
.dtf-report-meta {
  margin: 0;
  color: #4a5568;
}

/* Sección de descargas al final del informe (visible tras desbloqueo). */
.dtf-report-downloads {
  margin-top: 32px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(11, 79, 159, .08);
}
.dtf-report-downloads h4 {
  margin-bottom: 8px !important;
}
.dtf-downloads-hint {
  margin: 0 0 16px;
  color: #1f3a5f;
  font-size: .9rem;
  line-height: 1.55;
}
.dtf-downloads-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}
.dtf-downloads-actions .ds-btn {
  flex: 1 1 220px;
  min-height: 48px;
}
@media (max-width: 600px) {
  .dtf-downloads-actions .ds-btn { flex: 1 1 100%; }
}

.dtf-report-section { margin: 22px 0; }
.dtf-report-section h4 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #0b4f9f;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.dtf-section-hint {
  margin: 0 0 12px;
  color: #4a5568;
  font-size: .92rem;
  font-style: italic;
}

.dtf-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
/* Layout uniforme: NOMBRE (+ pictograma) arriba pequeño, VALOR grande
   debajo.  El orden DOM también lo refleja: <label> antes que <value>. */
.dtf-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e3eaf3;
  border-radius: 10px;
  text-align: left;
}
.dtf-kpi-label {
  display: block;
  color: #4a5568;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.25;
}
.dtf-kpi-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: #0b4f9f;
  line-height: 1.1;
}
.dtf-kpi-sub {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: .72rem;
  font-style: italic;
}

/* KPI con pictograma oficial del tacógrafo: pictograma + nombre ARRIBA
   en una fila horizontal, valor grande DEBAJO. */
.dtf-kpi-iconed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e3eaf3;
  text-align: left;
}
.dtf-kpi-iconed .dtf-kpi-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.dtf-kpi-iconed .dtf-kpi-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #f0f9ff;
  border-radius: 6px;
}
.dtf-kpi-iconed .dtf-kpi-label {
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: .78rem;
  font-weight: 600;
  color: #4a5568;
  line-height: 1.2;
}
.dtf-kpi-iconed .dtf-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}
.dtf-kpi-iconed[data-kpi="driving"] .dtf-kpi-value { color: #D2002B; }
.dtf-kpi-iconed[data-kpi="driving"] .dtf-kpi-ico { background: #fef2f2; }
.dtf-kpi-iconed[data-kpi="work"] .dtf-kpi-value { color: #0B4F9F; }
.dtf-kpi-iconed[data-kpi="work"] .dtf-kpi-ico { background: #f0f9ff; }
.dtf-kpi-iconed[data-kpi="availability"] .dtf-kpi-value { color: #0EA5E9; }
.dtf-kpi-iconed[data-kpi="availability"] .dtf-kpi-ico { background: #f0f9ff; }
.dtf-kpi-iconed[data-kpi="rest"] .dtf-kpi-value { color: #15803D; }
.dtf-kpi-iconed[data-kpi="rest"] .dtf-kpi-ico { background: #f0fdf4; }

/* Icono pequeño dentro de cabeceras de tabla y otros sitios */
.dtf-th-ico {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 4px;
}
.dtf-th-ico svg { display: block; }

/* Wrapper de scroll horizontal para que la tabla de 7 columnas no rompa
   el ancho de la página en móvil. Se aplica con :has() al contenedor
   directo del table; navegadores sin :has() simplemente verán la tabla
   recortarse al ancho de la card (gracias a overflow:auto en #root). */
/* Wrapper con scroll horizontal explícito (no depende de :has()).
   Funciona en todos los navegadores y aísla el overflow del resto del
   layout para que el resto del informe NO se desplace. */
.dtf-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  position: relative;
}
.dtf-scroll-hint {
  display: none;
  padding: 6px 10px;
  background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 6px 6px 0 0;
  color: #0b4f9f;
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: .02em;
}
@media (max-width: 760px) {
  .dtf-scroll-hint { display: block; }
}
/* La columna "Fecha" se mantiene fija a la izquierda durante el scroll
   horizontal — el conductor siempre sabe qué día está viendo. */
.dtf-worktime-table th:first-child,
.dtf-worktime-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 2px 0 4px -2px rgba(11, 79, 159, .15);
}
.dtf-worktime-table thead th:first-child {
  background: #f7fafc;
}
.dtf-worktime-table .dtf-day-row.dtf-day-empty td:first-child {
  background: #fafbfc;
}
.dtf-worktime-table .dtf-week-total td:first-child {
  background: #f1f5f9;
}
.dtf-worktime-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: .9rem;
}
.dtf-worktime-table th,
.dtf-worktime-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
.dtf-worktime-table thead th {
  background: #f7fafc;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #475569;
}
.dtf-week-head {
  background: #0b4f9f;
  color: #fff !important;
  font-weight: 700;
  text-align: left !important;
  padding: 10px 12px !important;
}
.dtf-day-row.dtf-day-empty {
  color: #94a3b8;
  background: #fafbfc;
}
/* En los días sin actividad la fecha debe seguir siendo legible — el
   resto de la fila se mantiene en gris claro para indicar inactividad,
   pero la primera columna (fecha) recupera el contraste habitual del
   resto del informe. */
.dtf-worktime-table .dtf-day-row.dtf-day-empty td:first-child {
  color: #1a2540;
  font-weight: 600;
}
.dtf-week-total {
  background: #f1f5f9;
  font-weight: 700;
}
.dtf-empty {
  margin: 0;
  padding: 14px 16px;
  background: #fafbfc;
  border: 1px dashed #cbd5e0;
  border-radius: 8px;
  color: #4a5568;
  font-style: italic;
}

.dtf-activities-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.dtf-activity-day {
  padding: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.dtf-activity-day.is-empty {
  background: #fafbfc;
  border-style: dashed;
  color: #94a3b8;
}
/* En días vacíos la fecha sigue siendo legible: el cabecero conserva
   el color azul Driver Solution y el día de la semana se ve en gris
   medio (no en gris muy claro del .is-empty). */
.dtf-activity-day.is-empty .dtf-day-date {
  color: #0b4f9f !important;
}
.dtf-activity-day.is-empty .dtf-day-weekday {
  color: #56627a !important;
}
.dtf-activity-day.is-empty .dtf-activity-day-header {
  background: linear-gradient(180deg, #f0f9ff 0%, #fafbfc 100%);
}

/* Cuerpo de día vacío con FECHA BIG bien visible (no se puede confundir
   con el conjunto de tarjetas similares). */
.dtf-empty-day-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  min-height: 120px;
  text-align: center;
}
.dtf-empty-day-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}
.dtf-empty-day-weekday {
  text-transform: capitalize;
  font-size: .82rem;
  font-weight: 600;
  color: #56627a !important;
  letter-spacing: .02em;
}
.dtf-empty-day-bigdate {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0b4f9f !important;
  letter-spacing: .01em;
}
.dtf-empty-day-body .dtf-empty-day {
  margin: 0;
  color: #56627a !important;
  font-size: .85rem;
  font-style: italic;
  max-width: 240px;
}
.dtf-activity-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}
.dtf-activity-day h5 {
  margin: 0;
  font-size: .98rem;
  color: #1a2540;
}

/* Fecha grande y visible en cada tarjeta de día (sección 3) */
.dtf-activity-day-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  margin: -4px -4px 10px;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border-bottom: 2px solid #0b4f9f;
  border-radius: 8px 8px 0 0;
}
.dtf-day-datebox {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.dtf-day-weekday {
  text-transform: capitalize;
  font-size: .78rem;
  font-weight: 500;
  color: #56627a;
  letter-spacing: .02em;
}
.dtf-day-date {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0b4f9f;
  letter-spacing: .01em;
}
.dtf-tag {
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 999px;
  color: #475569;
  font-size: .72rem;
  font-weight: 600;
}
.dtf-tag-ok {
  background: #d1fae5;
  color: #064e3b;
}
.dtf-day-times { margin: 4px 0; font-size: .9rem; color: #1a2540; }
.dtf-day-vehicle { margin: 4px 0 8px; font-size: .85rem; color: #4a5568; }
.dtf-day-vehicles {
  margin: 0 0 8px;
  padding: 8px 12px;
  list-style: none;
  background: #f0f9ff;
  border-left: 3px solid #0b4f9f;
  border-radius: 0 4px 4px 0;
  font-size: .82rem;
  color: #1f2937;
}
.dtf-day-vehicles li { margin: 2px 0; }
.dtf-day-vehicles strong { color: #0b4f9f; }
.dtf-day-vehicles time { color: #0b4f9f; font-weight: 600; }
.dtf-day-events { margin: 0; padding-left: 16px; font-size: .82rem; color: #4a5568; }
.dtf-day-events time { color: #0b4f9f; font-weight: 600; margin-right: 6px; }
.dtf-empty-day { margin: 0; font-size: .9rem; }

.dtf-infringements {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.dtf-inf {
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 4px solid #cbd5e0;
  background: #fafbfc;
}
.dtf-inf-leve { border-left-color: #fbbf24; }
.dtf-inf-grave { border-left-color: #f97316; }
.dtf-inf-muy_grave { border-left-color: #dc2626; background: #fff5f5; }
.dtf-inf header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.dtf-inf-severity {
  padding: 2px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.dtf-inf-when { margin: 0 0 4px; font-size: .85rem; color: #475569; }
.dtf-inf-detail { margin: 0; font-size: .92rem; }
.dtf-inf-norm { margin: 6px 0 0; font-size: .78rem; color: #64748b; font-style: italic; }

.dtf-assessment {
  margin: 0;
  padding-left: 22px;
  color: #1a2540;
}
.dtf-assessment li { margin-bottom: 8px; line-height: 1.55; }

.dtf-legal-list {
  margin: 0;
  padding-left: 22px;
  color: #4a5568;
  font-size: .92rem;
}
.dtf-disclaimer {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  color: #78350f;
  font-size: .88rem;
}
.dtf-disclaimer-warn {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-left-width: 6px;
  padding: 14px 16px;
  font-size: .92rem;
  line-height: 1.55;
}
.dtf-disclaimer-warn strong { color: #92400e; }

/* ===== Paywall ===== */
.dtf-paywall {
  margin-top: -120px;
  position: relative;
  z-index: 2;
}
.dtf-paywall-card {
  margin: 0 auto;
  padding: 22px 24px;
  max-width: 520px;
  background: #fff;
  border: 1px solid #0b4f9f;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(11, 79, 159, .18);
}
.dtf-paywall-card h3 {
  margin: 0 0 8px;
  color: #0b4f9f;
}
.dtf-paywall-card p { margin: 0 0 12px; color: #1a2540; line-height: 1.5; }
.dtf-paywall-price {
  margin: 12px 0 16px !important;
  padding: 8px 12px;
  background: #eff6ff;
  border-radius: 8px;
  color: #0b4f9f;
  font-weight: 700;
}
.dtf-paywall-vat-inline {
  font-weight: 500;
  font-size: .92em;
  color: #4a6587;
}

.dtf-noscript {
  margin: 24px 0;
  padding: 16px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .dtf-step { padding: 18px; }
  .dtf-step-title { font-size: 1.05rem; }
  .dtf-extract-row { grid-template-columns: 1fr; gap: 2px; }
  .dtf-worktime-table { font-size: .82rem; min-width: 680px; }
  .dtf-worktime-table th, .dtf-worktime-table td {
    padding: 6px 7px;
    white-space: nowrap;   /* sin partir palabras dentro de celdas */
  }
  .dtf-worktime-table thead th {
    white-space: nowrap;
    font-size: .7rem;
  }
  .dtf-week-head { white-space: nowrap; }
  .dtf-paywall { margin-top: -100px; }
  .dtf-paywall-card { padding: 18px 16px; }
  .dtf-report { padding: 18px 16px; }
  .dtf-report-title { font-size: 1.15rem; }
  .dtf-report-downloads { padding: 16px; }
  .dtf-activities-grid { grid-template-columns: 1fr; }
  .dtf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dtf-stepper { gap: 8px; margin-bottom: 18px; }
  .dtf-chip { padding: 6px 11px; font-size: .85rem; }
  .dtf-connect-grid { grid-template-columns: 1fr; }
  .dtf-guide-grid { grid-template-columns: 1fr; }
  .dtf-actions .ds-btn,
  .dtf-downloads-actions .ds-btn { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .dtf-step { padding: 14px; }
  .dtf-report { padding: 14px; }
  .dtf-kpis { grid-template-columns: 1fr; }
  .dtf-paywall { margin-top: -80px; }
  .dtf-inf header { flex-direction: column; align-items: flex-start; gap: 4px; }
}
