/* ====================================================================
   Dashboard Shell (DashboardLayout.razor) — scoped under .app-shell
   so it never affects the public pages still using MainLayout.
   ==================================================================== */

.app-shell {
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 76px;
    --sidebar-bg: #171a25;
    --sidebar-bg-hover: rgba(255, 255, 255, 0.07);
    --sidebar-text: #cbd5e1;
    --sidebar-text-muted: #7d8598;
    --accent: #6366f1;
    --accent-soft: rgba(99, 102, 241, 0.18);
    --content-bg: #f5f6fa;

    display: flex;
    min-height: 100vh;
    background: var(--content-bg);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Hidden checkbox driving the collapse state — no JS required */
.sidebar-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-toggle-input:checked ~ .sidebar {
    width: var(--sidebar-width-collapsed);
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    color: var(--sidebar-text);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.15rem;
}

    .collapse-btn:hover {
        background: var(--sidebar-bg-hover);
    }

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
}

.brand-logo {
    height: 3rem;
    width: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    padding: 0.7rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #c3c7d1 transparent;
}

    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }

    .table-responsive::-webkit-scrollbar-track {
        background: transparent;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background-color: #c3c7d1;
        border-radius: 999px;
    }

[data-theme="dark"] .app-shell .table-responsive {
    scrollbar-color: #454b5e transparent;
}

    [data-theme="dark"] .app-shell .table-responsive::-webkit-scrollbar-thumb {
        background-color: #454b5e;
    }

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sidebar-text-muted);
    padding: 0.5rem 0.75rem 0.2rem;
    white-space: nowrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.55rem;
    color: var(--sidebar-text) !important;
    text-decoration: none !important;
    white-space: nowrap;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.92rem;
}

    .nav-link i {
        font-size: 1.15rem;
        width: 1.4rem;
        text-align: center;
        flex-shrink: 0;
    }

    .nav-link:hover {
        background: var(--sidebar-bg-hover);
        color: #fff !important;
    }

    .nav-link.active {
        background: var(--accent-soft);
        color: #fff !important;
        box-shadow: inset 3px 0 0 var(--accent);
    }

.sidebar-bottom {
    padding: 0.6rem 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: var(--sidebar-text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
}

    .user-chip i {
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    .user-chip-avatar {
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

.logout-form {
    margin: 0;
}

/* Collapsed state: hide all text labels, center icons */
.sidebar-toggle-input:checked ~ .sidebar .nav-label,
.sidebar-toggle-input:checked ~ .sidebar .nav-section-label,
.sidebar-toggle-input:checked ~ .sidebar .user-chip span {
    display: none;
}

.sidebar-toggle-input:checked ~ .sidebar .nav-link,
.sidebar-toggle-input:checked ~ .sidebar .user-chip {
    justify-content: center;
}

.sidebar-toggle-input:checked ~ .sidebar .nav-badge {
    display: none;
}

.sidebar-toggle-input:checked ~ .sidebar .brand-logo {
    height: 1.8rem;
}

.app-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.75rem 2rem;
}

/* Light polish for Bootstrap cards/tables inside the dashboard shell only */
.app-shell .card {
    border: 1px solid #e9eaf0;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.app-shell h3 {
    font-weight: 600;
    color: #1f2430;
}

.app-shell .table thead {
    background: #f8f9fc;
}

.app-shell .btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
}

    .app-shell .btn-primary:hover {
        background-color: #5457d9;
        border-color: #5457d9;
    }

/* Reusable pill tab switcher (SurveyManagement.razor, ManageDrivers.razor) */
.app-shell .dashboard-tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: #eef0f5;
    border-radius: 10px;
    padding: 0.25rem;
}

