﻿/* =============================================================
   Tanker Wala UI layer
   Palette matched to landing page (blue-900 / blue-600 / cyan / green)
   Loaded after app.css — overrides shared chrome + page patterns
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Nastaliq+Urdu:wght@400;500;600;700&display=swap');

:root {
    --af-navy: #0a2a4a;
    --af-navy-2: #0b4f8a;
    --af-blue: #0d63ad;
    --af-blue-2: #0b4f8a;
    --af-blue-soft: #e3f1fd;
    --af-cyan: #22b8e6;
    --af-bg: #f2f8fe;
    --af-ink: #0f1c2b;
    --af-muted: #56677a;
    --af-line: #dde7f1;
    --af-green: #1fae5b;
    --af-orange: #22b8e6;
    --af-red: #e5484d;
    --af-purple: #3d7ab8;
    --af-radius: 14px;
    --af-shadow: 0 18px 40px -18px rgba(10, 42, 74, .28);
    --wt-brand: var(--af-blue);
    --bs-primary: #0d63ad;
    --bs-primary-rgb: 13, 99, 173;
    --bs-link-color: #0d63ad;
    --bs-link-hover-color: #0b4f8a;
}

body {
    background: var(--af-bg) !important;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    color: var(--af-ink);
}

.urdu,
.nav-ur,
.metric-urdu,
.hero-urdu,
.hero-slogan-ur,
.dispatch-sub-ur {
    display: none !important;
}

/* ---------- Sidebar (light brand field so logo reads clearly) ---------- */
.sidebar {
    width: 260px !important;
    background: #ffffff !important;
    background-image: none !important;
    border-right: 1px solid var(--af-line) !important;
}

.app-main {
    margin-left: 260px !important;
}

.sidebar-brand {
    padding: 0 !important;
    gap: 0 !important;
    border-bottom: 1px solid var(--af-line);
}

.sidebar-brand.sidebar-brand--logo {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 14px 16px 10px !important;
    background: transparent;
}

.sidebar-brand .brand-logo-square {
    width: 86%;
    max-width: 220px;
    min-height: 42px;
    height: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    object-fit: contain;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.topbar-brand-logo {
    height: 32px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

.sidebar-brand .brand-mark {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px;
    background: rgba(13, 99, 173, .12);
    color: var(--af-blue) !important;
    font-size: 20px !important;
}

.sidebar-brand .brand-name {
    font-size: 15px !important;
    font-weight: 800 !important;
    letter-spacing: .2px;
    text-transform: uppercase;
    color: var(--af-ink) !important;
}

.sidebar-brand .brand-tag {
    font-size: 10px !important;
    letter-spacing: 1.4px !important;
    color: var(--af-muted) !important;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 10px 10px 8px !important;
}

.sidebar-nav .nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    margin-bottom: 4px;
    border-radius: 10px !important;
    border-left: 0 !important;
    color: var(--af-ink) !important;
    font-size: 13.5px !important;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.sidebar-nav .nav-link i {
    font-size: 16px !important;
    width: 20px !important;
    opacity: .95;
    color: var(--af-blue);
}

.sidebar-nav .nav-link .nav-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.sidebar-nav .nav-link .nav-en {
    font-weight: 600;
    font-size: 13.5px;
}

.sidebar-nav .nav-link .nav-ur {
    font-size: 11px;
    opacity: .72;
    margin-top: 2px;
    font-weight: 400;
}

.sidebar-nav .nav-link:hover {
    background: rgba(13, 99, 173, .08) !important;
    color: var(--af-blue) !important;
}

.sidebar-nav .nav-link:hover i {
    color: var(--af-blue);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--af-blue) 0%, var(--af-blue-2) 100%) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 8px 18px rgba(13, 99, 173, .28);
}

.sidebar-nav .nav-link.active i {
    color: #fff !important;
    opacity: 1;
}

.sidebar-nav .nav-divider {
    height: 1px;
    background: var(--af-line);
    margin: 10px 8px;
}

.sidebar-user {
    padding: 12px 12px 16px;
    border-top: 1px solid var(--af-line);
    margin-top: auto;
}

.sidebar-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: var(--af-ink);
}

