:root {
 --brand: #ed1f24;
 --brand-hover: #c9181d;
 --dark: #151515;
 --bg: #f4f4f5;
}

body {
 background: var(--bg);
 color: #171717;
}

aside, .sidebar {
 background: var(--dark) !important;
 color: white;
}

aside button, .sidebar button {
 background: #292929;
 color: white;
}

aside button:hover, .sidebar button:hover {
 background: var(--brand);
}

button {
 background: var(--brand);
 border-radius: 6px;
}

button:hover {
 filter: brightness(0.9);
}

a {
 color: var(--brand);
}

#carInfo button {
 color: var(--brand) !important;
 background: transparent !important;
}

.doc-actions button:first-child {
 background: #252525 !important;
}

.doc-actions button:last-child {
 background: var(--brand) !important;
}

.lanpro-logo {
 display: block;
 width: 100%;
 max-width: 180px;
 height: auto;
 padding: 10px;
 background: white;
 border-radius: 8px;
 box-sizing: border-box;
 margin: 0 auto 15px;
}

.lanpro-logo {
 background: transparent;
 padding: 0;
 border-radius: 0;
 max-width: 180px;
 margin: 10px auto 20px;
}

aside, .sidebar {
 background: #101010 !important;
}

.lanpro-logo {
 background: transparent !important;
 max-width: 190px;
 padding: 0;
 margin: 15px auto 25px;
}

aside button, .sidebar button {
 background: #252525;
 padding: 14px;
 margin-bottom: 6px;
 border-radius: 8px;
 text-align: left;
}

aside button:hover,
aside button.active,
.sidebar button.active {
 background: #ed1f24 !important;
 color: white;
}

#home .card,
#home .stat {
 border-bottom: 3px solid #ed1f24;
 border-radius: 14px;
 box-shadow: 0 3px 12px rgba(0,0,0,.06);
}

main h1 {
 border-left: 5px solid #ed1f24;
 padding-left: 14px;
}


.fleet-toolbar {
 display:flex;
 justify-content:space-between;
 align-items:center;
 gap:12px;
 flex-wrap:wrap;
 margin-bottom:15px;
}

.view-switch {
 display:flex;
 gap:5px;
}

.view-switch button {
 background:#e5e7eb;
 color:#333;
}

.view-switch button.active {
 background:#ed1f24;
 color:white;
}

#fleetCards {
 display:grid;
 grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
 gap:20px;
}

#fleetCards[hidden] {
 display:none;
}

.fleet-card {
 border:1px solid #ddd;
 border-bottom:3px solid #ed1f24;
 border-radius:12px;
 overflow:hidden;
 background:white;
}

.fleet-photo {
 height:190px;
 background:#f3f4f6;
 display:flex;
 align-items:center;
 justify-content:center;
 color:#777;
}

.fleet-photo img {
 width:100%;
 height:100%;
 object-fit:cover;
}

.fleet-card-body {
 padding:16px;
}

.fleet-card-body button {
 width:100%;
 margin-top:10px;
}

.fleet-card {
 display:flex;
 flex-direction:column;
}

.fleet-card-body {
 display:flex;
 flex-direction:column;
 flex:1;
}

.fleet-card-body button {
 margin-top:auto;
}

.fleet-photo {
 cursor:pointer;
 flex-shrink:0;
}

.fleet-photo:hover {
 background:#e5e5e5;
}

.vehicle-tabs{
 display:flex;
 flex-wrap:wrap;
 gap:8px;
 margin:20px 0;
 padding-bottom:12px;
 border-bottom:1px solid #ddd;
}

.vehicle-tabs button{
 background:#f1f3f5;
 color:#333;
 padding:12px 18px;
 border:0;
 border-radius:7px;
 font-weight:600;
}

.vehicle-tabs button.active{
 background:#ed1f24;
 color:white;
}

.vehicle-tab-section[hidden]{
 display:none!important;
}

