:root {
    --bg: #08111f;
    --bg-2: #0d1727;

    --panel: rgba(17, 29, 48, 0.92);
    --panel-light: #16243a;

    --border: rgba(148, 163, 184, 0.12);

    --text: #f8fafc;
    --muted: #91a0b5;

    --blue: #3b82f6;
    --blue-light: #60a5fa;

    --green: #22c55e;
    --red: #ef4444;
    --orange: #f59e0b;

    --radius: 20px;

    --shadow:
        0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--text);
    background:
        radial-gradient(
            circle at top right,
            rgba(59, 130, 246, 0.10),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #07101d,
            #0a1424 50%,
            #0c1728
        );

    overflow: hidden;
}

/* =========================================
   APP
========================================= */

.app {
    width: 100%;
    height: 100vh;

    display: flex;
    gap: 14px;

    padding: 14px;
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar {
    width: 84px;
    min-width: 84px;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 18px 12px;

    background:
        linear-gradient(
            180deg,
            rgba(17, 29, 48, 0.98),
            rgba(11, 20, 34, 0.98)
        );

    border: 1px solid var(--border);
    border-radius: 24px;

    box-shadow: var(--shadow);
}

.logo {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            #2563eb
        );

    color: #fff;

    font-size: 14px;
    font-weight: 800;

    box-shadow:
        0 8px 25px rgba(59, 130, 246, 0.35);
}

.sidebar-menu {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 10px;

    margin-top: 32px;
}

.sidebar-link {
    width: 100%;
    height: 50px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--muted);
    text-decoration: none;

    border-radius: 15px;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.sidebar-link.active {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #3b82f6,
            #2563eb
        );

    box-shadow:
        0 8px 24px rgba(37, 99, 235, 0.28);
}

.sidebar-link.active::before {
    content: "";

    position: absolute;
    left: -13px;

    width: 3px;
    height: 22px;

    background: #60a5fa;

    border-radius: 0 4px 4px 0;
}

.sidebar-link i {
    font-size: 17px;
}

.sidebar-bottom {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 10px;

    margin-top: auto;
}

/* =========================================
   MAIN
========================================= */

.main {
    flex: 1;

    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    gap: 14px;
}

/* =========================================
   TOPBAR
========================================= */

.topbar {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.page-title h1 {
    color: #fff;

    font-size: 22px;
    font-weight: 700;

    letter-spacing: -0.5px;
}

.page-title p {
    margin-top: 4px;

    color: var(--muted);

    font-size: 12px;
}

.topbar-right {
    display: flex;
    align-items: center;

    gap: 12px;
}

.search {
    width: 270px;
    height: 44px;

    display: flex;
    align-items: center;

    padding: 0 14px;

    background: rgba(17, 29, 48, 0.82);

    border: 1px solid var(--border);
    border-radius: 14px;

    backdrop-filter: blur(20px);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.search:focus-within {
    border-color: rgba(59, 130, 246, 0.45);

    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.08);
}

.search i {
    color: #7f8da1;

    font-size: 14px;
}

.search input {
    width: 100%;

    margin-left: 10px;

    border: none;
    outline: none;

    background: transparent;

    color: #fff;

    font: inherit;
    font-size: 13px;
}

.search input::placeholder {
    color: #738197;
}

.icon-button,
.avatar {
    width: 44px;
    height: 44px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(17, 29, 48, 0.82);

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.icon-button {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--muted);

    cursor: pointer;
}

.icon-button:hover,
.avatar:hover {
    color: #fff;
    background: var(--panel-light);
    transform: translateY(-1px);
}

.notification-dot {
    position: absolute;

    top: 8px;
    right: 8px;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--red);

    box-shadow:
        0 0 10px rgba(239, 68, 68, 0.65);
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

/* =========================================
   DASHBOARD
========================================= */

.dashboard {
    flex: 1;

    min-width: 0;
    min-height: 0;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        340px;

    gap: 14px;
}

/* =========================================
   MAP
========================================= */

.map-card {
    position: relative;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #142239,
            #0e1829
        );

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

#map {
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;

    top: 16px;
    left: 16px;

    z-index: 500;

    display: flex;

    gap: 8px;
}

.map-pill {
    display: flex;
    align-items: center;

    gap: 8px;

    padding: 9px 12px;

    color: #dbeafe;

    background: rgba(8, 17, 31, 0.84);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;

    backdrop-filter: blur(18px);

    font-size: 11px;
}

.live-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 12px rgba(34, 197, 94, 0.85);
}

/* =========================================
   RIGHT PANEL
========================================= */

.right-panel {
    min-height: 0;

    display: flex;
    flex-direction: column;

    gap: 14px;
}

.glass-card {
    background:
        linear-gradient(
            180deg,
            rgba(17, 29, 48, 0.92),
            rgba(13, 24, 40, 0.92)
        );

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    backdrop-filter: blur(18px);
}

/* =========================================
   CARD HEADER
========================================= */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 16px;
}

.card-header h2 {
    color: #fff;

    font-size: 14px;
    font-weight: 700;
}

.card-header span {
    color: var(--muted);

    font-size: 10px;
}

/* =========================================
   FLEET
========================================= */

.fleet-card {
    flex: 1;

    min-height: 0;

    display: flex;
    flex-direction: column;

    padding: 18px;

    overflow: hidden;
}

.vehicles {
    min-height: 0;

    overflow-y: auto;

    padding-right: 3px;
}

.vehicles::-webkit-scrollbar {
    width: 5px;
}