.app-shell .dashboard-tab-link {
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.92rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .app-shell .dashboard-tab-link:hover:not(.active) {
        color: #343a40;
    }

    .app-shell .dashboard-tab-link.active {
        background: #fff;
        color: var(--accent, #6366f1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    }

[data-theme="dark"] .app-shell .dashboard-tabs {
    background: #232736;
}

[data-theme="dark"] .app-shell .dashboard-tab-link {
    color: #9aa0ac;
}

    [data-theme="dark"] .app-shell .dashboard-tab-link:hover:not(.active) {
        color: #e2e4ea;
    }

    [data-theme="dark"] .app-shell .dashboard-tab-link.active {
        background: #1c1f2b;
        color: var(--accent, #8b8fef);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }

/* Responsive "stack on mobile" table — avoids horizontal scrolling on phones */
@media (max-width: 768px) {
    .app-shell .table-stack thead {
        display: none;
    }

    .app-shell .table-stack,
    .app-shell .table-stack tbody,
    .app-shell .table-stack tr,
    .app-shell .table-stack td {
        display: block;
        width: 100%;
    }

    .app-shell .table-stack tr {
        margin-bottom: 1rem;
        border: 1px solid #e9eaf0;
        border-radius: 0.5rem;
        padding: 0.5rem;
    }

    .app-shell .table-stack td {
        border: none;
        padding: 0.35rem 0.5rem;
    }

    .app-shell .table-stack td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        font-size: 0.72rem;
        color: #6c757d;
        text-transform: uppercase;
    }

    .app-shell .table-stack td.text-center {
        text-align: left !important;
    }
}

/* On mobile the sidebar is always icon-only — no room for the expanded 240px rail */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-width-collapsed);
    }

    .sidebar .nav-label,
    .sidebar .nav-section-label,
    .sidebar .user-chip span {
        display: none;
    }

    .sidebar .nav-link,
    .sidebar .user-chip {
        justify-content: center;
    }

    .sidebar .collapse-btn {
        display: none;
    }

    .brand-logo {
        height: 1.8rem;
    }

    .app-content {
        padding: 1.25rem 1rem;
    }
}


/* ====================================================================
   Dashboard widget cards (DashboardHome.razor) — the whole card is
   clickable via an invisible .stretched-link anchor, and drills into
   the page providing the full data.
   ==================================================================== */
.app-shell .card.clickable-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

    .app-shell .card.clickable-card:hover {
        box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1);
        transform: translateY(-2px);
    }

    .app-shell .card.clickable-card .stretched-link {
        cursor: pointer;
    }

    a.dashboard-widget .card {
        cursor: pointer;
    }

/* ====================================================================
   Live Driver Status widget (DashboardHome.razor) — per-driver mini
   stat tiles with a soft outlined icon circle, matching the driver
   manifest's own stat-card look.
   ==================================================================== */
.driver-status-row {
    padding: 0.85rem 0;
}

    .driver-status-row + .driver-status-row {
        border-top: 1px solid #e9eaf0;
    }

.icon-circle {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-tile .icon-circle {
    background: color-mix(in srgb, currentColor 8%, transparent);
}

/* Small "this widget refreshes live" indicator, top-right of any
   position-relative card on the dashboard. */
.live-badge {
    position: absolute;
    top: 0.7rem;
    right: 0.85rem;
    font-size: 0.75rem;
    color: #198754;
    animation: live-badge-pulse 1.8s ease-in-out infinite;
}

@keyframes live-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ====================================================================
   Deliveries page (Deliveries.razor) — brand-orange accents, status
   summary chips, and a friendlier table with per-row status color.
   ==================================================================== */
.app-shell .btn-brand {
    background-color: #f57c00;
    border-color: #f57c00;
    color: #fff;
}

    .app-shell .btn-brand:hover {
        background-color: #d96c00;
        border-color: #d96c00;
        color: #fff;
    }

.app-shell .btn-outline-brand {
    color: #f57c00;
    border-color: #f57c00;
}

    .app-shell .btn-outline-brand:hover {
        background-color: #f57c00;
        border-color: #f57c00;
        color: #fff;
    }

.text-brand {
    color: #f57c00 !important;
}

.app-shell .form-check-input:checked {
    background-color: #f57c00;
    border-color: #f57c00;
}

.app-shell .form-check-input:focus {
    border-color: #f57c00;
    box-shadow: 0 0 0 0.25rem rgba(245, 124, 0, 0.25);
}

/* ====================================================================
   New Delivery page (NewDelivery.razor) — brand gradient hero banner
   and small orange icon badges next to each section title, matching
   the logo's orange-to-red-orange gradient.
   ==================================================================== */
.new-delivery-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #f7941d, #f15a24);
    box-shadow: 0 4px 14px rgba(241, 90, 36, 0.25);
}

    .new-delivery-hero .icon-circle {
        width: 3rem;
        height: 3rem;
        font-size: 1.4rem;
    }

.section-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: color-mix(in srgb, #f57c00 15%, transparent);
    color: #f57c00;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.delivery-stat-chip {
    background: #fff;
    border: 1px solid #e9eaf0;
    border-radius: 0.6rem;
    padding: 0.6rem 0.5rem;
    text-align: center;
}

.deliveries-table tbody tr td {
    border-left: 3px solid transparent;
}

