* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    background: #05080d;
    color: #eaf4ff;
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;
    overflow: hidden;
}

body {
    background:
        radial-gradient(
            circle at top,
            #122138 0,
            #07101c 42%,
            #020509 100%
        );
}

#app {
    height: 100vh;
    display: grid;
    grid-template-rows:
        72px
        112px
        1fr
        32px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid #27384d;
    background:
        linear-gradient(
            180deg,
            rgba(18, 30, 48, .97),
            rgba(7, 13, 22, .97)
        );
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-mark {
    font-size: 34px;
    filter:
        drop-shadow(
            0 0 10px rgba(255, 208, 0, .75)
        );
}

.title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.subtitle {
    margin-top: 4px;
    font-size: 11px;
    color: #8fa5bd;
    letter-spacing: 1.3px;
}

.system-status {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #74ff9b;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 50%;
    background: #43ff72;
    box-shadow:
        0 0 10px #43ff72;
}

.metrics {
    display: grid;
    grid-template-columns:
        repeat(6, minmax(150px, 1fr));
    gap: 8px;
    padding: 10px;
    background: #050a11;
    border-bottom: 1px solid #25364b;
}

.metric-card {
    border: 1px solid #263a51;
    border-radius: 5px;
    padding: 12px 13px;
    background:
        linear-gradient(
            180deg,
            rgba(20, 34, 53, .96),
            rgba(8, 16, 27, .96)
        );
    box-shadow:
        inset 0 0 25px rgba(65, 125, 180, .06);
}

.metric-title {
    font-size: 10px;
    letter-spacing: 1.1px;
    color: #7f96ad;
}

.metric-value {
    margin-top: 10px;
    font-size: 23px;
    font-weight: 800;
    color: #dff3ff;
}

.metric-value.healthy {
    color: #61eaff;
    font-size: 17px;
}

.metric-foot {
    margin-top: 6px;
    font-size: 10px;
    color: #647b91;
}

.workspace {
    min-height: 0;
    display: grid;
    grid-template-columns:
        260px
        1fr
        285px;
}

.left-panel,
.right-panel {
    min-height: 0;
    overflow-y: auto;
    background:
        linear-gradient(
            180deg,
            rgba(8, 16, 27, .98),
            rgba(3, 8, 14, .98)
        );
}

.left-panel {
    border-right: 1px solid #25364b;
    padding: 18px;
}

.right-panel {
    border-left: 1px solid #25364b;
    padding: 18px;
}

.panel-heading {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: #73d9ff;
    padding-bottom: 10px;
    border-bottom: 1px solid #203148;
}

.second-heading {
    margin-top: 25px;
}

.layer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(45, 66, 88, .45);
    font-size: 12px;
}

.switch {
    position: relative;
    width: 33px;
    height: 17px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 20px;
    background: #263647;
    transition: .2s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #9bb0c4;
    transition: .2s;
}

.switch input:checked + .slider {
    background: #087aa5;
    box-shadow:
        0 0 8px rgba(0, 183, 255, .4);
}

.switch input:checked + .slider:before {
    transform: translateX(16px);
    background: white;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 11px;
    font-size: 12px;
    color: #b8c8d6;
}

.legend {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.green {
    background: #37e66b;
}

.yellow {
    background: #ffe34d;
}

.orange {
    background: #ff9e42;
}

.red {
    background: #ff4141;
}

.purple {
    background: #bf68ff;
}

.generation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 8px;
    margin-top: 13px;
    font-size: 11px;
    color: #aebdca;
}

.source {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 2px;
}

.nuclear {
    background: #eb63ff;
}

.hydro {
    background: #4aa8ff;
}

.gas {
    background: #ff934b;
}

.coal {
    background: #9c9c9c;
}

.solar {
    background: #ffe55e;
}

.wind {
    background: #53e7c7;
}

.map-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: #000;
}

#map {
    position: absolute;
    inset: 0;
}

.map-banner {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 500;
    width: 330px;
    padding: 12px 14px;
    border: 1px solid rgba(90, 177, 228, .45);
    border-radius: 5px;
    background: rgba(4, 11, 20, .88);
    backdrop-filter: blur(8px);
    font-size: 11px;
    line-height: 1.45;
    color: #9eb3c6;
}

.banner-title {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #68dcff;
}

.leaflet-control-zoom a {
    background: #0b1725 !important;
    color: #cdeeff !important;
    border-color: #2c4860 !important;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, .55) !important;
    color: #7890a4 !important;
}

.leaflet-control-attribution a {
    color: #69bde7 !important;
}

.intel-empty {
    padding: 28px 5px;
    text-align: center;
    color: #8398aa;
}

.intel-icon {
    font-size: 38px;
}

.intel-title {
    margin-top: 12px;
    font-weight: 700;
    color: #c8d9e7;
}

.intel-empty p {
    font-size: 12px;
    line-height: 1.6;
}

.system-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    font-size: 11px;
    border-bottom: 1px solid rgba(45, 66, 88, .45);
}

.online {
    color: #59ef7f;
}

.pending {
    color: #ffc34b;
}

footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: #04080d;
    border-top: 1px solid #1f3043;
    color: #5f7488;
    font-size: 9px;
    letter-spacing: 1px;
}

@media (max-width: 1100px) {
    .metrics {
        grid-template-columns:
            repeat(3, 1fr);
        overflow-y: auto;
    }

    #app {
        grid-template-rows:
            72px
            210px
            1fr
            32px;
    }

    .workspace {
        grid-template-columns:
            220px
            1fr;
    }

    .right-panel {
        display: none;
    }
}


/* =========================================================
   CANADA NUCLEAR LABELS
========================================================= */

.canada-nuclear-tooltip {
    background: rgba(3, 10, 20, .96) !important;
    border: 2px solid #ffffff !important;
    border-left: 5px solid #ff00ff !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    letter-spacing: .35px !important;
    box-shadow:
        0 0 14px rgba(255, 0, 255, .75) !important;
}

.canada-nuclear-tooltip::before {
    border-top-color: #ffffff !important;
}

