:root {
    color-scheme: light;
    --ink: #17211b;
    --muted: #66716c;
    --line: #e4e9e5;
    --surface: #ffffff;
    --surface-soft: #f7f9f6;
    --accent: #2f6f5e;
    --accent-strong: #1f4e41;
    --accent-soft: #e7f2ee;
    --danger: #ad3434;
    --danger-soft: #fae8e8;
    --warning: #a7651a;
    --warning-soft: #fff2dc;
    --shadow: 0 18px 50px rgba(23, 33, 27, 0.12);
    --shadow-soft: 0 10px 28px rgba(23, 33, 27, 0.08);
    --radius: 22px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(47, 111, 94, 0.15), transparent 34rem),
        linear-gradient(135deg, #fbfcfa 0%, #eef4f0 100%);
}

a {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.auth-card,
.panel,
.stat-card,
.user-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(228, 233, 229, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(460px, 100%);
    padding: 34px;
}

.brand-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #72a894);
    box-shadow: var(--shadow-soft);
}

.eyebrow {
    margin: 20px 0 8px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.auth-card h1 {
    font-size: 2.25rem;
}

h2 {
    margin-bottom: 18px;
    font-size: 1.35rem;
}

.lede,
.muted {
    color: var(--muted);
    line-height: 1.6;
}

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

.topbar-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar h1 {
    margin-bottom: 4px;
}

.actions,
.inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.dashboard-grid {
    grid-template-columns: 1fr 1.4fr;
    align-items: start;
}

.stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
}

.stat-card {
    padding: 22px;
    box-shadow: var(--shadow-soft);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.panel {
    padding: 26px;
}

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

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

label {
    font-size: 0.88rem;
    font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 0 15px;
    color: var(--ink);
    background: #fbfcfb;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus {
    border-color: rgba(47, 111, 94, 0.65);
    box-shadow: 0 0 0 4px rgba(47, 111, 94, 0.12);
    background: #fff;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(47, 111, 94, 0.22);
}

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

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

.button.danger {
    background: var(--danger);
    box-shadow: none;
}

.button.small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.88rem;
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.flash.success {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.flash.error {
    color: var(--danger);
    background: var(--danger-soft);
}

.flash.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.user-list {
    display: grid;
    gap: 14px;
}

.user-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.user-card h3 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.badge.inactive {
    color: var(--warning);
    background: var(--warning-soft);
}

.badge.user {
    color: var(--muted);
    background: var(--surface-soft);
}

.empty-state {
    padding: 28px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.footer-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

@media (max-width: 860px) {
    .topbar,
    .user-card {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        display: grid;
    }

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

    .user-card {
        grid-template-columns: 1fr;
    }

    .inline-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .page-shell {
        width: min(100% - 22px, 1120px);
        padding: 24px 0;
    }

    .auth-card,
    .panel {
        padding: 22px;
        border-radius: 18px;
    }

    .button {
        width: 100%;
    }
}