.sidebar-user-meta strong {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-user-meta span {
    font-size: 11px;
    color: var(--af-muted);
}

.sidebar-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--af-line);
    background: #fff;
    color: var(--af-ink);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-logout-btn small {
    opacity: .7;
    font-weight: 400;
    margin-left: 4px;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.sidebar-logout-btn:hover {
    background: var(--af-blue-soft);
    border-color: rgba(13, 99, 173, .25);
    color: var(--af-blue);
}

.sidebar-footer {
    display: none !important;
}

/* ---------- Topbar ---------- */
.topbar {
    height: 64px !important;
    padding: 0 22px !important;
    gap: 16px !important;
}

.topbar-search {
    max-width: 520px !important;
}

.topbar-search .form-control {
    height: 40px !important;
    border-radius: 10px !important;
    background: #eef3f9 !important;
    border-color: transparent !important;
    font-size: 13px !important;
    padding-left: 38px !important;
}

.topbar-datetime {
    align-items: center;
    gap: 8px;
    background: #eef5ff;
    border: 1px solid #d9e8ff;
    border-radius: 10px;
    padding: 6px 12px;
    color: var(--af-ink);
}

.topbar-datetime i {
    color: var(--af-blue);
    font-size: 16px;
}

.topbar-datetime .td-date {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
}

.topbar-datetime .td-time {
    font-size: 11px;
    color: var(--af-muted);
    line-height: 1.15;
}

.topbar-bell {
    width: 38px;
    height: 38px;
    display: grid !important;
    place-items: center;
    border-radius: 10px;
    background: #f3f6fb;
    color: var(--af-muted) !important;
}

.topbar-bell .dot {
    top: 4px !important;
    right: 4px !important;
}

.topbar .lang-switcher {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eef5ff;
    border: 1px solid #d9e8ff;
    color: var(--af-ink, #14335c);
    font-size: 12.5px;
    font-weight: 800;
}

.topbar .lang-switcher:hover {
    background: #e3efff;
    color: var(--af-ink, #14335c);
}

#languageDropdown {
    direction: ltr;
}

#languageDropdown .dropdown-menu {
    z-index: 1080;
}

/* ---------- Page hero ---------- */
.page-hero {
    position: relative;
    min-height: 118px;
    padding: 22px 26px !important;
    border-radius: 14px !important;
    border: 0 !important;
    background:
        linear-gradient(100deg, rgba(242, 248, 254, .98) 0%, rgba(227, 241, 253, .94) 40%, rgba(34, 184, 230, .22) 72%, rgba(10, 42, 74, .16) 100%),
        var(--hero-image, url('../../images/tanker-hero.png')) right center / cover no-repeat !important;
    box-shadow: var(--af-shadow);
    margin-bottom: 18px !important;
}

.page-hero::before,
.page-hero::after {
    display: none !important;
}

.page-hero h1 {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: var(--af-ink) !important;
}

.page-hero .hero-sub {
    font-size: 13.5px !important;
    color: #4f6d8c !important;
    max-width: 420px;
}

.page-hero .hero-urdu {
    margin: 4px 0 0;
    font-size: 14px;
    color: #2f5f95;
}

.page-hero .hero-slogan {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 20px rgba(21, 101, 192, .08);
}

.page-hero .hero-slogan strong {
    font-size: 14px !important;
    color: var(--af-ink) !important;
}

.page-hero .hero-brand-mark {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    max-width: 168px;
    height: 52px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    padding: 6px 10px;
    box-shadow: 0 10px 24px rgba(10, 29, 55, .18);
    z-index: 2;
}

@media (max-width: 991.98px) {
    .page-hero .hero-brand-mark {
        right: 12px;
        top: 12px;
        transform: none;
        height: 40px;
        max-width: 120px;
        padding: 4px 8px;
    }
}

body.customer-portal .page-hero .hero-brand-mark {
    display: block !important;
}

.page-hero .hero-slogan-ur {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #3b6ea5;
}

.page-hero .hero-actions {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Metric cards (colored summary strip) ---------- */
.metric-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-row.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 16px 18px;
    border-radius: 14px;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 10px 24px rgba(15, 39, 72, .12);
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -24px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .18);
    font-size: 18px;
    flex: 0 0 auto;
    z-index: 1;
}

.metric-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    z-index: 1;
}

.metric-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.5px;
}

.metric-label {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    opacity: .95;
}

.metric-urdu {
    font-size: 11px;
    opacity: .85;
    margin-top: 1px;
}

.metric-link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    opacity: .9;
    z-index: 1;
    white-space: nowrap;
}

.metric-blue {
    background: linear-gradient(135deg, var(--af-blue), var(--af-blue-2));
}

