/* Smart Fleet shared presentation layer. Existing feature DOM and permissions remain authoritative. */
:root{--sf-teal:#03989e;--sf-charcoal:#1e2226;--sf-bg:#f2f7f8;--sf-surface:#fff;--sf-line:#dce8ea;--sf-muted:#607780;--sf-success:#2e9d5b;--sf-warning:#d99521;--sf-danger:#d64b55;--sf-info:#3568d4;--sf-radius:12px;--sf-space:8px;--sf-shadow:0 4px 18px #163e4608;--primary:var(--sf-teal);--bg:var(--sf-bg);--text:var(--sf-charcoal);--muted:var(--sf-muted);--line:var(--sf-line)}
*{box-sizing:border-box}body{font:14px/1.5 'Segoe UI',Arial,sans-serif;color:var(--sf-charcoal);background:var(--sf-bg)}h1,h2,h3,h4{line-height:1.25;letter-spacing:-.025em}h2{font-size:26px}h3{font-size:20px}h4{font-size:15px}p{overflow-wrap:anywhere}main,.main,.app>section{min-width:0}header{min-height:88px;padding:20px 28px!important;gap:16px;border-bottom:1px solid var(--sf-line);box-shadow:none}header h2{margin:0;font-size:24px!important}header p{margin:4px 0 0;color:var(--sf-muted)}button,.button{min-height:42px;border-radius:8px;padding:10px 16px;font:600 13px/1.35 'Segoe UI',Arial,sans-serif;background:var(--sf-teal);color:white;border:1px solid transparent;transition:background .16s,box-shadow .16s}button:hover{filter:brightness(.96)}button.ghost{background:#edf5f6;color:#225c63;border-color:var(--sf-line)}button:disabled{opacity:.55;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #03989e66;outline-offset:3px}input,select,textarea{min-height:42px;border:1px solid #cbdcdf;border-radius:8px;background:white;color:var(--sf-charcoal);padding:10px 12px;font:inherit;max-width:100%}input[type=checkbox]{width:20px;height:20px;min-height:20px;accent-color:var(--sf-teal)}input[type=range]{accent-color:var(--sf-teal)}label{font-size:12px;font-weight:600;color:#42626d}form{min-width:0}fieldset{min-width:0}.panel,.cards article,.map-vehicle,.telemetry-card{border:1px solid var(--sf-line);border-radius:var(--sf-radius)!important;box-shadow:var(--sf-shadow)}.panel{padding:24px}.panel-head{gap:16px;align-items:center}.panel-head h3{margin:0 0 4px}.panel-head p{margin:0;color:var(--sf-muted)}.table-wrap{max-width:100%;overflow:auto;border:1px solid var(--sf-line);border-radius:10px;background:white}table{border-collapse:separate;border-spacing:0;font-size:13px;width:100%}th{background:#eaf3f4;color:#496770;font-size:10px;letter-spacing:.07em;text-transform:uppercase;padding:14px 12px;white-space:nowrap}td{padding:15px 12px;border-bottom:1px solid var(--sf-line);vertical-align:middle}tbody tr:nth-child(even){background:#f8fbfc}tbody tr:hover{background:#eef8f8}td button{min-height:36px;padding:7px 11px;font-size:12px}td small,.alert-detail{color:var(--sf-muted)}.badge,.sf-chip{display:inline-flex;align-items:center;gap:5px;border-radius:6px;padding:4px 8px;font-size:10px;font-weight:800;letter-spacing:.025em;white-space:nowrap;background:#edf3f5;color:#44606e}.badge.moving,.sf-chip.success{color:#22693e;background:#e8f4ed}.badge.offline,.sf-chip.danger{color:#a43440;background:#fcebed}.badge.parked,.sf-chip.info{color:#28579d;background:#edf2fc}.sf-chip.warning{color:#80550c;background:#fff4de}.cards{gap:16px}.cards article{border-top:2px solid var(--sf-teal);padding:20px}.cards article strong{font-size:30px;font-variant-numeric:tabular-nums}.cards article .metric-link{min-height:30px}.sf-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin:18px 0}.sf-kpi{background:white;border:1px solid var(--sf-line);border-radius:10px;padding:18px}.sf-kpi span{font-size:11px;color:var(--sf-muted);display:block}.sf-kpi strong{font-size:27px;display:block;margin-top:5px}.sf-kpi small{font-size:11px;color:var(--sf-muted)}.sf-callout{border-left:3px solid var(--sf-teal);border-radius:0 8px 8px 0;background:#eaf6f6;padding:14px 18px;color:#46666d;font-size:12px}.sf-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:16px 0}.sf-segment{display:inline-flex;border:1px solid var(--sf-line);padding:3px;border-radius:10px;background:white;gap:3px}.sf-segment button{background:transparent;color:var(--sf-muted);min-width:90px}.sf-segment button[aria-pressed=true],.sf-segment button[aria-selected=true]{background:var(--sf-teal);color:white}.sf-drawer{inset:0 0 0 auto;margin:0;width:380px;max-width:100vw;height:100dvh;max-height:100dvh;border:0;border-left:1px solid var(--sf-line);border-radius:0;padding:24px;box-shadow:-12px 0 40px #16374022}.sf-drawer::backdrop,dialog::backdrop{background:#12272d66}.sf-drawer header{padding:0 0 20px!important;min-height:50px;margin-bottom:20px;display:flex;justify-content:space-between}.sf-drawer label{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:18px 0}.sf-drawer select{max-width:190px}.sf-drawer fieldset{border:0;border-top:1px solid var(--sf-line);padding:18px 0;margin:20px 0}.sf-drawer legend{font-weight:700}.sf-drawer footer{margin-top:28px}.sf-empty,.empty,.map-message{color:var(--sf-muted);font-size:13px;padding:24px;text-align:center}.sf-loading{height:5px;border-radius:3px;background:linear-gradient(90deg,#e3f2f3,var(--sf-teal),#e3f2f3);background-size:200%;animation:sf-loading 1.5s linear infinite}@keyframes sf-loading{to{background-position:-200%}}dialog{border-radius:12px;border:1px solid var(--sf-line);padding:24px;max-width:96vw}dialog form{gap:12px}.login-card{border:1px solid var(--sf-line);box-shadow:0 20px 80px #123d4514;border-radius:16px;padding:36px;max-width:430px;width:calc(100% - 32px)}.login-card h1{font-size:24px}.login-card button{width:100%}.logo-window{background:white}.sf-vehicle-symbol{width:36px;height:36px;vertical-align:middle;margin-right:9px}.sf-rule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:18px 0}.sf-rule{padding:20px;border:1px solid var(--sf-line);border-radius:12px;background:#fcfefe}.sf-rule h4{margin:0 0 8px}.sf-rule .alert-filters{display:grid;grid-template-columns:1fr 1fr}.sf-rule p{font-size:12px;color:var(--sf-muted)}.sf-rule label{display:grid;gap:6px}.sf-rule label.alert-check{display:flex;align-items:center}.sf-table-tools{display:flex;justify-content:space-between;gap:12px;align-items:end;flex-wrap:wrap;margin:18px 0}.sf-table-tools input{min-width:220px}.sf-table-tools p{margin:0;font-size:12px;color:var(--sf-muted)}.sf-nav-break{border-top:1px solid #37545b!important;margin-top:16px!important;padding-top:12px!important}.sidebar{background:#182d33!important}.sidebar .nav{border-radius:8px;color:#d7e9ec;background:transparent;border:0}.sidebar .nav.active{background:#03989e30!important;color:white;box-shadow:inset 3px 0 var(--sf-teal)}.sidebar .nav:hover{background:#29464d}.sidebar .nav-icon{font-size:19px!important}.sidebar .sidebar-footer{font-size:10px;color:#91aeb4}.sidebar .portal-label{font-size:9px;letter-spacing:.15em;color:#9bb7be}.sidebar .nav-text{font-size:12px;font-weight:600}.fleet-workspace{height:calc(100dvh - 250px);min-height:510px;border-color:var(--sf-line);border-radius:12px;grid-template-columns:330px minmax(0,1fr)}.map-vehicle{margin:10px;padding:16px!important;box-shadow:none}.map-vehicle.selected{border-color:var(--sf-teal)!important;box-shadow:inset 3px 0 var(--sf-teal)!important}.map-vehicle .map-metrics{grid-template-columns:repeat(3,1fr)}.map-vehicle details{margin:8px 0}.map-vehicle summary{font-size:11px;padding:5px}.vehicle-popup{max-width:300px;padding:6px;color:var(--sf-charcoal)}.vehicle-popup strong{font-size:17px}.vehicle-popup dl{display:grid;grid-template-columns:1fr 1fr;gap:10px}.vehicle-popup dt{font-size:10px;color:var(--sf-muted)}.vehicle-popup dd{margin:0;font-size:13px;font-weight:600}.sf-fleet-table{background:white;border:1px solid var(--sf-line);border-radius:12px;padding:20px}.sf-list-mode .fleet-workspace{height:auto;min-height:0;display:block}.sf-list-mode .map-list{border:0}.sf-list-mode #mapVehicles,.sf-list-mode .fleet-map-panel{display:none}.sf-list-mode .map-filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.sf-list-mode .map-filters>label{display:none}.sf-list-mode .map-filters>input{width:300px}.sf-list-mode .map-filter-row{flex:1;min-width:220px}.sf-list-mode #mapCount{flex-basis:100%}.sf-performance-bars{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin:20px 0}.sf-performance-bars article{background:#f2f8f9;border-radius:10px;padding:16px}.sf-performance-bars span{font-size:11px;color:var(--sf-muted)}.sf-performance-bars strong{display:block;font-size:22px}.sf-performance-bars progress{display:block;width:100%;height:5px;accent-color:var(--sf-teal);margin-top:12px}.sf-score{font-variant-numeric:tabular-nums;font-size:17px;font-weight:700}.sf-score.pass{color:var(--sf-success)}.sf-score.fail{color:var(--sf-danger)}.sf-partner td{padding:11px 12px}.sf-partner .detail-grid{gap:18px}.sf-partner .panel{padding:20px}.sf-partner .detail-summary{gap:12px}.sf-partner .form-grid{gap:14px}
@media(min-width:901px){.sidebar{padding:20px 8px!important}.sidebar .nav{min-height:44px!important}.sidebar nav{gap:4px!important}.sidebar .brand{min-height:70px}.sidebar:hover,.sidebar:focus-within{width:248px!important}}
@media(max-width:900px){header{padding:16px!important;flex-wrap:wrap;min-height:80px}header h2{font-size:21px!important}.mobile-menu-open .sidebar{padding:20px 14px!important}.sidebar .nav{flex-direction:row!important;justify-content:flex-start!important;min-height:44px;padding:10px!important}.sidebar .nav-icon{margin-right:8px}.sidebar .nav-text{display:inline!important;visibility:visible!important}.sf-rule-grid{grid-template-columns:1fr}.fleet-workspace{min-height:440px}.sf-performance-bars{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){body{font-size:14px}.panel{padding:16px!important;margin-left:12px!important;margin-right:12px!important}.cards{gap:10px;padding:0 12px}.cards article{padding:16px}.sf-kpis{grid-template-columns:repeat(2,1fr)}.sf-kpi{padding:14px}.sf-kpi strong{font-size:24px}.sf-toolbar{gap:8px}.sf-toolbar>button{flex:1}.sf-drawer{width:100vw;padding:20px}.sf-drawer label{font-size:13px}.sf-fleet-table{padding:12px}.sf-fleet-table table thead{display:none}.sf-fleet-table tr{display:block;border-bottom:1px solid var(--sf-line);padding:12px 0}.sf-fleet-table td{display:flex;justify-content:space-between;gap:14px;border:0;padding:6px}.sf-fleet-table td::before{content:attr(data-label);font-size:11px;color:var(--sf-muted)}.sf-fleet-table td:last-child{justify-content:flex-end}.sf-rule .alert-filters{grid-template-columns:1fr}.sf-list-mode .map-filters{padding:16px}.sf-list-mode .map-filters>input{width:100%;min-width:0}.sf-list-mode .map-filter-row{width:100%;min-width:0}.map-toolbar{align-items:start;flex-wrap:wrap}.map-tools{flex-wrap:wrap}.map-tools button{padding:9px;font-size:11px}.map-list{min-width:0}.sf-table-tools input{min-width:0;width:100%}.mobile-show-map .fleet-workspace{height:calc(100dvh - 235px);min-height:380px}.mobile-show-map .fleet-map-panel{min-height:0}.mobile-show-map #liveMap{height:100%}.sf-performance-bars{gap:8px}.sf-performance-bars article{padding:12px}dialog{width:96vw;max-height:94dvh;padding:18px}input,select,textarea{font-size:16px}.table-wrap{max-width:calc(100vw - 58px)}.sf-partner .table-wrap{max-width:calc(100vw - 58px)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.sf-rule-grid{align-items:start}.sf-rule .alert-filters{margin:12px 0;gap:12px;align-items:end}.sf-segment{max-width:100%}.sf-segment button{min-width:0}

main>header{justify-content:flex-start}main>header>div:first-of-type{flex:1;min-width:0}main>header>.header-actions{flex:0 0 auto;margin-left:auto}
@media(min-width:901px){.sf-partner .report-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}.sf-partner div.report-controls{grid-template-columns:minmax(220px,2fr) minmax(180px,1fr)}.sf-partner .row-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.sf-partner .row-actions .filter-select{width:auto;max-width:260px}}

.sf-list-mode #mobileMapToggle{display:none!important}@media(max-width:640px){td button{min-height:42px}.sf-fleet-table td{flex-wrap:wrap;overflow-wrap:anywhere}.sf-fleet-table td small{display:block}}

/* Preserve login visibility over older mobile .app display overrides. */
.app.hidden,#loginView.hidden{display:none!important}
