:root {
    --bg: #f6f7f4;
    --panel: #ffffff;
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #d8ddd2;
    --brand: #176c5f;
    --accent: #d9a441;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

.sidebar {
    background: #142623;
    color: #f9fafb;
    padding: 24px;
}

.brand {
    display: grid;
    gap: 4px;
    margin-bottom: 32px;
}

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

.brand span,
.user-meta,
.muted {
    color: var(--muted);
}

.sidebar .brand span,
.sidebar .user-meta {
    color: #b7c3bd;
}

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

.nav a,
.button {
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    font-weight: 700;
}

.nav a {
    justify-content: flex-start;
    color: #dce5e1;
}

.nav a.active,
.nav a:hover {
    background: #21413b;
    color: #ffffff;
}

.main {
    padding: 28px;
}

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

.topbar h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0;
}

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

.section-head h2 {
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 6px;
}

.eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.table-wrap,
.login-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.card {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.card .count {
    color: var(--brand);
    font-size: 34px;
    font-weight: 800;
}

.button {
    background: var(--brand);
    color: #ffffff;
    border: 0;
    cursor: pointer;
}

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

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

.button.compact {
    min-height: 34px;
    padding: 7px 10px;
}

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

.detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 680px;
    padding: 22px;
}

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

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

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

th {
    background: #eef1ec;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
}

.status.active {
    background: #d7f2df;
    color: #17612a;
}

.status.draft,
.status.pending {
    background: #fff1cf;
    color: #7a4d00;
}

.status.error {
    background: #fee4e2;
    color: var(--danger);
}

.login-page {
    align-items: center;
    display: grid;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    margin: 0 auto;
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

label {
    font-weight: 700;
}

input {
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    min-height: 44px;
    padding: 10px 12px;
}

.alert {
    background: #fee4e2;
    border: 1px solid #fda29b;
    border-radius: 8px;
    color: var(--danger);
    margin-bottom: 16px;
    padding: 10px 12px;
}

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

    .sidebar {
        padding: 18px;
    }

    .main {
        padding: 18px;
    }

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

    .section-head {
        flex-direction: column;
    }
}
