/* Hoja operativa: columnas legibles y desplazamiento horizontal accesible. */
.data-grid-wrap {
  max-width: 100%;
  max-height: 52vh;
  padding-right: 18px;
  overflow-x: scroll;
  overflow-y: auto;
  scroll-padding-right: 18px;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
}

.data-grid-wrap::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.data-grid-wrap::-webkit-scrollbar-track {
  background: #edf2f5;
}

.data-grid-wrap::-webkit-scrollbar-thumb {
  border: 3px solid #edf2f5;
  border-radius: 999px;
  background: #8ea0af;
}

.data-grid-wrap::-webkit-scrollbar-thumb:hover {
  background: #687d8e;
}

.data-table {
  width: max-content;
  min-width: 100%;
}

.data-table td {
  min-width: 48px;
}

.data-table td.money {
  min-width: 62px;
}

.data-table th:not(.row-number) {
  padding-right: 4px;
  padding-left: 4px;
  line-height: 1.1;
  white-space: normal;
}

.data-table td.money .cell-input {
  padding-right: 4px;
  padding-left: 4px;
}

.data-table td.field-codigo,
.data-table th.field-codigo {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
}

.data-table td.field-codigo .cell-input {
  padding-right: 5px;
  padding-left: 5px;
}

.data-table td.field-conductor,
.data-table th.field-conductor {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}

