:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --line: #dfe4ea;
    --text: #1d2430;
    --muted: #667085;
    --brand: #2454a6;
    --brand-strong: #173d7a;
    --good: #157347;
    --warn: #9a6700;
    --bad: #b42318;
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--brand);
    text-decoration: none;
}

.shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #101828;
    color: #fff;
    padding: 20px 16px;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav a {
    color: #d0d5dd;
    padding: 10px 12px;
    border-radius: 6px;
}

.nav a.active,
.nav a:hover {
    background: #1d2939;
    color: #fff;
}

.main {
    padding: 24px;
}

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

h1 {
    margin: 0;
    font-size: 24px;
}

h2 {
    font-size: 17px;
    margin: 0 0 14px;
}

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

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

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

.panel,
.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.stat strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
}

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

.table-wrap {
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0;
    background: #fbfcfd;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3538cd;
    font-size: 12px;
    font-weight: 600;
}

.badge.good {
    background: #dcfae6;
    color: var(--good);
}

.badge.warn {
    background: #fef0c7;
    color: var(--warn);
}

.badge.bad {
    background: #fee4e2;
    color: var(--bad);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

button,
.button {
    appearance: none;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    border-radius: 6px;
    padding: 9px 12px;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

button.secondary,
.button.secondary {
    background: #fff;
    color: var(--brand);
}

button.danger {
    border-color: var(--bad);
    background: var(--bad);
}

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

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

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

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

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

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

.notice {
    border: 1px solid #b2ddff;
    background: #eff8ff;
    color: #1849a9;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

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

.login .panel {
    width: min(420px, 100%);
}

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

    .sidebar {
        position: static;
    }

    .grid.cols-4,
    .grid.cols-2,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

