* {
    box-sizing: border-box;
}

:root {
    font-family: Arial, Helvetica, sans-serif;
    color: #172033;
    background: #f4f7fb;
}

body {
    margin: 0;
    background: #f4f7fb;
}

.topbar {
    min-height: 86px;
    padding: 18px 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #e7ebf2;
}

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

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    background: #4569df;
}

.brand strong {
    display: block;
    font-size: 20px;
}

.brand small {
    display: block;
    margin-top: 3px;
    color: #7a8497;
}

.server {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: #f4f6fa;
    font-weight: 700;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.green {
    background: #25b66a;
}

.red {
    background: #df4d58;
}

.nav {
    padding: 0 5vw;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    background: #fff;
    border-bottom: 1px solid #e7ebf2;
}

.nav a {
    padding: 15px 13px;
    text-decoration: none;
    color: #697387;
    font-weight: 700;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.nav a.active {
    color: #3558d4;
    border-bottom-color: #4d6fe7;
}

.nav a.disabled {
    opacity: .45;
    cursor: default;
}

.container {
    width: min(1180px, 90vw);
    margin: 34px auto 60px;
}

.hero {
    min-height: 230px;
    padding: 38px 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 26px;
    color: #fff;
    box-shadow: 0 18px 50px rgba(41, 57, 98, .13);
}

.hero.healthy {
    background: linear-gradient(
        135deg,
        #234d9d,
        #476ce0 55%,
        #3aa17e
    );
}

.hero.unhealthy {
    background: linear-gradient(
        135deg,
        #8d2e38,
        #d2545d
    );
}

.eyebrow {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .75;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: 44px;
    line-height: 1.05;
}

.hero p {
    max-width: 620px;
    margin: 0;
    line-height: 1.6;
    opacity: .86;
}

.status-circle {
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    margin-left: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 50px;
    font-weight: 800;
    background: rgba(255,255,255,.17);
    border: 1px solid rgba(255,255,255,.25);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.card,
.panel,
.download-panel {
    background: #fff;
    border: 1px solid #e6eaf1;
    box-shadow: 0 8px 25px rgba(35, 48, 81, .05);
}

.card {
    padding: 24px;
    border-radius: 20px;
}

.label {
    display: block;
    margin-bottom: 12px;
    color: #7a8497;
    font-size: 13px;
    font-weight: 700;
}

.card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 25px;
}

.card small {
    color: #8a93a5;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 22px;
}

.panel {
    padding: 28px;
    border-radius: 22px;
}

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

.panel h2,
.download-panel h2 {
    margin: 0;
    font-size: 23px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge.ok {
    color: #16814c;
    background: #e9f8f0;
}

.badge.bad {
    color: #b52d39;
    background: #fcebed;
}

.rows {
    border-top: 1px solid #edf0f5;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #edf0f5;
}

.row span {
    color: #717b8f;
}

.good {
    color: #16814c;
}

.badtext {
    color: #c23d48;
}

.progress {
    height: 9px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf0f5;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: #4d6fe7;
}

.progress-text {
    display: block;
    margin-top: 9px;
    color: #8a93a5;
}

.download-panel {
    margin-top: 22px;
    padding: 28px;
    border-radius: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.download-panel p {
    margin: 7px 0;
    color: #707b8f;
}

.alert {
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 14px;
    font-weight: 700;
}

.alert.error {
    color: #a62f3a;
    background: #fcebed;
    border: 1px solid #f3cbd0;
}

footer {
    min-height: 70px;
    padding: 20px 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #7c8699;
    font-size: 13px;
    background: #fff;
    border-top: 1px solid #e7ebf2;
}

@media (max-width: 900px) {
    .metric-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .hero {
        padding: 30px;
    }

    .hero h1 {
        font-size: 36px;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 15px 20px;
    }

    .container {
        width: calc(100% - 30px);
        margin-top: 20px;
    }

    .nav {
        padding: 0 15px;
    }

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

    .hero {
        min-height: auto;
        padding: 28px 24px;
    }

    .status-circle {
        width: 70px;
        height: 70px;
        margin-left: 15px;
        font-size: 34px;
    }

    .download-panel {
        align-items: flex-start;
        flex-direction: column;
    }

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

.page-head {
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0 0 8px;
    font-size: 36px;
}

.page-head p {
    margin: 0;
    color: #727d91;
}

.scope-list {
    border-top: 1px solid #edf0f5;
}

.scope-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 17px 4px;
    border-bottom: 1px solid #edf0f5;
    cursor: pointer;
}

.scope-main,
.scope-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.scope-main input {
    width: 20px;
    height: 20px;
}

.scope-main strong {
    display: block;
    margin-bottom: 4px;
}

.scope-main small {
    color: #8790a2;
}

.scope-meta {
    color: #687387;
}

.badge.neutral {
    color: #697387;
    background: #eef1f5;
}

.scope-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding-top: 24px;
}

.scope-actions strong,
.scope-actions small {
    display: block;
}

.scope-actions small {
    margin-top: 4px;
    color: #8790a2;
}

.button-primary {
    border: 0;
    border-radius: 11px;
    padding: 12px 18px;
    color: #fff;
    background: #4569df;
    font-weight: 750;
    cursor: pointer;
}

.alert.success {
    color: #16814c;
    background: #e9f8f0;
    border: 1px solid #c8ead7;
}

@media (max-width: 700px) {
    .scope-item,
    .scope-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

.data-table {
    border-top: 1px solid #edf0f5;
}

.data-row {
    display: grid;
    grid-template-columns: 1fr 180px 130px;
    gap: 20px;
    align-items: center;
    padding: 15px 4px;
    border-bottom: 1px solid #edf0f5;
}

.data-head {
    color: #8790a2;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

@media (max-width: 700px) {
    .data-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .data-head {
        display: none;
    }
}

.badge.warn {
    color: #946200;
    background: #fff3cf;
}

.backup-row {
    grid-template-columns: 1fr 150px 260px;
}

@media (max-width: 700px) {
    .backup-row {
        grid-template-columns: 1fr;
    }
}

.download-row {
    grid-template-columns: 1fr 150px 190px;
}

.hash {
    display: block;
    max-width: 650px;
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: #8790a2;
    font-family: monospace;
}

.info-panel {
    margin-top: 22px;
    padding: 22px 26px;
    border: 1px solid #dce4f5;
    border-radius: 18px;
    background: #f8faff;
}

.info-panel p {
    margin: 7px 0 0;
    color: #707b8f;
    line-height: 1.6;
}

@media (max-width: 700px) {
    .download-row {
        grid-template-columns: 1fr;
    }
}

.log-row {
    grid-template-columns: 1fr 130px 110px 170px;
}

@media (max-width: 800px) {
    .log-row {
        grid-template-columns: 1fr;
    }
}

.system-storage {
    margin-top: 22px;
}

.system-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.system-metrics div {
    padding: 18px;
    border-radius: 15px;
    background: #f7f9fc;
}

.system-metrics span {
    display: block;
    margin-bottom: 8px;
    color: #7b8598;
    font-size: 13px;
}

.system-metrics strong {
    font-size: 20px;
}

@media (max-width: 800px) {
    .system-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 500px) {
    .system-metrics {
        grid-template-columns: 1fr;
    }
}

.login-body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(
            circle at top right,
            rgba(76, 110, 245, .12),
            transparent 32rem
        ),
        #f4f7fb;
}

.login-shell {
    width: 100%;
    max-width: 460px;
}

.login-card {
    padding: 38px 40px;
    border: 1px solid #e6eaf1;
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 24px 70px rgba(34, 48, 78, .12);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.login-brand strong {
    display: block;
    font-size: 20px;
}

.login-brand small {
    display: block;
    margin-top: 3px;
    color: #7a8497;
}

.login-heading {
    margin-bottom: 28px;
}

.login-heading h1 {
    margin: 0 0 10px;
    font-size: 32px;
    line-height: 1.15;
}

.login-heading p {
    margin: 0;
    color: #727d91;
    line-height: 1.55;
}

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

.login-form label {
    display: grid;
    gap: 7px;
}

.login-form label > span {
    font-size: 13px;
    font-weight: 700;
    color: #49546a;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d8deea;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: #172033;
    font: inherit;
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.login-form input:focus {
    border-color: #4d6fe7;
    box-shadow:
        0 0 0 3px rgba(77, 111, 231, .12);
}

.login-form .button-primary {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 800;
}

.login-note {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #edf0f5;
    color: #8a93a5;
    font-size: 12px;
    text-align: center;
}

.login-card .alert {
    margin-bottom: 20px;
}

@media (max-width: 520px) {
    .login-card {
        padding: 30px 24px;
        border-radius: 20px;
    }

    .login-heading h1 {
        font-size: 28px;
    }
}

.admin-tools {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-user {
    padding-left: 14px;
    border-left: 1px solid #e2e6ee;
    color: #687387;
    font-size: 13px;
    font-weight: 700;
}

.logout-form {
    margin: 0;
}

.logout-button {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #d8deea;
    border-radius: 9px;
    background: #fff;
    color: #4e596e;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.logout-button:hover {
    background: #f5f7fb;
    border-color: #c8cfdd;
}

@media (max-width: 700px) {
    .admin-tools {
        gap: 8px;
    }

    .admin-user {
        display: none;
    }
}

.download-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 9px;
    background: #4569df;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.download-button:hover {
    background: #3658c7;
}

.export-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
    padding: 20px 22px;
    border: 1px solid #dce4f5;
    border-radius: 16px;
    background: #f8faff;
}

.export-control strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.export-control small {
    display: block;
    max-width: 620px;
    color: #788398;
    line-height: 1.5;
}

.export-control form {
    flex: 0 0 auto;
}

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

@media (max-width: 760px) {
    .export-control {
        align-items: stretch;
        flex-direction: column;
    }

    .export-control .button-primary {
        width: 100%;
    }
}

.export-progress-wrap {
    width: min(680px, 100%);
    margin-top: 18px;
}

.export-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 8px;
    color: #657086;
    font-size: 12px;
}

.export-progress-head strong {
    margin: 0;
    color: #315bd5;
    font-size: 13px;
    white-space: nowrap;
}

.export-progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e4e9f2;
}

.export-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: #4d6fe7;
    transition: width .45s ease;
}

.export-progress-detail {
    margin-top: 8px;
    color: #8791a3;
    font-size: 11px;
    line-height: 1.45;
}
