:root {
    --bg: #050912;
    --bg-deep: #02050a;
    --panel: rgba(15, 24, 39, .78);
    --panel-strong: rgba(18, 29, 47, .94);
    --border: rgba(148, 174, 210, .14);
    --border-bright: rgba(91, 199, 255, .24);
    --text: #f5f8ff;
    --muted: #8194ae;
    --muted-2: #5e718d;
    --cyan: #2ed8ff;
    --blue: #4c7cff;
    --green: #18e49b;
    --yellow: #ffcb57;
    --red: #ff6175;
    --shadow: 0 28px 90px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box;
}

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

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);
    background:
        radial-gradient(
            circle at 50% -20%,
            #163c69 0%,
            #07111f 36%,
            var(--bg) 64%,
            var(--bg-deep) 100%
        );
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}


/* LOGIN */

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.login-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    opacity: .32;
}

.orb-one {
    width: 420px;
    height: 420px;
    left: -160px;
    top: -100px;
    background: #075dc9;
}

.orb-two {
    width: 380px;
    height: 380px;
    right: -120px;
    bottom: -100px;
    background: #00b486;
}

.login-shell {
    width: min(440px, calc(100vw - 32px));
    position: relative;
    z-index: 2;
}

.login-panel {
    position: relative;
    overflow: hidden;
    padding: 44px 40px 34px;

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

    background:
        linear-gradient(
            150deg,
            rgba(31, 51, 79, .92),
            rgba(13, 20, 32, .94)
        );

    box-shadow: var(--shadow);

    backdrop-filter: blur(22px);

    animation: panelEntry .65s ease both;
}

.login-panel::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -90px;
    top: -90px;
    border-radius: 50%;
    background: rgba(46, 216, 255, .12);
    filter: blur(20px);
}

.login-brand-mark {
    position: relative;
    width: 54px;
    height: 54px;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
}

.brand-core {
    width: 12px;
    height: 12px;
    background: var(--green);
    border-radius: 50%;
    box-shadow:
        0 0 12px var(--green),
        0 0 30px rgba(24, 228, 155, .58);
    animation: livePulse 2s infinite;
}

.brand-ring {
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(46, 216, 255, .22);
    border-radius: 50%;
    animation: slowSpin 10s linear infinite;
}

.brand-ring::before {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    left: 5px;
    top: 5px;
    border-radius: 50%;
    background: var(--cyan);
}

.login-eyebrow,
.eyebrow,
.section-label {
    color: var(--cyan);
    font-size: 11px;
    letter-spacing: .16em;
    font-weight: 750;
    text-transform: uppercase;
}

.login-eyebrow {
    text-align: center;
    margin-bottom: 8px;
}

.login-panel h1 {
    margin: 0;
    text-align: center;
    font-size: 38px;
    letter-spacing: .30em;
    padding-left: .30em;
}

.login-subtitle {
    margin: 7px 0 31px;
    text-align: center;
    color: #9ab0cc;
}

.login-panel form {
    display: grid;
    gap: 17px;
}

.login-panel label {
    color: #a9bad0;
    font-size: 12px;
    display: grid;
    gap: 8px;
}

.login-panel input {
    width: 100%;
    height: 48px;
    padding: 0 15px;

    color: var(--text);

    border:
        1px solid rgba(155, 182, 218, .12);

    border-radius: 12px;

    outline: none;

    background: rgba(255, 255, 255, .08);

    transition:
        border-color .2s,
        background .2s,
        box-shadow .2s;
}

.login-panel input:focus {
    border-color: rgba(46, 216, 255, .55);
    background: rgba(255, 255, 255, .11);
    box-shadow:
        0 0 0 4px rgba(46, 216, 255, .07);
}

.login-panel button {
    height: 50px;
    margin-top: 4px;

    border: 0;
    border-radius: 12px;

    color: white;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: .04em;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    background:
        linear-gradient(
            115deg,
            #15d6f0,
            #087cf5 70%
        );

    box-shadow:
        0 12px 30px rgba(7, 124, 245, .23);

    transition:
        transform .2s,
        filter .2s;
}

.login-panel button:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
}

.button-arrow {
    transition: transform .2s;
}

