/* Fleet Central - based on the Coup Admin prototype */
body { background: #f4f5f8; font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; overflow-x: hidden; }
.wrapper { display: flex; min-height: 100vh; flex-direction: column; }

.main-header { position: fixed; top: 0; left: 0; right: 0; height: 60px; background: #fff; z-index: 1030; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid #e5eaef; }
.logo-box { font-size: 19px; font-weight: 700; color: #1e1e2d; display: flex; align-items: center; }
.logo-dot { color: #6c5ce7; margin-right: 8px; font-size: 22px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #eff2f7; color: #0052cc; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.main-sidebar { position: fixed; top: 60px; left: 0; bottom: 0; width: 250px; background: #fff; border-right: 1px solid #e5eaef; z-index: 1020; overflow-y: auto; transition: transform .2s, width .2s; }
.sidebar-menu { list-style: none; padding: 8px 8px 16px; margin: 0; }
.sidebar-menu .header { font-size: 10.5px; color: #6c757d; font-weight: 800; padding: 10px 12px 3px; letter-spacing: .5px; text-transform: uppercase; line-height: 1.2; }
.sidebar-menu li a { display: flex; align-items: center; padding: 6px 12px; color: #464855; text-decoration: none; border-radius: 6px; font-size: 13.5px; line-height: 1.35; margin-bottom: 1px; }
.sidebar-menu li a i { font-size: 18px; line-height: 1; width: 20px; text-align: center; flex: none; margin-right: 10px; color: #74788d; } /* line-height 1: the icon font must not stretch the row */
.sidebar-menu li.active > a, .sidebar-menu li a:hover { background: #eff2f7; color: #0052cc; }
.sidebar-menu li.active > a { font-weight: 600; }
.sidebar-menu li.active > a i { color: #0052cc; }

.content-wrapper { margin-left: 250px; margin-top: 60px; padding: 28px; flex: 1; }
@media (max-width: 991.98px) {
  .main-sidebar { transform: translateX(-100%); }
  .main-sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .content-wrapper { margin-left: 0; padding: 18px; }
}

.box { background: #fff; border-radius: 8px; box-shadow: 0 .75rem 1.5rem rgba(18,38,63,.03); margin-bottom: 24px; }
.box-header { padding: 16px 20px; border-bottom: 1px solid #eff2f7; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.box-title { font-size: 16px; font-weight: 600; margin: 0; color: #343a40; }
.box-body { padding: 20px; }
.page-title { font-weight: 700; margin: 0; font-size: 22px; }
.stat-label { color: #74788d; font-size: 12px; }
.stat-value { font-size: 24px; font-weight: 700; margin: 4px 0 0; }

.table { margin-bottom: 0; vertical-align: middle; font-size: 13px; }
.table th { font-weight: 600; color: #495057; background: #fafbfe; white-space: nowrap; }
.table td .sub { color: #8a929a; font-size: 12px; }
.btn-icon { padding: 2px 7px; }

.badge-sync { font-weight: 500; font-size: 11px; margin: 1px 2px 1px 0; }
.badge-sync.synced { background: #e2f6f0; color: #0f7b55; }
.badge-sync.pending { background: #fff4d6; color: #9a6b00; }
.badge-sync.failed { background: #fde8ed; color: #b3163a; }
.badge-sync.none { background: #eef0f3; color: #6c757d; }
.health-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.health-dot.up { background: #20c997; } .health-dot.down { background: #e5484d; } .health-dot.unknown { background: #adb5bd; }

.ta-wrap { position: relative; }
.ta-box { position: absolute; left: 0; right: 0; top: 100%; z-index: 1060; max-height: 240px; overflow-y: auto; }
.chips .chip { display: inline-flex; align-items: center; background: #eff2f7; border-radius: 14px; padding: 2px 4px 2px 10px; margin: 0 4px 4px 0; font-size: 12px; }
.chips .chip button { border: 0; background: transparent; color: #6c757d; padding: 0 4px; }
.empty-state { text-align: center; color: #8a929a; padding: 40px 10px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }
:focus-visible { outline: 2px solid #0052cc; outline-offset: 2px; }

/* ---- Phase 3: map pages ---- */
.content-wrapper.full { padding: 0; height: calc(100vh - 60px); display: flex; overflow: hidden; flex: none; min-height: 0; } /* fixed to the screen: long side lists scroll inside, never stretch the map */
.map-side, .map-main { min-height: 0; }
.map-side { width: 330px; flex: none; background: #fff; border-right: 1px solid #e5eaef; display: flex; flex-direction: column; min-height: 0; }
.map-side .side-head { padding: 12px; border-bottom: 1px solid #eff2f7; }
.map-side .side-list { flex: 1; overflow-y: auto; min-height: 0; }
.map-main { flex: 1; position: relative; min-width: 0; }
.map-main #map { position: absolute; inset: 0; }
.chip-f { border: 1px solid #e5eaef; background: #fff; border-radius: 14px; padding: 2px 9px; font-size: 12px; margin: 0 4px 4px 0; cursor: pointer; }
.chip-f.active { background: #0052cc; border-color: #0052cc; color: #fff; }
.chip-f .dot { width: 8px; height: 8px; margin-right: 4px; }
.veh-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f3f5f8; cursor: pointer; font-size: 13px; }
.veh-row:hover, .veh-row.sel { background: #f4f7fc; }
.veh-row .vr-main { flex: 1; min-width: 0; }
.veh-row .vr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh-row .vr-sub { color: #8a929a; font-size: 12px; }
.veh-row .vr-spd { font-weight: 600; font-size: 12px; white-space: nowrap; }
.st-moving { background: #20c997; } .st-idle { background: #f1b44c; } .st-stopped { background: #4c8bf5; } .st-offline { background: #adb5bd; } .st-nodata { background: #dee2e6; }
.map-card { position: absolute; left: 12px; bottom: 12px; z-index: 1000; background: #fff; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.15); width: 320px; max-width: calc(100% - 24px); }
.map-card .mc-head { padding: 12px 14px; border-bottom: 1px solid #eff2f7; display: flex; justify-content: space-between; align-items: flex-start; }
.map-card .mc-body { padding: 10px 14px; font-size: 13px; }
.map-card .mc-body .row > div { margin-bottom: 6px; }
.map-card .lbl { color: #8a929a; font-size: 11px; display: block; }
.veh-icon { background: transparent; border: 0; }
.veh-icon .pin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.veh-icon .pin svg { width: 14px; height: 14px; fill: #fff; }
.veh-icon .lbl { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); background: rgba(30,30,45,.85); color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.play-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1000; background: #fff; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 10px 14px; }
.play-bar input[type=range] { width: 100%; }
@media (max-width: 991.98px) {
  .content-wrapper.full { flex-direction: column; height: auto; min-height: calc(100vh - 60px); }
  .map-side { width: 100%; max-height: 40vh; }
  .map-main { height: 60vh; }
}
/* shared KPI / stat styles */
.kpi { background:#fff; border-radius:8px; padding:14px 16px; height:100%; border-left:4px solid #adb5bd; box-shadow:0 .75rem 1.5rem rgba(18,38,63,.03); }
.kpi.ok { border-left-color:#20c997; } .kpi.warn { border-left-color:#f1b44c; } .kpi.bad { border-left-color:#e5484d; } .kpi.info { border-left-color:#4c8bf5; }
.kpi .k-label { color:#74788d; font-size:12px; }
.kpi .k-value { font-size:24px; font-weight:700; line-height:1.2; margin-top:4px; color:#1e1e2d; }
.kpi .k-sub { font-size:12px; color:#8a929a; margin-top:2px; }
.mini { background:#fafbfe; border-radius:6px; padding:10px 12px; height:100%; }
.mini .m-l { font-size:11px; color:#74788d; }
.mini .m-v { font-size:17px; font-weight:700; }
.mini .m-s { font-size:11px; color:#8a929a; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; flex:none; }
.t-ok { color:#0f7b55; } .t-warn { color:#9a6b00; } .t-bad { color:#b3163a; }
.loading-note { font-size:12px; color:#74788d; display:flex; align-items:center; gap:6px; }

.report-main { flex: 1; min-width: 0; overflow-y: auto; padding: 22px; background: #f4f5f8; }
@media (max-width: 991.98px) { .report-main { padding: 14px; } }

/* collapsed menu: icons only */
@media (min-width: 992px) {
  .sb-mini .main-sidebar { width: 68px; overflow-x: hidden; }
  .sb-mini .sidebar-menu { padding: 8px 8px 16px; }
  .sb-mini .sidebar-menu .header { font-size: 0; height: 1px; padding: 0; margin: 6px 10px; background: #e5eaef; } /* thin divider between groups */
  .sb-mini .sidebar-menu .header:first-child { display: none; }
  .sb-mini .sidebar-menu li a { justify-content: center; padding: 8px 0; }
  .sb-mini .sidebar-menu li a i { margin-right: 0; font-size: 19px; width: auto; }
  .sb-mini .sidebar-menu li a span { display: none; }
  .sb-mini .content-wrapper { margin-left: 68px; }
  .content-wrapper { transition: margin-left .2s; }
}

/* reports */
.rep-kpi { background:#fff; border-radius:10px; padding:14px 16px; height:100%; display:flex; gap:12px; align-items:center; box-shadow:0 .75rem 1.5rem rgba(18,38,63,.04); }
.rep-kpi .ic { width:42px; height:42px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:22px; flex:none; }
.rep-kpi .lb { color:#74788d; font-size:12px; }
.rep-kpi .vl { font-size:20px; font-weight:700; line-height:1.2; color:#1e1e2d; white-space:nowrap; }
.rep-kpi .sb { font-size:11px; color:#8a929a; }
.rep-chart { background:#fff; border-radius:10px; padding:14px 16px; height:100%; box-shadow:0 .75rem 1.5rem rgba(18,38,63,.04); }
.rep-chart h3 { font-size:14px; font-weight:700; margin:0 0 10px; color:#343a40; }
.rep-chart .cv { position:relative; height:240px; }
.report-main .table thead th { position: sticky; top: 0; z-index: 1; }
.report-main .table tbody tr:nth-child(even) { background:#fbfcfe; }
.rep-empty { text-align:center; padding:50px 20px; color:#8a929a; }
.rep-empty i { font-size:48px; color:#c4cbd6; display:block; margin-bottom:8px; }
.report-main .table td { white-space: nowrap; }