.vehicle-tab-section{
 padding:10px 0;
}

.vehicle-gallery-grid{
 display:grid;
 grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
 gap:15px;
 margin-top:20px;
}

.vehicle-gallery-grid img{
 width:100%;
 height:180px;
 object-fit:cover;
 border-radius:10px;
}

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

.maintenance-form label{
 display:flex;
 flex-direction:column;
 gap:7px;
 font-weight:600;
}

.maintenance-form input,
.maintenance-form select,
.maintenance-form textarea{
 width:100%;
 box-sizing:border-box;
 padding:12px;
 border:1px solid #ddd;
 border-radius:7px;
 font:inherit;
 font-weight:normal;
}

.maintenance-form .wide{
 grid-column:1/-1;
}

.maintenance-total{
 padding:18px 0;
 border-top:1px solid #ddd;
 font-size:20px;
}

.maintenance-total strong{
 color:#15803d;
 float:right;
}

@media(max-width:600px){
 .maintenance-form{
  grid-template-columns:1fr;
 }
}

/* FLEET ADD VEHICLE DESIGN */

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

.fleet-add-grid button{
 display:flex;
 align-items:center;
 gap:22px;
 min-height:150px;
 padding:22px;
 border-radius:18px;
 text-align:left;
 transition:transform .18s,box-shadow .18s;
}

.fleet-add-grid button:hover{
 transform:translateY(-3px);
 filter:none;
}

.fleet-add-ai{
 background:linear-gradient(145deg,#ff394d,#c90018);
 color:white;
 box-shadow:0 8px 22px #ed1f2430;
}

.fleet-add-manual{
 background:linear-gradient(145deg,#fff,#f3eff0);
 color:#171717;
 border:1px solid #d5d7dc;
 box-shadow:0 5px 16px #0000000c;
}

.fleet-add-icon{
 width:95px;
 height:95px;
 flex-shrink:0;
 position:relative;
 display:flex;
 align-items:center;
 justify-content:center;
}

.fleet-add-icon svg{
 width:100%;
 height:100%;
}

.keyboard-icon{
 font-size:70px;
 position:absolute;
 top:0;
}

.hands-icon{
 font-size:46px;
 position:absolute;
 bottom:0;
}

.fleet-add-grid strong{
 display:block;
 font-size:27px;
 margin-bottom:10px;
}

.fleet-add-grid small{
 font-size:14px;
 line-height:1.5;
}

.fleet-add-arrow{
 margin-left:auto;
 font-size:28px;
 font-weight:bold;
}

.fleet-add-dialog{
 width:850px;
 max-width:94vw;
 max-height:88vh;
 padding:24px;
 border:1px solid #ddd;
 border-radius:18px;
}

.fleet-add-dialog::backdrop{
 background:#0008;
 backdrop-filter:blur(3px);
}

.fleet-add-dialog section{
 margin:0;
 padding:10px;
}

.fleet-dialog-close{
 display:block;
 margin-left:auto;
}

#fleetManualDialog #vehicleForm{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:12px;
}

#fleetManualDialog input,
#fleetManualDialog select{
 width:100%;
 margin:0;
}

#fleetManualDialog button[type="submit"]{
 grid-column:1/-1;
}

#fleetThemeButton{
 background:#e5e7eb;
 color:#171717;
 white-space:nowrap;
}

header{
 gap:15px;
 flex-wrap:wrap;
}

@media(max-width:850px){
 .fleet-add-grid{
  grid-template-columns:1fr;
 }
}

@media(max-width:500px){
 #fleetManualDialog #vehicleForm{
  grid-template-columns:1fr;
 }
 .fleet-add-grid button{
  padding:15px;
  gap:12px;
 }
 .fleet-add-grid strong{
  font-size:22px;
 }
}

/* FLEET DARK THEME */

html[data-fleet-theme="dark"]{
 color-scheme:dark;
 --bg:#101217;
 --brand:#ed1f24;
}