.deliveries-table .address-cell {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

@media (max-width: 768px) {
    .app-shell .deliveries-table .address-cell {
        max-width: 100%;
        white-space: normal;
    }
}

    .deliveries-table tbody tr td:first-child {
        border-left-width: 3px;
    }

.deliveries-table tbody tr.status-row-warning td:first-child { border-left-color: #f59e0b; }
.deliveries-table tbody tr.status-row-danger td:first-child { border-left-color: #dc3545; }
.deliveries-table tbody tr.status-row-success td:first-child { border-left-color: #198754; }
.deliveries-table tbody tr.status-row-neutral td:first-child { border-left-color: #d1d5db; }

/* Driver history cards (DriverHistory.razor) */
.history-card {
    border-left: 4px solid #198754;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

    .history-card:hover {
        box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1);
        transform: translateY(-2px);
    }

/* ====================================================================
   Big attention-grabbing count widget (DashboardHome.razor) — replaces
   the old "Entregas por Estado" donut chart with a bold, glowing tile
   showing today's completed-delivery count.
   ==================================================================== */
.big-count-card {
    background: #171a25;
    color: #fff;
    min-height: 340px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(23, 26, 37, 0.45);
}

.big-count-card-compact {
    min-height: 160px;
}

    .big-count-card .live-badge {
        color: rgba(255, 255, 255, 0.85);
    }

.big-count-title-standard {
    color: rgba(255, 255, 255, 0.6);
}

.big-count-number {
    font-size: 12rem !important;
    font-weight: 400;
    line-height: 1;
    margin: 0;
}

    .big-count-card .big-count-number {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    }

.big-count-number-compact {
    font-size: 4.5rem !important;
}

/* ====================================================================
   Dark theme — toggled from the dashboard page, persisted via
   localStorage and applied as [data-theme] on <html> (see
   wwwroot/js/dashboard-theme.js and the anti-flash script in App.razor).
   ==================================================================== */
[data-theme="dark"] .app-shell {
    --content-bg: #0f1117;
}

[data-theme="dark"] .app-shell .card {
    background-color: #1c1f2b;
    border-color: #2a2e3d;
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .text-muted {
    color: #9099ab !important;
}

[data-theme="dark"] .app-shell h1,
[data-theme="dark"] .app-shell h2,
[data-theme="dark"] .app-shell h3,
[data-theme="dark"] .app-shell h4,
[data-theme="dark"] .app-shell h5,
[data-theme="dark"] .app-shell h6 {
    color: #f1f2f6;
}

[data-theme="dark"] .app-shell .form-control,
[data-theme="dark"] .app-shell .form-select,
[data-theme="dark"] .app-shell textarea {
    background-color: #262a3a;
    border-color: #383e52;
    color: #e2e4ea;
}

    [data-theme="dark"] .app-shell .form-control::placeholder {
        color: #6b7280;
    }

    [data-theme="dark"] .app-shell .form-control:focus,
    [data-theme="dark"] .app-shell .form-select:focus {
        background-color: #262a3a;
        color: #e2e4ea;
    }

[data-theme="dark"] .app-shell .input-group-text {
    background-color: #262a3a;
    border-color: #383e52;
    color: #9099ab;
}

[data-theme="dark"] .app-shell .delivery-stat-chip,
[data-theme="dark"] .app-shell .driver-chip,
[data-theme="dark"] .app-shell .stat-tile {
    background-color: #262a3a;
    border-color: #383e52;
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .table {
    --bs-table-bg: #1c1f2b;
    --bs-table-color: #e2e4ea;
    --bs-table-striped-bg: #232736;
    --bs-table-striped-color: #e2e4ea;
    --bs-table-active-bg: #262a3a;
    --bs-table-active-color: #e2e4ea;
    --bs-table-hover-bg: #232736;
    --bs-table-hover-color: #e2e4ea;
    --bs-table-border-color: #383e52;
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .table thead {
    --bs-table-bg: #262a3a;
    background-color: #262a3a;
}

[data-theme="dark"] .app-shell .bg-light {
    background-color: #262a3a !important;
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .bg-white {
    background-color: #1c1f2b !important;
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .border,
[data-theme="dark"] .app-shell .border-bottom,
[data-theme="dark"] .app-shell .border-top,
[data-theme="dark"] .app-shell .border-end {
    border-color: #383e52 !important;
}

[data-theme="dark"] .app-shell .driver-status-row + .driver-status-row {
    border-top-color: #383e52;
}

[data-theme="dark"] .app-shell .deliveries-table tbody tr td {
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .list-group-item {
    background-color: transparent;
    color: #e2e4ea;
    border-color: #383e52;
}

.app-shell .customer-search-results {
    background-color: #fff !important;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

    .app-shell .customer-search-results .list-group-item {
        background-color: #fff !important;
    }

    .app-shell .customer-search-results .list-group-item:hover {
        background-color: #f1f2f6 !important;
    }

[data-theme="dark"] .app-shell .customer-search-results {
    background-color: #1c1f2b !important;
    border-color: #383e52;
}

[data-theme="dark"] .app-shell .customer-search-results .list-group-item {
    background-color: #1c1f2b !important;
}

    [data-theme="dark"] .app-shell .customer-search-results .list-group-item:hover {
        background-color: #262b3b !important;
    }

[data-theme="dark"] .app-shell .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .app-shell .modal-content {
    background-color: #1c1f2b;
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .modal-header,
[data-theme="dark"] .app-shell .modal-footer {
    border-color: #383e52;
}

[data-theme="dark"] .app-shell .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #383e52;
}

    [data-theme="dark"] .app-shell .btn-outline-secondary:hover {
        background-color: #383e52;
        color: #fff;
    }

[data-theme="dark"] .app-shell .alert-info {
    background-color: rgba(13, 202, 240, 0.12);
    border-color: rgba(13, 202, 240, 0.3);
    color: #9eeaf9;
}

[data-theme="dark"] .app-shell .alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.35);
    color: #f3a8b0;
}

[data-theme="dark"] .app-shell .alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.35);
    color: #ffdf7e;
}

[data-theme="dark"] .app-shell .alert-success {
    background-color: rgba(25, 135, 84, 0.15);
    border-color: rgba(25, 135, 84, 0.35);
    color: #8fdcae;
}

[data-theme="dark"] .app-shell .text-secondary {
    color: #9099ab !important;
}

[data-theme="dark"] .app-shell .table-stack td::before {
    color: #9099ab;
}

[data-theme="dark"] .app-shell .table-stack tr {
    border-color: #383e52;
}

.customer-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: color-mix(in srgb, #f57c00 15%, transparent);
    color: #f57c00;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.driver-avatar-img {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.driver-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: color-mix(in srgb, #f57c00 15%, transparent);
    color: #f57c00;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.driver-avatar-img-sm {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.driver-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f8f9fc;
    border: 1px solid #e9eaf0;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.82rem;
    color: #495057;
}

/* ====================================================================
   Notification Badge (NotificationBadge.razor) — simple unread count
   pill shown inline on the "Notificaciones" nav link.
   ==================================================================== */
.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    min-width: 1.2rem;
    text-align: center;
}

/* ====================================================================
   "Estatus Ordenes de Entrega" widget (DashboardHome.razor) — raised,
   3D-ish tiles so this widget pops out from the flat card style used
   elsewhere on the dashboard.
   ==================================================================== */
.status-widget-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f8fc 100%);
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.1);
}

.stat-tile-3d {
    background: #ffffff;
    border-radius: 0.85rem;
    padding: 1rem 0.5rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 10px 18px rgba(16, 24, 40, 0.08),
        0 2px 4px rgba(16, 24, 40, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

    .stat-tile-3d:hover {
        transform: translateY(-4px);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.8) inset,
            0 16px 26px rgba(16, 24, 40, 0.14),
            0 4px 8px rgba(16, 24, 40, 0.08);
    }

.icon-circle-3d {
    width: 3.25rem;
    height: 3.25rem;
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 -3px 6px rgba(0, 0, 0, 0.15) inset;
}

.icon-circle-primary { background: linear-gradient(145deg, #6ea8fe, #0d6efd) !important; border: none !important; }
.icon-circle-warning { background: linear-gradient(145deg, #ffda6a, #f59e0b) !important; border: none !important; }
.icon-circle-danger  { background: linear-gradient(145deg, #ea868f, #dc3545) !important; border: none !important; }
.icon-circle-success { background: linear-gradient(145deg, #75c791, #198754) !important; border: none !important; }
.icon-circle-brand    { background: linear-gradient(145deg, #ffb066, #f57c00) !important; border: none !important; }
.icon-circle-secondary { background: linear-gradient(145deg, #adb5bd, #6c757d) !important; border: none !important; }

[data-theme="dark"] .app-shell .status-widget-card {
    background: linear-gradient(180deg, #1c1f2b 0%, #181b26 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .app-shell .stat-tile-3d {
    background: #232736;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 10px 18px rgba(0, 0, 0, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.25);
}

.stat-tile-primary { background: linear-gradient(160deg, #eaf2ff 0%, #ffffff 65%); }
.stat-tile-warning { background: linear-gradient(160deg, #fff6e0 0%, #ffffff 65%); }
.stat-tile-danger  { background: linear-gradient(160deg, #ffe9eb 0%, #ffffff 65%); }
.stat-tile-success { background: linear-gradient(160deg, #e6f7ec 0%, #ffffff 65%); }
.stat-tile-brand    { background: linear-gradient(160deg, #fff1e0 0%, #ffffff 65%); }
.stat-tile-secondary { background: linear-gradient(160deg, #eef0f2 0%, #ffffff 65%); }

.stat-tile-primary .fs-5 { color: #0d6efd; }
.stat-tile-warning .fs-5 { color: #b45309; }
.stat-tile-danger .fs-5 { color: #dc3545; }
.stat-tile-success .fs-5 { color: #198754; }
.stat-tile-brand .fs-5 { color: #f57c00; }
.stat-tile-secondary .fs-5 { color: #495057; }

.stat-tile-primary .small { color: #5686d1; }
.stat-tile-warning .small { color: #b8860b; }
.stat-tile-danger .small { color: #c96570; }
.stat-tile-success .small { color: #4a9d6e; }
.stat-tile-brand .small { color: #c07a2e; }
.stat-tile-secondary .small { color: #7d8590; }

[data-theme="dark"] .app-shell .stat-tile-primary { background: linear-gradient(160deg, rgba(13, 110, 253, 0.18) 0%, #232736 65%); }
[data-theme="dark"] .app-shell .stat-tile-warning { background: linear-gradient(160deg, rgba(245, 158, 11, 0.18) 0%, #232736 65%); }
[data-theme="dark"] .app-shell .stat-tile-danger  { background: linear-gradient(160deg, rgba(220, 53, 69, 0.18) 0%, #232736 65%); }
[data-theme="dark"] .app-shell .stat-tile-success { background: linear-gradient(160deg, rgba(25, 135, 84, 0.18) 0%, #232736 65%); }
[data-theme="dark"] .app-shell .stat-tile-brand { background: linear-gradient(160deg, rgba(245, 124, 0, 0.18) 0%, #232736 65%); }

/* ====================================================================
   Driver manifest — quick status action panel (Próxima Parada)
   ==================================================================== */
.quick-status-panel {
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem;
    border-radius: 14px;
    background: #eef1f5;
    border: 1px solid #dde2e9;
}

.quick-status-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 0.5rem;
    border: 1px solid #dde2e9;
    border-radius: 12px;
    background: #ffffff;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.quick-status-btn:hover {
    color: #6c757d;
}

.quick-status-btn i {
    font-size: 2rem;
    line-height: 1;
}

@media (max-width: 480px) {
    .quick-status-panel {
        gap: 0.4rem;
        padding: 0.4rem;
    }

    .quick-status-btn {
        padding: 0.6rem 0.25rem;
        gap: 0.25rem;
        font-size: 0.68rem;
    }

    .quick-status-btn i {
        font-size: 1.4rem;
    }
}

.route-highlight {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: rgba(13, 110, 253, 0.08);
    color: #1c1f2b;
}

.route-highlight i {
    color: #0d6efd;
    font-size: 1.1rem;
}

[data-theme="dark"] .app-shell .route-highlight {
    background: rgba(74, 158, 255, 0.12);
    color: #e2e4ea;
}

[data-theme="dark"] .app-shell .route-highlight i {
    color: #4a9eff;
}

.quick-status-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: currentColor;
}

.quick-status-btn:active:not(:disabled) {
    transform: translateY(0);
}

.quick-status-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.quick-status-enruta i { color: #b8860b; }
.quick-status-retrasada i { color: #c96570; }
.quick-status-entregada i { color: #4a9d6e; }
.quick-status-action i { color: #0d6efd; }

[data-theme="dark"] .app-shell .quick-status-panel {
    background: #16191f;
    border-color: #2a2e3d;
}

[data-theme="dark"] .app-shell .quick-status-btn {
    background: #1c1f2b;
    border-color: #2a2e3d;
    color: #9099ab;
}

[data-theme="dark"] .app-shell .quick-status-btn:hover {
    color: #9099ab;
}

[data-theme="dark"] .app-shell .quick-status-enruta i { color: #f5a623; }
[data-theme="dark"] .app-shell .quick-status-retrasada i { color: #e5484d; }
[data-theme="dark"] .app-shell .quick-status-entregada i { color: #30a46c; }
[data-theme="dark"] .app-shell .quick-status-action i { color: #4a9eff; }
[data-theme="dark"] .app-shell .stat-tile-secondary { background: linear-gradient(160deg, rgba(173, 181, 189, 0.15) 0%, #232736 65%); }
