:root {
  --pad: 10px;
  --radius: 12px;
  --border: #e6e6e6;
  --text: #111;
  --muted: #666;
  --bg: #fff;
  --bg2: #fafafa;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* --------------------- */
/* HEADER                */
/* --------------------- */

.header {
  padding: var(--pad);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* --------------------- */
/* COMPACT TOPBAR        */
/* --------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-logo {
  height: 56px;
  width: auto;
}

.topbar-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;

  background: linear-gradient(90deg, #111, #e10600);

  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* --------------------- */
/* SEARCH ROW            */
/* --------------------- */

.row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
}

.field span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
}

.btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-secondary {
  background: var(--bg2);
  color: var(--text);
}

/* --------------------- */
/* STATUS                */
/* --------------------- */

.status {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

/* --------------------- */
/* INFO GRID             */
/* --------------------- */

.info-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
}

.k {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.v {
  font-weight: 600;
  font-size: 14px;
}

/* Tijd weergave (compact) */

.time-main {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

.time-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.1;
}

/* --------------------- */
/* HISTORY BUTTONS       */
/* --------------------- */

.history {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.history .btn {
  padding: 6px 8px;
  font-size: 13px;
}

/* --------------------- */
/* MAP                   */
/* --------------------- */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#map {
  width: 100%;
  flex: 1;
  min-height: 340px;
}

/* --------------------- */
/* TABLET                */
/* --------------------- */

@media (max-width: 1024px) {

  .row {
    grid-template-columns: 1fr auto 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .history {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* --------------------- */
/* MOBILE                */
/* --------------------- */

@media (max-width: 700px) {

  .brand {
    margin-bottom: 6px;
  }

  .row {
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
  }

  .field input {
    padding: 7px 8px;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
  }

  .history {
    grid-template-columns: 1fr 1fr 1fr;
  }

  #map {
    min-height: 300px;
  }
}

/* -------------------------------- */
/* Custom Leaflet markers           */
/* -------------------------------- */


#mapCopyright {
  position: absolute;
  bottom: 28px; /* omhoog verschoven i.v.m. OSM attribution */
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 8px;
  pointer-events: none;
  z-index: 999;
}


.main {
  position: relative;
}
.schema-indicator {
  color: #ff0000;
  font-weight: 600;
  font-size: 10px;          /* iets kleiner */
  line-height: 1;           /* voorkomt verticale verschuiving */
  display: flex;
  align-items: center;      /* exact gelijk met logo/tekst */
}

.line-badge {
  background: #f9d519;
  color: #000;
  font-weight: bold;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  font-size: 14px;
}

.user-dot {
  width: 16px;
  height: 16px;
  background: #0066ff;
  border-radius: 50%;
  border: 3px solid white;
}

.badge-red,
.badge-orange,
.badge-yellow {
  font-weight: bold;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  font-size: 14px;
}

.badge-red {
  background: #ff3b3b;
  color: #fff;
}

.badge-orange {
  background: #ff9800;
  color: #000;
}

.badge-yellow {
  background: #f9d519;
  color: #000;
}


.toolbar input {
    height: 36px;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 0 6px;
    font-size: 14px;
    text-align: center;
}

#omloopInput {
    width: 7ch;
}

#lijnInput {
    width: 4ch;
}

#vehicleInput {
    width: 5ch;
}

#searchButton {
    height: 36px;
    padding: 0 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
/* ===== Ultra-compact toolbar ===== */

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    box-sizing: border-box;
    flex-wrap: wrap;                 /* automatisch wrappen */
}

/* Inputs */
.toolbar input {
    height: 34px;
    line-height: 34px;
    font-size: 13px;
    padding: 0 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
    text-align: center;
    box-sizing: border-box;

    flex: 0 0 auto;                  /* niet laten groeien */
}

/* Exacte breedtes op basis van digits */
#inpOmloop  { width: 7ch; min-width: 80px; }
#lineInput  { width: 4ch; min-width: 55px; }
#inpVehicle { width: 5ch; min-width: 75px; }

/* Zoekknop — toolbar specifiek */
.toolbar #btnZoek {
    height: 34px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 13px;

    flex: 0 0 auto;                  /* niet laten groeien */
}

.date-label {
  font-weight: normal;
  color: #666;
  margin-left: 6px;
  font-size: 11px;
}