@font-face { font-family: Manrope; font-weight: 600; src: url(/assets/fonts/Manrope-600.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Manrope; font-weight: 700; src: url(/assets/fonts/Manrope-700.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Inter; font-weight: 400; src: url(/assets/fonts/Inter-Regular.otf) format('opentype'); font-display: swap; }
@font-face { font-family: Inter; font-weight: 500; src: url(/assets/fonts/Inter-Medium.otf) format('opentype'); font-display: swap; }

:root {
  --navy: #0B1B33; --navy-2: #13284A; --navy-3: #1D3660; --cloud: #F4F7FB; --line: #DCE3EE;
  --aqua: #2FD4C8; --blue: #2E6BFF; --muted: #6B7A90; --ok: #1FA971; --warn: #E8A33D; --off: #9AA6B8; --err: #D9475A;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
body { font: 14px/1.45 Inter, system-ui, sans-serif; color: var(--navy); background: var(--cloud); }
h1, h2, h3 { font-family: Manrope, Inter, sans-serif; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
button, input, select { font: inherit; }
.hidden { display: none !important; }

/* Prisijungimas */
.auth { min-height: 100%; display: grid; place-items: center; background: var(--navy); padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card img { width: 220px; display: block; margin: 0 auto 8px; }
.auth-card .slogan { text-align: center; color: #8FA3C2; font-family: Manrope; font-weight: 600; letter-spacing: .08em; margin-bottom: 32px; font-size: 12px; text-transform: uppercase; }
.auth form { background: #fff; border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.auth h2 { font-size: 20px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--navy); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,107,255,.15); }
.btn { border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-weight: 500; background: var(--cloud); color: var(--navy); }
.btn:hover { background: #E8EEF6; }
.btn-primary { background: var(--aqua); color: var(--navy); font-weight: 600; }
.btn-primary:hover { background: #27C2B7; }
.btn-ghost { background: transparent; color: #C8D4E6; }
.btn-ghost:hover { background: var(--navy-2); }
.error { color: var(--err); font-size: 13px; min-height: 18px; }
.note { color: var(--muted); font-size: 12px; }

/* Pagrindinis langas */
.shell { display: grid; grid-template-rows: 56px 1fr; height: 100%; }
.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 20px; padding: 0 16px; }
.top img { height: 22px; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab { background: transparent; border: 0; color: #8FA3C2; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.tab.active { color: #fff; background: var(--navy-2); }
.top .who { margin-left: auto; color: #8FA3C2; font-size: 13px; }
.main { display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.side { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.side-head .row { display: flex; justify-content: space-between; align-items: baseline; }
.side-head h3 { font-size: 15px; }
.counts { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.list { overflow: auto; flex: 1; }
.veh { padding: 12px 16px; border-bottom: 1px solid #EEF2F7; cursor: pointer; display: grid; grid-template-columns: 10px 1fr auto; gap: 4px 10px; align-items: center; }
.veh:hover { background: #F7F9FC; }
.veh.sel { background: #EAF1FF; }
.veh .plate { font-family: Manrope; font-weight: 700; font-size: 15px; }
.veh .sub { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.veh .spd { font-size: 12px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); }
.dot.moving { background: var(--ok); } .dot.idle { background: var(--warn); } .dot.parked { background: var(--blue); }
.empty { padding: 32px 20px; color: var(--muted); text-align: center; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }
.detail { position: absolute; top: 12px; right: 12px; width: 340px; max-height: calc(100% - 24px); overflow: auto; background: #fff; border-radius: var(--r); box-shadow: 0 6px 24px rgba(11,27,51,.15); z-index: 500; }
.detail-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.detail-head .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.kv div span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.kv div b { font-weight: 500; }
.trips { padding: 8px 0; }
.trip { padding: 10px 16px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px; }
.trip:hover, .trip.sel { background: #F2F6FC; }
.trip .t { font-weight: 500; } .trip .m { color: var(--muted); font-size: 12px; }
.sum { padding: 10px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.x { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }

/* Administravimas */
.admin { overflow: auto; padding: 24px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-content: start; }
.card { background: #fff; border-radius: var(--r); border: 1px solid var(--line); }
.card h3 { font-size: 15px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card form { padding: 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-bottom: 1px solid var(--line); }
.card form .full { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 16px; }
td { padding: 8px 16px; border-top: 1px solid #EEF2F7; }
.link-box { margin: 12px 16px; padding: 10px; background: var(--cloud); border-radius: 8px; word-break: break-all; font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--cloud); font-size: 12px; }
.leaflet-container { font: inherit; }
.car-icon { background: none; border: 0; }
.car-icon div { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }

@media (max-width: 800px) {
  .main { grid-template-columns: 1fr; grid-template-rows: 40% 60%; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail { left: 12px; width: auto; }
  .tabs { display: none; }
}
.car-icon .c-moving { background: var(--ok); } .car-icon .c-idle { background: var(--warn); }
.car-icon .c-parked { background: var(--blue); } .car-icon .c-offline, .car-icon .c-none { background: var(--off); }
input, select { width: 100%; min-width: 0; }
.card form > *, label { min-width: 0; }
.side-head input { width: 100%; }
.car-icon div { width: 22px; height: 22px; transition: transform .6s ease; }
.car-icon div.arrow { border-radius: 0; border: 0; box-shadow: none; background: none !important; width: 0; height: 0;
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 22px solid var(--ok);
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.check { display: flex; align-items: center; gap: 8px; color: var(--navy); font-size: 13px; }
.check input { width: auto; }
.live { color: var(--ok); font-size: 11px; font-weight: 600; text-transform: uppercase; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.kv div b span.live { display: inline; color: var(--ok); font-size: 11px; letter-spacing: .04em; }