.login-panel button:hover .button-arrow {
    transform: translateX(4px);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.security-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.login-error {
    margin: -12px 0 20px;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255, 97, 117, .25);
    background: rgba(255, 97, 117, .08);
    color: #ff9ba8;
    font-size: 12px;
}


/* DASHBOARD */

.dashboard-page {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-grid {
    position: fixed;
    inset: 0;
    opacity: .17;
    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(75, 117, 163, .09) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(75, 117, 163, .09) 1px,
            transparent 1px
        );

    background-size: 36px 36px;
    mask-image:
        linear-gradient(
            to bottom,
            black,
            transparent 78%
        );
}

.ambient {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    opacity: .17;
}

.ambient-a {
    background: #056bf2;
    top: -170px;
    right: 8%;
}

.ambient-b {
    background: #00c78b;
    left: -180px;
    bottom: -180px;
}

.ops-shell {
    width:
        min(1660px, calc(100vw - 48px));

    margin: 0 auto;
    padding: 27px 0 24px;
    position: relative;
    z-index: 2;
}

.ops-header {
    min-height: 76px;

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

    gap: 24px;
    margin-bottom: 20px;
}

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

.brand-symbol {
    position: relative;

    width: 43px;
    height: 43px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    border:
        1px solid rgba(46, 216, 255, .24);

    background:
        linear-gradient(
            145deg,
            rgba(46, 216, 255, .12),
            rgba(76, 124, 255, .08)
        );
}

.brand-symbol::before,
.brand-symbol::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border:
        1px solid rgba(46, 216, 255, .20);
}

.brand-symbol::before {
    width: 27px;
    height: 27px;
}

.brand-symbol::after {
    width: 16px;
    height: 16px;
}

.brand-symbol span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px var(--green);
}

.ops-header h1 {
    margin: 4px 0 0;
    font-size: clamp(20px, 2vw, 30px);
    letter-spacing: .055em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 11px;
}

.live-badge,
.heartbeat,
.logout-button,
.load-indicator,
.service-summary,
.stream-rate,
.alert-count {
    border:
        1px solid var(--border);

    background:
        rgba(17, 27, 43, .76);

    backdrop-filter: blur(14px);
}

.live-badge {
    height: 39px;
    padding: 0 14px;

    border-radius: 11px;

    display: flex;
    align-items: center;
    gap: 8px;

    color: #aab9cc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
}

.live-badge.live {
    color: var(--green);
    border-color:
        rgba(24, 228, 155, .20);
}

.live-badge.stale,
.live-badge.offline {
    color: var(--red);
    border-color:
        rgba(255, 97, 117, .25);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.live-badge.live .live-dot {
    animation: livePulse 1.8s infinite;
}

.heartbeat {
    height: 39px;
    padding: 0 13px;

    border-radius: 11px;

    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 11px;
    color: var(--muted);
}

.heartbeat strong {
    color: var(--text);
}

.logout-button {
    height: 39px;
    padding: 0 15px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    text-decoration: none;
    color: #dce8f7;
    font-size: 12px;

    transition:
        background .2s,
        border-color .2s;
}

.logout-button:hover {
    background:
        rgba(255, 255, 255, .08);

    border-color:
        rgba(255, 255, 255, .22);
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(12, minmax(0, 1fr));

    gap: 18px;
}

.panel {
    border:
        1px solid var(--border);

    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            rgba(18, 29, 47, .80),
            rgba(9, 15, 25, .88)
        );

    box-shadow:
        0 18px 55px rgba(0, 0, 0, .18);

    backdrop-filter: blur(18px);

    animation:
        panelEntry .48s ease both;
}

.hero-panel {
    grid-column: span 5;

    min-height: 310px;

    padding: 27px;

    display: grid;
    grid-template-columns: 190px 1fr;
    align-items: center;
    gap: 27px;
}

.metrics-panel {
    grid-column: span 7;
    padding: 26px;
}

.services-panel {
    grid-column: span 8;
    padding: 25px;
}

.integrity-panel {
    grid-column: span 4;
    padding: 25px;
}

.alerts-panel {
    grid-column: span 5;
    padding: 25px;
}

.activity-panel {
    grid-column: span 7;
    padding: 25px;
}

