
:root{
  --bg:#f6f8fb;
  --surface:#ffffff;
  --surface-alt:#edf3f8;
  --text:#111827;
  --muted:#4b5563;
  --border:#d8e1ea;
  --primary:#005ca9;
  --primary-dark:#003e73;
  --accent:#eef6ff;
  --success:#2f7d32;
  --warning:#b4690e;
  --danger:#b42318;
  --shadow:0 8px 24px rgba(17,24,39,.08);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:linear-gradient(180deg,#f8fafc 0%,#eef3f8 100%);
  color:var(--text);
  font-family:Arial,Helvetica,sans-serif;
}
.app{
  max-width:1100px;
  margin:0 auto;
  padding:28px 18px 56px;
}
.header{
  background:linear-gradient(135deg,#ffffff 0%,#edf4fb 100%);
  border:1px solid var(--border);
  border-radius:28px;
  padding:28px 24px;
  margin-bottom:18px;
  box-shadow:var(--shadow);
}
.header h1{
  font-size:46px;
  line-height:1.05;
  margin:0 0 8px;
  color:var(--primary-dark);
  letter-spacing:-0.02em;
}
.header p{
  margin:0;
  color:var(--muted);
  font-size:18px;
  max-width:720px;
}
.banner{
  margin:0 0 16px;
  padding:14px 16px;
  border-radius:18px;
  background:#e9f7eb;
  color:#1f5f2a;
  border:1px solid #b7d6bc;
  font-weight:700;
}
.banner-error{
  background:#fff1f2;
  color:var(--danger);
  border-color:#f3c2c9;
}
.hidden{display:none !important}
.steps{
  display:flex;
  gap:10px;
  margin:0 0 20px;
  flex-wrap:wrap;
}
.step{
  padding:11px 16px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  color:var(--primary-dark);
  font-weight:700;
}
.step.active{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:24px;
  padding:22px;
  margin-bottom:16px;
  box-shadow:var(--shadow);
}
.section-head h2,.card h3{
  margin:0 0 8px;
  color:var(--primary-dark);
}
.section-head p,.hint,.stat-sub,#vehicleMeta,.history-sub{
  color:var(--muted);
}
label{
  display:block;
  font-weight:700;
  margin:0 0 6px;
  color:var(--primary-dark);
}
input,select{
  width:100%;
  margin:8px 0 16px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:16px;
  padding:14px 16px;
  font-size:16px;
  outline:none;
}
input:focus,select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(0,92,169,.12);
}
.btn{
  width:100%;
  border:0;
  border-radius:18px;
  padding:15px 18px;
  font-size:19px;
  font-weight:700;
  cursor:pointer;
  margin-top:12px;
  transition:transform .05s ease, opacity .15s ease, background .15s ease;
}
.btn:hover{opacity:.96}
.btn:active{transform:translateY(1px)}
.btn-primary,.btn-blue{
  background:var(--primary);
  color:#fff;
}
.btn-primary:hover,.btn-blue:hover{
  background:var(--primary-dark);
}
.btn-green{
  background:#2f7d32;
  color:#fff;
}
.btn-orange{
  background:#b4690e;
  color:#fff;
}
.btn-light{
  background:#fff;
  color:var(--primary-dark);
  border:1px solid var(--border);
}
.small{
  width:auto;
  padding:11px 16px;
  font-size:15px;
  margin-top:0;
}
.btn-inline{
  width:auto;
  padding:10px 14px;
  font-size:14px;
  margin-top:10px;
}
.vehicle-summary{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.grid{
  display:grid;
  gap:16px;
}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.stat{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
}
.stat-label{
  color:var(--primary-dark);
  font-size:15px;
  margin-bottom:10px;
  font-weight:700;
}
.stat-value{
  font-size:28px;
  font-weight:800;
  line-height:1.15;
  color:var(--text);
}
.small-stat .stat-value{font-size:22px}
.report-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 16px;
}
.history-item{
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  margin-top:12px;
  background:#fbfdff;
}
.history-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:14px;
  font-weight:700;
  color:var(--primary-dark);
}
.trip-map{
  height:340px;
  width:100%;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--border);
}
.leaflet-container{
  font-family:Arial,Helvetica,sans-serif;
}
@media (max-width: 760px){
  .header h1{font-size:36px}
  .header p{font-size:16px}
  .grid.two,.grid.three,.report-grid{grid-template-columns:1fr}
  .vehicle-summary{flex-direction:column}
  .small{width:100%}
  .trip-map{height:280px}
}

.history-badge{
  display:inline-block;
  margin-top:8px;
  padding:6px 10px;
  border-radius:999px;
  background:#eaf4ff;
  color:var(--primary-dark);
  font-size:12px;
  font-weight:700;
  border:1px solid var(--border);
}


.bottleneck-legend{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin:10px 0 14px;
  color:var(--muted);
  font-size:14px;
  font-weight:700;
}
.dot{
  display:inline-block;
  width:12px;
  height:12px;
  border-radius:999px;
  margin-right:8px;
  vertical-align:middle;
}
.dot-stop{background:#d97706}
.dot-brake{background:#dc2626}
.dot-accel{background:#60a5fa}
.bottleneck-list{
  display:grid;
  gap:10px;
}
.bottleneck-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fbfdff;
}
.bottleneck-item strong{
  color:var(--primary-dark);
}
.bottleneck-item span{
  color:var(--muted);
  text-align:right;
}


.plate-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:end;
  margin-bottom:8px;
}
.plate-btn{
  width:auto;
  min-width:200px;
  margin-top:0;
  white-space:nowrap;
}
@media (max-width:760px){
  .plate-row{
    grid-template-columns:1fr;
  }
  .plate-btn{
    width:100%;
    min-width:0;
  }
}