html[data-fleet-theme="dark"] body{
 background:#101217;
 color:#edf0f5;
}

html[data-fleet-theme="dark"] :is(
 section,.card,.fleet-card,dialog,#fleetAlerts
){
 background:#1b1e26!important;
 color:#edf0f5;
 border-color:#373c48;
}

html[data-fleet-theme="dark"] aside{
 background:#090b10!important;
}

html[data-fleet-theme="dark"] :is(input,select,textarea){
 background:#232732!important;
 color:#edf0f5!important;
 border-color:#444956!important;
}

html[data-fleet-theme="dark"] :is(input,textarea)::placeholder{
 color:#a3a9b5;
}

html[data-fleet-theme="dark"] th{
 background:#252936;
}

html[data-fleet-theme="dark"] :is(td,th,.doc-row,.vehicle-tabs){
 border-color:#373c48!important;
}

html[data-fleet-theme="dark"] #vehicleManagement{
 background:#252936!important;
 color:#edf0f5;
}

html[data-fleet-theme="dark"] .fleet-photo{
 background:#252936;
 color:#a3a9b5;
}

html[data-fleet-theme="dark"] .fleet-add-manual{
 background:linear-gradient(145deg,#282c36,#161922);
 color:#edf0f5;
 border-color:#444956;
}

html[data-fleet-theme="dark"] .vehicle-tabs button:not(.active),
html[data-fleet-theme="dark"] .view-switch button:not(.active),
html[data-fleet-theme="dark"] #fleetThemeButton{
 background:#303542;
 color:#edf0f5;
}

html[data-fleet-theme="dark"] a{
 color:#ff6872;
}

html[data-fleet-theme="dark"] #carInfo strong{
 color:inherit;
}

html[data-fleet-theme="dark"] #carInfo div{
 border-color:#373c48!important;
}

html[data-fleet-theme="dark"] .maintenance-total strong{
 color:#4ade80;
}

#fleetHeaderTools{
 position:relative;
 display:flex;
 align-items:center;
 gap:8px;
}

#fleetHeaderTools .header-icon{
 position:relative;
 display:flex;
 align-items:center;
 justify-content:center;
 gap:5px;
 min-width:42px;
 height:42px;
 padding:8px;
 background:transparent;
 color:inherit;
 border-radius:10px;
}

.header-icon svg{
 width:24px;
 height:24px;
 stroke:currentColor;
 fill:none;
 stroke-width:1.7;
 stroke-linecap:round;
 stroke-linejoin:round;
}

#fleetAlertBadge{
 position:absolute;
 top:-3px;
 right:-4px;
 background:#ed1f24;
 color:white;
 font-size:11px;
 font-weight:bold;
 min-width:19px;
 padding:3px;
 border-radius:20px;
 text-align:center;
}

#fleetProfileMenu{
 position:absolute;
 right:0;
 top:52px;
 z-index:1000;
 width:260px;
 background:white;
 color:#171717;
 border:1px solid #ddd;
 border-radius:14px;
 box-shadow:0 12px 35px #0002;
 padding:18px;
}

#fleetProfileMenu small{
 display:block;
 color:#888;
 margin-top:5px;
}

#fleetProfileMenu button{
 display:block;
 width:100%;
 background:transparent;
 color:inherit;
 text-align:left;
 padding:12px;
 margin:3px 0;
}

#fleetProfileMenu button:hover{
 background:#ed1f24;
 color:white;
}

html[data-fleet-theme="dark"] #fleetProfileMenu{
 background:#232732;
 color:#edf0f5;
 border-color:#444956;
}

#fleetHeaderTools [hidden]{
 display:none!important;
}

/* FLEET DASHBOARD DESIGN */

:root{
 --fleet-surface:#ffffff;
 --fleet-text:#171923;
 --fleet-muted:#64748b;
 --fleet-border:#e4e7ec;
 --fleet-sidebar:#fafafa;
}

