/* ── Fleet Hub — Custom styles on top of Bootstrap 5 ────────────── */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #3b82f6;
    --sidebar-hover-bg: #334155;
}

/* ── Layout ─────────────────────────────────────────────────────── */

body {
    height: 100vh;
    overflow-y: auto;
    background: #f1f5f9;
}

.sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #334155;
}

.sidebar-brand h4 {
    color: #fff;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-brand small {
    color: #64748b;
    font-size: 0.75rem;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

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

.sidebar-nav .nav-link.active {
    background: var(--sidebar-hover-bg);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #334155;
}

.main-content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
}

/* ── Top bar ────────────────────────────────────────────────────── */

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

/* ── Cards ──────────────────────────────────────────────────────── */

.card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

/* ── Summary cards ──────────────────────────────────────────────── */

.summary-card {
    text-align: center;
    padding: 24px;
}

.summary-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
}

.summary-card .label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Status badges ──────────────────────────────────────────────── */

.badge-status-received {
    background: #fef3c7;
    color: #92400e;
}

.badge-status-dispatched,
.badge-status-assigned,
.badge-status-driver_assigned {
    background: #dbeafe;
    color: #1e40af;
}

.badge-status-delivered {
    background: #dcfce7;
    color: #166534;
}

.badge-status-failed,
.badge-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-active {
    background: #dcfce7;
    color: #166534;
}

.badge-status-disabled {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Platform badges ────────────────────────────────────────────── */

.badge-platform-justeat {
    background: #fff7ed;
    color: #c2410c;
}

.badge-platform-eatch {
    background: #fef3c7;
    color: #92400e;
}

.badge-platform-ubereats {
    background: #dcfce7;
    color: #166534;
}

.badge-fleet {
    background: #eef2ff;
    color: #3730a3;
}

/* ── Tables ─────────────────────────────────────────────────────── */

.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* ── Forms ──────────────────────────────────────────────────────── */

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Alerts ─────────────────────────────────────────────────────── */

.alert {
    font-size: 0.875rem;
    border-radius: 8px;
}

/* ── Language switcher ──────────────────────────────────────────── */

.lang-switcher .dropdown-toggle {
    color: var(--sidebar-text);
    font-size: 0.8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-switcher .dropdown-toggle:hover {
    color: #f1f5f9;
}

.lang-switcher .dropdown-menu {
    min-width: 140px;
    font-size: 0.85rem;
}

/* ── Sidebar toggle (mobile) ────────────────────────────────────── */

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
    display: flex;
    flex-direction: column;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ── Timeline (order detail) ────────────────────────────────────── */

.timeline-item {
    position: relative;
    padding-left: 28px;
    margin-bottom: 22px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
}

.timeline-item::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 18px;
    width: 2px;
    height: calc(100% + 8px);
    background: #d9dee7;
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-event {
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-ts {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.timeline-payload {
    background: #f3f4f6;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
}