.metric-orange {
    background: linear-gradient(135deg, var(--af-cyan), #1a7fd6);
}

.metric-green {
    background: linear-gradient(135deg, #2bc46f, var(--af-green));
}

.metric-red {
    background: linear-gradient(135deg, #e5484d, #c93b40);
}

.metric-purple {
    background: linear-gradient(135deg, #3d7ab8, var(--af-blue-2));
}

.metric-teal {
    background: linear-gradient(135deg, var(--af-cyan), #1499c4);
}

.metric-cyan {
    background: linear-gradient(135deg, var(--af-cyan), var(--af-blue));
}

/* ---------- Quick action grid (dashboard) ---------- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 108px;
    border-radius: 14px;
    padding: 16px 10px;
    text-align: center;
    text-decoration: none !important;
    color: var(--af-ink) !important;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease;
}

.action-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--af-shadow);
}

.action-tile i {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
    background: rgba(255, 255, 255, .7);
}

.action-tile small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--af-muted);
    margin-top: 2px;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.action-tile.tint-blue {
    background: #e8f1ff;
    color: #1a56c4 !important;
}

.action-tile.tint-orange {
    background: #fff1e4;
    color: #c45f12 !important;
}

.action-tile.tint-green {
    background: #e8f8ef;
    color: #1b8a4a !important;
}

.action-tile.tint-purple {
    background: #f0edff;
    color: #5a4ad1 !important;
}

.action-tile.tint-teal {
    background: #e6f9fc;
    color: #0b8ea3 !important;
}

.action-tile.tint-yellow {
    background: #fff8e1;
    color: #a67c00 !important;
}

.action-tile.tint-red {
    background: #ffeaea;
    color: #c23434 !important;
}

.action-tile.tint-cyan {
    background: #e7f7fb;
    color: #0f7f9c !important;
}

.action-tile.tint-slate {
    background: #eef2f7;
    color: #44566f !important;
}

/* ---------- Delivery list rows ---------- */
.delivery-list {
    display: flex;
    flex-direction: column;
}

.delivery-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--af-line);
    text-decoration: none !important;
    color: inherit;
}

.delivery-row:last-child {
    border-bottom: 0;
}

.delivery-row:hover {
    background: #f8fbff;
}

.delivery-row .dr-id {
    font-weight: 700;
    color: var(--af-blue);
    min-width: 96px;
}

.delivery-row .dr-main {
    flex: 1 1 auto;
    min-width: 0;
}

.delivery-row .dr-name {
    font-weight: 700;
    color: var(--af-ink);
    font-size: 13.5px;
}

.delivery-row .dr-meta {
    font-size: 12px;
    color: var(--af-muted);
}

/* ---------- Map / panel helpers ---------- */
.map-shell {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #dfeaf7;
    min-height: 280px;
}

.map-shell .mapboxgl-map,
.map-shell .leaflet-container,
.map-shell #dash-map,
.map-shell #dispatch-map,
.map-shell #trip-map {
    min-height: 280px;
    height: 100%;
    width: 100%;
}

.map-chip {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 400;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--af-ink);
    box-shadow: 0 4px 14px rgba(15, 39, 72, .12);
}

.live-tankers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
}

.live-tanker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7faff;
    border: 1px solid #e8f0fa;
}

.panel .panel-head,
.panel-header {
    border-bottom: 1px solid var(--af-line);
}

.btn-primary {
    background: linear-gradient(135deg, var(--af-blue) 0%, var(--af-blue-2) 100%) !important;
    border-color: var(--af-blue-2) !important;
}

.btn-primary:hover {
    background: var(--af-blue-2) !important;
    border-color: var(--af-navy) !important;
}

/* ---------- Tables bilingual headers ---------- */
.table-af thead th {
    background: var(--af-blue-soft) !important;
    color: var(--af-ink) !important;
    font-size: 12.5px;
    font-weight: 700;
    border-bottom: 0 !important;
    white-space: nowrap;
}

.table-af thead th small {
    display: block;
    font-weight: 500;
    color: #6d84a3;
    font-size: 11px;
    margin-top: 2px;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.table-af tbody td {
    vertical-align: middle;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
}

/* ---------- Right rail widgets ---------- */
.side-rail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rail-card {
    background: #fff;
    border: 1px solid var(--af-line);
    border-radius: 14px;
    box-shadow: var(--af-shadow);
    padding: 16px;
}

.rail-card h3 {
    font-size: 14px;
    font-weight: 800;
    color: var(--af-ink);
    margin: 0 0 4px;
}

.rail-card .rail-sub {
    font-size: 12px;
    color: var(--af-muted);
    margin-bottom: 12px;
}

/* ---------- Status / filter chips ---------- */
.nav-pills-app .nav-link.active {
    background: var(--af-blue) !important;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    background: #eef3f9;
    color: #51637c;
}

.filter-tabs a.active-blue {
    background: #e8f1ff;
    color: var(--af-blue);
}

.filter-tabs a.active-orange {
    background: #fff1e4;
    color: #d97706;
}

.filter-tabs a.active-green {
    background: #e8f8ef;
    color: #159947;
}

.filter-tabs a.active-red {
    background: #ffeaea;
    color: #d64545;
}

.filter-tabs a.active-teal {
    background: #e6f9fc;
    color: #0b8ea3;
}

/* ---------- Settings cards grid ---------- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.settings-card {
    background: #fff;
    border: 1px solid var(--af-line);
    border-radius: 14px;
    box-shadow: var(--af-shadow);
    padding: 16px;
    min-height: 220px;
}

.settings-card .sc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.settings-card .sc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 16px;
}

.settings-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--af-ink);
}

.settings-card .sc-urdu {
    font-size: 11px;
    color: var(--af-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.settings-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

/* ---------- Order form (New Order mockup) ---------- */
.order-stepper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 14px;
}

