:root {
    --bg: #07070c;
    --bg-deep: #05050a;
    --midnight: #0d1018;
    --midnight-2: #161c28;
    --panel: rgba(20, 24, 35, 0.78);
    --panel-solid: #151a24;
    --panel-soft: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.15);
    --text: #f5f1ec;
    --muted: #a9acb6;
    --muted-2: #7b7f8b;
    --brand: #7c0f23;
    --brand-strong: #b11f39;
    --brand-soft: rgba(177, 31, 57, 0.14);
    --brand-glow: rgba(177, 31, 57, 0.28);
    --success: #63d9ac;
    --warn: #f3b453;
    --danger: #ff6d7d;
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.24);
    --radius: 26px;
    --font-sans: "Bahnschrift", "Trebuchet MS", "Segoe UI", sans-serif;
    --font-mono: "Consolas", "Cascadia Code", monospace;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at 20% 20%, rgba(177, 31, 57, 0.12), transparent 28%),
        radial-gradient(circle at 86% 14%, rgba(86, 29, 46, 0.18), transparent 22%),
        radial-gradient(circle at 50% 80%, rgba(31, 39, 61, 0.26), transparent 34%),
        linear-gradient(180deg, #090a10 0%, #05060a 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(circle at center, black 36%, transparent 100%);
    opacity: 0.34;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, p {
    margin: 0;
}

code, pre {
    font-family: var(--font-mono);
}

.glass-panel,
.panel-card,
.stat-card,
.guest-panel,
.info-octagon {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    background:
        linear-gradient(180deg, rgba(20, 12, 20, 0.88), rgba(10, 12, 19, 0.96)),
        var(--midnight);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.28);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    padding: 8px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(177, 31, 57, 0.16), rgba(255, 255, 255, 0.05));
    box-shadow: 0 0 24px rgba(177, 31, 57, 0.18);
}

.brand-block h1 {
    font-size: 1.24rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.nav-menu {
    display: grid;
    gap: 10px;
}

.nav-menu a {
    padding: 14px 16px;
    border-radius: 18px;
    color: var(--muted);
    font-size: 0.96rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-menu a:hover {
    color: var(--text);
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-menu a.active {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(177, 31, 57, 0.22), rgba(177, 31, 57, 0.07)),
        rgba(255, 255, 255, 0.04);
    border-color: rgba(177, 31, 57, 0.36);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 30px rgba(124, 15, 35, 0.22);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 10px 0;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.content {
    width: 100%;
    max-width: 1760px;
    margin: 0 auto;
    padding: 32px 34px 38px;
    display: grid;
    gap: 24px;
}

.page-header,
.panel-head,
.toolbar,
.actions,
.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.page-header {
    align-items: flex-end;
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.eyebrow {
    display: inline-flex;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 900;
    color: #d78c97;
}

.help-text,
.muted {
    color: var(--muted);
}

.stats-grid,
.grid-two,
.form-grid,
.stack-list,
.alert-stack {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
    padding: 22px;
    border-radius: var(--radius);
}

.stat-card p {
    margin-bottom: 14px;
    color: var(--muted);
}

.stat-card strong {
    font-size: 1.8rem;
}

.panel-card,
.guest-panel {
    padding: 22px;
    border-radius: var(--radius);
}

.panel-head-tight {
    align-items: flex-start;
}

.toolbar {
    flex-wrap: wrap;
}

.table-wrap {
    overflow: auto;
    border-radius: 20px;
}

.data-table,
.monitor-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 840px;
}

.data-table thead th,
.monitor-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(10, 12, 18, 0.94);
    color: #d2d7df;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    font-weight: 900;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-strong);
}

.data-table tbody td,
.monitor-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.92rem;
    color: #f0edf0;
    vertical-align: top;
    background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:hover td,
.monitor-table tbody tr:hover td {
    background: rgba(177, 31, 57, 0.08);
}

.actions form {
    margin: 0;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, filter 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover,
button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-strong), var(--brand));
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 24px rgba(124, 15, 35, 0.26);
}

.btn-secondary {
    color: #f7dbe1;
    background: rgba(177, 31, 57, 0.12);
    border-color: rgba(177, 31, 57, 0.2);
}

