:root {
    --bg: #081725;
    --sidebar: #06131f;

    --card: #172d41;
    --card-alt: #1c344a;
    --card-deep: #102538;

    --green: #2fc47f;
    --green-soft: #22b9a6;

    --white: #f5f7f7;
    --text: #dce4e8;

    --muted: #8da0af;
    --muted-dark: #617789;

    --warning: #d99a3d;
    --danger: #df6651;

    --border: rgba(255,255,255,.075);

    --shadow:
        0 8px 30px rgba(0,0,0,.10);
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    background: var(--bg);

    color: var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


.app {
    min-height: 100vh;

    display: flex;
}


/* SIDEBAR */

.sidebar {
    width: 265px;

    background:
        var(--sidebar);

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

    padding:
        35px 25px 25px;

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    display: flex;

    flex-direction: column;

    z-index: 20;
}


.brand {
    min-height: 105px;

    display: flex;

    align-items: flex-start;

    margin-bottom: 24px;
}


.brand-logo {
    display: block;

    width: 185px;

    max-height: 95px;

    object-fit: contain;

    object-position: left center;
}


.brand-fallback {
    display: block;
}


.brand-name {
    color: var(--white);

    font-size: 29px;

    font-weight: 700;

    letter-spacing: .16em;
}


.brand-sub {
    color: var(--muted);

    font-size: 9px;

    letter-spacing: .17em;

    margin-top: 8px;

    line-height: 1.3;
}


.nav-label {
    color: #536b7d;

    font-size: 9px;

    letter-spacing: .22em;

    margin:
        0 0 10px 14px;
}


.sidebar nav {
    display: flex;

    flex-direction: column;

    gap: 4px;

    flex: 1;
}


.sidebar nav a {
    text-decoration: none;

    color: #99afbf;

    font-size: 14px;

    border-radius: 9px;

    padding:
        12px 15px;

    display: flex;

    align-items: center;

    gap: 11px;

    position: relative;

    transition:
        background .18s ease,
        color .18s ease;
}


.sidebar nav a:hover {
    background:
        rgba(255,255,255,.035);

    color: var(--white);
}


.nav-dot {
    width: 5px;

    height: 5px;

    border-radius: 50%;

    background:
        #42596b;
}


.sidebar nav a.active {
    color: var(--green);

    background:
        rgba(47,196,127,.10);
}


.sidebar nav a.active::before {
    content: "";

    position: absolute;

    left: 0;
    top: 8px;
    bottom: 8px;

    width: 3px;

    border-radius: 5px;

    background:
        var(--green);
}


.sidebar nav a.active .nav-dot {
    background:
        var(--green);
}


.sidebar-footer {
    border-top:
        1px solid var(--border);

    padding-top: 19px;

    color: var(--muted-dark);

    font-size: 10px;
}


.connection-small {
    display: flex;

    align-items: center;

    gap: 7px;

    color: var(--muted);

    margin-bottom: 8px;

    font-size: 11px;
}


/* MAIN */

.main {
    margin-left: 265px;

    width:
        calc(100% - 265px);

    padding:
        43px 48px 65px;
}


/* TOP */

.topbar {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 40px;
}


.eyebrow {
    color: var(--green);

    font-size: 10px;

    line-height: 1.3;

    font-weight: 700;

    letter-spacing: .22em;

    text-transform: uppercase;

    margin-bottom: 10px;
}


h1,
h2,
h3 {
    font-family:
        Georgia,
        'Times New Roman',
        serif;

    color:
        var(--white);
}


h1 {
    font-size: 40px;

    line-height: 1.05;

    margin:
        0 0 9px;

    letter-spacing:
        -.02em;
}


.subtitle {
    color: var(--muted);

    font-size: 14px;
}


.live-status {
    color: var(--green);

    border:
        1px solid rgba(47,196,127,.35);

    background:
        rgba(47,196,127,.07);

    border-radius: 30px;

    padding:
        10px 16px;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: .15em;
}


.live-dot,
.status-dot {
    display: inline-block;

    width: 7px;

    height: 7px;

    border-radius: 50%;

    background:
        var(--green);

    box-shadow:
        0 0 10px rgba(47,196,127,.35);
}


.live-dot {
    margin-right: 7px;
}


/* SECTION HEAD */

.section-header {
    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    margin-bottom: 17px;
}


.section-header h2 {
    margin: 0;

    font-size: 23px;
}


.updated {
    color: var(--muted-dark);

    font-size: 11px;
}


.section-gap {
    margin-top: 34px;
}


.mode-tag,
.preview-tag {
    color: var(--warning);

    font-size: 9px;

    letter-spacing: .14em;

    font-weight: 700;

    border:
        1px solid rgba(217,154,61,.28);

    border-radius: 20px;

    background:
        rgba(217,154,61,.07);

    padding:
        7px 10px;
}


/* PROJECT HEALTH */

.health-grid {
    display: grid;

    grid-template-columns:
        1.1fr 1fr 1fr;

    gap: 16px;
}


.health-main {
    grid-row:
        span 2;

    min-height: 255px;

    background:
        var(--card);

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

    border-radius:
        13px;

    padding:
        27px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

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


.card-label,
.health-item > span {
    color:
        var(--muted);

    font-size: 12px;
}


.health-score {
    color:
        var(--green);

    font-family:
        Georgia,
        'Times New Roman',
        serif;

    font-size:
        74px;

    font-weight:
        700;

    line-height:
        .95;
}


.health-score span {
    font-size:
        27px;

    margin-left:
        5px;
}


.health-caption {
    color:
        var(--muted);

    font-size:
        12px;
}


.health-item {
    min-height:
        119px;

    background:
        var(--card);

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

    border-left:
        4px solid transparent;

    border-radius:
        11px;

    padding:
        20px 20px;

    display: flex;

    flex-direction: column;

    justify-content:
        center;
}


.health-item strong {
    font-size:
        20px;

    margin:
        8px 0 6px;

    color:
        var(--white);
}


.health-item small {
    color:
        var(--muted);

    font-size:
        10px;
}


.good-border {
    border-left-color:
        var(--green);
}


.learning-border {
    border-left-color:
        var(--warning);
}


.neutral-border {
    border-left-color:
        #587185;
}


.good-text {
    color:
        var(--green) !important;
}


.learning-text {
    color:
        var(--warning) !important;
}


/* LIVE METRICS */

.metrics {
    display: grid;

    grid-template-columns:
        repeat(4,1fr);

    gap:
        17px;
}


.metric-card {
    min-height:
        155px;

    background:
        var(--card);

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

    border-radius:
        13px;

    padding:
        24px;

    box-shadow:
        var(--shadow);

    position:
        relative;
}


.metric-card span {
    display:
        block;

    color:
        var(--muted);

    font-size:
        12px;

    margin-bottom:
        26px;
}


.metric-card strong {
    display:
        block;

    color:
        var(--green);

    font-family:
        Georgia,
        'Times New Roman',
        serif;

    font-size:
        40px;

    line-height:
        1;

    margin-bottom:
        8px;
}


.metric-card small {
    color:
        #8ca4b6;

    font-size:
        10px;
}


.metric-card.featured {
    background:
        linear-gradient(
            145deg,
            #18354a,
            #162d41
        );
}


/* EQUIPMENT */

.system-card {
    margin-top:
        22px;

    background:
        var(--card);

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

    border-radius:
        13px;

    padding:
        28px 29px 30px;

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


.system-card-head {
    display:
        flex;

    justify-content:
        space-between;

    align-items:
        flex-start;
}


.system-card h2 {
    margin:
        0;

    font-size:
        25px;
}


.equipment-status {
    color:
        var(--green);

    font-size:
        11px;

    display:
        flex;

    align-items:
        center;

    gap:
        8px;

    padding:
        8px 12px;

    border-radius:
        20px;

    background:
        rgba(47,196,127,.07);

    border:
        1px solid rgba(47,196,127,.18);
}


.system-values {
    display:
        grid;

    grid-template-columns:
        repeat(4,1fr);

    gap:
        14px;

    margin-top:
        27px;
}


.system-values > div {
    background:
        rgba(255,255,255,.025);

    border:
        1px solid rgba(255,255,255,.025);

    border-radius:
        9px;

    padding:
        17px;
}


.system-values span {
    display:
        block;

    color:
        var(--muted);

    font-size:
        11px;

    margin-bottom:
        9px;
}


.system-values strong {
    color:
        var(--white);

    font-size:
        17px;
}


/* INSIGHT / OPTIMIZER */

.bottom-grid {
    display:
        grid;

    grid-template-columns:
        1.4fr 1fr;

    gap:
        18px;

    margin-top:
        22px;
}


.insight-card,
.optimizer-card {
    background:
        var(--card);

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

    border-radius:
        13px;

    padding:
        27px;

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


.insight-card {
    border-left:
        4px solid var(--green);
}


.insight-card h3,
.optimizer-card h3 {
    font-size:
        23px;

    margin:
        0 0 13px;
}


.insight-card p {
    color:
        var(--muted);

    max-width:
        680px;

    line-height:
        1.65;

    font-size:
        13px;
}


.insight-footer {
    margin-top:
        23px;

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

    padding-top:
        15px;

    display:
        flex;

    justify-content:
        space-between;

    font-size:
        12px;
}


.insight-footer span {
    color:
        var(--muted);
}


.insight-footer strong {
    color:
        var(--green);
}


.optimizer-top {
    display:
        flex;

    align-items:
        flex-start;

    justify-content:
        space-between;

    margin-bottom:
        17px;
}


.optimizer-row {
    border-top:
        1px solid var(--border);

    padding:
        13px 0;

    display:
        flex;

    justify-content:
        space-between;

    gap:
        15px;

    font-size:
        11px;
}


.optimizer-row span {
    color:
        var(--muted);
}


.optimizer-row strong {
    color:
        var(--white);
}


/* PLACEHOLDER MODULES */

.placeholder-page {
    min-height:
        400px;

    background:
        var(--card);

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

    border-radius:
        13px;

    padding:
        40px;

    display:
        flex;

    flex-direction:
        column;

    justify-content:
        center;

    align-items:
        flex-start;
}


.placeholder-page h2 {
    font-size:
        35px;

    margin:
        3px 0 13px;
}


.placeholder-page p {
    color:
        var(--muted);

    max-width:
        560px;

    line-height:
        1.7;

    margin:
        0 0 22px;
}


.preview-tag.large {
    font-size:
        10px;

    padding:
        9px 13px;
}


/* FOOT NOTE */

.demo-label {
    margin-top:
        21px;

    color:
        var(--muted-dark);

    font-size:
        10px;

    font-style:
        italic;
}


/* RESPONSIVE */

@media (max-width: 1250px) {

    .health-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

    .health-main {
        grid-row:
            span 1;

        grid-column:
            span 2;
    }

    .metrics {
        grid-template-columns:
            repeat(2,1fr);
    }

}


@media (max-width: 900px) {

    .sidebar {
        position:
            static;

        width:
            100%;

        min-height:
            auto;
    }

    .app {
        display:
            block;
    }

    .main {
        margin-left:
            0;

        width:
            100%;

        padding:
            30px 24px 50px;
    }

    .sidebar-footer {
        display:
            none;
    }

    .system-values {
        grid-template-columns:
            repeat(2,1fr);
    }

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

}


@media (max-width: 600px) {

    .topbar,
    .section-header {
        flex-direction:
            column;

        gap:
            15px;

        align-items:
            flex-start;
    }

    h1 {
        font-size:
            32px;
    }

    .health-grid,
    .metrics,
    .system-values {
        grid-template-columns:
            1fr;
    }

    .health-main {
        grid-column:
            span 1;
    }

}

/* ETQAN OPERATING STATES */

.state-good {
    color: var(--green) !important;
}

.state-neutral {
    color: #9fb1be !important;
}

.state-warning {
    color: var(--warning) !important;
}

.state-danger {
    color: var(--danger) !important;
}

.warning-border {
    border-left-color: var(--warning) !important;
}

.warning-text {
    color: var(--warning) !important;
}

.live-status.stale {
    color: var(--warning);
    border-color: rgba(217,154,61,.35);
    background: rgba(217,154,61,.07);
}

.live-status.stale .live-dot {
    background: var(--warning);
}

.database-error {
    margin-bottom: 20px;
    padding: 15px 18px;
    border: 1px solid rgba(223,102,81,.4);
    border-radius: 10px;
    background: rgba(223,102,81,.08);
    color: #ef9b8d;
    font-size: 12px;
}


/* =========================================================
   ETQAN HISTORY
   ========================================================= */

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

.history-range a {
    padding: 9px 14px;
    border: 1px solid rgba(126,160,182,.18);
    border-radius: 999px;
    color: #8fb1c7;
    text-decoration: none;
    font-size: 12px;
    transition: .2s ease;
}

.history-range a:hover,
.history-range a.active {
    color: var(--green);
    border-color: rgba(47,201,135,.35);
    background: rgba(47,201,135,.07);
}

.history-summary {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.history-stat {
    background: #193247;
    border: 1px solid rgba(126,160,182,.14);
    border-radius: 15px;
    padding: 24px 28px;
}

.history-stat span {
    display: block;
    color: #8fb1c7;
    font-size: 13px;
    margin-bottom: 10px;
}

.history-stat strong {
    display: block;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: 38px;
    line-height: 1;
}

.history-stat small {
    display: block;
    color: #8fb1c7;
    font-size: 11px;
    margin-top: 10px;
}

.history-chart-card {
    background: #193247;
    border: 1px solid rgba(126,160,182,.14);
    border-radius: 15px;
    padding: 26px 28px;
    margin-bottom: 22px;
}

.history-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.history-chart-head h3 {
    margin: 6px 0 0;
    color: #fff;
    font-family: Georgia, serif;
    font-size: 25px;
}

.history-meta {
    color: #d99a3d;
    border: 1px solid rgba(217,154,61,.30);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 10px;
    letter-spacing: .12em;
}

.history-two-column {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.history-canvas {
    display: block;
    width: 100%;
    height: 320px;
}

.history-canvas.small {
    height: 270px;
}

@media (max-width: 1100px) {

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

    .history-two-column {
        grid-template-columns: 1fr;
    }
}

/* FINAL ETQAN BRANDING */

.brand {
    display: block !important;
}

.brand-logo {
    display: block !important;
    width: 215px !important;
    max-width: 100% !important;
    height: auto !important;
}

.brand-fallback {
    display: none !important;
}
