:root {
    --bg: #f5f6f4;
    --card: #ffffff;
    --text: #151816;
    --muted: #69706b;
    --line: #e4e8e3;
    --main: #637169;
    --main-dark: #4e5b54;
    --soft: #eef1ed;
    --danger: #a94343;
    --success: #3c7655;
    --shadow: 0 10px 28px rgba(27, 35, 30, .055);
    --radius: 22px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #fafbf9 0%, #f3f5f2 100%);
}

a { color: var(--main); text-decoration: none; }
a:hover { color: var(--main-dark); }

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: 104px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 20px 0 8px;
}

.brand {
    grid-column: 2;
    justify-self: center;
}

.brand img {
    height: 44px;
    max-width: 250px;
    display: block;
}

.nav {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px;
}

.nav a {
    color: var(--text);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 999px;
}

.nav a:hover {
    background: var(--soft);
}

.center-wrap,
.auth-wrap {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 32px 0 54px;
}

.wide-wrap {
    flex: 1;
    padding: 30px 0 54px;
}

.card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px;
}

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

.entry-card { width: min(720px, 100%); }

.auth-card .eyebrow {
    text-align: center;
    margin-bottom: 10px;
}

.auth-card h1 {
    text-align: center;
    font-size: 24px;
    line-height: 1.15;
    margin-bottom: 22px;
    letter-spacing: -.02em;
}

.auth-card .form {
    gap: 12px;
}

.auth-card .button {
    margin-top: 10px;
}

.auth-wrap {
    padding-top: 0;
}


.eyebrow {
    color: var(--main);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

h1 {
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.08;
    margin: 0 0 12px;
    letter-spacing: -.035em;
}

.entry-card h1,
.admin-head h1 {
    font-size: clamp(32px, 4vw, 46px);
}

h2 {
    font-size: 22px;
    margin: 0 0 20px;
    letter-spacing: -.02em;
}

.muted {
    margin: 0 0 28px;
    color: var(--muted);
    line-height: 1.55;
}

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

label {
    color: #333a36;
    font-size: 14px;
    font-weight: 700;
}

.input,
.textarea,
select.input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fbfcfb;
    color: var(--text);
    border-radius: 15px;
    padding: 14px 16px;
    font-size: 16px;
    outline: none;
    transition: border .18s, box-shadow .18s, background .18s;
}

.textarea {
    resize: vertical;
    min-height: 190px;
    line-height: 1.5;
}

.input:focus,
.textarea:focus {
    border-color: var(--main);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(99,113,105,.13);
}

.button {
    border: none;
    appearance: none;
    background: var(--main);
    color: #fff;
    border-radius: 15px;
    padding: 13px 18px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: transform .16s, background .16s, box-shadow .16s;
    box-shadow: none;
}

.button:hover {
    background: var(--main-dark);
}

.button.full { width: 100%; margin-top: 6px; }

.button.secondary {
    background: #eef1ed;
    color: var(--text);
    box-shadow: none;
}

.button.ghost {
    background: transparent;
    color: var(--main);
    border: 1px solid var(--line);
    box-shadow: none;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--soft);
    border-radius: 22px;
    padding: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.switch input { display: none; }

.switch span {
    position: relative;
    display: inline-block;
    width: 62px;
    height: 34px;
    background: #dbe1dc;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s;
}

.switch span::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    transition: transform .2s;
}

.switch input:checked + span {
    background: var(--main);
}

.switch input:checked + span::after {
    transform: translateX(28px);
}

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

.field-block small {
    color: var(--muted);
}

.hidden { display: none; }

.inline-error,
.flash {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-weight: 700;
}

.inline-error,
.flash.error {
    color: var(--danger);
    background: #fbefef;
    border: 1px solid #efd2d2;
}

.flash.success {
    color: var(--success);
    background: #edf7f1;
    border: 1px solid #d0eadb;
}

.admin-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-head .muted { margin-bottom: 0; }

.stats {
    display: flex;
    gap: 12px;
}

.stats div {
    min-width: 118px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 18px;
    box-shadow: none;
}

.stats strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.stats span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

.bulk-footer {
    margin: 20px 0 0;
    justify-content: flex-end;
}

.tabs {
    display: flex;
    gap: 6px;
    background: var(--soft);
    padding: 6px;
    border-radius: 999px;
}

.tabs a {
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
}

.tabs a.active {
    background: #fff;
    color: var(--text);
    box-shadow: none;
}

.actions {
    display: flex;
    gap: 10px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.data-table th,
.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
}

.data-table th {
    color: var(--muted);
    background: #fbfcfb;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.data-table tr:last-child td { border-bottom: none; }

.mail {
    font-weight: 800;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
}

.pill.open {
    color: #7b5f1f;
    background: #fff5d6;
}

.pill.done {
    color: var(--success);
    background: #edf7f1;
}

.copy-one,
.mini-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    padding: 9px 12px;
}

.copy-one:hover,
.mini-button:hover {
    background: var(--soft);
}

.empty {
    text-align: center !important;
    color: var(--muted);
    padding: 32px !important;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(300px, 420px) 1fr;
    gap: 22px;
}

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

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfcfb;
}

.user-row strong {
    display: block;
}

.user-row span {
    color: var(--muted);
    font-size: 13px;
}

.footer {
    padding: 22px 0 32px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}


.footer-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.footer-badges span,
.footer-badges a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
}

.footer-badges a {
    color: var(--main);
}

.made-by {
    color: #8a928d;
}

@media (max-width: 760px) {
    .shell { width: min(100% - 20px, 1180px); }
    .topbar {
        min-height: auto;
        padding: 18px 0;
        display: flex;
        align-items: center;
        gap: 16px;
        flex-direction: column;
    }
    .brand { grid-column: auto; }
    .nav {
        grid-column: auto;
        justify-self: auto;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        border-radius: 18px;
    }
    .card { padding: 24px; border-radius: 22px; }
    .admin-head,
    .toolbar,
    .bulk-footer {
        align-items: stretch;
        flex-direction: column;
    }
    .stats, .actions { width: 100%; }
    .stats div, .actions .button { flex: 1; }
    .grid-2 { grid-template-columns: 1fr; }
}


.auth-card label {
    text-align: center;
}

.auth-card .input {
    text-align: center;
}

.auth-card .button {
    width: 100%;
}


.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
