/* vehicle-card.css
   ================
   Komponent karty pojazdu w zakladce Historia (i pokrewna karta podsumowania
   kierowcy) - naglowek karty, status/animacje zaplonu, selektor pojazdow,
   lista tras z filtrami, wiersz "Dodaj wykres", oraz popup ze szczegolowa
   tabela parametrow.
*/
  /* --- Karta pojazdu (wspolna dla widoku Pojazdy) --- */
  .vehicle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
  }
  .vehicle-card.unknown { opacity: 0.55; }
  .vehicle-card.compact { padding: 14px; }

  .driver-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 14px;
  }
  .driver-summary-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }
  .driver-summary-name { font-size: 16px; font-weight: 700; }
  .driver-summary-totals { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: var(--accent-brand); font-size: 13px; }
  .driver-segments-list { display: flex; flex-direction: column; gap: 8px; }
  .driver-segment-row {
    background: var(--surface-2);
    border-radius: 9px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }
  .driver-segment-vrn { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 13px; min-width: 90px; }
  .driver-segment-time { font-size: 11.5px; color: var(--text-dim); flex: 1; }
  .driver-segment-stats { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; white-space: nowrap; }

  .driver-live-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-dim);
    background: var(--surface-2);
    border-radius: 9px;
    padding: 8px 12px;
    margin-bottom: 10px;
  }
  .driver-live-row strong { color: var(--text); font-family: 'IBM Plex Mono', monospace; }
  .driver-live-badge { color: var(--accent-green); font-weight: 700; font-size: 11px; }

  .vcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
  .vrn-row { display: flex; align-items: center; gap: 10px; }

  .status-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
  .status-pulse.on { background: var(--accent-green); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); }

  .vrn { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 19px; letter-spacing: 0.02em; }
  .vrn.idle-ignition { color: var(--accent-amber); animation: vrn-pulse 1.4s ease-in-out infinite; }
  .vrn.idle-engine { color: var(--accent-red); animation: vrn-pulse 1.4s ease-in-out infinite; }
  @keyframes vrn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

  .idle-alert-note { font-size: 11px; margin-top: 2px; margin-left: 20px; font-weight: 600; }
  .idle-alert-note.idle-ignition { color: var(--accent-amber); }
  .idle-alert-note.idle-engine { color: var(--accent-red); }
  .vin-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; margin-left: 20px; }
  /* --- Selektor pojazdow (zakladka Pojazdy) --- */
  .vehicle-selector { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .vehicle-selector button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
  }
  .vehicle-selector button.active { background: var(--accent-brand); color: #14181D; border-color: var(--accent-brand); font-family: 'Inter', sans-serif; }
  /* --- Trasy --- */
  .trips-container { margin-top: 14px; }
  .trips-range-picker { margin-bottom: 10px; }
  .trips-range-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .trips-range-presets button {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
    color: var(--text-dim); font-family: inherit; font-size: 11px; font-weight: 600;
    cursor: pointer; padding: 5px 9px;
  }
  .trips-range-presets button.active { background: var(--accent-brand); color: #14181D; border-color: var(--accent-brand); }
  .trips-range-custom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .trips-range-custom input[type="date"] {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
    color: var(--text); font-family: inherit; font-size: 11.5px; padding: 5px 7px;
  }
  .trips-range-custom span { color: var(--text-dim); font-size: 11px; }
  .trips-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
  .trips-filter-row label { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
  .trips-filter-row input[type="number"] {
    width: 64px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
    color: var(--text); font-family: inherit; font-size: 11.5px; padding: 5px 7px;
  }
  .trips-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
  .trips-summary-tile { background: var(--surface-2); border-radius: 9px; padding: 8px 9px; text-align: center; }
  .trips-summary-value { font-size: 14px; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
  .trips-summary-unit { font-size: 10px; font-weight: 400; color: var(--text-dim); }
  .trips-summary-label { font-size: 9.5px; color: var(--text-dim); margin-top: 1px; }
  .trip-row {
    display: flex; flex-direction: column; gap: 4px;
    padding: 9px 10px; background: var(--surface-2); border-radius: 9px; margin-bottom: 6px; font-size: 12px;
    cursor: pointer;
  }
  .trip-row-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .trip-row:active { background: var(--border); }
  .trip-row.ongoing { border: 1px solid rgba(52, 211, 153, 0.4); }
  .trip-row.trip-row-selected { background: rgba(76, 122, 212, 0.16); border: 1px solid rgba(76, 122, 212, 0.5); }
  .trip-time .trip-date { font-weight: 600; }
  .trip-time .trip-range { color: var(--text-dim); font-size: 11px; margin-top: 1px; }
  .trip-metrics { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
  .trip-metrics .trip-main-metric { color: var(--text); font-weight: 600; font-size: 13px; }
  .trip-speed-info { font-size: 10.5px; color: var(--text-dim); }
  .trip-driver { font-size: 11px; color: var(--text); font-weight: 600; margin-top: 2px; }
  .trip-locations { font-size: 10.5px; color: var(--text-dim); display: flex; flex-direction: column; gap: 2px; }
  .trip-location-row { display: flex; align-items: center; gap: 6px; }
  .trip-location-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .trip-location-dot.start { background: var(--accent-brand); }
  .trip-location-dot.end { background: var(--accent-red); }
  .trip-location-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .trips-loading, .trips-empty { font-size: 12.5px; color: var(--text-dim); padding: 6px 0; }

  /* --- Wiersz filtrow historii + przycisk "Dodaj wykres" (na wysokosci
     filtrow, po prawej) - patrz .vehicle-charts-section nizej. --- */
  .vcard-filters-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
  .vcard-filters-row .trips-range-picker { flex: 1; min-width: 240px; }
  .vcard-chart-actions { flex-shrink: 0; }
  .vehicle-charts-section:empty { display: none; }
  .vehicle-charts-section { margin: 12px 0; }

  /* --- Szczegoly (tabela parametrow - popup Floty ORAZ dawna rozwijana
     wersja) - siatka CSS z DWOMA kolumnami o stalej szerokosci pierwszej
     kolumny, zeby wartosci wyrownywaly sie pionowo miedzy wierszami (samo
     "flex + space-between" tego nie gwarantuje, bo kazdy wiersz liczy
     szerokosc niezaleznie od pozostalych). --- */
  .details-table { display: none; margin-top: 10px; font-size: 12.5px; }
  .details-table .row {
    display: grid; grid-template-columns: minmax(120px, 40%) 1fr; align-items: baseline;
    padding: 7px 0; border-bottom: 1px solid var(--border); gap: 14px;
  }
  .details-table .row:last-child { border-bottom: none; }
  .details-table .row .k { color: var(--text-dim); }
  .details-table .row .v { font-family: 'IBM Plex Mono', monospace; text-align: right; word-break: break-word; }

  .unknown-msg { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