html[data-fleet-theme="dark"]{
 --fleet-surface:#1b1e26;
 --fleet-text:#edf0f5;
 --fleet-muted:#a4aab7;
 --fleet-border:#343945;
 --fleet-sidebar:#111319;
}

aside{
 background:var(--fleet-sidebar)!important;
 color:var(--fleet-text)!important;
 border-right:1px solid var(--fleet-border);
 padding:20px 16px;
}

html[data-fleet-theme="dark"] aside{
 background:var(--fleet-sidebar)!important;
}

aside nav button{
 background:transparent!important;
 color:var(--fleet-text);
 display:flex;
 align-items:center;
 gap:12px;
 font-size:14px;
 font-weight:500;
 padding:13px;
}

aside nav button.active,
aside nav button:hover{
 background:#ed1f2418!important;
 color:#ed1f24!important;
}

aside nav svg{
 width:21px;
 height:21px;
 stroke:currentColor;
 fill:none;
 stroke-width:1.7;
 stroke-linecap:round;
 stroke-linejoin:round;
 flex-shrink:0;
}

aside p{
 font-size:11px;
 letter-spacing:2px;
 text-align:center;
 color:var(--fleet-muted);
 margin-bottom:25px;
}

main header{
 display:flex;
 align-items:center;
 justify-content:flex-start;
 margin-bottom:24px;
 gap:16px;
}

main header h1{
 margin-right:auto;
 font-size:25px;
}

#connection{
 font-size:11px;
 color:#22a06b!important;
}

#home .cards{
 grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
 gap:16px;
}

#home .card{
 position:relative;
 border:1px solid var(--fleet-border);
 border-radius:14px;
 box-shadow:none;
 padding:20px;
 min-height:125px;
 color:var(--fleet-muted);
}

#home .card b{
 color:var(--fleet-text);
 font-size:34px;
 margin-top:18px;
}

.dashboard-icon{
 position:absolute;
 right:17px;
 top:17px;
 color:#ed1f24;
 background:#ed1f2412;
 border-radius:10px;
 padding:9px;
}

.dashboard-icon svg{
 width:22px;
 height:22px;
 stroke:currentColor;
 fill:none;
 stroke-width:1.8;
 stroke-linecap:round;
 stroke-linejoin:round;
}

#fleetAlerts{
 border:1px solid var(--fleet-border);
 padding:20px!important;
}

#fleetAlerts > div{
 padding:10px 0!important;
 border-color:var(--fleet-border)!important;
}

#fleetAlerts > div > div > div{
 color:var(--fleet-muted)!important;
}

#fleetAlerts button{
 background:#ed1f2415;
 color:#ed1f24;
 padding:8px 13px;
 font-size:12px;
}

#fleetProfileMenu{
 width:245px;
 padding:12px;
 border-color:var(--fleet-border);
}

#fleetProfileMenu button{
 font-size:13px;
 padding:10px;
}

#fleetProfileMenu small{
 color:var(--fleet-muted);
}

#fleetProfileMenu hr{
 border:0;
 border-top:1px solid var(--fleet-border);
}


.fleet-alert-group{
 border:1px solid var(--fleet-border);
 border-radius:12px;
 margin:10px 0;
 overflow:hidden;
}

.fleet-alert-group summary{
 display:flex;
 align-items:center;
 gap:12px;
 padding:16px;
 cursor:pointer;
 font-weight:600;
 list-style:none;
}

.fleet-alert-group summary strong{
 margin-left:auto;
 background:#ed1f2420;
 color:#ed1f24;
 padding:4px 11px;
 border-radius:20px;
}

.fleet-alert-group summary::after{
 content:'⌄';
 color:var(--fleet-muted);
}

.fleet-alert-group[open] summary::after{
 content:'⌃';
}

.fleet-alert-group[open] summary{
 border-bottom:1px solid var(--fleet-border);
}

.fleet-alert-group > div{
 padding:0 16px;
}

