/* ═══════════════════════════════════════════
   FIVE STARS EXPRESS — DASHBOARD CSS
   ═══════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --navy:       #0D1B3E;
    --navy-mid:   #152850;
    --navy-light: #1E3A6E;
    --gold:       #C9A227;
    --gold-light: #E8C547;
    --white:      #FFFFFF;
    --off-white:  #F4F6FB;
    --bg:         #F0F3F9;
    --border:     #E2E8F0;
    --text:       #1E293B;
    --muted:      #64748B;
    --success:    #10B981;
    --warning:    #F59E0B;
    --danger:     #EF4444;
    --info:       #3B82F6;
    --purple:     #8B5CF6;
    --orange:     #F97316;

    --sidebar-w:  240px;
}

html, body {
    height: 100%; font-family: 'Inter', sans-serif;
    background: var(--bg); color: var(--text);
    overflow: hidden;
}

/* ══ LAYOUT ══ */
body { display: flex; }

/* ══ SIDEBAR ══ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    display: flex; flex-direction: column;
    height: 100vh; flex-shrink: 0;
    overflow-y: auto; overflow-x: hidden;
    transition: width 0.25s;
    position: relative; z-index: 100;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}
.logo-stars  { color: var(--gold); font-size: 18px; letter-spacing: 2px; }
.logo-name   { color: var(--gold); font-weight: 800; font-size: 20px; letter-spacing: 2px; margin-top: 4px; }
.logo-sub    { color: rgba(255,255,255,0.55); font-size: 9px; letter-spacing: 1.5px; margin-top: 2px; }

/* Nav items */
.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    border-radius: 0;
    text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: all 0.18s;
    margin: 1px 0;
    white-space: nowrap;
}
.nav-item i { font-size: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.nav-item.active {
    background: var(--info);
    color: var(--white);
    font-weight: 600;
    border-left: 3px solid var(--gold);
}

/* Profile */
.sidebar-profile {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
}
.sp-avatar {
    width: 36px; height: 36px;
    background: var(--navy-light); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sp-avatar i { color: white; font-size: 20px; }
.sp-name { color: white; font-weight: 600; font-size: 13px; }
.sp-role { color: rgba(255,255,255,0.5); font-size: 11px; }
.sp-caret { color: rgba(255,255,255,0.4); font-size: 18px; margin-left: auto; }

/* Logout */
.sidebar-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}
.sidebar-logout:hover { color: var(--danger); background: rgba(239,68,68,0.08); }
.sidebar-logout i { font-size: 20px; }

/* ══ MAIN WRAPPER ══ */
.main-wrapper {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; height: 100vh;
}

/* ══ TOP HEADER ══ */
.top-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}
.th-left  { display: flex; align-items: center; gap: 14px; }
.th-right { display: flex; align-items: center; gap: 20px; }

.hamburger {
    background: none; border: none; cursor: pointer; padding: 4px;
    display: flex; align-items: center;
}
.hamburger i { font-size: 24px; color: var(--muted); }

.th-title  { font-size: 16px; font-weight: 700; color: var(--text); }
.th-sub    { font-size: 12px; color: var(--muted); }

.th-datetime {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--muted);
    background: var(--off-white); border-radius: 8px;
    padding: 6px 12px;
}
.th-datetime i { font-size: 16px; }