.vehicles::-webkit-scrollbar-track {
    background: transparent;
}

.vehicles::-webkit-scrollbar-thumb {
    background: #27364d;
    border-radius: 20px;
}

.vehicle {
    padding: 13px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: 14px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.vehicle:hover {
    background: rgba(255, 255, 255, 0.045);
    transform: translateX(2px);
}

.vehicle-left {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 12px;
}

.vehicle-icon {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: rgba(59, 130, 246, 0.12);

    color: var(--blue-light);

    font-size: 14px;
}

.vehicle-info {
    min-width: 0;
}

.vehicle-info h3 {
    overflow: hidden;

    color: #fff;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.vehicle-info p {
    overflow: hidden;

    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.vehicle-status {
    display: flex;
    align-items: center;

    gap: 6px;

    margin-left: 10px;

    color: var(--muted);

    font-size: 10px;
}

.status-dot {
    width: 6px;
    height: 6px;

    flex-shrink: 0;

    border-radius: 50%;
}

.status-dot.online {
    background: var(--green);

    box-shadow:
        0 0 8px rgba(34, 197, 94, 0.6);
}

.status-dot.offline {
    background: #64748b;
}

/* =========================================
   STATS
========================================= */

.stats {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.stat {
    min-height: 100px;

    padding: 17px;
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.stat-top > span {
    color: var(--muted);

    font-size: 10px;
}

.stat-icon {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    color: var(--blue-light);

    background: rgba(59, 130, 246, 0.10);

    font-size: 11px;
}

.stat h3 {
    margin-top: 10px;

    color: #fff;

    font-size: 25px;
    line-height: 1;
    font-weight: 700;
}

.stat small {
    display: block;

    margin-top: 8px;

    color: var(--green);

    font-size: 9px;
}

.stat small.muted {
    color: var(--muted);
}

.stat small.danger {
    color: #f87171;
}

/* =========================================
   CHART
========================================= */

.chart-card {
    height: 170px;

    padding: 18px;
}

.chart-container {
    width: 100%;
    height: 100px;

    margin-top: 8px;
}

/* =========================================
   ALERTS
========================================= */

.alerts-card {
    padding: 18px;
}

.alert {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 9px 0;

    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.alert:first-of-type {
    border-top: none;
}

.alert-icon {
    width: 30px;
    height: 30px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: rgba(239, 68, 68, 0.10);

    color: #f87171;

    font-size: 11px;
}

.alert-icon.warning {
    background: rgba(245, 158, 11, 0.10);
    color: #fbbf24;
}

.alert-text {
    min-width: 0;
}

.alert-text strong {
    display: block;

    overflow: hidden;

    color: #fff;

    font-size: 10px;
    font-weight: 600;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.alert-text span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 9px;
}

/* =========================================
   LEAFLET
========================================= */

.leaflet-control-zoom {
    display: none;
}

.leaflet-control-attribution {
    background: rgba(8, 17, 31, 0.82) !important;

    color: #94a3b8 !important;

    font-size: 8px;
}

.leaflet-control-attribution a {
    color: #60a5fa !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #111d30;
    color: #fff;
}

.leaflet-popup-content {
    margin: 12px;
    font-family: "Inter", sans-serif;
    font-size: 12px;
}

.leaflet-container a {
    color: #60a5fa;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .right-panel {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .fleet-card {
        min-height: 330px;
    }
}

@media (max-width: 800px) {
    body {
        overflow: auto;
    }

    .app {
        min-height: 100vh;
        height: auto;

        flex-direction: column;

        padding: 8px;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: 68px;

        flex-direction: row;

        padding: 8px 10px;

        border-radius: 18px;
    }

    .sidebar-menu {
        width: auto;

        flex-direction: row;

        margin: 0 0 0 20px;

        overflow-x: auto;
    }

    .sidebar-bottom {
        width: auto;

        flex-direction: row;

        margin-left: auto;
        margin-top: 0;
    }

    .sidebar-link {
        width: 45px;
        min-width: 45px;

        height: 45px;
    }

    .sidebar-link.active::before {
        display: none;
    }

    .main {
        min-height: calc(100vh - 84px);
    }

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

    .search {
        width: 180px;
    }

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

    .map-card {
        min-height: 500px;
    }

    .right-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .topbar {
        align-items: center;
    }

    .topbar-right .icon-button,
    .avatar {
        display: none;
    }

    .search {
        width: 170px;
    }

    .page-title h1 {
        font-size: 18px;
    }

    .page-title p {
        font-size: 10px;
    }

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

    .map-card {
        min-height: 420px;
    }
}




















/* ===== JOBB OLDALI PANEL JAVÍTÁS ===== */

.right-panel {
    min-height: 0;

    display: flex;
    flex-direction: column;

    gap: 14px;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 2px;
}

.right-panel::-webkit-scrollbar {
    width: 5px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: #27364d;
    border-radius: 10px;
}

/* A járműlista ne nyomódjon össze */
.fleet-card {
    flex: 0 0 270px;
}

/* Járműlista magassága */
.vehicles {
    max-height: 205px;
    overflow-y: auto;
}

/* A statisztikák maradjanak normális méretűek */
.stats {
    flex: 0 0 auto;
}

/* Grafikon */
.chart-card {
    flex: 0 0 170px;
}

/* Riasztások */
.alerts-card {
    flex: 0 0 auto;
}

/* Térkép legyen kicsit sötétebb */
#map {
    filter: brightness(0.82) saturate(0.9);
}