.score-gauge {
    --score: 0;

    width: 170px;
    height: 170px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    position: relative;

    background:
        conic-gradient(
            var(--green)
            calc(var(--score) * 1%),
            rgba(116, 145, 181, .10) 0
        );

    box-shadow:
        inset 0 0 35px rgba(24, 228, 155, .08);

    transition: background .8s ease;
}

.score-gauge::before {
    content: "";

    position: absolute;
    inset: 11px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 50% 25%,
            #162944,
            #09111d 72%
        );

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

.score-inner {
    position: relative;
    z-index: 2;

    text-align: center;
}

.score-inner strong {
    display: block;
    font-size: 53px;
    line-height: 1;
    letter-spacing: -.04em;
}

.score-inner span {
    display: block;
    margin-top: 8px;

    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .11em;
}

.overall-status {
    margin: 9px 0 10px;

    font-size:
        clamp(28px, 3vw, 44px);

    line-height: 1;
    font-weight: 850;
    letter-spacing: -.035em;
}

.overall-status.healthy {
    color: var(--green);
}

.overall-status.warning {
    color: var(--yellow);
}

.overall-status.failed {
    color: var(--red);
}

.overall-status.waiting {
    color: var(--muted);
}

.hero-copy {
    color: var(--muted);
    line-height: 1.65;
    max-width: 520px;
    font-size: 13px;
}

.hero-meta {
    margin-top: 21px;

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

    gap: 10px;
}

.hero-meta div {
    min-width: 0;

    padding: 12px;

    border-radius: 12px;

    border:
        1px solid rgba(145, 170, 205, .10);

    background:
        rgba(255, 255, 255, .025);
}

.hero-meta span {
    display: block;
    color: var(--muted-2);
    font-size: 10px;
    margin-bottom: 5px;
}

.hero-meta strong {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;

    color: #dce7f6;
    font-size: 11px;
    font-weight: 700;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 18px;
    margin-bottom: 21px;
}

.panel-heading h2 {
    margin: 5px 0 0;
    font-size: 19px;
}

.load-indicator,
.service-summary,
.stream-rate,
.alert-count {
    min-height: 33px;
    padding: 0 11px;

    display: flex;
    align-items: center;
    gap: 6px;

    border-radius: 9px;

    color: var(--muted);
    font-size: 10px;
}

.load-indicator strong {
    color: var(--cyan);
}

.metric-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 13px;
}

.metric-card {
    min-width: 0;
    padding: 17px;

    border-radius: 15px;

    border:
        1px solid rgba(137, 169, 210, .10);

    background:
        linear-gradient(
            145deg,
            rgba(26, 42, 66, .52),
            rgba(11, 18, 30, .62)
        );
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-top span {
    color: var(--muted);
    font-size: 11px;
}

.metric-top strong {
    font-size: 22px;
    letter-spacing: -.03em;
}

.sparkline {
    height: 65px;
    margin: 13px 0 9px;
}

.sparkline svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sparkline path.line {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.sparkline path.area {
    fill:
        url(#metricAreaGradient);
}

.sparkline .grid-line {
    stroke:
        rgba(120, 154, 196, .09);

    stroke-width: 1;
}

.progress-track {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;

    background:
        rgba(103, 132, 170, .13);
}

.progress-fill {
    display: block;
    height: 100%;
    width: 0;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--cyan),
            var(--blue)
        );

    box-shadow:
        0 0 10px rgba(46, 216, 255, .45);

    transition:
        width .7s ease,
        background .25s;
}

.progress-fill.warn {
    background:
        linear-gradient(
            90deg,
            #ffcd5c,
            #ff9e44
        );
}

.progress-fill.danger {
    background:
        linear-gradient(
            90deg,
            #ff817c,
            var(--red)
        );
}

.service-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;
}

.service-card {
    position: relative;
    min-height: 128px;
    padding: 16px;

    border-radius: 15px;

    border:
        1px solid rgba(128, 160, 200, .10);

    background:
        linear-gradient(
            145deg,
            rgba(25, 39, 61, .52),
            rgba(9, 15, 25, .57)
        );

    overflow: hidden;

    transition:
        transform .2s,
        border-color .2s;
}

.service-card:hover {
    transform: translateY(-2px);
    border-color:
        rgba(46, 216, 255, .22);
}

.service-card::after {
    content: "";

    position: absolute;
    width: 80px;
    height: 80px;
    right: -40px;
    bottom: -40px;

    border-radius: 50%;
    filter: blur(18px);

    background:
        rgba(24, 228, 155, .08);
}

