body {
    background: #f5f7fb;
}

/* Scroll virker ikke når form-wrapperen bryder Bootstrap modalens flex-layout.
   Gør formularen til flex-kolonne så .modal-body kan få intern scroll. */
.modal-dialog-scrollable .modal-content > form.ajax-form {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    min-height: 0;
}

.modal-dialog-scrollable .modal-content > form.ajax-form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .nav-link:hover {
    color: #fff;
}

.navbar-user-info {
    white-space: nowrap;
}

pre {
    overflow-x: auto;
}

.stat-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.table thead th {
    white-space: nowrap;
}

.badge-soft {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.section-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.sensor-status {
    min-width: 95px;
}

.history-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(13, 110, 253, 0.08);
    border-radius: 1rem;
    padding: 1rem;
}

.history-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    min-height: 140px;
    padding: 0.5rem 0;
}

.history-bar-group {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.history-bar {
    width: 100%;
    min-height: 12px;
    background: linear-gradient(180deg, #0d6efd 0%, #6ea8fe 100%);
    border-radius: 0.75rem 0.75rem 0 0;
}

.history-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.35rem;
}

.history-bar-label,
.history-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.sensor-metric {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.sensor-metric-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.2rem;
}

.sensor-metric-value {
    font-weight: 600;
}

.chart-wrap {
    position: relative;
    min-height: 360px;
}

@media (max-width: 575.98px) {
    .chart-wrap {
        min-height: 260px;
    }
}

/* Admin visuel adskillelse */
.admin-nav {
    border-top: 4px solid #dc3545;
}

.admin-nav .navbar-brand .admin-badge {
    font-size: 0.6em;
    vertical-align: middle;
    margin-left: 0.4rem;
    letter-spacing: 0.05em;
}

/* Bruger-avatar cirkel i navbar */
.user-avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.admin-nav .user-avatar-circle {
    background: rgba(220, 53, 69, 0.4);
}

/* Dropdown admin-sektion header */
.dropdown-header.admin-section {
    color: #dc3545;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sensor-map {
    height: 320px;
    border-radius: 0.75rem;
    border: 1px solid #dee2e6;
    clip-path: inset(0 round 0.75rem);
}

.sensor-map-small {
    height: 220px;
}

@media (max-width: 575.98px) {
    .sensor-map-small {
        height: 160px;
    }

    /* Leaflet sætter touch-action: none på containeren, hvilket blokerer modal-scroll.
       pan-y tillader vertikal scroll mens taps stadig registreres. */
    .sensor-map .leaflet-container {
        touch-action: pan-y !important;
    }
}

.sensor-map-tall {
    height: 520px;
}

.leaflet-scroll-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
}

.sensor-table-row {
    cursor: pointer;
}

.sensor-table-row:hover {
    background: #f8fbff;
}

.action-buttons {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
    white-space: nowrap;
}

.sla-row-critical {
    background: rgba(220, 53, 69, 0.08);
}

.sla-row-warning {
    background: rgba(255, 193, 7, 0.12);
}

.sla-row-ok {
    background: rgba(25, 135, 84, 0.06);
}

.sla-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.sla-pill-critical {
    background: rgba(220, 53, 69, 0.12);
    color: #a60b22;
    border: 1px solid rgba(220, 53, 69, 0.28);
}

.sla-pill-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #7a5a00;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.sla-pill-neutral {
    background: rgba(108, 117, 125, 0.14);
    color: #495057;
    border: 1px solid rgba(108, 117, 125, 0.3);
}
