* {
    box-sizing: border-box;
}

:root {
    --nav: #111827;
    --nav-light: #1f2937;
    --page: #f5f7fb;
    --card: #ffffff;
    --line: #e5e9f0;
    --text: #172033;
    --muted: #7a8494;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #15805d;
    --green-bg: #e7f7ef;
    --amber: #a76b00;
    --amber-bg: #fff4da;
    --red: #b42318;
    --red-bg: #feeceb;
}

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

body {
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--page);
    color: var(--text);
    font-size: 14px;
}

a {
    color: inherit;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    background: var(--nav);
    color: white;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

.brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    padding: 0 8px 27px;
}

.brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 11px;
    background: var(--blue);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 20px;
}

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

.brand span,
.login-brand span {
    display: block;
    color: #929daf;
    font-size: 11px;
    margin-top: 3px;
}

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

nav a {
    color: #aeb8c9;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 11px;
}

nav a:hover,
nav a.active {
    background: var(--nav-light);
    color: white;
}

.nav-icon {
    width: 18px;
    text-align: center;
}

.nav-label {
    color: #596579;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    margin: 22px 12px 8px;
}

.sidebar-user {
    margin-top: auto;
    border-top: 1px solid #283346;
    padding: 18px 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #26364f;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-text {
    min-width: 0;
    flex: 1;
}

.user-text strong,
.user-text span {
    display: block;
}

.user-text strong {
    font-size: 12px;
}

.user-text span {
    color: #7f8ba0;
    font-size: 10px;
    margin-top: 2px;
}

.logout {
    text-decoration: none;
    color: #8692a5;
    font-size: 18px;
}

.main {
    margin-left: 250px;
    padding: 30px 34px 50px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.topbar h1 {
    font-size: 25px;
    margin: 0 0 5px;
}

.topbar p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.health-pill {
    background: white;
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
}

.health-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.health-pill.ok span {
    background: #17a673;
    box-shadow: 0 0 0 3px #daf5ea;
}

.health-pill.bad span {
    background: #d92d20;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 20px;
}

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

.metric-card {
    padding: 20px;
}

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

.metric-value {
    font-size: 30px;
    font-weight: 700;
    margin: 8px 0 5px;
}

.metric-foot {
    font-size: 10px;
    color: #9ba3b0;
}

.green-text {
    color: var(--green);
}

.amber-text {
    color: var(--amber);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 20px;
}

.split-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
}

.deploy-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 20px;
}

.panel {
    padding: 21px;
    margin-bottom: 20px;
}

.panel h2 {
    margin: 0;
    font-size: 16px;
}

.panel-description,
.panel-head p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.panel-description {
    margin: 7px 0 20px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.panel-head p {
    margin: 4px 0 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 650px;
}

th {
    padding: 10px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

td {
    padding: 13px 9px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 12px;
    vertical-align: middle;
}

td strong {
    display: block;
    font-size: 12px;
}

.sub {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 3px;
}

.mono,
code {
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 30px;
}

.badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}

.badge.green {
    background: var(--green-bg);
    color: var(--green);
}

.badge.amber {
    background: var(--amber-bg);
    color: var(--amber);
}

.badge.red {
    background: var(--red-bg);
    color: var(--red);
}

.badge.gray {
    background: #eef1f5;
    color: #677284;
}

.server-panel {
    align-self: start;
}

.server-host {
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    font-family: monospace;
    margin: 15px 0;
}

.port-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #edf0f4;
}

.port-row span {
    font-size: 12px;
}

.port-row small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
    font-size: 9px;
}

.port-row b {
    font-size: 10px;
}

.up {
    color: var(--green);
}

.down {
    color: var(--red);
}

.server-config-state {
    padding: 16px 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 7px;
}

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

.green-dot {
    background: var(--green);
}

.amber-dot {
    background: #e19a18;
}

.form {
    display: grid;
    gap: 15px;
}

.form label {
    display: grid;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
}

