*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Inter,Arial,sans-serif;
}

/* DASHBOARD */

.dashboard{
display:grid;
grid-template-columns:260px 1fr 280px;
grid-template-rows:90px 1fr auto;
gap:18px;
padding:18px;
min-height:100vh;
height:auto;
}

.sidebar{
grid-column:1;
}

.center{
grid-column:2;
min-width:0;
}

.right-panel{
grid-column:3;
display:flex;
flex-direction:column;
gap:18px;
min-width:280px;
}

body{
background:linear-gradient(135deg,#edf1f5,#dfe5ec);
color:#111827;
overflow-x:hidden;
overflow-y:auto;
}

/* HEADER */

.header{
grid-column:1/4;
display:flex;
justify-content:space-between;
align-items:center;
background:#fff;
border-radius:24px;
padding:18px 24px;
box-shadow:0 10px 30px rgba(0,0,0,.05);
}

.logo{
display:flex;
align-items:center;
gap:16px;
}

.logo h1{
font-size:34px;
font-weight:900;
}

.logo-sub{
font-size:12px;
opacity:.5;
}

.header-right{
display:flex;
align-items:center;
gap:12px;
}

.clock{
font-size:42px;
font-weight:900;
}

button{
border:none;
border-radius:14px;
padding:12px 16px;
font-weight:700;
cursor:pointer;
}

.sidebar{
background:#fff;
border-radius:24px;
padding:18px;
display:flex;
flex-direction:column;
gap:14px;
box-shadow:0 10px 30px rgba(0,0,0,.05);
}

.sidebar h2{
font-size:28px;
font-weight:900;
line-height:1;
margin-bottom:8px;
}

.input{
width:100%;
padding:14px;
border:none;
border-radius:14px;
background:#f3f4f6;
}

.save-btn{
background:#16a34a;
color:#fff;
font-weight:800;
}

/* CENTER */

.center{
display:flex;
flex-direction:column;
gap:18px;
min-width:0;
}

/* ROUTE HEADER */

.route-header{

display:flex;
justify-content:space-between;
align-items:center;

background:#fff;

padding:18px 22px;

border-radius:24px 24px 0 0;

border-bottom:1px solid #e5e7eb;

position:relative;

z-index:1;

}

.route-title{
font-size:12px;
font-weight:700;
opacity:.5;
}

.route-subtitle{
font-size:24px;
font-weight:900;
margin-top:4px;
}

.route-meta{
display:flex;
flex-direction:column;
gap:6px;
align-items:flex-end;
font-size:14px;
font-weight:700;
}

/* MAP */

#map{
width:100%;
height:100%;
min-height:520px;
z-index:1;
}

/* RIGHT PANEL */

.right-panel{
display:flex;
flex-direction:column;
gap:18px;
}

/* CAMERA */

.live-camera-card{
background:#fff;
border-radius:24px;
padding:14px;
box-shadow:0 10px 30px rgba(0,0,0,.05);
overflow:hidden;
}

.panel-title{
font-size:13px;
font-weight:800;
margin-bottom:12px;
}

.live-camera-card video{
width:100%;
height:160px;
object-fit:cover;
border-radius:16px;
background:#000;
}

/* HISTORY */

.history-panel{
background:#fff;
border-radius:24px;
padding:16px;
box-shadow:0 10px 30px rgba(0,0,0,.05);
}

#historyList{
display:flex;
flex-direction:column;
gap:10px;
margin-top:12px;
}

.history-item{
background:#f8fafc;
border-radius:14px;
padding:12px;
font-size:13px;
font-weight:600;
}

/* CHAT */

.chat-panel{
background:#fff;
border-radius:24px;
padding:16px;
box-shadow:0 10px 30px rgba(0,0,0,.05);
display:flex;
flex-direction:column;
gap:12px;
}

#chatMessages{
display:flex;
flex-direction:column;
gap:10px;
max-height:240px;
overflow:auto;
}

.chat-input{
display:flex;
gap:10px;
}

.chat-input input{
flex:1;
padding:12px;
border:none;
border-radius:12px;
background:#f3f4f6;
}

/* KPI */

#routeInfo,
#routeProgress,
#kpiPanel,
#networkPanel,
#telemetryPanel{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:16px;
}

