* { box-sizing:border-box; }
        body { margin:0; background:#f1f5f9; color:#0f172a; font-family:var(--route-font); }
        .dashboard-page { padding:20px 22px 32px; }
        .dashboard-hero { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; padding:22px 24px; border-radius:20px; color:#fff; background:linear-gradient(120deg,#0f172a,#1e3a8a 62%,#0369a1); box-shadow:0 18px 38px rgba(15,23,42,.20); }
        .dashboard-hero h1 { margin:0; font-size:27px; }
        .dashboard-hero p { max-width:800px; margin:8px 0 0; color:#dbeafe; font-size:13px; line-height:1.55; }
        .dashboard-hero-date { text-align:right; white-space:nowrap; }
        .dashboard-hero-date strong { display:block; font-size:23px; }
        .dashboard-hero-date span { color:#bfdbfe; font-size:11px; }
        .dashboard-filter { position:sticky; top:var(--route-nav-height); z-index:1000; display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:16px 0; padding:13px 15px; border:1px solid #dbe4ee; border-radius:15px; background:rgba(255,255,255,.96); box-shadow:0 10px 24px rgba(15,23,42,.09); backdrop-filter:blur(10px); }
        .dashboard-filter label { color:#475569; font-size:12px; font-weight:800; }
        .dashboard-filter input[type=date] { border:1px solid #cbd5e1; border-radius:9px; padding:8px 10px; }
        .shift-options { display:flex; gap:7px; flex-wrap:wrap; }
        .shift-option input { position:absolute; opacity:0; pointer-events:none; }
        .shift-option span { display:inline-flex; align-items:center; justify-content:center; min-width:48px; min-height:36px; border:1px solid #cbd5e1; border-radius:999px; background:#fff; color:#475569; font-size:12px; font-weight:900; cursor:pointer; }
        .shift-option input:checked + span { color:#fff; border-color:#2563eb; background:#2563eb; box-shadow:0 5px 12px rgba(37,99,235,.25); }
        .dashboard-btn { border:0; border-radius:9px; padding:9px 14px; color:#fff; background:#2563eb; text-decoration:none; font-size:12px; font-weight:900; cursor:pointer; }
        .dashboard-btn.secondary { background:#64748b; }
        .dashboard-filter .spacer { flex:1; }
        .kpi-grid { display:grid; grid-template-columns:repeat(3,minmax(220px,1fr)); gap:13px; margin-bottom:17px; }
        .kpi { min-height:128px; padding:17px 18px; border:1px solid #e2e8f0; border-radius:17px; background:#fff; box-shadow:0 10px 24px rgba(15,23,42,.06); }
        .kpi .label { color:#64748b; font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
        .kpi .value { margin-top:8px; font-size:31px; font-weight:900; }
        .kpi .help { margin-top:6px; color:#64748b; font-size:11px; line-height:1.4; }
        .kpi.success { border-top:4px solid #65b312; }.kpi.recovery{border-top:4px solid #52B2DF}.kpi.info{border-top:4px solid #2563eb}.kpi.warning{border-top:4px solid #f5a623}.kpi.danger{border-top:4px solid #CF0A2C}.kpi.reader{border-top:4px solid #7c3aed}
        .chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
        .chart-card { min-height:365px; padding:17px; border:1px solid #e2e8f0; border-radius:17px; background:#fff; box-shadow:0 10px 24px rgba(15,23,42,.06); }
        .chart-card.wide { grid-column:1/-1; }
        .chart-title { font-size:15px; font-weight:900; }.chart-help{margin-top:4px;color:#64748b;font-size:11px;line-height:1.4}.chart-wrap{position:relative;height:285px;margin-top:12px}.chart-card.wide .chart-wrap{height:310px}
        .dashboard-lower { display:grid; grid-template-columns:1.2fr .8fr; gap:15px; margin-top:15px; }
        .panel { border:1px solid #e2e8f0; border-radius:17px; background:#fff; box-shadow:0 10px 24px rgba(15,23,42,.06); overflow:hidden; }
        .panel-header { padding:15px 17px; border-bottom:1px solid #e2e8f0; font-size:14px; font-weight:900; }
        .alert-list { margin:0; padding:0; list-style:none; }.alert-item{display:grid;grid-template-columns:1fr auto;gap:10px;padding:13px 17px;border-bottom:1px solid #edf2f7}.alert-item:last-child{border-bottom:0}.alert-route{font-weight:900}.alert-meta{margin-top:3px;color:#64748b;font-size:11px}.alert-text{align-self:center;color:#CF0A2C;background:#fee2e2;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:900}.empty{padding:24px;color:#64748b;text-align:center;font-size:12px}
        .explanation { padding:17px; color:#475569; font-size:12px; line-height:1.55; }.explanation strong{color:#0f172a}.explanation .rule{margin-top:11px;padding:10px 12px;border-radius:10px;background:#eff6ff;color:#1e3a8a;font-weight:800}
        @media(max-width:1100px){.kpi-grid{grid-template-columns:repeat(2,1fr)}.chart-grid,.dashboard-lower{grid-template-columns:1fr}.chart-card.wide{grid-column:auto}}
        @media(max-width:680px){.dashboard-page{padding:13px}.dashboard-hero{flex-direction:column}.dashboard-hero-date{text-align:left}.kpi-grid{grid-template-columns:1fr}.dashboard-filter .spacer{display:none}}

@media (min-width: 1101px) {
    .route-dashboard-page.route-client-mode .kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .route-dashboard-page.route-diagnostic-mode .kpi-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .route-dashboard-page.route-diagnostic-mode .kpi-grid > .kpi:nth-child(-n + 4) {
        grid-column: span 3;
    }

    .route-dashboard-page.route-diagnostic-mode .kpi-grid > .kpi:nth-child(n + 5) {
        grid-column: span 4;
    }
}

.chart-empty-state {
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    border:1px dashed #cbd5e1;
    border-radius:12px;
    background:#f8fafc;
    color:#64748b;
    text-align:center;
    font-size:12px;
    font-weight:800;
    line-height:1.5;
}


/* =========================================================
   Retrasos y actividad de lectores
   ========================================================= */
.delay-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.delay-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 13px 17px;
    border-bottom: 1px solid #edf2f7;
}

.delay-item:last-child {
    border-bottom: 0;
}

.delay-rank {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    min-height: 42px;
    padding: 8px 7px;
    border-radius: 10px;
    background: #fee2e2;
    color: #CF0A2C;
    font-size: 18px;
    font-weight: 900;
}

.delay-rank span {
    font-size: 10px;
    text-transform: uppercase;
}

.delay-main {
    min-width: 0;
}

.delay-route {
    font-size: 13px;
    font-weight: 900;
}

.delay-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.delay-average-panel {
    display: flex;
    flex-direction: column;
}

.delay-average-wrap {
    position: relative;
    min-height: 270px;
    padding: 14px 17px 4px;
}

.panel-footnote {
    margin-top: auto;
    padding: 10px 17px 15px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

@media(max-width:680px) {
    .delay-item {
        grid-template-columns: 62px minmax(0, 1fr);
        padding: 11px 13px;
    }
}


/* =========================================================
   Puntualidad: llegada anticipada o hasta +5 min
   ========================================================= */
.panel-header-with-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-count {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fee2e2;
    color: #CF0A2C;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.delay-average-wrap {
    min-height: 145px;
    height: 145px;
    padding: 10px 17px 0;
}

.shift-delay-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px 17px 12px;
    border-top: 1px solid #eef2f7;
}

.shift-delay-card {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.shift-delay-card__head,
.shift-delay-card__details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.shift-delay-card__head strong {
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
}

.shift-delay-card__head span,
.shift-delay-card__details {
    color: #64748b;
    font-size: 9px;
}

.shift-delay-card__metric {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 7px;
}

.shift-delay-card__value {
    color: #65b312;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.shift-delay-card__label {
    color: #475569;
    font-size: 10px;
    font-weight: 800;
}

.shift-delay-card__details {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #e2e8f0;
}

.shift-delay-card__details b {
    color: #0f172a;
}

@media (max-width: 680px) {
    .panel-header-with-count {
        align-items: flex-start;
    }

    .shift-delay-summary {
        grid-template-columns: 1fr;
    }

    .delay-average-wrap {
        min-height: 135px;
        height: 135px;
    }
}

/* =========================================================
   Tarjeta desplazable de retrasos fuera de puntualidad
   ========================================================= */
.delay-list-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 430px;
}

.delay-list-panel .panel-header {
    flex: 0 0 auto;
    background: #fff;
}

.delay-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: #fff;
}

.delay-list-scroll:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.delay-list-scroll::-webkit-scrollbar {
    width: 10px;
}

.delay-list-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.delay-list-scroll::-webkit-scrollbar-thumb {
    border: 2px solid #f1f5f9;
    border-radius: 999px;
    background: #94a3b8;
}

.delay-item {
    position: relative;
    border-left: 4px solid transparent;
    transition: background-color .16s ease;
}

.delay-item--slight {
    border-left-color: #F5D523;
    background: #fefce8;
}

.delay-item--slight .delay-rank {
    background: #fef3c7;
    color: #a16207;
}

.delay-item--moderate {
    border-left-color: #f5a623;
    background: #fff7ed;
}

.delay-item--moderate .delay-rank {
    background: #ffedd5;
    color: #a85e00;
}

.delay-item--severe {
    border-left-color: #CF0A2C;
    background: #fef2f2;
}

.delay-item--severe .delay-rank {
    background: #fee2e2;
    color: #CF0A2C;
}

.delay-item:hover {
    filter: brightness(.985);
}

@media (max-width: 1100px) {
    .delay-list-panel {
        max-height: 390px;
    }
}

@media (max-width: 680px) {
    .delay-list-panel {
        max-height: 360px;
    }

    .delay-list-scroll {
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================================
   Igualar altura de las tarjetas inferiores
   ========================================================= */
.dashboard-lower {
    align-items: stretch;
}

.dashboard-lower > .panel {
    height: 100%;
}

.delay-list-panel {
    /* La altura la determina la tarjeta contigua. */
    max-height: none;
    min-height: 0;
}

.delay-list-scroll {
    /* Ocupa todo el espacio libre entre la cabecera y el final. */
    flex: 1 1 0;
}

@media (max-width: 1100px) {
    .dashboard-lower > .panel {
        height: auto;
    }

    .delay-list-panel {
        /* Al apilarse, conserva una altura cómoda sin crecer indefinidamente. */
        height: 480px;
        max-height: 480px;
    }
}

@media (max-width: 680px) {
    .delay-list-panel {
        height: 420px;
        max-height: 420px;
    }
}

/* =========================================================
   Conciliación global de fichajes
   ========================================================= */
.chart-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
}

.readings-reconciliation {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.reading-total {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    white-space: nowrap;
}

.reading-total b {
    font-size: 15px;
    line-height: 1;
}

.reading-total--raw {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.reading-total--summary,
.reading-total--ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #65b312;
}

.reading-total--gap {
    border-color: #fecaca;
    background: #fef2f2;
    color: #CF0A2C;
}

.reading-total--warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #a16207;
}

.all-readings-chart-wrap {
    min-height: 250px;
}

.chart-footnote {
    margin-top: 10px;
    padding: 8px 10px;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .chart-title-row {
        display: block;
    }

    .readings-reconciliation {
        justify-content: flex-start;
        margin-top: 10px;
    }

    .reading-total {
        flex: 1 1 auto;
        justify-content: center;
    }
}


/* =========================================================
   Fichajes: comparativa por turno + distribución global
   ========================================================= */
.readings-card {
    min-height: 365px;
}

.readings-chart-wrap,
.all-readings-chart-wrap {
    height: 245px;
    min-height: 245px;
}

.all-readings-card {
    display: flex;
    flex-direction: column;
}

.all-readings-card .all-readings-chart-wrap {
    flex: 0 0 245px;
}

.readings-reconciliation--compact {
    justify-content: center;
    margin-top: 4px;
}

.readings-reconciliation--compact .reading-total {
    min-height: 29px;
    padding: 5px 9px;
    font-size: 11px;
}

.readings-reconciliation--compact .reading-total b {
    font-size: 14px;
}

.all-readings-card .chart-footnote {
    margin-top: 8px;
    font-size: 10px;
}

@media (max-width: 1100px) {
    .readings-card {
        min-height: 350px;
    }

    .readings-chart-wrap,
    .all-readings-chart-wrap,
    .all-readings-card .all-readings-chart-wrap {
        height: 240px;
        min-height: 240px;
        flex-basis: 240px;
    }
}

@media (max-width: 680px) {
    .readings-card {
        min-height: auto;
    }

    .readings-chart-wrap,
    .all-readings-chart-wrap,
    .all-readings-card .all-readings-chart-wrap {
        height: 275px;
        min-height: 275px;
        flex-basis: 275px;
    }

    .readings-reconciliation--compact {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
}

/* =========================================================
   Fichajes en una sola fila: turno, total y vehículos sin lectura
   ========================================================= */
.readings-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    min-width: 0;
}

.readings-grid > .chart-card {
    min-width: 0;
    height: 100%;
}

.reader-zero-card {
    display: flex;
    flex-direction: column;
    min-height: 365px;
}

.reader-zero-card__title-row {
    margin-bottom: 8px;
}

.reader-zero-card__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 30px;
    padding: 0 9px;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 900;
}

.reader-zero-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    height: 245px;
    margin-top: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #fff;
}

.reader-zero-list-scroll::-webkit-scrollbar {
    width: 9px;
}

.reader-zero-list-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.reader-zero-list-scroll::-webkit-scrollbar-thumb {
    border: 2px solid #f1f5f9;
    border-radius: 999px;
    background: #94a3b8;
}

.reader-zero-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.reader-zero-item {
    position: relative;
    padding: 12px 13px;
    border-bottom: 1px solid #e2e8f0;
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.reader-zero-item:last-child {
    border-bottom: 0;
}

.reader-zero-item--critical {
    border-left-color: #CF0A2C;
    background: #fef2f2;
}

.reader-zero-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.reader-zero-item__plate {
    min-width: 0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.reader-zero-item__ratio {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 900;
}

.reader-zero-item--critical .reader-zero-item__ratio {
    background: #fee2e2;
    color: #CF0A2C;
}

.reader-zero-item__metric {
    margin-top: 6px;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.reader-zero-item__meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.35;
}

.reader-zero-item__routes {
    margin-top: 6px;
    overflow: hidden;
    color: #475569;
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-zero-empty {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 245px;
    margin-top: 8px;
    padding: 22px;
    border: 1px dashed #bbf7d0;
    border-radius: 11px;
    background: #f0fdf4;
    color: #166534;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

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

    .reader-zero-list-scroll {
        height: 285px;
    }
}

@media (max-width: 680px) {
    .reader-zero-card {
        min-height: 340px;
    }

    .reader-zero-list-scroll {
        height: 250px;
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================================
   Frotcom brand layer
   ========================================================= */
body.route-dashboard-page {
    background: var(--route-bg);
    color: var(--route-text);
    font-family: var(--route-font);
}

.dashboard-filter,
.kpi,
.chart-card,
.panel,
.shift-delay-card,
.reader-zero-card,
.reader-zero-item {
    border-color: var(--route-border);
    box-shadow: 0 10px 24px rgba(38, 55, 69, .06);
}

.dashboard-filter {
    background: rgba(255, 255, 255, .97);
}

.shift-option span,
.dashboard-filter input[type=date] {
    border-color: #c6d4dd;
    color: var(--route-muted);
}

.shift-option input:checked + span,
.dashboard-btn {
    border-color: var(--frotcom-blue);
    background: var(--frotcom-blue);
    box-shadow: 0 5px 12px rgba(0, 130, 201, .24);
}

.dashboard-btn:hover {
    background: var(--frotcom-blue-dark);
}

.dashboard-btn.secondary {
    background: var(--frotcom-grey);
}

.kpi.info {
    border-top-color: var(--frotcom-blue);
}

.kpi.reader {
    border-top-color: var(--frotcom-grey);
}

.chart-title,
.panel-header,
.shift-delay-card__head strong,
.reader-zero-item__plate {
    color: var(--route-text);
}

.chart-help,
.kpi .label,
.kpi .help,
.panel-footnote,
.reader-zero-item__meta,
.reader-zero-item__routes,
.delay-meta {
    color: var(--route-muted);
}

.explanation .rule,
.reader-zero-card__count {
    border-color: #b9dce9;
    background: var(--frotcom-blue-soft);
    color: var(--frotcom-blue-dark);
}

.chart-empty-state,
.shift-delay-card {
    background: #f8fafb;
}

.route-dashboard-page .dashboard-filter,
.route-dashboard-page .dashboard-filter input,
.route-dashboard-page .dashboard-filter button,
.route-dashboard-page .dashboard-filter select,
.route-dashboard-page .chart-help,
.route-dashboard-page .kpi .help,
.route-dashboard-page .alert-meta,
.route-dashboard-page .delay-meta,
.route-dashboard-page .reader-zero-item__meta,
.route-dashboard-page .reader-zero-item__routes {
    font-size: 12px;
}

.route-dashboard-page .chart-title,
.route-dashboard-page .panel-header {
    font-size: 14px;
}

.route-dashboard-page .kpi .label {
    font-size: 11px;
}

/* =========================================================
   Paleta operativa: puntualidad, retrasos y fichajes
   ========================================================= */
:root {
    --dashboard-delay-green: #65b312;
    --dashboard-delay-yellow: #F5D523;
    --dashboard-delay-orange: #f5a623;
    --dashboard-delay-red: #CF0A2C;
}

/* Resumen de puntualidad por turno. */
.shift-delay-card__value {
    color: var(--dashboard-delay-green);
}

/* Contador y estilos base de los servicios fuera de margen. */
.panel-count,
.delay-rank {
    background: #fde4e9;
    color: var(--dashboard-delay-red);
}

/* Retraso leve con el amarillo corporativo solicitado. */
.delay-item--slight {
    border-left-color: var(--dashboard-delay-yellow);
}

/* Retraso moderado. */
.delay-item--moderate {
    border-left-color: var(--dashboard-delay-orange);
    background: #fff8e8;
}

.delay-item--moderate .delay-rank {
    background: #fff0cf;
    color: var(--dashboard-delay-orange);
}

/* Retraso grave. */
.delay-item--severe {
    border-left-color: var(--dashboard-delay-red);
    background: #fff1f4;
}

.delay-item--severe .delay-rank {
    background: #fde4e9;
    color: var(--dashboard-delay-red);
}

.route-period-page .period-warning {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #f3c46d;
    border-radius: 8px;
    background: #fff7e6;
    color: #7a4a00;
    font-size: 12px;
    font-weight: 800;
}

.route-period-page .period-filter select,
.route-period-page .period-filter input[type="date"] {
    min-height: 36px;
}

.route-period-page .period-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.route-period-page .period-field[hidden] {
    display: none !important;
}

.route-period-page .period-delta {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.route-period-page .period-delta--good {
    background: #e5f4d6;
    color: #336600;
}

.route-period-page .period-delta--bad {
    background: #fde4e9;
    color: var(--dashboard-delay-red);
}

.route-period-page .period-delta--neutral {
    background: var(--frotcom-grey-soft);
    color: var(--route-muted);
}

.route-period-page .period-delta-context {
    display: inline-block;
    margin-left: 6px;
    color: var(--route-muted);
    font-size: 11px;
    font-weight: 700;
}

.route-period-page .period-matrix-card {
    min-height: 0;
}

.route-period-page .period-shift-matrix-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.route-period-page .period-shift-matrix {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 12px;
}

.route-period-page .period-shift-matrix th,
.route-period-page .period-shift-matrix td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--route-border);
    text-align: left;
    vertical-align: top;
}

.route-period-page .period-shift-matrix thead th {
    background: #e7eef2;
    color: var(--frotcom-grey);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.route-period-page .period-shift-cell {
    border-left: 4px solid transparent;
    background: #fff;
}

.route-period-page .period-shift-cell strong,
.route-period-page .period-shift-cell span,
.route-period-page .period-shift-cell small {
    display: block;
}

.route-period-page .period-shift-cell strong {
    color: var(--route-text);
    font-size: 13px;
    line-height: 1.2;
}

.route-period-page .period-shift-cell span {
    margin-top: 2px;
    color: var(--route-muted);
    font-weight: 800;
}

.route-period-page .period-shift-cell .period-shift-cell__previous {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    color: var(--route-muted);
    font-size: 11px;
    font-weight: 800;
}

.route-period-page .period-shift-cell .period-shift-cell__delta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 18px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.route-period-page .period-shift-cell__delta.is-better {
    background: #e5f4d6;
    color: #336600;
}

.route-period-page .period-shift-cell__delta.is-worse {
    background: #fde4e9;
    color: var(--dashboard-delay-red);
}

.route-period-page .period-shift-cell__delta.is-neutral {
    background: #e8eef2;
    color: var(--route-muted);
}

.route-period-page .period-shift-cell small {
    margin-top: 4px;
    color: var(--route-muted);
}

.route-period-page .period-shift-cell--empty {
    color: var(--route-muted);
    background: #f8fafc;
}

.route-period-page .period-shift-cell--early {
    border-left-color: var(--dashboard-delay-green);
    background: #f1f8e8;
}

.route-period-page .period-shift-cell--on-time {
    border-left-color: #4fb8a8;
    background: #eefaf8;
}

.route-period-page .period-shift-cell--slight {
    border-left-color: var(--dashboard-delay-yellow);
    background: #fffbea;
}

.route-period-page .period-shift-cell--moderate {
    border-left-color: var(--dashboard-delay-orange);
    background: #fff8e8;
}

.route-period-page .period-shift-cell--severe {
    border-left-color: var(--dashboard-delay-red);
    background: #fff1f4;
}
