/* Operations dashboard (home, trips, bookings, reports). Builds on theme.css (Dash UI / Bootstrap 5). */

.dash-page {
    padding: 1.5rem;
}

.dash-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.dash-page-header h1 {
    font-size: 1.375rem;
    margin: 0;
}

.dash-page-header .dash-subtitle {
    color: var(--bs-secondary-color, #64748b);
    font-size: .875rem;
    margin: .125rem 0 0;
}

/* KPI tiles */
.kpi-card {
    height: 100%;
    border: 0;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

.kpi-card .card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.kpi-label {
    color: #64748b;
    font-size: .8125rem;
    font-weight: 500;
    margin-bottom: .375rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.kpi-meta {
    font-size: .75rem;
    color: #64748b;
    margin-top: .25rem;
}

.kpi-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .625rem;
    font-size: 1.125rem;
}

.dash-card {
    border: 0;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    height: 100%;
}

.dash-card > .card-header {
    background: transparent;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .875rem 1.25rem;
}

.dash-card > .card-header h2,
.dash-card > .card-header h3 {
    font-size: 1rem;
    margin: 0;
}

.dash-empty {
    color: #94a3b8;
    text-align: center;
    padding: 2rem 1rem;
    font-size: .875rem;
}

.dash-empty i {
    display: block;
    font-size: 1.75rem;
    margin-bottom: .5rem;
}

/* Filter bar */
.dash-filters .form-label {
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: .25rem;
}

/* Status tabs with counters */
.status-tabs {
    display: flex;
    gap: .25rem;
    overflow-x: auto;
    padding: .5rem .75rem 0;
    border-bottom: 1px solid #eef2f7;
    scrollbar-width: thin;
}

.status-tabs .nav-link {
    white-space: nowrap;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #64748b;
    padding: .625rem .75rem;
    font-size: .875rem;
}

.status-tabs .nav-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
    font-weight: 600;
}

.status-tabs .count {
    display: inline-block;
    min-width: 1.5rem;
    margin-inline-start: .25rem;
    padding: 0 .375rem;
    border-radius: 1rem;
    background: #f1f5f9;
    font-size: .75rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.status-tabs .nav-link.active .count {
    background: rgba(98, 75, 255, .12);
}

/* Tables */
.dash-table td,
.dash-table th,
#trips-table td,
#trips-table th {
    vertical-align: middle;
    font-size: .875rem;
}

#trips-table thead th {
    color: #64748b;
    font-weight: 600;
    background: #f8fafc;
    white-space: nowrap;
}

.trip-route {
    max-width: 260px;
}

.num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Trip timeline */
.trip-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.trip-timeline li {
    position: relative;
    padding-inline-start: 1.75rem;
    padding-bottom: 1.125rem;
}

.trip-timeline li::before {
    content: "";
    position: absolute;
    inset-inline-start: .4375rem;
    top: 1.125rem;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.trip-timeline li:last-child {
    padding-bottom: 0;
}

.trip-timeline li:last-child::before {
    display: none;
}

.trip-timeline .dot {
    position: absolute;
    inset-inline-start: 0;
    top: .25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    background: #cbd5e1;
}

.trip-timeline li.pending-step {
    color: #94a3b8;
}

.trip-map {
    height: 320px;
    border-radius: .5rem;
    z-index: 0;
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .5rem 1rem;
    margin: 0;
    font-size: .875rem;
}

.detail-list dt {
    color: #64748b;
    font-weight: 500;
}

.detail-list dd {
    margin: 0;
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.detail-list .total {
    border-top: 1px solid #eef2f7;
    padding-top: .5rem;
    font-weight: 700;
    color: #1e293b;
}

/* Peak hours heatmap */
.heatmap {
    overflow-x: auto;
}

.heatmap table {
    border-collapse: separate;
    border-spacing: 3px;
    width: 100%;
    min-width: 760px;
}

.heatmap th {
    font-size: .6875rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
}

.heatmap td {
    height: 2rem;
    border-radius: 4px;
    text-align: center;
    font-size: .6875rem;
    font-variant-numeric: tabular-nums;
    color: #1e293b;
}

.heatmap td.hot {
    color: #fff;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    color: #64748b;
}

.heatmap-legend .scale {
    width: 160px;
    height: .5rem;
    border-radius: 1rem;
    background: linear-gradient(90deg, rgba(98, 75, 255, .06), rgba(98, 75, 255, 1));
}

[dir="rtl"] .heatmap-legend .scale {
    background: linear-gradient(270deg, rgba(98, 75, 255, .06), rgba(98, 75, 255, 1));
}

/* Booking countdown */
.pickup-soon {
    color: #b45309;
    font-weight: 600;
}

.pickup-late {
    color: #dc2626;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .dash-page {
        padding: 1rem;
    }

    .kpi-value {
        font-size: 1.25rem;
    }
}
