/* ===== Rosenbauer-inspired design: clean white, red accent, professional ===== */

:root {
    --rb-red: #e2001a;
    --rb-red-dark: #b80015;
    --rb-gray-100: #f8f9fa;
    --rb-gray-200: #e9ecef;
    --rb-gray-600: #6c757d;
    --rb-gray-800: #343a40;
    --rb-white: #ffffff;
    --rb-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --rb-sidebar-width: 300px;
    --rb-header-height: 56px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--rb-gray-100);
}

/* Header */
.rb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--rb-header-height);
    padding: 0 24px;
    background: linear-gradient(135deg, #bfc0c3 0%, var(--rb-red) 100%);
    color: var(--rb-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
}

.rb-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rb-logo {
    height: 36px;
    width: auto;
}

.rb-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

.rb-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Layout */
.rb-container {
    display: flex;
    height: calc(100vh - var(--rb-header-height));
    margin-top: var(--rb-header-height);
}

/* Sidebar */
.rb-sidebar {
    width: var(--rb-sidebar-width);
    min-width: var(--rb-sidebar-width);
    background: var(--rb-white);
    border-right: 1px solid var(--rb-gray-200);
    padding: 20px;
    overflow-y: auto;
    box-shadow: var(--rb-shadow);
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rb-gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--rb-red);
}

.filter-section {
    margin-bottom: 24px;
}

/* Summary Cards */
.summary-section {
    margin-top: 16px;
}

.summary-card {
    background: var(--rb-gray-100);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    text-align: center;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rb-red);
}

.summary-label {
    font-size: 0.75rem;
    color: var(--rb-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Main map area */
.rb-main {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
}

#error-overlay {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

/* Rating badges */
.bg-rating-a {
    background-color: #28a745 !important;
    color: white;
}

.bg-rating-b {
    background-color: #e6c200 !important;
    color: #333;
}

.bg-rating-c {
    background-color: #fd7e14 !important;
    color: white;
}

.bg-rating-d {
    background-color: #e2001a !important;
    color: white;
}

.bg-rating-none {
    background-color: #4a90d9 !important;
    color: white;
}

/* Form tweaks */
.form-control-sm {
    border-radius: 6px;
}

.form-check-label {
    font-size: 0.85rem;
}

.form-switch .form-check-input:checked {
    background-color: var(--rb-red);
    border-color: var(--rb-red);
}

/* Leaflet popup styling */
.leaflet-popup-content {
    font-size: 0.85rem;
    line-height: 1.5;
    min-width: 200px;
}

.leaflet-popup-content .popup-company {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--rb-gray-800);
}

.leaflet-popup-content .popup-address {
    color: #555;
    font-size: 0.82rem;
}

.leaflet-popup-content .popup-rating {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    margin-top: 4px;
}

.leaflet-popup-content .popup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.leaflet-popup-content .btn-dynamics {
    display: inline-block;
    padding: 6px 14px;
    background: var(--rb-red);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.leaflet-popup-content .btn-dynamics:hover {
    background: var(--rb-red-dark);
    color: white;
}

.leaflet-popup-content .btn-navigate {
    display: inline-block;
    padding: 6px 14px;
    background: #198754;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.leaflet-popup-content .btn-navigate:hover {
    background: #146c43;
    color: white;
}

/* Fire truck marker */
.firetruck-marker {
    background: none !important;
    border: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .rb-header {
        padding: 0 12px;
    }

    .rb-title {
        font-size: 0.95rem;
    }

    .user-name {
        display: none;
    }

    .rb-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 35vh;
        padding: 12px;
    }

    .rb-container {
        flex-direction: column;
    }

    .filter-title {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .summary-section {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .summary-card {
        flex: 1;
        min-width: 70px;
        padding: 8px;
    }

    .summary-value {
        font-size: 1.1rem;
    }

    .leaflet-popup-content {
        font-size: 0.9rem;
    }

    .leaflet-popup-content .popup-actions {
        flex-direction: column;
    }

    .leaflet-popup-content .btn-dynamics,
    .leaflet-popup-content .btn-navigate {
        text-align: center;
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}
}