.btn-ghost {
    color: var(--danger);
    background: rgba(255, 109, 125, 0.08);
    border-color: rgba(255, 109, 125, 0.18);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
}

.pill.success { color: var(--success); background: rgba(99, 217, 172, 0.12); }
.pill.warn { color: var(--warn); background: rgba(243, 180, 83, 0.14); }
.pill.danger { color: var(--danger); background: rgba(255, 109, 125, 0.12); }
.pill.soft { color: #d7dbe2; }

.status-dot,
.status-cluster,
.live-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.online {
    background: var(--success);
    box-shadow: 0 0 18px rgba(99, 217, 172, 0.95);
}

.dot.offline {
    background: var(--danger);
    box-shadow: 0 0 18px rgba(255, 109, 125, 0.9);
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(177, 31, 57, 0.36); }
    70% { box-shadow: 0 0 0 14px rgba(177, 31, 57, 0); }
    100% { box-shadow: 0 0 0 0 rgba(177, 31, 57, 0); }
}

.pulse-brand {
    animation: pulse-red 2s infinite;
}

.search-form,
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-form input,
.search-form select {
    min-width: 220px;
}

.form-grid {
    gap: 16px;
}

.form-grid.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid label {
    display: grid;
    gap: 8px;
}

.form-grid label span {
    color: #d3d6de;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.full-row {
    grid-column: 1 / -1;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(177, 31, 57, 0.58);
    box-shadow: 0 0 0 4px rgba(177, 31, 57, 0.14);
}

textarea {
    resize: vertical;
}

.chart-box {
    min-height: 240px;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(177, 31, 57, 0.08), transparent 30%),
        rgba(255, 255, 255, 0.025);
}

.chart-grid {
    height: 100%;
    display: grid;
    align-items: end;
    grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
    gap: 10px;
}

.chart-bar {
    display: grid;
    gap: 10px;
    align-items: end;
}

.chart-value {
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.chart-fill {
    min-height: 18px;
    border-radius: 16px 16px 8px 8px;
    background: linear-gradient(180deg, #ce566f, #6d1021 85%);
    box-shadow: 0 0 22px rgba(177, 31, 57, 0.28);
}

.chart-label {
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted-2);
}

.code-block,
.inline-code {
    margin: 0;
    padding: 14px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #f3eef3;
    font-size: 0.83rem;
    white-space: pre-wrap;
}

.inline-code {
    max-width: 460px;
}

.guest-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.guest-layout {
    width: min(1320px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}

.guest-panel {
    display: grid;
    gap: 18px;
    border-radius: 28px;
}

.guest-panel.hero {
    padding: 44px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 22%),
        linear-gradient(145deg, rgba(122, 15, 35, 0.78), rgba(11, 14, 22, 0.96));
}

.guest-panel.compact {
    width: min(520px, 100%);
}

.guest-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
}

.alert.danger {
    color: var(--danger);
    background: rgba(255, 109, 125, 0.12);
    border: 1px solid rgba(255, 109, 125, 0.18);
}

.superior-shell {
    display: block;
}

.superior-main {
    display: grid;
    gap: 20px;
}

.mission-banner {
    padding: 22px 24px;
    border-radius: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.7fr);
    gap: 20px;
    align-items: center;
}

.mission-banner h3 {
    font-size: 2.05rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.mission-copy {
    margin-top: 10px;
    max-width: 860px;
    color: #d5d0cf;
    font-size: 0.98rem;
}

.mission-status {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    align-items: center;
    justify-self: end;
}

.pulse-core {
    position: relative;
    width: 108px;
    height: 108px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(177, 31, 57, 0.3), rgba(13, 16, 24, 0.2) 65%),
        rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pulse-core strong {
    position: relative;
    z-index: 2;
    font-size: 1.45rem;
    font-weight: 900;
}

.pulse-ring {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(177, 31, 57, 0.5);
    animation: pulse-red 2.4s infinite;
}

.info-octagon-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.info-octagon {
    position: relative;
    padding: 22px 24px;
    clip-path: polygon(10% 0, 90% 0, 100% 18%, 100% 82%, 90% 100%, 10% 100%, 0 82%, 0 18%);
}

.info-octagon::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    clip-path: inherit;
    pointer-events: none;
}

