:root {
    color-scheme: dark;
    --bg: #090b10;
    --panel: #111620;
    --panel-soft: #171d29;
    --line: #273244;
    --text: #eef3f8;
    --muted: #9aa8ba;
    --accent: #2dd4bf;
    --accent-strong: #14b8a6;
    --danger: #fb7185;
    --success: #34d399;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.guest-shell {
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.auth-wrap {
    width: min(100%, 560px);
}

.auth-panel,
.empty-state {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
    padding: 32px;
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 8px;
    background: var(--accent);
    color: #021310;
    font-weight: 800;
}

.brand-mark.small {
    width: 36px;
    height: 36px;
    margin: 0;
    font-size: 14px;
}

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

h1 {
    margin-bottom: 10px;
    font-size: 28px;
    line-height: 1.15;
}

h2 {
    margin-bottom: 10px;
    font-size: 22px;
}

.muted,
.empty-state p {
    color: var(--muted);
    line-height: 1.6;
}

.step-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 24px 0;
}

.step {
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
}

.step.active,
.step.done {
    border-color: rgba(45, 212, 191, .5);
    color: var(--text);
}

.check-list,
.form-grid {
    display: grid;
    gap: 14px;
}

.check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.ok {
    color: var(--success);
}

.bad,
.alert {
    color: var(--danger);
}

.alert {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid rgba(251, 113, 133, .35);
    border-radius: 8px;
    background: rgba(251, 113, 133, .08);
}

.alert p {
    margin-bottom: 6px;
}

.alert p:last-child {
    margin-bottom: 0;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    background: #0d1119;
    color: var(--text);
}

input,
select {
    height: 48px;
}

textarea {
    min-height: 112px;
    padding-top: 12px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, .14);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: 100%;
    margin-top: 18px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #031513;
    cursor: pointer;
    font-weight: 800;
}

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

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

.link-button {
    width: auto;
}

.no-margin {
    margin-top: 0;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
}

.secondary-button:hover {
    border-color: rgba(45, 212, 191, .45);
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    min-height: 100vh;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: #0b0f16;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.nav-list {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
}

.nav-link.active,
.nav-link:hover {
    background: var(--panel-soft);
    color: var(--text);
}

.icon {
    width: 22px;
    text-align: center;
}

.main-column {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 96px;
    padding: 24px 32px;
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    margin-bottom: 0;
}

.eyebrow {
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    max-width: 280px;
    overflow: hidden;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}

.content {
    padding: 32px;
}

.empty-state {
    max-width: 720px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

.stat-card {
    display: grid;
    gap: 12px;
    min-height: 126px;
    padding: 20px;
}

.stat-card span,
.detail-card .muted {
    color: var(--muted);
    font-size: 14px;
}

.stat-card strong {
    font-size: 34px;
    line-height: 1;
}

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

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(180px, 240px) auto;
    gap: 10px;
    align-items: center;
}

.table-card {
    overflow: hidden;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

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

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

tbody tr:hover {
    background: rgba(255, 255, 255, .02);
}

.status-badge,
.tag-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid rgba(45, 212, 191, .28);
    border-radius: 999px;
    background: rgba(45, 212, 191, .09);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.row-actions a,
.row-actions button {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-weight: 700;
}

.row-actions button {
    color: var(--danger);
}

.form-card {
    max-width: 980px;
    padding: 24px;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 980px;
}

.detail-card {
    display: grid;
    gap: 8px;
    padding: 20px;
}

.detail-card strong {
    line-height: 1.5;
    white-space: pre-wrap;
}

.wide-card {
    grid-column: 1 / -1;
}

.wide-card:first-child {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-shell {
    background:
        linear-gradient(180deg, rgba(45, 212, 191, .04), transparent 280px),
        var(--bg);
}

.sidebar {
    position: sticky;
    top: 0;
    background: rgba(11, 15, 22, .96);
}

.sidebar-brand strong {
    display: block;
    max-width: 178px;
    line-height: 1.25;
}

.sidebar-brand span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.nav-link {
    position: relative;
    border: 1px solid transparent;
}

.nav-link.active {
    border-color: rgba(45, 212, 191, .24);
    background: rgba(45, 212, 191, .1);
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: -1px;
    width: 3px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent);
}

.icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    color: var(--accent);
    font-size: 14px;
}