.order-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef3f9;
    color: #61758f;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.order-step .n {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: #61758f;
    font-size: 11px;
}

.order-step.active {
    background: #e8f1ff;
    color: var(--af-blue);
}

.order-step.active .n {
    background: var(--af-blue);
    color: #fff;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border: 1.5px solid #dbe5f2;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-card.is-selected,
.choice-card:has(input:checked) {
    border-color: var(--af-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}

.choice-card .cc-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--af-blue);
    color: #fff;
    display: none;
    place-items: center;
    font-size: 11px;
}

.choice-card.is-selected .cc-check,
.choice-card:has(input:checked) .cc-check {
    display: grid;
}

.summary-card {
    background: #fff;
    border: 1px solid var(--af-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--af-shadow);
    position: sticky;
    top: 78px;
}

.summary-card .sum-head {
    background: #eaf3ff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.summary-card .sum-body {
    padding: 16px;
}

.summary-row {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #e6edf5;
}

.summary-row:last-child {
    border-bottom: 0;
}

.summary-row i {
    color: var(--af-blue);
    margin-top: 2px;
}

.summary-row strong {
    display: block;
    font-size: 13px;
    color: var(--af-ink);
}

.summary-row span {
    font-size: 11.5px;
    color: var(--af-muted);
}

.summary-amount {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--af-line);
}

.summary-amount .label {
    font-size: 12px;
    color: var(--af-muted);
}

.summary-amount .value {
    font-size: 24px;
    font-weight: 800;
    color: var(--af-blue);
}

/* ---------- Tracking timeline ---------- */
.progress-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.progress-timeline li {
    position: relative;
    padding: 0 0 18px 28px;
}

.progress-timeline li::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 22px;
    bottom: 0;
    width: 2px;
    background: #dbe5f2;
}

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

.progress-timeline .pt-dot {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    background: #eef3f9;
    color: #6b7c93;
}

.progress-timeline li.done .pt-dot {
    background: #e8f8ef;
    color: #28c76f;
}

.progress-timeline li.current .pt-dot {
    background: #e8f1ff;
    color: var(--af-blue);
}

.progress-timeline strong {
    display: block;
    font-size: 13px;
    color: var(--af-ink);
}

.progress-timeline span {
    font-size: 11.5px;
    color: var(--af-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .metric-row.cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .choice-grid.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .app-main {
        margin-left: 0 !important;
    }

    .metric-row,
    .metric-row.cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-hero {
        min-height: 100px;
    }
}

@media (max-width: 575.98px) {

    .metric-row,
    .metric-row.cols-5 {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr 1fr;
    }

    .choice-grid,
    .choice-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .metric-link {
        display: none;
    }
}

[dir="rtl"] .app-main {
    margin-left: 0 !important;
    margin-right: 260px !important;
}

@media (max-width: 991.98px) {
    [dir="rtl"] .app-main {
        margin-right: 0 !important;
    }
}

/* =============================================================
   Driver mobile app (mockup)
   ============================================================= */
body.driver-portal .app-content {
    background: var(--af-bg, #eef4fb);
}

.da-app {
    --da-blue: var(--af-blue);
    --da-blue-deep: #0d47a1;
    --da-green: #22c55e;
    --da-orange: #f59e0b;
    --da-ink: #0f2748;
    --da-muted: #6b7c93;
    max-width: none;
    margin: 0;
    min-height: 0;
    padding-bottom: 0;
    background: transparent;
    position: relative;
    font-family: inherit;
}

.da-app--dashboard .da-body {
    padding: 0;
}

.da-hero {
    position: relative;
    padding: 16px 16px 56px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(10, 42, 74, .94), rgba(13, 99, 173, .84)),
        url('../../images/tanker-hero.png') center / cover no-repeat;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    overflow: visible;
}

.da-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.da-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.da-brand-mark {
    width: auto;
    max-width: 140px;
    height: 36px;
    border-radius: 10px;
    background: #fff;
    display: block;
    color: #8fd3ff;
    font-size: 18px;
    object-fit: contain;
    padding: 4px 8px;
}

.da-brand strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .3px;
    line-height: 1.1;
}

.da-brand small {
    display: block;
    font-size: 10px;
    opacity: .8;
    letter-spacing: 1px;
}

.da-icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none !important;
}

.da-bell-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
    padding: 0 3px;
}

.da-profile-card {
    margin: -40px 14px 0;
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 39, 72, .1);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.da-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #e8f1ff;
    color: var(--da-blue);
    display: grid;
    place-items: center;
    font-size: 24px;
    flex: none;
}