.route-stat,
.route-live-card,
.kpi-card,
.network-card,
.telemetry-card{

    background:#fff;

    border-radius:16px;

    padding:10px 14px;

    min-height:70px;

    height:70px;

    box-shadow:0 4px 12px rgba(0,0,0,.05);

    display:flex;
    flex-direction:column;
    justify-content:center;

}

.route-value,
.live-value,
.kpi-value,
.network-value,
.telemetry-value{
font-size:24px;
font-weight:800;
line-height:1;
}

.progress-bar{
height:14px;
background:#dbe4ee;
border-radius:999px;
overflow:hidden;
margin-bottom:12px;
}

.progress-fill-live{
height:100%;
background:#2563eb;
width:32%;
}

/* VEHICLES */

.vehicle-bar{
height:160px;
overflow-y:auto;
}

#truckList{
display:flex;
flex-direction:column;
gap:10px;
}

/* BOTTOM */

.bottom{
grid-column:1/4;
display:grid;
grid-template-columns:repeat(4,1fr);
gap:18px;
}

.bottom-card{
background:#fff;
border-radius:24px;
padding:22px;
font-size:32px;
font-weight:900;
min-height:120px;
display:flex;
align-items:flex-end;
box-shadow:0 10px 30px rgba(0,0,0,.05);
}

/* MOBILE */

@media(max-width:768px){

body{
overflow-x:hidden;
overflow-y:auto;
}

.dashboard{
display:flex;
flex-direction:column;
height:auto;
padding:10px;
}

.header{
flex-direction:column;
align-items:flex-start;
gap:14px;
}

.logo h1{
font-size:30px;
}

.clock{
font-size:28px;
}

.map-wrap{
position:relative;
height:380px;
}

#map{
min-height:420px;
}

#map{
min-height:420px;
}

.right-panel{
width:100%;
}


.route-stat,
.route-live-card,
.kpi-card,
.network-card,
.telemetry-card{

background:#fff;
border-radius:18px;

padding:10px 14px;

min-height:70px;

display:flex;
flex-direction:column;
justify-content:center;

}

.bottom{
display:flex;
flex-direction:column;
}

.bottom-card{
min-height:90px;
font-size:28px;
}

}
.section-label{

font-size:12px;
font-weight:800;
letter-spacing:.5px;
opacity:.55;
margin-top:8px;

}

.cargo-grid{

display:grid;
grid-template-columns:1fr 1fr;
gap:10px;

}

.sidebar{

overflow:auto;

}

.map-wrap{

height:auto;

}

.route-subtitle{

font-size:34px;

}
/* STOPS */

#stopsList{
display:flex;
flex-direction:column;
gap:10px;
}

/* CALCULATOR */

#priceCalculator{

width:100%;

}

.calc-card{

min-height:auto;

}

.calc-card h3{

font-size:28px;

margin-bottom:20px;

}

.calc-total{

font-size:38px;

font-weight:900;

margin-top:20px;

}

.calc-card{

background:#fff;

border-radius:24px;

padding:20px;

min-height:auto;

box-shadow:0 10px 30px rgba(0,0,0,.05);

}

.calc-card h3{
font-size:14px;
margin-bottom:8px;
font-weight:800;
}

.calc-card div{
margin-bottom:6px;
font-size:12px;
}

.calc-total{
margin-top:10px;
font-size:24px;
font-weight:900;
color:#16a34a;
}

/* DARK MODE */

body.dark{
background:#0f172a;
color:#fff;
}

body.dark .header,
body.dark .sidebar,
body.dark .history-panel,
body.dark .chat-panel,
body.dark .vehicle-bar,
body.dark .calc-card{

background:#1e293b;
color:#fff;

}

body.dark .route-stat,
body.dark .kpi-card,
body.dark .network-card,
body.dark .telemetry-card{

background:#334155;
color:#fff;

}

body.dark .map-wrap{

background:#fff;

}

body.dark input,
body.dark select{
background:#334155;
color:#fff;
}
body.dark .calc-total{
color:#22c55e;
}

#priceCalculator{
grid-row:auto;
}

.stats-grid{

display:block;

margin-top:12px;

}

/* KPI FIX */