.th-notif {
    position: relative; cursor: pointer;
}
.th-notif i { font-size: 24px; color: var(--muted); }
.notif-badge {
    position: absolute; top: -4px; right: -6px;
    background: var(--danger); color: white;
    font-size: 10px; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.th-user {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
}
.th-avatar {
    width: 34px; height: 34px;
    background: var(--navy); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.th-avatar i { color: white; font-size: 20px; }
.th-user > span { font-size: 13px; font-weight: 600; }
.th-user > i { font-size: 18px; color: var(--muted); }

/* ══ PAGE CONTENT ══ */
.page-content {
    flex: 1; overflow-y: auto;
    padding: 20px 24px 32px;
    display: flex; flex-direction: column; gap: 20px;
}

/* ══ HERO BANNER ══ */
.hero-banner {
    display: flex; gap: 0;
    border-radius: 16px; overflow: hidden;
    height: 180px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.hero-img-side {
    flex: 1; position: relative; overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background: url('/assets/img/hero_bg.jpg') center/cover;
}
.hero-logo-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(13,27,62,0.88) 30%, rgba(13,27,62,0.30));
    display: flex; flex-direction: column;
    justify-content: center; padding: 24px 32px;
}
.hlo-stars { color: var(--gold); font-size: 22px; letter-spacing: 3px; }
.hlo-name  { color: var(--gold); font-size: 30px; font-weight: 800; letter-spacing: 2px; margin-top: 2px; }
.hlo-sub   { color: white; font-size: 11px; letter-spacing: 3px; font-weight: 600; }
.hlo-tag   { color: rgba(255,255,255,0.7); font-size: 11px; letter-spacing: 2px; margin-top: 6px; }

.hero-offices {
    display: flex; gap: 0;
}
.ho-card {
    background: white;
    width: 176px; flex-shrink: 0;
    padding: 14px 16px;
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    justify-content: center; gap: 4px;
}
.ho-img { font-size: 26px; margin-bottom: 4px; }
.ho-city {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700;
    color: var(--text);
}
.ho-city i { font-size: 14px; color: var(--info); }
.ho-addr { font-size: 11px; color: var(--muted); line-height: 1.4; }
.ho-phone {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; color: var(--text);
    margin-top: 2px;
}
.ho-phone i { font-size: 12px; color: var(--muted); }

/* ══ STATS GRID ══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.stat-card {
    background: var(--white);
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex; flex-direction: column; gap: 4px;
}
.stat-card.loading { min-height: 90px; }
.sk-rect {
    height: 14px; background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    border-radius: 4px; animation: shimmer 1.4s infinite;
    background-size: 200% 100%;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.sc-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
}
.sc-icon i { font-size: 22px; color: white; }
.sc-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.sc-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.sc-sub   { font-size: 12px; color: var(--muted); }
.sc-trend { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 2px; }
.sc-trend.up   { color: var(--success); }
.sc-trend.neutral { color: var(--muted); }

/* ══ CHARTS ROW ══ */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 14px;
}
.chart-card {
    background: var(--white);
    border-radius: 14px; padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.cc-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.cc-header h3 { font-size: 15px; font-weight: 700; }
.cc-filter {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 5px 10px; font-size: 13px; outline: none;
    color: var(--text); cursor: pointer;
}
.cc-link { font-size: 13px; color: var(--info); text-decoration: none; font-weight: 600; }

/* Donut chart */
.donut-wrapper {
    position: relative; display: flex;
    justify-content: center; align-items: center;
    margin-bottom: 16px;
}
.donut-center {
    position: absolute; text-align: center;
}
.dc-total { font-size: 26px; font-weight: 800; }
.dc-label { font-size: 12px; color: var(--muted); }

.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.dl-item {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px;
}
.dl-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0; margin-right: 8px;
}
.dl-left  { display: flex; align-items: center; }
.dl-count { font-weight: 700; color: var(--text); }

/* Bar chart */
.bar-chart-wrapper {
    height: 160px;
    display: flex; align-items: flex-end; gap: 14px;
    padding: 0 8px;
}
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-fill {
    width: 100%; border-radius: 6px 6px 0 0;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 6px;
    transition: height 0.6s cubic-bezier(0.4,0,0.2,1);
}
.bar-fill span { font-size: 12px; font-weight: 700; color: white; }
.bar-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Vehicles */
.veh-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.veh-item:last-child { border-bottom: none; }
.veh-thumb {
    width: 40px; height: 32px;
    background: var(--off-white); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.veh-info { flex: 1; min-width: 0; }
.veh-name  { font-size: 13px; font-weight: 700; }
.veh-model { font-size: 11px; color: var(--muted); }
.veh-bar-wrap { width: 80px; }
.veh-bar-bg {
    height: 6px; background: var(--border); border-radius: 3px;
    overflow: hidden; margin-bottom: 3px;
}
.veh-bar-fill { height: 100%; border-radius: 3px; }
.veh-pct { font-size: 11px; font-weight: 700; text-align: right; }

/* ══ SECTION CARD / TABLE ══ */
.section-card {
    background: var(--white);
    border-radius: 14px; padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.sc-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.sc-header h3 { font-size: 15px; font-weight: 700; }
.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left; padding: 10px 14px;
    font-size: 12px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    background: var(--off-white);
}
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #F8FAFF; }

.td-vehicle-name { font-weight: 700; font-size: 13px; }
.td-vehicle-model { font-size: 11px; color: var(--muted); }

.td-driver { display: flex; align-items: center; gap: 8px; }
.td-driver-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--navy); display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.td-driver-avatar i { color: white; font-size: 16px; }
.td-driver-name  { font-size: 13px; font-weight: 600; }
.td-driver-phone { font-size: 11px; color: var(--muted); }

/* Status badges */
.badge {
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    white-space: nowrap; display: inline-block;
}
.badge-in_route   { background: #DBEAFE; color: #1D4ED8; }
.badge-assigned   { background: #EDE9FE; color: #6D28D9; }
.badge-confirmed  { background: #D1FAE5; color: #065F46; }
.badge-pending    { background: #FEF3C7; color: #92400E; }
.badge-completed  { background: #F0FDF4; color: #15803D; }
.badge-cancelled  { background: #FEE2E2; color: #991B1B; }

/* Action icons */
.actions-cell { display: flex; align-items: center; gap: 8px; }
.act-btn {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 1px solid var(--border); background: var(--off-white);
    transition: 0.15s;
}
.act-btn:hover { background: var(--navy); border-color: var(--navy); }
.act-btn:hover i { color: white; }
.act-btn i { font-size: 16px; color: var(--muted); }

.loading-row { text-align: center; padding: 32px; color: var(--muted); font-style: italic; }