html[data-fleet-theme="dark"] #fleetAlerts button{
 color:#ff6872;
}

#mechanicsMenuBtn{
 width:100%;
 background:transparent!important;
 color:var(--fleet-text)!important;
 text-align:left;
}


.dashboard-clickable{
 cursor:pointer;
 transition:transform .18s,border-color .18s;
}

.dashboard-clickable:hover{
 transform:translateY(-3px);
 border-color:#ed1f24!important;
}

#mechanicsMenuBtn{
 display:flex;
 align-items:center;
 gap:12px;
 padding:13px;
 font-size:14px;
}

#mechanicsMenuBtn svg,
#fleetProfileMenu button svg{
 width:20px;
 height:20px;
 fill:none;
 stroke:currentColor;
 stroke-width:1.7;
 stroke-linecap:round;
 stroke-linejoin:round;
 flex-shrink:0;
}

.fleet-profile-heading{
 display:flex;
 align-items:center;
 gap:12px;
 padding:8px;
}

.fleet-avatar{
 display:flex;
 align-items:center;
 justify-content:center;
 width:44px;
 height:44px;
 border-radius:50%;
 background:#ed1f2418;
 color:#ed1f24;
}

.fleet-avatar svg{
 width:25px;
 height:25px;
 stroke:currentColor;
 fill:none;
 stroke-width:1.6;
}

#fleetProfileMenu button{
 display:flex;
 align-items:center;
 gap:10px;
}

.fleet-alert-group summary:hover{
 background:#ed1f2409;
}

html[data-fleet-theme="dark"] .fleet-alert-group summary strong{
 color:#ff6872;
}

.fleet-alert-group > div > div{
 border-color:var(--fleet-border)!important;
}

.fleet-alert-group > div > div > div > div{
 color:var(--fleet-muted)!important;
}

.alert-group-icon{
 display:flex;
 align-items:center;
 justify-content:center;
 width:36px;
 height:36px;
 border-radius:9px;
 background:#ed1f2415;
 color:#ed1f24;
}

.alert-group-icon svg{
 width:21px;
 height:21px;
 stroke:currentColor;
 fill:none;
 stroke-width:1.7;
 stroke-linecap:round;
 stroke-linejoin:round;
}

.fleet-alert-group summary{
 padding:12px 16px;
}


.alert-group-icon{
 display:flex;
 align-items:center;
 justify-content:center;
 width:36px;
 height:36px;
 border-radius:9px;
 background:#ed1f2415;
 color:#ed1f24;
}

.alert-group-icon svg{
 width:21px;
 height:21px;
 stroke:currentColor;
 fill:none;
 stroke-width:1.7;
 stroke-linecap:round;
 stroke-linejoin:round;
}

.fleet-alert-group summary{
 padding:12px 16px;
}


.lanpro-logo{
 content:url('/logo-light.png');
 background:transparent!important;
 max-width:175px;
}

html[data-fleet-theme="dark"] .lanpro-logo{
 content:url('/logo-dark.png');
}


#fleetProfileMenu #adminLogout{
 color:#ed1f24!important;
 border:1px solid #ed1f2430;
 background:#ed1f2410!important;
 justify-content:center;
 margin-top:8px;
}

#fleetProfileMenu #adminLogout:hover{
 background:#ed1f24!important;
 color:white!important;
}

#adminUsersDialog,#adminUserEditor{
 width:min(520px,94vw);
 max-height:85vh;
 border-radius:18px;
}

.admin-user-card{
 display:flex;
 align-items:center;
 justify-content:space-between;
 gap:15px;
 padding:18px;
 margin:12px 0;
 border:1px solid var(--fleet-border,#ddd);
 border-radius:12px;
}

.admin-user-card p{
 margin:6px 0;
 font-size:13px;
}

#adminUserForm{
 display:grid;
 gap:10px;
}

#adminUserForm input:not([type="checkbox"]){
 width:100%;
}

#adminUserMessage{
 color:#ed1f24;
}
