:root {
    color-scheme: light;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    color: #172033;
    background: #f5f7fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --navy: #172033;
    --muted: #788398;
    --border: #e8ecf2;
    --blue: #4263eb;
    --green: #15956b;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 360px;
    min-height: 100vh;
    margin: 0;
}

button {
    font: inherit;
}

.shell {
    min-height: 100vh;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    color: #19243a;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.65px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #617cff, #3f5de0);
    box-shadow: 0 5px 12px #4263eb35;
    color: #fff;
    font-family: Manrope, sans-serif;
    font-size: 19px;
}

.brand-light {
    color: #64708a;
    font-weight: 600;
}

.sidebar-label {
    margin: 47px 10px 12px;
    color: #9aa3b3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.05px;
}

nav {
    display: grid;
    gap: 5px;
}

.nav-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 12px;
    padding: 0 11px;
    border-radius: 8px;
    color: #657187;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
}

.nav-link:hover {
    background: #f5f7fc;
    color: #33425e;
}

.nav-link.active {
    background: #edf1ff;
    color: #3e5bda;
    font-weight: 700;
}

.nav-icon {
    width: 17px;
    color: #8a95a8;
    font-size: 17px;
    text-align: center;
}

.active .nav-icon {
    color: #4a65e5;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 13px 8px 0;
    border-top: 1px solid #eef0f4;
    color: #657187;
    font-size: 11px;
    white-space: nowrap;
}

.local-indicator,
.health-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.local-indicator,
.health-dot.is-healthy {
    background: #1aa779;
    box-shadow: 0 0 0 3px #1aa7791c;
}

.environment-tag {
    margin-left: auto;
    padding: 3px 5px;
    border-radius: 4px;
    background: #f0f3f8;
    color: #69758b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    height: 66px;
    align-items: center;
    justify-content: space-between;
    padding: 0 42px;
    border-bottom: 1px solid var(--border);
    background: #ffffffed;
    backdrop-filter: blur(12px);
}

.breadcrumb {
    color: #8791a3;
    font-size: 12px;
}

.breadcrumb span {
    margin: 0 9px;
    color: #c2c8d2;
}

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

.protected-label {
    color: #758096;
    font-size: 11px;
}

.protected-label span {
    margin-right: 5px;
    color: #4d66de;
}

.avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #dfe5ff;
    border-radius: 50%;
    background: #f0f3ff;
    color: #5368d7;
    font-size: 11px;
    font-weight: 700;
}

.page-content {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 37px 42px 25px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 25px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #8792a6;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.15px;
}

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

h1 {
    margin-bottom: 5px;
    color: #1b263b;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: clamp(24px, 3vw, 29px);
    font-weight: 800;
    letter-spacing: -1.15px;
}

.subtitle {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 12px;
}

.read-only-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 2px;
    padding: 7px 10px;
    border: 1px solid #e8eaf0;
    border-radius: 6px;
    background: #fff;
    color: #758096;
    font-size: 10px;
    white-space: nowrap;
}

.read-only-badge span {
    color: #d29a39;
    font-size: 8px;
}

.scan-notice {
    margin: -8px 0 17px;
    padding: 10px 13px;
    border: 1px solid #cfe9da;
    border-radius: 7px;
    background: #f2faf5;
    color: #16794f;
    font-size: 11px;
}

.scan-notice.is-error {
    border-color: #efcdd0;
    background: #fff6f6;
    color: #a93740;
}

.operation-notice {
    display: grid;
    gap: 5px;
    margin: -8px 0 17px;
    padding: 12px 14px;
    border: 1px solid #cfe9da;
    border-radius: 7px;
    background: #f2faf5;
    color: #16794f;
    font-size: 11px;
    line-height: 1.5;
}

.operation-notice span {
    color: #597c6c;
    font-size: 10px;
}

.operation-notice.is-error {
    border-color: #efcdd0;
    background: #fff6f6;
    color: #a93740;
}

.operation-notice.is-error span {
    color: #986469;
}

.state-warning {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid #f0d7b4;
    border-radius: 6px;
    background: #fff9ef;
    color: #805a25;
    font-size: 10px;
    line-height: 1.5;
}

.state-warning strong {
    color: #704817;
}

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

.summary-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 6px #26385905;
}

.summary-card {
    position: relative;
    min-height: 143px;
    padding: 17px 19px 15px;
    overflow: hidden;
}

.summary-card::after {
    position: absolute;
    right: -25px;
    bottom: -50px;
    width: 125px;
    height: 125px;
    border: 1px solid #e8ecfa;
    border-radius: 50%;
    content: "";
}

.summary-card::before {
    position: absolute;
    right: -5px;
    bottom: -30px;
    width: 80px;
    height: 80px;
    border: 1px solid #edf0fa;
    border-radius: 50%;
    content: "";
}

.card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-label {
    color: #828da1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.card-symbol {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 7px;
    font-size: 16px;
}

.release-symbol {
    background: #edf1ff;
    color: #4b65e0;
}

