:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #697586;
    --line: #d9e0e8;
    --accent: #0f766e;
    --accent-2: #b42318;
    --gold: #b7791f;
    --blue: #1d4ed8;
    --shadow: 0 14px 30px rgba(31, 41, 55, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.auth-page {
    display: block;
    min-height: 100vh;
    background: #eef2f6;
}

.sidebar {
    min-height: 100vh;
    background: #101820;
    color: #f8fafc;
    padding: 24px 18px;
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #0f766e;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: #aab6c5;
    margin-top: 3px;
}

.nav {
    display: grid;
    gap: 6px;
    margin-top: 24px;
}

.nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 650;
}

.nav a:hover,
.nav a.active {
    background: #22303c;
    color: #ffffff;
}

.user-panel {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: grid;
    gap: 10px;
}

.user-panel strong,
.user-panel small {
    display: block;
}

.text-button {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    min-height: 40px;
    width: 100%;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.main {
    padding: 32px;
    overflow-x: hidden;
}

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

.login-panel {
    width: min(100%, 420px);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
    display: grid;
    gap: 18px;
}

.login-brand {
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

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

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #b7ebd8;
    background: #edfff8;
    color: #0f5f50;
    margin-bottom: 18px;
    font-weight: 700;
}

.alert.error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b42318;
    margin-bottom: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 24px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 30px;
    line-height: 1.15;
}

h2 {
    font-size: 18px;
}

.page-header p {
    color: var(--muted);
    margin-top: 8px;
    max-width: 900px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metrics article,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metrics article {
    padding: 18px;
}

.metrics span,
small,
.activity-row em {
    color: var(--muted);
}

.metrics strong {
    display: block;
    font-size: 23px;
    margin-top: 8px;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.two {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.panel {
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-title {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: #475467;
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

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

.bar {
    height: 9px;
    width: 150px;
    background: #e8edf3;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 7px;
}

.bar span {
    display: block;
    height: 100%;
    background: var(--accent);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e7f8f4;
    color: #0f766e;
    font-size: 12px;
    font-weight: 750;
    margin: 0 5px 5px 0;
    white-space: nowrap;
}

.pill.soft {
    background: #fff4df;
    color: var(--gold);
}

.activity {
    display: grid;
    gap: 12px;
    padding: 18px 20px;
}

.activity-row {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

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

.activity-row span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.activity-row em {
    font-style: normal;
}

.setup-body {
    padding: 20px;
    display: grid;
    gap: 14px;
}

.setup-body pre {
    margin: 0;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    background: #101820;
    color: #f8fafc;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    padding: 18px 20px 20px;
    align-items: end;
}

label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 700;
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 11px;
    font: inherit;
    color: var(--text);
    background: #ffffff;
    font-size: 16px;
}

textarea {
    min-height: 82px;
    resize: vertical;
}

.span-2 {
    grid-column: span 2;
}

.check {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check input {
    width: auto;
}

.button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    min-height: 41px;
    padding: 10px 15px;
    font-weight: 800;
    cursor: pointer;
}

.button:hover {
    background: #0b5f59;
}

.button.small {
    min-height: 34px;
    padding: 8px 10px;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(105px, 1fr));
    gap: 8px;
    min-width: 560px;
}

.inline-form input,
.inline-form select {
    padding: 8px;
    font-size: 12px;
}

@media (max-width: 1120px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        position: static;
    }

    .nav {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

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

@media (max-width: 760px) {
    body {
        background: #eef2f6;
    }

    .sidebar {
        padding: 14px;
    }

    .brand {
        padding-bottom: 14px;
    }

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

    .user-panel {
        margin-top: 14px;
        padding-top: 14px;
    }

    .main {
        padding: 16px 12px 28px;
    }

    .nav,
    .metrics,
    .form-grid,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    h1 {
        font-size: 24px;
    }

    .page-header {
        margin-bottom: 16px;
    }

    .page-header p {
        font-size: 14px;
    }

    .metrics {
        gap: 10px;
    }

    .metrics article {
        padding: 14px;
    }

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

    .panel {
        margin-bottom: 14px;
    }

    .panel-title {
        padding: 14px;
    }

    .form-grid {
        padding: 14px;
        gap: 12px;
    }

    input,
    select,
    textarea,
    .button,
    .text-button {
        min-height: 44px;
    }

    .table-wrap {
        overflow: visible;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    thead {
        display: none;
    }

    tr {
        border-bottom: 1px solid var(--line);
        padding: 12px 14px;
    }

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

    td {
        border-bottom: 0;
        padding: 5px 0;
    }

    .bar {
        width: 100%;
    }

    .inline-form {
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .login-shell {
        align-items: start;
        padding: 18px 12px;
    }

    .login-panel {
        padding: 18px;
    }
}