.form-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input,
select,
textarea {
    width: 100%;
    background: white;
    border: 1px solid #d8dde6;
    border-radius: 8px;
    padding: 10px 11px;
    outline: none;
    font: inherit;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow:
        0 0 0 3px
        rgba(37,99,235,.08);
}

textarea {
    resize: vertical;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn.primary {
    background: var(--blue);
    color: white;
}

.btn.primary:hover {
    background: var(--blue-dark);
}

.btn.secondary {
    background: #f0f3f7;
    color: #435066;
}

.btn.wide {
    width: 100%;
}

.alert {
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 12px;
}

.alert.success {
    background: var(--green-bg);
    color: var(--green);
}

.alert.danger {
    background: var(--red-bg);
    color: var(--red);
}

.alert.warning {
    background: var(--amber-bg);
    color: var(--amber);
}

.alert a {
    font-weight: 700;
}

.text-link {
    color: var(--blue);
    font-size: 10px;
    text-decoration: none;
}

.device-count {
    background: #f0f3f7;
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 10px;
}

.inline-form {
    display: inline;
}

.icon-button {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #788395;
    font-size: 18px;
}

.password-reveal {
    background: #101828;
    color: white;
    border-radius: 11px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.password-reveal span {
    display: block;
    color: #a9b2c3;
    font-size: 10px;
    margin-bottom: 4px;
}

.password-reveal strong {
    font-size: 16px;
}

.password-reveal a {
    color: #b9ceff;
    font-size: 11px;
}

.deployment-success {
    background: #ecfdf3;
    border: 1px solid #c3ead4;
    border-radius: 12px;
    padding: 17px 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
}

.success-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #159367;
    color: white;
    font-weight: 800;
}

.deployment-success h2 {
    margin: 0 0 4px;
    font-size: 15px;
}

.deployment-success p {
    margin: 0;
    color: #577266;
    font-size: 11px;
}

.command-box {
    background: #101828;
    color: #d7e1f5;
    border-radius: 9px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.command-box code {
    flex: 1;
    overflow-wrap: anywhere;
    font-size: 11px;
}

.command-box button {
    background: #29374d;
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
}

.info-grid,
.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
    margin-top: 18px;
}

.info-grid > div,
.settings-grid > div {
    background: white;
    padding: 13px;
}

.info-grid span,
.settings-grid span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-bottom: 4px;
}

.info-grid strong,
.settings-grid strong {
    font-size: 11px;
}

.settings-grid code {
    font-size: 9px;
    overflow-wrap: anywhere;
}

.step-list {
    display: grid;
    gap: 14px;
    margin-top: 19px;
}

.step-list > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-list b {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border-radius: 50%;
    background: #edf2ff;
    color: var(--blue);
    display: grid;
    place-items: center;
    font-size: 10px;
}

.step-list span {
    color: #586477;
    font-size: 11px;
}

.settings-panel {
    max-width: 850px;
}

.muted {
    color: var(--muted);
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(
            circle at 20% 0%,
            #213c7a,
            #101827 50%,
            #090f19
        );
}

.login-shell {
    width: 390px;
    max-width: calc(100% - 30px);
}

.login-brand {
    color: white;
    margin-bottom: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow:
        0 25px 80px
        rgba(0,0,0,.32);
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 23px;
}

.login-card > p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    margin: 0 0 20px;
}

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

.login-card label {
    font-size: 10px;
    font-weight: 700;
    margin-top: 6px;
}

@media (max-width: 1050px) {

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

    .dashboard-grid,
    .split-grid,
    .deploy-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 720px) {

    .sidebar {
        width: 68px;
        padding: 20px 8px;
    }

    .brand > div:last-child,
    nav a:not(.active) {
        font-size: 0;
    }

    .brand {
        padding-left: 6px;
    }

    nav a {
        justify-content: center;
    }

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

    .nav-label,
    .sidebar-user {
        display: none;
    }

    .main {
        margin-left: 68px;
        padding: 20px;
    }

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

    .topbar {
        align-items: flex-start;
        gap: 15px;
    }

    .info-grid,
    .settings-grid,
    .form-two {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 480px) {

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

}