.health-symbol {
    background: #eaf8f2;
    color: #15956b;
}

.active-version {
    margin-top: 13px;
    color: #202b42;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.1;
}

.card-footnote {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    color: #8a94a5;
    font-size: 10px;
}

.card-footnote code {
    color: #66728a;
    font-size: 10px;
}

.health-state {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 15px;
    color: #16835f;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.health-state.is-unhealthy {
    color: #be4149;
}

.health-dot.is-unhealthy {
    background: #d64e56;
    box-shadow: 0 0 0 3px #d64e561b;
}

.footnote-divider {
    margin: 0 5px;
    color: #c0c6d0;
}

.health-error {
    margin-left: 5px;
    color: #be4149;
}

.checked-at {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 5px;
    color: #9aa3b1;
    font-size: 9px;
}

.panel {
    padding: 19px 20px;
}

.releases-panel {
    margin-bottom: 16px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.section-heading h2 {
    margin-bottom: 4px;
    color: #253148;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.25px;
}

.section-heading p {
    margin-bottom: 0;
    color: #8791a3;
    font-size: 10px;
}

.count-badge {
    padding: 5px 8px;
    border: 1px solid #e8ebf1;
    border-radius: 5px;
    color: #7d8799;
    font-size: 9px;
    white-space: nowrap;
}

.table-wrap {
    margin-top: 17px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead {
    background: #f8f9fc;
}

th {
    padding: 9px 10px;
    color: #8a94a5;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.7px;
    white-space: nowrap;
}

th:first-child {
    border-radius: 5px 0 0 5px;
}

th:last-child {
    border-radius: 0 5px 5px 0;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f2f6;
    color: #364159;
    font-size: 10px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.version-mark {
    display: block;
    color: #3b4962;
    font-weight: 700;
}

.version-mark-active {
    color: #425fdf;
}

.release-dir {
    display: block;
    margin-top: 3px;
    color: #9aa3b1;
    font-size: 8px;
}

.description-cell {
    color: #7b8698;
}

.release-issues {
    display: grid;
    gap: 4px;
    margin: 7px 0 0;
    padding-left: 14px;
    color: #ae4449;
    font-size: 9px;
    line-height: 1.4;
}

.active-structure-warning {
    display: block;
    margin-top: 5px;
    color: #b27622;
    font-size: 8px;
    line-height: 1.4;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pill span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.status-active {
    background: #eaf8f2;
    color: #16835f;
}

.status-active span {
    background: #19a376;
}

.status-ready {
    background: #edf3ff;
    color: #4562bf;
}

.status-ready span {
    background: #5270d5;
}

.status-inactive {
    background: #fff0ef;
    color: #aa4849;
}

.status-inactive span {
    background: #cf5b5e;
}

.button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 600;
    transition: background 120ms ease, color 120ms ease;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.54;
}

.button:focus-visible,
a:focus-visible {
    outline: 3px solid #7187f280;
    outline-offset: 2px;
}

.button-small {
    min-height: 25px;
    padding: 0 8px;
    border-color: #e5e9f1;
    background: #fff;
    color: #788399;
}

.release-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.release-actions form {
    margin: 0;
}

.release-actions .button-small:not(:disabled) {
    border-color: #dce4fb;
    color: #5268c4;
    cursor: pointer;
}

.release-actions .button-small:not(:disabled):hover {
    background: #f1f4ff;
}

.release-actions .button-activate {
    border-color: #d3ebdf;
    color: #16794f;
}

.release-actions .button-activate:hover {
    background: #f1faf5;
}

.button-outline {
    border-color: #e1e6ef;
    background: #fff;
    color: #778399;
}

.button-primary {
    border-color: #4965e5;
    background: #4965e5;
    color: white;
    cursor: pointer;
}

.button-primary:hover {
    background: #3d57d2;
}

.activation-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
    box-shadow: 0 22px 70px #15213b40;
    color: #253148;
}

.activation-dialog::backdrop {
    background: #18223870;
    backdrop-filter: blur(2px);
}

.activation-dialog form {
    padding: 23px;
}

.activation-dialog h2 {
    margin: 0 0 17px;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 18px;
    font-weight: 800;
}

.activation-dialog p {
    margin: 9px 0;
    color: #68758b;
    font-size: 12px;
}

.activation-dialog strong {
    color: #263650;
}

.activation-dialog .dialog-warning {
    margin-top: 17px;
    padding: 10px 11px;
    border-radius: 6px;
    background: #f5f7fc;
    color: #778398;
    font-size: 10px;
    line-height: 1.5;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
}

.dialog-actions .button {
    min-height: 34px;
    padding: 0 13px;
    font-size: 11px;
}

.dialog-actions .button-outline {
    cursor: pointer;
}

.login-page {
    background: #f5f7fb;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-card {
    display: grid;
    width: min(380px, 100%);
    gap: 14px;
    padding: 30px 28px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 50px #15213b12;
}

.login-brand {
    padding: 0;
}

.login-title {
    margin: 6px 0 0;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.login-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.login-error {
    padding: 9px 11px;
    border: 1px solid #f2d4d4;
    border-radius: 7px;
    background: #fdf4f4;
    color: #a54445;
    font-size: 12px;
}

.login-field {
    display: grid;
    gap: 6px;
    color: #4b566b;
    font-size: 11px;
    font-weight: 600;
}

.login-field input {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid #dfe4ec;
    border-radius: 7px;
    background: #fbfcfe;
    color: var(--navy);
    font: inherit;
    font-size: 13px;
}

.login-field input:focus {
    border-color: #8ba0f0;
    outline: 3px solid #7187f233;
}

.login-submit {
    min-height: 38px;
    margin-top: 6px;
    font-size: 12px;
}

.logout-form {
    margin: 0;
}

.logout-button {
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid #e1e6ef;
    border-radius: 5px;
    background: #fff;
    color: #778399;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.logout-button:hover {
    background: #f5f7fc;
    color: #33425e;
}

.table-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    padding-top: 12px;
    border-top: 1px solid #f0f2f6;
    color: #929bac;
    font-size: 9px;
}

.info-icon {
    display: grid;
    width: 13px;
    height: 13px;
    place-items: center;
    border: 1px solid #aeb8c9;
    border-radius: 50%;
    font-size: 8px;
    font-weight: 700;
}

.journal-panel {
    min-width: 0;
    padding: 18px;
}

.journal-table-wrap {
    max-height: 390px;
    margin-bottom: 16px;
}

.journal-table {
    min-width: 850px;
}

.journal-table th,
.journal-table td {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 9px;
}

.journal-operation.is-success td:first-child {
    border-left: 2px solid #19a376;
}

.journal-operation.is-error td:first-child {
    border-left: 2px solid #cf5b5e;
}

.journal-operation.is-success .journal-result {
    color: #16835f;
}

.journal-operation.is-error .journal-result {
    color: #b64449;
}

.journal-http {
    display: block;
    margin-top: 3px;
    color: #7b8698;
    font-size: 8px;
}

.journal-error-row td {
    padding-top: 0;
    color: #ae4449;
    font-size: 9px;
    line-height: 1.5;
}

.journal-error-row strong {
    color: #963b40;
}

.journal-icon {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 7px;
    background: #f0f3ff;
    color: #5269dc;
    font-size: 16px;
}

.journal-empty {
    display: flex;
    min-height: 151px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #929bac;
    text-align: center;
}

.journal-empty-icon {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    margin-bottom: 2px;
    border-radius: 50%;
    background: #f4f6fa;
    color: #98a2b2;
    font-size: 18px;
}

.journal-empty strong {
    color: #667187;
    font-size: 10px;
}

.journal-empty > span:last-child {
    font-size: 9px;
}

.rollback-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f2f6;
}

.rollback-row div {
    display: grid;
    gap: 3px;
}

.rollback-row strong {
    color: #58647b;
    font-size: 9px;
}

.rollback-row div span {
    color: #9aa3b1;
    font-size: 8px;
}

.rollback-row .state-timestamp {
    font-size: 8px;
}

.rollback-row .rollback-unavailable {
    max-width: 430px;
    color: #ae4449;
    line-height: 1.4;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 19px;
    color: #9aa3b1;
    font-size: 9px;
}

.footer-separator {
    margin: 0 4px;
    color: #c5cbd5;
}

.empty-state {
    padding: 20px 10px;
    color: #8993a4;
    text-align: center;
}

@media (min-width: 1500px) {
    .page-content {
        padding-top: 48px;
    }
}

@media (max-width: 1000px) {
    .sidebar {
        width: 215px;
    }

    .main-content {
        margin-left: 215px;
    }

    .page-content {
        padding-right: 25px;
        padding-left: 25px;
    }

    .topbar {
        padding-right: 25px;
        padding-left: 25px;
    }

}

@media (max-width: 700px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 12px 15px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        font-size: 15px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .sidebar-label,
    .sidebar-footer {
        display: none;
    }

    nav {
        display: flex;
        gap: 4px;
        margin-top: 11px;
        overflow-x: auto;
    }

    .nav-link {
        min-height: 35px;
        gap: 6px;
        padding: 0 9px;
        font-size: 10px;
        white-space: nowrap;
    }

    .nav-icon {
        font-size: 14px;
    }

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

    .topbar {
        height: 48px;
        padding: 0 16px;
    }

    .protected-label {
        font-size: 0;
    }

    .protected-label span {
        font-size: 12px;
    }

    .page-content {
        padding: 25px 15px 20px;
    }

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

    .read-only-badge {
        padding: 6px 7px;
        font-size: 8px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-card {
        min-height: 128px;
    }

    .panel {
        padding: 15px;
    }

    .table-wrap {
        margin-right: -5px;
        margin-left: -5px;
    }

    table {
        min-width: 590px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