.topbar {
    background: rgba(9, 11, 16, .76);
    backdrop-filter: blur(16px);
}

.content {
    max-width: 1440px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-heading h2 {
    margin-bottom: 6px;
    font-size: 30px;
}

.page-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.with-action .primary-button {
    min-width: 148px;
}

.stats-grid {
    gap: 18px;
}

.stat-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 128px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .035), transparent),
        var(--panel);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}

.stat-marker {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    background: rgba(45, 212, 191, .12);
    color: var(--accent);
    font-weight: 900;
}

.stat-marker.soft {
    background: rgba(96, 165, 250, .13);
    color: #93c5fd;
}

.stat-marker.warm {
    background: rgba(251, 191, 36, .13);
    color: #facc15;
}

.stat-marker.good {
    background: rgba(52, 211, 153, .13);
    color: var(--success);
}

.stat-card span {
    display: block;
    margin-bottom: 8px;
}

.filter-card {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .16);
}

.filter-bar {
    grid-template-columns: minmax(260px, 1fr) minmax(200px, 260px) auto auto;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
}

.ghost-button:hover {
    background: rgba(255, 255, 255, .04);
    color: var(--text);
}

.table-card {
    box-shadow: 0 18px 54px rgba(0, 0, 0, .18);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.card-header h3 {
    margin: 0 0 4px;
    font-size: 17px;
}

.card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

th {
    background: rgba(255, 255, 255, .025);
    text-transform: uppercase;
}

td {
    color: #d7e0ea;
}

td strong {
    color: var(--text);
}

.status-new {
    border-color: rgba(96, 165, 250, .32);
    background: rgba(96, 165, 250, .1);
    color: #93c5fd;
}

.status-invited,
.status-responded {
    border-color: rgba(45, 212, 191, .32);
    background: rgba(45, 212, 191, .1);
    color: var(--accent);
}

.status-attended,
.status-became_member {
    border-color: rgba(52, 211, 153, .32);
    background: rgba(52, 211, 153, .1);
    color: var(--success);
}

.status-no_show,
.status-rejected {
    border-color: rgba(251, 113, 133, .32);
    background: rgba(251, 113, 133, .1);
    color: var(--danger);
}

.row-actions {
    gap: 6px;
}

.action-button,
.row-actions .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.action-button:hover {
    border-color: rgba(45, 212, 191, .45);
    color: var(--accent);
}

.action-button.danger {
    color: #fecdd3;
}

.action-button.danger:hover {
    border-color: rgba(251, 113, 133, .45);
    color: var(--danger);
}

.form-card {
    max-width: 1120px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .18);
}

.form-section {
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
    border-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.section-title span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 8px;
    background: rgba(45, 212, 191, .1);
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.section-title h3 {
    margin: 0;
    font-size: 18px;
}

label span {
    font-weight: 700;
}

input,
select,
textarea {
    background: #0b1018;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-actions {
    margin-top: 0;
    padding: 20px 24px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .018);
}

.form-actions .primary-button,
.form-actions .secondary-button {
    min-width: 132px;
}

.detail-grid {
    max-width: 1120px;
}

.detail-card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .03), transparent),
        var(--panel);
}

.profile-card {
    align-items: center;
    min-height: 132px;
}

.profile-card h2 {
    margin-bottom: 6px;
    font-size: 28px;
}

.profile-card p {
    margin: 0;
    color: var(--muted);
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
}

.detail-list dt {
    color: var(--muted);
    font-size: 13px;
}

.detail-list dd {
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.empty-state {
    position: relative;
    overflow: hidden;
    max-width: none;
    min-height: 220px;
}

.empty-state::after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: 28px;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(45, 212, 191, .14);
    border-radius: 50%;
}

.status-dot {
    width: 12px;
    height: 12px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 8px rgba(52, 211, 153, .12);
}

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

    .sidebar {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

    .content,
    .topbar,
    .sidebar,
    .auth-panel,
    .empty-state {
        padding: 20px;
    }

    .step-list {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .detail-grid,
    .two-columns,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .page-actions,
    .form-actions,
    .wide-card:first-child {
        align-items: stretch;
        flex-direction: column;
    }
}
