:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #18212f;
    --muted: #5f6c7c;
    --line: #d9e1ea;
    --accent: #175cd3;
    --accent-2: #0f4aa8;
    --success: #166534;
    --error: #b42318;
    --warn: #92400e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #eef4fb 0%, #f9fbfd 100%);
    color: var(--ink);
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.hero {
    margin-bottom: 24px;
}

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

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.07);
}

h1,
h2 {
    margin-top: 0;
}

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

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.flash.success {
    background: #ecfdf3;
    color: var(--success);
    border-color: #abefc6;
}

.flash.error {
    background: #fef3f2;
    color: var(--error);
    border-color: #fecdca;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select,
button {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 12px 14px;
    font: inherit;
}

button {
    background: var(--accent);
    color: #fff;
    border: 0;
    font-weight: 700;
    cursor: pointer;
}

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

.secondary {
    background: #eef4ff;
    color: var(--accent-2);
}

.inline-form {
    display: inline;
}

.stack {
    display: grid;
    gap: 14px;
}

.stack-spaced {
    margin-top: 14px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.pill.admin {
    background: #e0f2fe;
    color: #075985;
}

.pill.viewer {
    background: #eef2ff;
    color: #3730a3;
}

.pill.active {
    background: #ecfdf3;
    color: #166534;
}

.pill.inactive {
    background: #fef3f2;
    color: #b42318;
}

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

.button-link {
    text-decoration: none;
    width: auto;
}

.button-auto {
    width: auto;
    padding: 12px 18px;
}

.note {
    background: #fffaeb;
    border: 1px solid #fedf89;
    color: var(--warn);
    padding: 12px 14px;
    border-radius: 12px;
}

.section-spaced {
    margin-top: 20px;
}