.info-octagon strong {
    display: block;
    margin: 14px 0 8px;
    font-size: 2rem;
    font-weight: 900;
}

.octagon-label {
    display: inline-flex;
    color: #d8dbe2;
    text-transform: uppercase;
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.info-octagon small {
    color: var(--muted);
}

.danger-edge {
    box-shadow: 0 28px 70px rgba(73, 0, 8, 0.28);
}

.desktop-grid {
    display: grid;
    grid-template-columns: minmax(980px, 1.62fr) minmax(360px, 0.78fr);
    gap: 20px;
    align-items: start;
}

.map-panel,
.live-feed-panel,
.chart-panel,
.alerts-panel {
    border-radius: 28px;
    overflow: hidden;
}

.map-panel {
    padding: 22px;
    display: grid;
    gap: 18px;
}

.map-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.map-stage {
    position: relative;
    min-height: 465px;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(177, 31, 57, 0.12), transparent 40%),
        linear-gradient(180deg, #081019 0%, #07080e 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.world-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 54px 54px;
}

.world-outline {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.34;
}

.world-outline path {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.14);
    stroke-width: 2;
}

.map-nodes {
    position: absolute;
    inset: 0;
}

.map-node {
    position: absolute;
    transform: translate(-50%, -50%);
}

.map-node button {
    position: relative;
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.86);
    background: linear-gradient(180deg, #ff95a6, #9f1630);
    box-shadow: 0 0 24px rgba(177, 31, 57, 0.45);
}

.map-node.offline button {
    background: linear-gradient(180deg, #ff9aa6, #7c2135);
    box-shadow: 0 0 18px rgba(255, 109, 125, 0.28);
}

.map-node button::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1px solid rgba(177, 31, 57, 0.22);
    animation: pulse-red 2.3s infinite;
}

.map-tooltip {
    position: absolute;
    left: 22px;
    bottom: 22px;
    width: 320px;
    min-height: 138px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(8, 10, 15, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft);
}

.map-tooltip h4 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.map-tooltip p {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.map-tooltip code {
    color: #ffd3da;
}

.map-overlay-card {
    position: absolute;
    right: 22px;
    top: 22px;
    width: 280px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(7, 8, 13, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft);
}

.map-overlay-card h4 {
    margin: 8px 0 10px;
    font-size: 1.08rem;
}

.map-table {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
}

.superior-sidebar {
    display: grid;
    gap: 18px;
    align-self: stretch;
}

.live-feed-panel,
.chart-panel,
.alerts-panel {
    padding: 20px;
}

.feed-stream {
    max-height: 420px;
    overflow: auto;
    display: grid;
    gap: 12px;
    padding-right: 6px;
}

.feed-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
}

.feed-item.tone-success {
    box-shadow: inset 3px 0 0 rgba(99, 217, 172, 0.7);
}

.feed-item.tone-warn {
    box-shadow: inset 3px 0 0 rgba(243, 180, 83, 0.7);
}

.feed-item.tone-danger {
    box-shadow: inset 3px 0 0 rgba(255, 109, 125, 0.75);
}

.feed-time {
    color: #f6cad1;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    padding-top: 2px;
}

.feed-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.feed-body p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.empty-feed {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.superior-chart {
    min-height: 260px;
}

.alert-line {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.alert-line strong {
    display: block;
    margin-bottom: 6px;
}

.alert-line p {
    color: var(--muted);
    font-size: 0.9rem;
}

.alert-line.critical {
    box-shadow: inset 4px 0 0 rgba(255, 109, 125, 0.8);
}

.alert-line.muted-line {
    box-shadow: inset 4px 0 0 rgba(243, 180, 83, 0.62);
}

.alert-line.calm {
    box-shadow: inset 4px 0 0 rgba(99, 217, 172, 0.72);
}

@media (max-width: 1440px) {
    .desktop-grid {
        grid-template-columns: 1fr;
    }

    .mission-banner,
    .info-octagon-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1160px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .content {
        padding: 22px;
    }

    .stats-grid,
    .stats-grid.compact,
    .grid-two,
    .form-grid.two-cols,
    .guest-layout,
    .mission-banner,
    .info-octagon-grid {
        grid-template-columns: 1fr;
    }
}