.data-table td.field-telefono,
.data-table th.field-telefono {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

.data-table td.field-coche,
.data-table th.field-coche {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
}

.data-table td.field-maquina,
.data-table th.field-maquina {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.data-table td.field-observaciones,
.data-table th.field-observaciones {
  width: 390px;
  min-width: 390px;
  max-width: 390px;
}

.data-table td.field-informe_uber,
.data-table th.field-informe_uber {
  width: 98px;
  min-width: 98px;
  max-width: 98px;
}

.data-table td.field-uber,
.data-table th.field-uber,
.data-table td.field-uber_efectivo,
.data-table th.field-uber_efectivo,
.data-table td.field-uber_visa,
.data-table th.field-uber_visa,
.data-table td.field-bolt,
.data-table th.field-bolt,
.data-table td.field-bolt_efectivo,
.data-table th.field-bolt_efectivo,
.data-table td.field-bolt_visa,
.data-table th.field-bolt_visa,
.data-table td.field-cabify,
.data-table th.field-cabify,
.data-table td.field-cabify_efectivo,
.data-table th.field-cabify_efectivo,
.data-table td.field-cabify_visa,
.data-table th.field-cabify_visa {
  width: 62px;
  min-width: 62px;
  max-width: 62px;
}

.data-table td.field-efectivo_transfers,
.data-table th.field-efectivo_transfers,
.data-table td.field-visa_transfers,
.data-table th.field-visa_transfers,
.data-table td.field-efectivo,
.data-table th.field-efectivo,
.data-table td.field-visa,
.data-table th.field-visa,
.data-table td.field-gastos,
.data-table th.field-gastos {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
}

.data-table .cell-input {
  text-align: center;
}

.data-table .cell-input.field-conductor {
  color: #0757a6;
  font-weight: 800;
}

/* Plantilla 1: alternancia visual de los bloques de plataformas. */
.data-table th.field-uber,
.data-table th.field-uber_efectivo,
.data-table th.field-uber_visa,
.data-table td.field-uber,
.data-table td.field-uber_efectivo,
.data-table td.field-uber_visa,
.data-table th.field-cabify,
.data-table th.field-cabify_efectivo,
.data-table th.field-cabify_visa,
.data-table td.field-cabify,
.data-table td.field-cabify_efectivo,
.data-table td.field-cabify_visa {
  background: #f3f5f6;
  border-right-color: #cfd8df;
  border-bottom-color: #cfd8df;
}

.data-table th.field-uber,
.data-table th.field-uber_efectivo,
.data-table th.field-uber_visa,
.data-table th.field-cabify,
.data-table th.field-cabify_efectivo,
.data-table th.field-cabify_visa {
  border-right: 1px solid #c5cfd7;
  border-bottom-color: #b8c4cd;
}

.data-table th.field-bolt,
.data-table th.field-bolt_efectivo,
.data-table th.field-bolt_visa,
.data-table td.field-bolt,
.data-table td.field-bolt_efectivo,
.data-table td.field-bolt_visa {
  background: #fff;
}

/* Facturación: alineación, búsqueda y evolución en tiempo real. */
.main-content {
  transition: background-color 220ms ease;
}

.main-content.driver-report-view {
  background: #e7f1f1;
}

/* Cabeceras de turno centradas y claramente diferenciadas. */
.shift-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.shift-header > div {
  grid-column: 2;
  justify-self: center;
  gap: 12px;
}

.shift-header > label {
  grid-column: 3;
  justify-self: end;
}

.shift-header h2 {
  color: #0757a6;
  font-size: 20px;
  letter-spacing: .01em;
  text-align: center;
}

.shift-header .shift-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 11px;
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.shift-header .shift-badge.day {
  border: 1px solid #efd170;
  background: #fff7d9;
  color: #9a6a00;
  box-shadow: 0 5px 12px rgba(154, 106, 0, .09);
}

.shift-header .shift-badge.night {
  border: 1px solid #bfd0e2;
  background: #e9f0f8;
  color: #244f7d;
  box-shadow: 0 5px 12px rgba(36, 79, 125, .09);
}

@media (max-width: 1450px) {
  .shift-header {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .shift-header > div,
  .shift-header > label {
    grid-column: 1;
  }

  .shift-header > label {
    width: min(100%, 520px);
    justify-self: center;
  }
}

.report-page-heading {
  justify-content: center;
  text-align: center;
}

.report-page-heading > div {
  width: 100%;
}

.report-context-heading {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .32em;
  white-space: nowrap;
}

.report-context-heading .report-scope-title {
  color: #14273d;
  font-size: 1.08em;
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.report-context-heading .report-scope-title.is-driver {
  color: #bd2f3d;
}

.report-title-separator {
  color: #7b8d9e;
}

.kpi .kpi-label {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.kpi .kpi-driver-name {
  color: #bd2f3d;
  font-style: normal;
  font-weight: 950;
}

.kpi.billing {
  border-color: #72bea5;
  background: linear-gradient(135deg, #dff5e9 0%, #f1fbf6 48%, #fff 100%);
}

.driver-summary-row td {
  font-weight: 850;
}

.daily-driver-name {
  color: #0757a6;
  font-weight: 900;
}

.summary-table td.daily-billing-below-minimum {
  color: #c22f3f;
  font-weight: 950;
}

.driver-filter-button.is-below-minimum,
.average-billing.is-below-minimum {
  color: #c22f3f;
  font-weight: 950;
}

.average-billing.is-meeting-minimum {
  color: #168466;
  font-weight: 950;
}

.chart-metric-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px 18px;
}

.chart-metric-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 126px;
  min-height: 42px;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #cbd7e1;
  border-radius: 10px;
  background: #fff;
  color: #42586d;
  font-size: 12px;
  font-weight: 850;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.chart-metric-button::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.chart-metric-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 13px rgba(15,39,64,.12);
}

.chart-metric-button:active {
  transform: scale(.97);
}

.chart-metric-button.metric-billing {
  color: #168466;
}

.chart-metric-button.metric-visa {
  color: #7654b4;
}

.chart-metric-button.metric-cash {
  color: #0757a6;
}

.chart-metric-button.metric-expenses {
  color: #c63f4a;
}

.chart-metric-button.metric-grand-total {
  color: #d98100;
}

.chart-metric-button.active {
  border-color: currentColor;
  background: #f4f9fa;
  box-shadow: 0 0 0 3px rgba(40,120,189,.09);
}

.chart-metric-button:not(.active) {
  border-color: #d7e0e7;
  background: #f8fafb;
  color: #8795a3;
  opacity: .72;
}

.summary-table th,
.summary-table td,
.summary-table td:not(:first-child) {
  text-align: center;
  vertical-align: middle;
}

.summary-table .driver-name {
  color: #0757a6;
  font-weight: 800;
  text-transform: uppercase;
}

.driver-filter-button {
  max-width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #0757a6;
  font: inherit;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.driver-filter-button:hover {
  background: #eaf3fb;
  color: #034683;
  box-shadow: 0 5px 13px rgba(7, 87, 166, 0.14);
  transform: translateY(-1px);
}

.driver-filter-button:focus-visible {
  outline: 3px solid rgba(40, 120, 189, 0.22);
  outline-offset: 2px;
}

.driver-filter-button:active {
  background: #dcecf8;
  transform: scale(0.97);
}

.summary-table tfoot td {
  border-top: 2px solid #aebbc6;
  background: #eef3f6;
  color: #102a43;
  font-weight: 900;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  margin-left: auto;
  color: #25745f;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.live-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2aa57e;
  box-shadow: 0 0 0 5px rgba(42,165,126,.12);
}

.report-driver-filter {
  display: grid;
  flex: 0 1 450px;
  gap: 7px;
  width: 450px;
  min-width: 320px;
}

.report-driver-filter > label {
  min-width: 0;
}

.report-driver-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-bar .report-driver-control input {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 800;
  text-overflow: ellipsis;
}

.report-driver-clear {
  flex: 0 0 44px;
  width: 44px;
  height: 46px;
  padding: 0;
  border: 1px solid #b9c9d7;
  border-radius: 8px;
  background: #f1f6f8;
  color: #17334e;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.report-driver-clear:hover:not(:disabled) {
  border-color: #2878bd;
  background: #e7f2fa;
  color: #0757a6;
  box-shadow: 0 4px 10px rgba(7,87,166,.16);
  transform: scale(1.06);
}

.report-driver-clear:focus-visible {
  outline: 3px solid rgba(40,120,189,.2);
  outline-offset: 2px;
}

.report-driver-clear:active:not(:disabled) {
  background: #d6ebf7;
  transform: scale(.96);
}

.report-driver-clear:disabled {
  opacity: .35;
  cursor: default;
}

.chart-wrap {
  position: relative;
  min-height: 270px;
  padding: 18px;
}

.chart-tooltip {
  position: absolute;
  z-index: 6;
  display: grid;
  gap: 5px;
  min-width: 132px;
  max-width: 230px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: #102a43;
  color: #fff;
  box-shadow: 0 8px 20px rgba(6,27,51,.2);
  font-size: 12px;
  line-height: 1.25;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}

.chart-tooltip::after {
  position: absolute;
  top: 100%;
  left: var(--chart-tooltip-arrow, 50%);
  border: 6px solid transparent;
  border-top-color: #102a43;
  content: '';
  transform: translateX(-50%);
}

.chart-tooltip.is-below {
  transform: translate(-50%, 10px);
}

.chart-tooltip.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #102a43;
}

.chart-tooltip-date {
  color: #b9cad8;
  font-size: 11px;
  font-weight: 750;
}

.chart-tooltip-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.chart-tooltip-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-tooltip-row strong {
  margin-left: 5px;
  font-size: 13px;
  font-weight: 900;
}

#driverChart {
  display: block;
  width: 100%;
  height: 240px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #68798b;
  font-size: 12px;
}

@media (max-width: 760px) {
  .chart-metric-controls {
    flex-wrap: wrap;
  }

  .report-driver-filter {
    width: auto;
    min-width: 0;
  }

  .report-context-heading {
    flex-wrap: wrap;
    white-space: normal;
  }

  .data-grid-wrap {
    max-height: 48vh;
  }

  .data-table td.field-conductor,
  .data-table th.field-conductor {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
  }

  .data-table td.field-telefono,
  .data-table th.field-telefono {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
  }

  .live-badge {
    grid-column: 1 / -1;
    margin-left: 0;
  }
}