.da-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.da-profile-text {
    flex: 1;
    min-width: 0;
}

.da-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--da-ink);
    line-height: 1.2;
}

.da-code {
    font-size: 12.5px;
    color: var(--da-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.da-code i {
    color: var(--da-blue);
}

.da-online-form {
    margin: 0;
}

.da-online {
    border: 0;
    border-radius: 12px;
    padding: 8px 10px;
    background: #e8f8ef;
    color: #15803d;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 72px;
}

.da-online .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    margin-right: 4px;
}

.da-online.is-off {
    background: #fee2e2;
    color: #b91c1c;
}

.da-online small {
    font-family: "Noto Nastaliq Urdu", sans-serif;
    font-weight: 500;
    opacity: .85;
}

.da-body {
    padding: 14px 14px 24px;
}

.da-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.da-stat {
    background: #fff;
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(15, 39, 72, .05);
}

.da-stat i {
    font-size: 18px;
    display: block;
    margin-bottom: 4px;
}

.da-stat strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.da-stat span {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 4px;
    color: var(--da-ink);
}

.da-stat small {
    display: block;
    font-size: 10px;
    color: var(--da-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.da-stat.is-blue {
    background: #eaf2ff;
    color: var(--af-blue);
}

.da-stat.is-green {
    background: #e8f8ef;
    color: #16a34a;
}

.da-stat.is-orange {
    background: #fff4e5;
    color: #d97706;
}

.da-next {
    margin-bottom: 16px;
}

.da-next-head,
.da-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.da-next-head h2,
.da-list-head h2,
.da-earnings-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--da-ink);
}

.da-next-head small,
.da-list-head small,
.da-earnings-head small {
    display: block;
    font-size: 11px;
    color: var(--da-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.da-pager {
    background: #e8f1ff;
    color: var(--da-blue);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}

.da-list-head a {
    font-size: 13px;
    font-weight: 700;
    color: var(--da-blue);
    text-decoration: none !important;
}

.da-next-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(15, 39, 72, .07);
}

.da-next-name {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.da-next-name>i {
    color: var(--da-blue);
    font-size: 18px;
    margin-top: 2px;
}

.da-next-name strong {
    display: block;
    font-size: 16px;
    color: var(--da-ink);
}

.da-next-name span {
    display: block;
    font-size: 12.5px;
    color: var(--da-muted);
    margin-top: 2px;
    line-height: 1.35;
}

.da-next-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--da-ink);
}

.da-next-meta i {
    color: var(--da-blue);
    margin-right: 4px;
}

.da-next-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.da-act-form {
    margin: 0;
}

.da-act {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 78px;
    border: 0;
    border-radius: 14px;
    padding: 10px 6px;
    text-align: center;
    text-decoration: none !important;
    color: #fff !important;
    font-weight: 800;
    font-size: 12px;
    line-height: 1.15;
}

.da-act i {
    font-size: 18px;
}

.da-act small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: .9;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.da-act.is-start {
    background: #22c55e;
}

.da-act.is-call {
    background: var(--af-blue);
}

.da-act.is-route {
    background: #fff;
    color: var(--af-blue) !important;
    border: 1.5px solid #cfe0ff;
}

.da-act:disabled {
    opacity: .5;
}

.da-delivery-list {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 39, 72, .05);
}

.da-delivery-row {
    display: grid;
    grid-template-columns: 34px 1fr auto auto 16px;
    gap: 8px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eef2f7;
    text-decoration: none !important;
    color: inherit;
}

.da-delivery-row:last-child {
    border-bottom: 0;
}

.da-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: #94a3b8;
}

.da-num.is-next {
    background: var(--af-blue);
}

.da-num.is-done {
    background: #22c55e;
}

.da-num.is-wait {
    background: #93c5fd;
    color: #0d47a1;
}

.da-delivery-main strong {
    display: block;
    font-size: 13.5px;
    color: var(--da-ink);
}

.da-delivery-main span {
    display: block;
    font-size: 11.5px;
    color: var(--da-muted);
    margin-top: 2px;
}

.da-delivery-qty {
    font-size: 12px;
    font-weight: 700;
    color: var(--da-blue);
    white-space: nowrap;
}

.da-badge {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.da-badge.is-next {
    background: #e8f1ff;
    color: var(--af-blue);
}

.da-badge.is-done {
    background: #e8f8ef;
    color: #15803d;
}

.da-badge.is-pending {
    background: #fff4e5;
    color: #c2410c;
}

.da-badge.is-bad {
    background: #fee2e2;
    color: #b91c1c;
}

.da-chevron {
    color: #94a3b8;
    font-size: 14px;
}

.da-earnings {
    margin-top: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(15, 39, 72, .05);
}

.da-earnings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.da-earnings-grid div {
    background: #f7faff;
    border-radius: 12px;
    padding: 12px;
}

.da-earnings-grid span {
    display: block;
    font-size: 11.5px;
    color: var(--da-muted);
}

.da-earnings-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    color: var(--da-ink);
}

