/* HIVELOCK LAYER FIXES
   Ten plik jest ładowany po style.css i fleet-list-controller.css.
   Nie dopisywać już takich poprawek do style.css.
*/

/* Historia trasy/czujników zawsze nad topbarem */
body #device-history-modal.device-history-modal {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 2147483400 !important;
    box-sizing: border-box !important;
}

/* Wnętrze historii ma mieć własny scroll, nie topbar */
body #device-history-modal .device-history-shell {
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Header historii ma być klikalny i na wierzchu modala */
body #device-history-modal .device-history-header {
    position: relative !important;
    top: auto !important;
    z-index: 2 !important;
}

/* Ciało historii nie może wychodzić pod topbar */
body #device-history-modal .device-history-body {
    max-height: calc(100vh - 170px) !important;
    overflow: hidden !important;
}

/* Gdy historia jest otwarta, topbar znika całkowicie */
body.device-history-open #app-header,
body.device-history-open .app-topbar,
body.device-history-open #hivelock-header-tools-menu,
body.device-history-open .hivelock-header-tools-menu {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Gdy użytkownik jest wylogowany, topbar znika całkowicie */
body.hivelock-auth-logged-out #app-header,
body.hivelock-auth-logged-out .app-topbar,
body.hivelock-auth-logged-out #hivelock-header-tools-menu,
body.hivelock-auth-logged-out .hivelock-header-tools-menu {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Device history route click popup */
.device-history-route-time-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
}

.device-history-route-time-popup .leaflet-popup-content {
    margin: 12px 14px;
    color: #0f172a;
    font-size: 0.86rem;
    line-height: 1.45;
}

.device-history-route-time-popup .leaflet-popup-content strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.92rem;
    font-weight: 900;
}

.device-history-route-time-popup .leaflet-popup-content small {
    color: #64748b;
}