.service-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

    border-radius: 9px;

    display: grid;
    place-items: center;

    color: var(--cyan);

    border:
        1px solid rgba(46, 216, 255, .14);

    background:
        rgba(46, 216, 255, .06);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.ok {
    background: var(--green);
    box-shadow: 0 0 11px var(--green);
}

.status-indicator.bad {
    background: var(--red);
    box-shadow: 0 0 11px var(--red);
}

.service-card h3 {
    margin: 17px 0 6px;
    font-size: 13px;
}

.service-card p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;

    word-break: break-word;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.integrity-grid {
    display: grid;
    gap: 10px;
}

.integrity-item {
    min-width: 0;

    display: grid;
    grid-template-columns:
        11px minmax(0, 1fr) auto;

    align-items: center;
    gap: 10px;

    padding: 12px 13px;

    border-radius: 12px;

    background:
        rgba(255, 255, 255, .025);

    border:
        1px solid rgba(133, 163, 200, .08);
}

.integrity-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.integrity-dot.bad {
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
}

.integrity-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;

    color: #cbd8e9;
    font-size: 11px;
}

.integrity-state {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
}

.alert-count {
    min-width: 34px;
    justify-content: center;
    color: var(--yellow);
    font-weight: 850;
}

.alert-item {
    display: grid;
    grid-template-columns:
        31px 1fr;

    gap: 11px;
    align-items: start;

    padding: 12px 13px;
    margin-bottom: 9px;

    border-radius: 12px;

    border:
        1px solid rgba(255, 203, 87, .11);

    background:
        rgba(255, 203, 87, .035);
}

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

    border-radius: 9px;

    display: grid;
    place-items: center;

    color: var(--yellow);

    background:
        rgba(255, 203, 87, .08);
}

.alert-item strong {
    display: block;
    font-size: 11px;
    margin-bottom: 4px;
}

.alert-item p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.empty-state,
.timeline-empty {
    padding: 22px;

    border-radius: 13px;

    text-align: center;

    color: var(--muted-2);

    border:
        1px dashed rgba(121, 153, 194, .12);
}

.activity-timeline {
    max-height: 260px;
    overflow: auto;
    padding-right: 4px;
}

.timeline-item {
    position: relative;

    display: grid;
    grid-template-columns:
        74px 15px 1fr;

    gap: 9px;

    min-height: 47px;
}

.timeline-time {
    color: var(--muted-2);
    font-size: 9px;
    padding-top: 2px;
}

.timeline-node {
    position: relative;
}

.timeline-node::before {
    content: "";
    position: absolute;

    width: 7px;
    height: 7px;
    top: 3px;
    left: 4px;

    border-radius: 50%;

    background: var(--cyan);
    box-shadow:
        0 0 9px rgba(46,216,255,.7);
}

.timeline-node::after {
    content: "";
    position: absolute;

    top: 15px;
    bottom: -2px;
    left: 7px;

    width: 1px;

    background:
        rgba(113, 147, 188, .14);
}

.timeline-item:last-child
.timeline-node::after {
    display: none;
}

.timeline-copy {
    padding-bottom: 12px;
}

.timeline-copy strong {
    display: block;
    color: #d3dfef;
    font-size: 11px;
}

.timeline-copy span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

.ops-footer {
    margin-top: 18px;

    padding: 15px 4px 0;

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

    gap: 16px;

    border-top:
        1px solid rgba(122, 153, 193, .08);

    color: var(--muted-2);
    font-size: 9px;
}

@keyframes panelEntry {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes livePulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .45;
        transform: scale(1.32);
    }
}

@keyframes slowSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1200px) {
    .hero-panel,
    .metrics-panel,
    .services-panel,
    .integrity-panel,
    .alerts-panel,
    .activity-panel {
        grid-column: span 12;
    }
}

@media (max-width: 820px) {
    .ops-shell {
        width:
            min(100% - 24px, 1660px);

        padding-top: 15px;
    }

    .ops-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .hero-panel {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .score-gauge {
        margin: auto;
    }

    .hero-meta {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .metric-grid,
    .service-grid {
        grid-template-columns: 1fr;
    }

    .ops-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