.da-tabbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: min(430px, 100%);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fff;
    border-top: 1px solid #e5ebf3;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 40;
}

.da-tabbar a,
.da-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 700;
    min-height: 52px;
    padding: 4px;
}

.da-tabbar a i,
.da-tab-btn i {
    font-size: 18px;
}

.da-tabbar a small,
.da-tab-btn small {
    display: block;
    font-size: 9px;
    font-weight: 500;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.da-tabbar a.active,
.da-tab-btn.active {
    color: var(--af-blue);
}

@media (max-width: 380px) {
    .da-delivery-row {
        grid-template-columns: 28px 1fr auto;
        grid-template-rows: auto auto;
    }

    .da-delivery-qty {
        grid-column: 2;
    }

    .da-badge {
        justify-self: end;
    }

    .da-chevron {
        display: none;
    }

    .da-next-actions {
        grid-template-columns: 1fr;
    }
}

/* =============================================================
   Customer portal (mockup)
   ============================================================= */
/* Customer portal shares the dashboard app shell; keep content cards. */
body.customer-portal .cp-tabbar,
body.customer-portal .cp-top {
    display: none !important;
}

body.customer-portal.customer-portal--guest .app-main {
    margin-left: 0;
}

body.customer-portal .cp-body {
    padding: 0;
    max-width: none;
}

body.customer-portal .cp-app {
    max-width: none;
    margin: 0;
    padding-bottom: 0;
    min-height: 0;
    background: transparent;
}

body.customer-portal .cp-card,
body.customer-portal .cp-current-card,
body.customer-portal .cp-order-card,
body.customer-portal .cp-recent-card {
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 39, 72, .06));
}

body.customer-portal {
    background: #f2f8fe;
}

.cp-app {
    --cp-blue: #0d63ad;
    --cp-ink: #0f1c2b;
    --cp-muted: #56677a;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 86px;
    background: #f4f7fb;
    position: relative;
}

.cp-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid #e8eef6;
}

.cp-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cp-brand img,
.cp-mark {
    width: auto;
    max-width: 132px;
    height: 34px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    color: var(--cp-blue);
    display: block;
    padding: 4px 8px;
}

.cp-brand strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--cp-blue);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .2px;
}

.cp-brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--cp-muted);
}

.cp-icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: #f3f6fb;
    color: var(--cp-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none !important;
}

.cp-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.cp-body {
    padding: 14px;
}

.cp-page-title h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--cp-ink);
}

.cp-page-title small {
    display: block;
    margin-top: 2px;
    color: var(--cp-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-hero {
    border-radius: 18px;
    overflow: hidden;
    min-height: 148px;
    margin-bottom: 14px;
    padding: 20px 16px;
    color: #0d47a1;
    position: relative;
    background:
        linear-gradient(105deg, rgba(242, 248, 254, .97) 0%, rgba(227, 241, 253, .9) 42%, rgba(34, 184, 230, .18) 72%, rgba(227, 241, 253, .05) 100%),
        url("../../images/tanker-hero.png") right -12px center / auto 118% no-repeat,
        linear-gradient(135deg, #e3f1fd, #c5e2f8);
}

.cp-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 62%;
}

.cp-hero h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #0b3d91;
}

.cp-hero p {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e4f96;
    line-height: 1.35;
}

.cp-hero small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #1a56a8;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-card,
.cp-current-card,
.cp-order-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(15, 39, 72, .06);
    margin-bottom: 14px;
}

.cp-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cp-step-n {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cp-blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    flex: none;
}

.cp-step-title strong {
    display: block;
    font-size: 14px;
    color: var(--cp-ink);
}

.cp-step-title small {
    display: block;
    font-size: 11px;
    color: var(--cp-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-choice-grid {
    display: grid;
    gap: 8px;
}

.cp-choice-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.cp-choice-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cp-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 12px;
    border: 1.5px solid #dbe5f2;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    cursor: pointer;
}

.cp-choice.is-selected {
    border-color: var(--cp-blue);
    background: #f5f9ff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}

.cp-choice-ico {
    color: var(--cp-blue);
    font-size: 20px;
}

.cp-choice strong {
    font-size: 12.5px;
    color: var(--cp-ink);
    line-height: 1.2;
}

.cp-choice small {
    font-size: 10px;
    color: var(--cp-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
    line-height: 1.4;
}

.cp-radio {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #c5d3e6;
    background: #fff;
}

.cp-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cp-blue);
    color: #fff;
    display: none;
    place-items: center;
    font-size: 10px;
    z-index: 1;
}

.cp-choice.is-selected .cp-check {
    display: grid;
}

.cp-choice.is-selected .cp-radio {
    display: none;
}

.cp-primary-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    padding: 14px 16px;
    background: var(--cp-blue);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 800;
}

