/* Huisstijl overgenomen van de oude tracking.combi-outboards.com:
   witte bovenbalk met logo, Combi-groen (#4c9c2c) voor actief, donkergrijs (#3c3b42) rechtermenu,
   witte voertuigregels met bootafbeelding en lichtgroen (#b9ede3) als de motor aan staat. */
:root {
    --green: #4c9c2c;
    --green-dark: #3d8123;
    --green-soft: #e9f3e5;
    --dark: #3c3b42;
    --dark-2: #525158;
    --on-dark: #f4f4f4;
    --text: #3c3b42;
    --title: #242a30;
    --muted: #707478;
    --line: #cccccc;
    --active: #b9ede3;
    --blue: #3598db;
    --alarm: #d0352b;
    --map: #d9e0e7;
    font-family: Roboto, "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; color: var(--text); background: #fff; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; }
input { font: inherit; color: rgba(0, 0, 0, .87); }

/* ---------- Inloggen ---------- */
.login { height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: #2b3d2b url("img/login-background.jpg") center / cover no-repeat; }
.card { width: 100%; max-width: 480px; background: #fff; padding: 24px 24px 48px; box-shadow: 0 3px 12px rgba(0,0,0,.25);
    display: flex; flex-direction: column; align-items: stretch; gap: 22px; }
.logo-big { align-self: center; width: 170px; height: auto; margin-bottom: 6px; }
.card input { margin: 0 0 0 33px; border: 0; border-bottom: 1px solid #949494; padding: 6px 0; font-size: 16px; outline: 0; background: transparent; }
.card input:focus { border-bottom: 2px solid var(--blue); padding-bottom: 5px; }
.card input::placeholder { color: #757575; }
.card button { background: var(--blue); color: #fff; padding: 9px; font-size: 14px; font-weight: 300; border-radius: 2px; box-shadow: 0 2px 2px rgba(0,0,0,.2); }
.card button:hover { background: #2a87c5; }
.error { color: var(--alarm); margin: 0 0 0 33px; font-size: 14px; }

/* ---------- Bovenbalk ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.bar { height: 54px; flex: none; display: flex; align-items: stretch; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.18); position: relative; z-index: 1001; padding: 0 16px 0 32px; }
.logo { height: 30px; align-self: center; margin-right: 26px; }
.nav { display: flex; }
.nav a { display: flex; align-items: center; padding: 0 16px; color: #3a1c39; font-size: 14px; font-weight: 300; text-decoration: none; }
.nav a.active { color: var(--green); background: var(--green-soft); }
.spacer { flex: 1; }
.pill { align-self: center; font-size: 12px; padding: 2px 9px; border-radius: 10px; background: #e0e0e0; color: var(--muted); margin-right: 16px; }
.pill.on { background: var(--green); color: #fff; }
.user { align-self: center; font-size: 14px; margin-right: 12px; }
.link { background: none; color: var(--text); font-size: 14px; font-weight: 300; }
.link:hover { color: var(--green); }

/* ---------- Kaart + rechtermenu ---------- */
.main { flex: 1; min-height: 0; display: flex; }
.map { flex: 1; min-width: 0; background: var(--map); }
.side { width: 340px; flex: none; display: flex; flex-direction: column; background: #fff; min-height: 0; box-shadow: -1px 0 3px rgba(0,0,0,.2); z-index: 1000; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-head { background: var(--dark); padding: 16px 16px 8px; }
.side-head input { width: 100%; height: 48px; border: 0; padding: 0 12px; text-align: center; font-size: 16px; outline: 0; }
.side-head input::placeholder { color: #9e9e9e; }
.back { width: 100%; height: 46px; background: var(--green); color: var(--on-dark); font-size: 16px; font-weight: 300; border-radius: 2px; box-shadow: 0 2px 2px rgba(0,0,0,.2); }
.back:hover { background: var(--green-dark); }
.side-bar, .side-foot { display: flex; background: var(--dark); }
.side-bar { height: 48px; }
.side-foot { height: 48px; flex: none; }
.flat { flex: 1; background: none; color: var(--on-dark); font-size: 14px; font-weight: 300; }
.flat:hover { background: rgba(255,255,255,.08); }
.side-bar .flat.live:not(.active) { color: #9e9e9e; text-decoration: line-through; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--alarm); color: #fff; font-size: 11px; line-height: 18px; margin-left: 4px; }

/* Voertuigregels: afbeelding links, naam, straat, datum/tijd */
.vlist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.vlist.card-only { flex: none; overflow: visible; }
.vlist li { position: relative; display: flex; align-items: center; height: 83px; border-bottom: 1px solid var(--line); cursor: pointer; background: #fff; }
.vlist li:hover { background: #f5f5f5; }
.vlist li.on { background: var(--active); }
.vlist li.on:hover { background: #abe3d8; }
.vlist li.selected { box-shadow: inset 4px 0 0 var(--green); }
.vlist li.empty { height: auto; padding: 16px; color: var(--muted); cursor: default; }
.vimg { width: 88px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.vimg img { width: 48px; height: 48px; object-fit: contain; }
.vtext { flex: 1; min-width: 0; padding-right: 10px; }
.vtext h4 { margin: 0 0 2px; font-size: 16px; font-weight: 500; color: var(--title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtext div { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 20px; }
.vtext b { font-weight: 700; color: var(--muted); }
.vtext .geofence { color: var(--green); font-weight: 500; }
.vbat { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; }
.vspeed { position: absolute; right: 8px; bottom: 6px; font-size: 12px; font-weight: 500; color: var(--green); }
.vlist li.offline .vimg img { opacity: .5; filter: grayscale(.6); }

/* Gele Nederlandse kentekenplaat */
.license { height: 18px; min-width: 76px; padding: 0 6px 0 14px; background: #fc0 url("img/license_left.gif") left center / 10px 18px no-repeat;
    border: 1px solid #333; border-radius: 3px; color: #000; font-size: 11.5px; font-weight: 700; line-height: 16px; text-align: center; letter-spacing: .02em; }

/* Gekozen boot: datum/van/tot en tabbladen Route / Ritten */
.range { display: flex; border-bottom: 1px solid var(--line); }
.range label { flex: 1; display: flex; flex-direction: column; padding: 6px 7px 4px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); min-width: 0; }
.range label:last-child { border-right: 0; }
.range input { border: 0; padding: 2px 0; font-size: 16px; background: transparent; outline: 0; min-width: 0; width: 100%; }
.dtabs { display: flex; background: var(--dark); height: 48px; }
.dtab { flex: 1; background: none; color: var(--on-dark); font-size: 14px; font-weight: 300; }
.dtab.active { background: var(--dark-2); }
.dpane { flex: 1; min-height: 0; overflow-y: auto; }
#dtab-route { padding: 12px 16px; font-size: 14px; color: var(--text); }
#dtab-route dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
#dtab-route dt { color: var(--muted); }
#dtab-route dd { margin: 0; font-weight: 500; }
.tlist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.tlist li { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tlist li.clickable { cursor: pointer; }
.tlist li.clickable:hover { background: #f5f5f5; }
.tlist li.empty { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.sub { font-size: 12px; color: var(--muted); }
.right { text-align: right; white-space: nowrap; font-weight: 500; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--alarm); }
.ack { align-self: center; padding: 4px 10px; font-size: 12px; background: var(--green); color: #fff; border-radius: 2px; }

/* Kaartmarker: de bootafbeelding van het voertuig, met een koerspijl als hij vaart */
.vmarker { width: 44px; height: 44px; position: relative; }
.vmarker img { position: absolute; inset: 4px; width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.vmarker.on::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(76,156,44,.25); border: 2px solid var(--green); }
.vmarker.offline img { opacity: .6; filter: grayscale(.7) drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.vmarker.selected::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--blue); }
.vmarker .arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; }
.vmarker .arrow i { position: absolute; left: -6px; top: -32px; border: 6px solid transparent; border-bottom: 10px solid var(--green); border-top: 0; }
.leaflet-tooltip { font-family: inherit; font-size: 12px; }

.toasts { position: fixed; left: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 1100; }
.toast { background: #fff; border-left: 4px solid var(--alarm); padding: 10px 14px; box-shadow: 0 4px 12px rgba(0,0,0,.2); max-width: 320px; font-size: 14px; }

@media (max-width: 760px) {
    .main { flex-direction: column; }
    .side { width: 100%; height: 50%; }
    .bar { padding: 0 12px; }
    .user { display: none; }
}
