:root {
    --ink: #182426;
    --muted: #5d6b70;
    --line: #d8e2df;
    --panel: #ffffff;
    --band: #f4f8f7;
    --brand: #087f83;
    --brand-strong: #056367;
    --warn: #a85f12;
    --bad: #9f2419;
    --good: #117a52;
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--band);
}

body {
    margin: 0;
}

a {
    color: var(--brand);
}

.auth-shell,
.install-shell {
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 24px;
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    min-height: 68px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
}

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

.nav a,
.link-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 12px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.narrow {
    width: min(760px, 100%);
    margin: 0 auto;
}

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

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 16px;
}

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

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

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

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

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

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric {
    display: grid;
    gap: 8px;
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    font-size: 26px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

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

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

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

button,
.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    padding: 9px 13px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--brand-strong);
}

.button.secondary {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

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

.notice {
    margin-bottom: 16px;
    border: 1px solid rgba(17, 122, 82, .22);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(17, 122, 82, .08);
    color: var(--good);
}

.error-list {
    margin-bottom: 16px;
    border: 1px solid rgba(159, 36, 25, .22);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(159, 36, 25, .08);
    color: var(--bad);
}

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

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

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

th {
    color: #536367;
    font-size: 12px;
    text-transform: uppercase;
}

code,
.mono {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 13px;
}

.pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 8px;
    background: #eef5f4;
    color: #315356;
    font-size: 12px;
    font-weight: 800;
}

.log-box {
    max-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    border-radius: 8px;
    padding: 14px;
    background: #142124;
    color: #d9f0ed;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
}

@media (max-width: 820px) {
    .topbar,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .grid.two,
    .grid.three,
    .grid.four,
    .form-grid {
        grid-template-columns: 1fr;
    }
}