.cp-primary-btn small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: .9;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-primary-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    color: var(--cp-blue);
    display: grid;
    place-items: center;
}

.cp-outline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    border: 1.5px solid #cfe0ff;
    border-radius: 12px;
    padding: 10px;
    color: var(--cp-blue) !important;
    text-decoration: none !important;
    font-weight: 700;
    background: #fff;
}

.cp-outline-btn small {
    font-family: "Noto Nastaliq Urdu", sans-serif;
    font-weight: 500;
}

.cp-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}

.cp-quick {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border-radius: 14px;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 13px;
    color: inherit !important;
}

.cp-quick i:first-child {
    font-size: 18px;
}

.cp-quick span {
    flex: 1;
    min-width: 0;
}

.cp-quick small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: .8;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-quick.tint-blue {
    background: #e8f1ff;
    color: var(--af-blue) !important;
}

.cp-quick.tint-green {
    background: #e8f8ef;
    color: #15803d !important;
}

.cp-quick.tint-orange {
    background: #fff4e5;
    color: #c2410c !important;
}

.cp-quick.tint-purple {
    background: #f3e8ff;
    color: #7e22ce !important;
}

.cp-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0 10px;
}

.cp-section-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--cp-ink);
}

.cp-section-head small {
    display: block;
    font-size: 11px;
    color: var(--cp-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-section-head a {
    font-size: 13px;
    font-weight: 700;
    color: var(--cp-blue);
    text-decoration: none !important;
}

.cp-recent-card,
.cp-order-top,
.cp-current-main {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: inherit;
}

.cp-recent-card {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 4px 14px rgba(15, 39, 72, .05);
}

.cp-recent-ico {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8f1ff;
    color: var(--cp-blue);
    display: grid;
    place-items: center;
    flex: none;
}

.cp-recent-main {
    flex: 1;
    min-width: 0;
}

.cp-recent-main strong,
.cp-current-main strong,
.cp-order-top strong {
    display: block;
    font-size: 14px;
    color: var(--cp-blue);
}

.cp-recent-main>span,
.cp-current-main span {
    display: block;
    font-size: 12px;
    color: var(--cp-muted);
}

.cp-recent-meta {
    margin-top: 4px !important;
    font-size: 11.5px !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cp-recent-qty {
    margin-inline-start: auto;
    font-weight: 700;
    color: var(--cp-ink);
}

.cp-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 12px 0 14px;
    padding-bottom: 2px;
}

.cp-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 9px 12px;
    border-radius: 999px;
    background: #eef3f9;
    color: #51637c;
    text-decoration: none !important;
    font-size: 12.5px;
    font-weight: 700;
    position: relative;
}

.cp-tabs a.active {
    background: var(--cp-blue);
    color: #fff;
}

.cp-tabs a.active .text-success {
    color: #fff !important;
}

.cp-tab-count {
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    display: grid;
    place-items: center;
    padding: 0 4px;
}

.cp-tabs a.active .cp-tab-count {
    background: #fff;
    color: var(--cp-blue);
}

.cp-current-card {
    background: #eaf3ff;
    border: 1px solid #d4e6ff;
}

.cp-order-card {
    border: 1px solid #e8eef6;
    box-shadow: none;
}

.cp-order-flow .panel,
.cp-order-flow .choice-card {
    border-radius: 14px;
}

.cp-current-tags {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.cp-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
}

.cp-tag.is-blue {
    background: #dbeafe;
    color: var(--af-blue);
}

.cp-current-main {
    margin-bottom: 12px;
}

.cp-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.cp-detail-grid div {
    background: rgba(255, 255, 255, .7);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
}

.cp-detail-grid.compact div {
    background: #f7faff;
}

.cp-detail-grid i {
    color: var(--cp-blue);
    display: block;
    margin-bottom: 2px;
}

.cp-detail-grid strong {
    display: block;
    font-size: 12.5px;
    color: var(--cp-ink);
}

.cp-detail-grid small {
    display: block;
    font-size: 10px;
    color: var(--cp-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-order-card .cp-order-top {
    margin-bottom: 10px;
}

.cp-stat-strip {
    background: linear-gradient(135deg, var(--af-blue), #0d47a1);
    color: #fff;
    border-radius: 16px;
    padding: 16px;
}

.cp-stat-strip span {
    display: block;
    font-size: 12px;
    opacity: .85;
}

.cp-stat-strip strong {
    display: block;
    font-size: 24px;
    font-weight: 800;
    margin-top: 4px;
}

.cp-stat-strip small {
    display: block;
    font-size: 11px;
    opacity: .85;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-empty {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: var(--cp-muted);
    font-weight: 600;
}

.cp-tabbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: min(480px, 100%);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;
    border-top: 1px solid #e8eef6;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 30;
}

.cp-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    margin: 0 2px;
}

.cp-tabbar a i {
    font-size: 18px;
}

.cp-tabbar a small {
    display: block;
    font-size: 9px;
    font-weight: 500;
    font-family: "Noto Nastaliq Urdu", sans-serif;
}

.cp-tabbar a.active {
    color: var(--cp-blue);
    background: #e8f1ff;
}

@media (max-width: 400px) {
    .cp-choice-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================
   Live Dispatch board (mockup)
   ============================================================= */
.dispatch-page .panel-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--af-ink);
}

.dispatch-sub-ur {
    display: block;
    font-size: 12px;
    color: var(--af-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
    margin-top: 2px;
}

.dispatch-panel-head {
    padding: 16px 18px 0;
}

.dispatch-map-panel,
.dispatch-merge-panel,
.dispatch-waiting-panel {
    border-radius: 14px !important;
    overflow: hidden;
}

.dispatch-map-shell {
    margin: 12px 14px 14px;
    min-height: 460px;
    border: 1px solid #dbe7f5;
}

.dispatch-trip-map .trip-map-toolbar {
    display: none !important;
}

.dispatch-trip-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.dispatch-trip-map .trip-map-canvas,
.dispatch-trip-map .mapboxgl-map,
.dispatch-trip-map .leaflet-container {
    min-height: 440px !important;
    height: 100% !important;
    border-radius: 0;
}

.dispatch-trip-map .trip-map-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(255, 255, 255, .92);
    z-index: 2;
    text-align: center;
    font-weight: 600;
    color: var(--af-muted);
}

.dispatch-map-legend {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 500;
    background: rgba(255, 255, 255, .95);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 6px 18px rgba(15, 39, 72, .1);
    font-size: 11px;
    min-width: 148px;
}

.dispatch-map-legend .legend-title {
    font-weight: 800;
    color: var(--af-ink);
    margin-bottom: 6px;
    font-size: 11px;
}

.dispatch-map-legend .legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    color: #51637c;
    font-weight: 600;
}

.dispatch-map-legend .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 8px;
}

