:root {
    --bg: oklch(96% 0.006 250);
    --ink: oklch(17% 0.018 250);
    --muted: oklch(46% 0.02 250);
    --line: oklch(88% 0.012 250);
    --panel: white;
    --night: oklch(10% 0.016 245);
    --cyan: oklch(68% 0.16 230);
    --green: oklch(56% 0.17 150);
    --red: oklch(58% 0.22 28);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

a {
    color: oklch(50% 0.22 255);
}

button,
.button-secondary {
    height: 34px;
    border: 1px solid oklch(58% 0.2 250);
    border-radius: 6px;
    background: oklch(98% 0.005 250);
    color: oklch(42% 0.2 250);
    padding: 0 12px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

input,
select {
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px;
    background: white;
    color: var(--ink);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--night);
}

.login-card {
    width: min(380px, calc(100% - 32px));
    background: white;
    border-radius: 8px;
    padding: 28px;
    display: grid;
    gap: 16px;
}

.brand {
    color: oklch(86% 0.16 96);
    font-size: 28px;
    font-weight: 750;
    text-decoration: none;
}

.login-card .brand {
    color: oklch(70% 0.16 96);
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 18px;
}

h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.login-card input,
.login-card button {
    width: 100%;
}

.admin-top {
    height: 70px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    background: var(--night);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-top > div {
    display: flex;
    align-items: center;
    gap: 18px;
}

.admin-user {
    color: white;
    text-decoration: none;
    font-weight: 700;
    margin-left: auto;
    margin-right: 14px;
}

.admin-layout {
    width: min(1180px, calc(100% - 32px));
    margin: 22px auto 56px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tabs a {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.tabs a.active {
    border-color: var(--cyan);
    color: oklch(44% 0.2 240);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metrics div,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metrics div {
    padding: 18px;
    display: grid;
    gap: 8px;
}

.metrics span,
.hint,
small {
    color: var(--muted);
}

.metrics strong {
    font-size: 24px;
}

.panel {
    padding: 16px;
    overflow-x: auto;
}

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

.search {
    display: flex;
    gap: 8px;
}

.search input {
    width: min(420px, 45vw);
}

.range-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 12px;
    margin-bottom: 14px;
    background: oklch(98% 0.004 250);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.range-form label:nth-of-type(9) {
    grid-column: span 2;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.8fr) minmax(560px, 1.2fr);
    gap: 16px;
    align-items: start;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 16px;
}

.settings-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: oklch(98% 0.004 250);
}

.settings-form button {
    width: fit-content;
}

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

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

th {
    color: var(--muted);
    font-weight: 700;
    background: oklch(97% 0.004 250);
}

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

.review-form {
    min-width: 520px;
}

.review-form input {
    width: 108px;
}

.review-form input[name="as_name"],
.review-form input[name="note"] {
    width: 180px;
}

.actions form {
    margin: 0;
}

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

.status--pending {
    background: oklch(65% 0.16 80);
}

.status--approved {
    background: var(--green);
}

.status--rejected {
    background: var(--red);
}

.alert {
    padding: 10px 12px;
    border-radius: 7px;
    margin: 0 0 14px;
}

.alert--ok {
    color: oklch(35% 0.14 150);
    background: oklch(94% 0.05 150);
}

.alert--error {
    color: oklch(35% 0.16 28);
    background: oklch(94% 0.045 28);
}

@media (max-width: 780px) {
    .admin-top,
    .panel-head,
    .search {
        align-items: stretch;
        flex-direction: column;
    }

    .metrics,
    .range-form,
    .split-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .search input {
        width: 100%;
    }
}
