
:root {
    color-scheme: dark;
    --background: #0b1120;
    --sidebar: #0e1626;
    --panel: #111c2e;
    --panel-hover: #16243a;
    --border: #243149;
    --text: #edf3fc;
    --muted: #91a0b8;
    --blue: #66a6ff;
    --green: #43d6a0;
    --purple: #b59aff;
    --cyan: #57d9e8;
    --orange: #ffb86b;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

button,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: 250px;
    padding: 26px 18px 18px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 35px;
    color: var(--text);
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4388ff, #7557e8);
    font-size: 23px;
    font-weight: 800;
    color: white;
}

.brand strong,
.brand small,
.profile strong,
.profile small,
.environment-card strong,
.environment-card small {
    display: block;
}

.brand strong {
    font-size: 15px;
    letter-spacing: -0.3px;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1px;
}

.nav-label {
    padding: 0 12px 12px;
    color: #71819c;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.navigation {
    display: grid;
    gap: 7px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #a5b3c9;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: var(--panel-hover);
    color: white;
}

.nav-link.active {
    background: #1a2d49;
    border-color: #2a466c;
    color: #a9ceff;
}

.nav-icon {
    width: 20px;
    font-size: 19px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
}

.environment-card {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
    padding: 14px 10px;
    background: #111e30;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.environment-card strong,
.profile strong {
    font-size: 12px;
}

.environment-card small,
.profile small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.environment-dot,
.status-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.profile {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 17px 4px 0;
    border-top: 1px solid var(--border);
}

.avatar {
    display: grid;
    place-items: center;
    width: 37px;
    height: 37px;
    border-radius: 50%;
    background: #293959;
    color: #d7e5ff;
    font-size: 12px;
    font-weight: 700;
}

.main-content {
    min-height: 100vh;
    margin-left: 250px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 34px;
    background: rgba(11, 17, 32, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

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

.breadcrumb span {
    margin: 0 10px;
    color: #52617a;
}

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

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.environment-pill,
.subtle-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #a8bad4;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.environment-pill .environment-dot {
    width: 6px;
    height: 6px;
}

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

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 22px;
}

.page-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 35px 34px 22px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.eyebrow {
    margin-bottom: 7px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 7px;
    font-size: clamp(25px, 3vw, 32px);
    font-weight: 650;
    letter-spacing: -1px;
}

.page-heading p,
.panel-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.button-primary {
    background: #3977e8;
    border-color: #3977e8;
    color: white;
}

.button-primary:hover {
    background: #4d89f5;
}

.button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 15px;
    border: 1px solid #31527d;
    border-radius: 8px;
    background: #132440;
    color: #bcd8ff;
    font-size: 12px;
}

.notice.error {
    border-color: #7b4249;
    background: #2b1923;
    color: #ffb6bd;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 22px;
}

.metric-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}

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

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

.metric-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.9px;
}

.metric-icon,
.infra-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 35px;
    height: 35px;
    border-radius: 9px;
    font-size: 18px;
}

.blue {
    background: #1a3153;
    color: var(--blue);
}

.purple {
    background: #30264e;
    color: var(--purple);
}

.cyan {
    background: #163840;
    color: var(--cyan);
}

.orange {
    background: #3d2d20;
    color: var(--orange);
}

.metric-value {
    overflow-wrap: anywhere;
    margin: 14px 0 7px;
    font-size: 25px;
    font-weight: 650;
    letter-spacing: -0.6px;
}

.metric-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 17px;
    color: var(--muted);
    font-size: 10px;
}

.metric-foot .status-dot {
    width: 6px;
    height: 6px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
    gap: 20px;
    margin-bottom: 22px;
    scroll-margin-top: 90px;
}

.panel {
    min-width: 0;
    padding: 22px;
    margin-bottom: 22px;
    scroll-margin-top: 90px;
}

.content-grid .panel {
    margin-bottom: 0;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.panel-heading h2 {
    margin-bottom: 5px;
    font-size: 15px;
    font-weight: 650;
}

.subtle-label {
    white-space: nowrap;
    padding: 5px 7px;
    color: #8ca0bd;
    font-size: 9px;
}

.service-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.service-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #1b3150;
    color: #91bfff;
    font-size: 11px;
    font-weight: 800;
}

.frontend-symbol {
    background: #2c2447;
    color: #c4adff;
}

.service-info {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 3px;
}

.service-info strong {
    font-size: 12px;
}

.service-info span,
.service-info code {
    color: var(--muted);
    font-size: 10px;
}

.service-info code {
    overflow-wrap: anywhere;
    font-family: Consolas, monospace;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 650;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-online {
    background: #14362f;
    border-color: #235444;
    color: #69ddb4;
}

.status-checking {
    background: #2e2b20;
    border-color: #51462b;
    color: #f0c67d;
}

.status-offline {
    background: #3a2029;
    border-color: #60323c;
    color: #ff9ba8;
}

.status-planned {
    background: #202c40;
    border-color: #33425b;
    color: #9aacc7;
}

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 18px;
    color: var(--muted);
    font-size: 10px;
}

.text-button {
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--blue);
    font-size: 11px;
    font-weight: 600;
}

.text-button:hover {
    color: white;
}

.environment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}

.environment-row:last-child {
    border-bottom: 0;
}

.environment-row strong {
    color: #dce6f5;
    font-size: 11px;
    font-weight: 550;
    text-align: right;
}

.environment-row a {
    white-space: nowrap;
}

.infrastructure-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.infra-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 177px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0e1829;
}

.infra-symbol {
    margin-bottom: 13px;
}

.infra-card strong {
    font-size: 12px;
}

.infra-card p {
    flex: 1;
    margin: 6px 0 14px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

.activity-list {
    display: grid;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:first-child {
    padding-top: 0;
}

.activity-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.activity-marker {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
}

.activity-marker.green {
    background: var(--green);
}

.activity-marker.blue {
    background: var(--blue);
}

.activity-marker.purple {
    background: var(--purple);
}

.activity-copy {
    flex: 1;
    min-width: 0;
}

.activity-copy strong {
    font-size: 12px;
}

.activity-copy p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.activity-item time {
    color: #71819c;
    font-size: 10px;
    white-space: nowrap;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 5px;
    color: #74839d;
    font-size: 10px;
}

.footer-separator {
    margin: 0 5px;
}

@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 850px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 12px 0 35px #0006;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-button {
        display: inline-block;
    }

    .topbar {
        gap: 14px;
        padding: 0 20px;
    }

    .topbar-date {
        display: none;
    }

    .page-content {
        padding: 26px 20px;
    }

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

@media (max-width: 520px) {
    .page-content {
        padding: 22px 14px;
    }

    .topbar {
        min-height: 60px;
        padding: 0 14px;
    }

    .breadcrumb {
        font-size: 11px;
    }

    .topbar-right {
        gap: 0;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .metrics-grid {
        gap: 10px;
    }

    .metric-card {
        padding: 13px;
    }

    .metric-value {
        font-size: 21px;
    }

    .panel {
        padding: 16px;
    }

    .service-row {
        flex-wrap: wrap;
    }

    .service-info {
        flex-basis: calc(100% - 65px);
    }

    .service-row .status-badge {
        margin-left: 55px;
    }

    .infrastructure-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .infra-card {
        padding: 12px;
    }

    .activity-item {
        flex-wrap: wrap;
    }

    .activity-item time {
        margin-left: 22px;
    }
}