.dispatch-map-legend .dot-wait {
    background: #22c55e;
}

.dispatch-map-legend .dot-truck {
    background: #e8f1ff;
    color: var(--af-blue);
    border-radius: 4px;
    width: 18px;
    height: 14px;
}

.dispatch-map-legend .dot-route {
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #22c55e, #2563eb, #f59e0b);
}

.dispatch-map-legend .dot-live {
    background: var(--af-blue);
    color: #fff;
    font-weight: 800;
    font-size: 9px;
}

.dispatch-map-footer {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 500;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.dispatch-map-footer .btn {
    box-shadow: 0 4px 14px rgba(15, 39, 72, .12);
}

.dispatch-merge-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px 0;
}

.dispatch-merge-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff8e1;
    color: #f59e0b;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex: none;
}

.dispatch-ai-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.dispatch-merge-panel {
    padding-bottom: 16px;
}

.dispatch-merge-panel>p,
.dispatch-merge-panel>.dispatch-merge-card,
.dispatch-merge-panel>.dispatch-banner {
    margin-left: 18px;
    margin-right: 18px;
}

.dispatch-merge-featured {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 14px;
}

.dispatch-merge-stack {
    position: relative;
    padding-left: 8px;
}

.dispatch-merge-stop {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
    padding-bottom: 12px;
}

.dispatch-merge-pin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #bbf7d0;
    margin-top: 4px;
    flex: none;
    z-index: 1;
}

.dispatch-merge-line {
    position: absolute;
    left: 13px;
    top: -10px;
    width: 2px;
    height: 14px;
    background: #cbd5e1;
}

.dispatch-merge-total {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    color: #15803d;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
}

.dispatch-accept-merge {
    font-weight: 800 !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
}

.dispatch-waiting-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--af-line);
}

.dispatch-waiting-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dispatch-mock-table thead th {
    font-size: 12px;
    font-weight: 800;
    color: var(--af-ink);
    vertical-align: bottom;
}

.dispatch-mock-table thead th small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--af-muted);
    font-family: "Noto Nastaliq Urdu", sans-serif;
    margin-top: 2px;
}

.dispatch-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dispatch-send-chip {
    font-weight: 700;
    white-space: nowrap;
}

.dispatch-merge-card.is-active {
    border-color: var(--af-blue) !important;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .15);
}

@media (max-width: 1199px) {
    .dispatch-map-shell {
        min-height: 380px;
    }

    .dispatch-map-legend {
        max-width: 140px;
    }
}

@media (max-width: 991px) {
    .metric-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}