:root {
    --bg: #0f1724;
    --card: #0b1220;
    --muted: #9aa6b2;
    --free: #16a34a;
    --occ: #dc2626;
    --blink-duration: 1s;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: #e6eef6;
}

body {
    background: linear-gradient(180deg, #071025 0%, #071a2b 100%);
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
}

.container {
    width: 1100px;
    max-width: 96vw;
    background: rgba(8, 12, 20, .6);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 30px rgba(2, 6, 23, .6);
    border: 1px solid rgba(255, 255, 255, .03)
}

/* --- NAVBAR --- */
header.navbar {
    background: rgba(8, 12, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, .03);
    border-radius: 10px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

header.navbar h2 {
    font-size: 20px;
    font-weight: 600;
    color: #e6eef6;
    margin: 0;
}

header.navbar nav {
    display: flex;
    gap: 16px;
}

header.navbar a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
}

header.navbar a:hover {
    color: #facc15;
    transform: translateY(-1px);
}

header.navbar a.active {
    color: #facc15;
    font-weight: 600;
}

/* --- DASHBOARD HEADER --- */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px
}

h1 {
    font-size: 20px;
    margin: 0;
    letter-spacing: .2px
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center
}

.btn {
    background: #112233;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, .03);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    filter: brightness(1.05);
    color: #fff;
}

.map {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px
}

.left-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start
}

.entry-exit {
    display: flex;
    justify-content: space-between;
    width: 100%
}

.spot {
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01));
    border-radius: 10px;
    padding: 14px;
    width: 220px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .03)
}

.spot-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px
}

.spot-value {
    font-size: 18px;
    font-weight: 700
}

.map-area {
    position: relative;
    height: 420px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .01), rgba(255, 255, 255, .005));
    border: 1px solid rgba(255, 255, 255, .03);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center
}

.parking-grid {
    display: grid;
    grid-template-columns: repeat(2, 240px);
    grid-template-rows: repeat(2, 140px);
    gap: 18px
}

.lot {
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #071423;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(2, 6, 23, .5);
    transition: all .25s ease
}

.lot .sub {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    color: rgba(0, 0, 0, .6)
}

.lot.free {
    background: linear-gradient(180deg, rgba(34, 197, 94, .95), rgba(16, 185, 129, .95));
    box-shadow: 0 6px 18px rgba(16, 185, 129, .12)
}

.lot.occupied {
    background: linear-gradient(180deg, rgba(239, 68, 68, .95), rgba(220, 38, 38, .95));
    color: #fff
}

.lot.nopark {
    background: linear-gradient(180deg, rgba(148, 163, 184, .95), rgba(100, 116, 139, .95));
    color: #071423
}

.blink {
    animation: blink var(--blink-duration) infinite;
    box-shadow: 0 6px 24px rgba(220, 38, 38, .18);
}

@keyframes blink {
    0% {
        opacity: 1;
        transform: translateY(0)
    }

    50% {
        opacity: .25;
        transform: translateY(-2px)
    }

    100% {
        opacity: 1;
        transform: translateY(0)
    }
}

.side-info {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.meta {
    background: rgba(255, 255, 255, .02);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, .02)
}

.status-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%
}

.dot.free {
    background: var(--free)
}

.dot.occ {
    background: var(--occ)
}

footer {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center
}

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

@media (max-width:980px) {
    .map {
        grid-template-columns: 1fr;
        align-items: center
    }

    .parking-grid {
        transform: scale(.95)
    }
}

/* --- HEATMAP + PREDICTOR --- */
.chart-container {
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    background: rgba(8, 12, 20, .8);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 24px rgba(2, 6, 23, .5);
    border: 1px solid rgba(255, 255, 255, .03);
}

.chart-container h2 {
    text-align: center;
    color: var(--muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.predictor {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
}

.predictor select,
.predictor input,
.predictor button {
    margin: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #333;
    color: #fff;
    font-size: 14px;
    transition: 0.2s ease;
}

.predictor button:hover {
    background: #444;
    cursor: pointer;
}

#predictResult {
    margin-top: 15px;
    font-weight: 600;
    color: #00ff9d;
}