* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1220;
    --bg-soft: #131d31;
    --panel: #ffffff;
    --panel-2: #f5f7fb;
    --line: #e6ebf3;
    --text: #162033;
    --muted: #70809a;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --green: #16a34a;
    --orange: #ea8a12;
    --red: #dc2626;
    --gray: #94a3b8;
    --shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Inter, Arial, sans-serif;
    background: linear-gradient(180deg, #eef3fa 0%, #e9eff8 100%);
    color: var(--text);
    min-height: 100%;
}

body {
    padding: 18px;
}

.app-shell {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 18px;
    height: calc(100vh - 36px);
    min-height: calc(100vh - 36px);
}

.sidebar,
.map-panel {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
}

.sidebar {
    padding: 18px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: white;
    border-radius: 20px;
    margin-bottom: 14px;
}

.brand-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    font-size: 26px;
    flex: 0 0 auto;
}

.brand-card h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.1;
}

.brand-card p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 13px;
}

.toolbar-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 14px;
    margin-bottom: 14px;
}

.toolbar-top {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.filters {
    display: grid;
    gap: 10px;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 13px 14px;
    outline: none;
    font-size: 14px;
}

input::placeholder {
    color: #98a6bb;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 12px;
}

.sidebar-head h2 {
    margin: 0;
    font-size: 18px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #e8eefb;
    color: #24437b;
    font-weight: 800;
}

.station-list {
    display: grid;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.station-card {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.station-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.1);
    border-color: #cbd8f1;
}

.station-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.station-card h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.station-meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.station-bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.small {
    font-size: 12px;
    color: var(--muted);
}

.fuel-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.fuel-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #eef2f8;
    color: #52627d;
    border: 1px solid #e2e8f0;
}

.fuel-available {
    background: #e9f8ef;
    color: #13803a;
    border-color: #c9ecd5;
}

.fuel-limited {
    background: #fff4e8;
    color: #b86400;
    border-color: #f3dbbb;
}

.fuel-none {
    background: #fdecec;
    color: #b42318;
    border-color: #f3c9c9;
}

.fuel-unknown {
    background: #eef2f8;
    color: #64748b;
    border-color: #dbe3ee;
}

.map-panel {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.map-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.map-topbar h2 {
    margin: 0;
    font-size: 22px;
}

.map-topbar p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.dot-green {
    background: var(--green);
}

.dot-orange {
    background: var(--orange);
}

.dot-red {
    background: var(--red);
}

.dot-gray {
    background: var(--gray);
}

#map {
    width: 100%;
    flex: 1;
    min-height: 500px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid #d9e2f0;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.15s ease;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-soft {
    background: #eef3fb;
    color: #29456f;
}

.btn-success {
    background: #16a34a;
    color: white;
}

.btn-warning {
    background: #ea8a12;
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-available {
    background: #e9f8ef;
    color: #13803a;
    border-color: #c9ecd5;
}

.status-limited {
    background: #fff4e8;
    color: #b86400;
    border-color: #f3dbbb;
}

.status-none {
    background: #fdecec;
    color: #b42318;
    border-color: #f3c9c9;
}

.status-unknown {
    background: #eef2f8;
    color: #64748b;
    border-color: #dbe3ee;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 32, 0.55);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 9999;
}

.hidden {
    display: none;
}

.modal-card {
    width: min(1000px, 100%);
    background: #fff;
    border-radius: 26px;
    padding: 22px;
    position: relative;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #eef2f8;
    color: #22324d;
    font-size: 26px;
    cursor: pointer;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-right: 52px;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
}

.modal-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}

.modal-section {
    border: 1px solid var(--line);
    background: #fbfcfe;
    border-radius: 20px;
    padding: 16px;
}

.modal-section h4 {
    margin: 0 0 14px;
    font-size: 17px;
}

.recent-reports {
    display: grid;
    gap: 14px;
}

.fuel-report-group {
    display: grid;
    gap: 8px;
}

.fuel-report-title {
    font-size: 13px;
    font-weight: 800;
    color: #31425f;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.report-item {
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e8edf5;
    color: #23304a;
    font-size: 14px;
}

.report-fuel-select {
    margin-bottom: 12px;
}

.report-fuel-select label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.report-actions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.help-text {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.fuel-status-summary {
    margin-bottom: 14px;
}

.fuel-summary-grid {
    display: grid;
    gap: 10px;
}

.fuel-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: white;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 14px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 18px;
    background: #fff;
    border: 1px dashed #dbe4f0;
    border-radius: 16px;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }

    .sidebar {
        min-height: auto;
        height: auto;
    }

    .station-list {
        max-height: 360px;
        flex: unset;
    }

    .map-panel {
        min-height: auto;
        height: auto;
    }

    #map {
        height: 60vh;
        min-height: 420px;
        flex: unset;
    }
}

@media (max-width: 800px) {
    body {
        padding: 12px;
    }

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

    .toolbar-top {
        flex-direction: column;
    }

    .map-topbar {
        align-items: flex-start;
    }

    #map {
        height: 55vh;
        min-height: 360px;
    }
}