.route-stat,
.kpi-card,
.network-card,
.telemetry-card{

min-height:90px;

padding:14px;

border-radius:18px;

background:#fff;

box-shadow:0 5px 20px rgba(0,0,0,.05);

}

.route-value,
.kpi-value,
.network-value,
.telemetry-value{

font-size:28px;

font-weight:900;

line-height:1;

}

.route-label,
.kpi-label,
.network-label,
.telemetry-label{

font-size:11px;

opacity:.6;

margin-bottom:6px;

}
.vehicle-bar{

background:#fff;

border-radius:18px;

padding:12px;

min-height:120px;

box-shadow:0 5px 20px rgba(0,0,0,.05);

overflow:auto;

}

#truckList{

display:flex;

flex-direction:column;

gap:8px;

}
.autocomplete-list{

position:absolute;

background:white;

border-radius:12px;

box-shadow:0 10px 30px rgba(0,0,0,.15);

width:100%;

max-height:220px;

overflow:auto;

z-index:9999;

}

.autocomplete-item{

padding:10px;

cursor:pointer;

border-bottom:1px solid #eee;

}

.autocomplete-item:hover{

background:#f3f4f6;

}
.calc-card{

padding:24px;

font-size:18px;

}

.calc-card h3{

font-size:28px;

margin-bottom:18px;

}

.calc-card div{

margin-bottom:10px;

}

.calc-total{

font-size:38px !important;

font-weight:900;

margin-top:20px;

}
.driver-card{

background:white;

padding:18px;

border-radius:20px;

margin-top:15px;

margin-bottom:15px;

box-shadow:0 6px 18px rgba(0,0,0,.05);

}

.driver-btn{

display:block;

text-align:center;

background:#16a34a;

color:white;

text-decoration:none;

padding:12px;

border-radius:12px;

font-weight:700;

transition:.2s;

}

.driver-btn:hover{

opacity:.9;

transform:translateY(-1px);

}

.operations-center{

margin-top:20px;

display:grid;

grid-template-columns:1fr 1fr 1fr;

gap:20px;

width:100%;

align-items:start;

}

.operations-center .history-panel,
.operations-center .chat-panel{

margin:0;

min-height:420px;
height:auto;
overflow:auto;

display:flex;

flex-direction:column;

}

#ordersPanelBottom,
#historyListBottom,
#chatMessagesBottom{

flex:1;

overflow:auto;

}

#chatMessagesBottom{

display:flex;

flex-direction:column;

gap:10px;

}

.operations-center{
    margin-top:20px;
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:20px;
}

.operations-center .history-panel,
.operations-center .chat-panel{
    min-height:350px;
}
/* GPS FLEET */

#gpsFleetBar{

background:#fff;

border-radius:20px;

padding:14px 20px;

margin-bottom:16px;

box-shadow:0 5px 20px rgba(0,0,0,.05);

}

.gps-title{

font-size:14px;

font-weight:800;

margin-bottom:10px;

letter-spacing:.5px;

}

#gpsFleetList{

display:flex;

gap:12px;

flex-wrap:wrap;

}

.gps-truck{

background:#f8fafc;

border-radius:12px;

padding:10px 14px;

font-size:13px;

font-weight:600;

border:1px solid #e5e7eb;

}
.gps-truck{

display:inline-block;

background:#fff;

border-radius:12px;

padding:10px 14px;

margin-right:10px;

cursor:pointer;

box-shadow:0 2px 10px rgba(0,0,0,.08);

min-width:180px;

}

.gps-truck:hover{

transform:translateY(-2px);

}
#gpsKpiBar{

display:grid;

grid-template-columns:repeat(4,1fr);

gap:15px;

margin:15px 0;

}

.gps-kpi-card{

background:#fff;

border-radius:16px;

padding:16px;

box-shadow:0 4px 12px rgba(0,0,0,.06);

}

.gps-kpi-label{

font-size:12px;

opacity:.6;

font-weight:700;

}

.gps-kpi-value{

font-size:30px;

font-weight:900;

margin-top:6px;

}
#zeitfensterBar{

display:grid;

grid-template-columns:1fr 1fr 1fr;

gap:15px;

margin-bottom:15px;

}
