:root {
    --ink: #162033;
    --muted: #687287;
    --line: #dfe3ea;
    --paper: #f4f6f9;
    --white: #fff;
    --navy: #0a1120;
    --cyan: #00dce8;
    --pink: #ef288d;
    --danger: #c7354b;
    --success: #177a52;
    --shadow: 0 16px 50px rgba(18, 28, 46, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.admin-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 max(24px, calc((100vw - 1320px) / 2));
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background: rgba(10, 17, 32, .96);
    color: var(--white);
}

.admin-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.admin-brand img { width: 44px; height: 44px; border-radius: 13px; object-fit: cover; }
.admin-header nav { display: flex; align-items: center; gap: 20px; font-size: .86rem; }
.admin-header nav form { margin: 0; }
.admin-header nav button { padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.72); }
.admin-header nav a { color: rgba(255,255,255,.72); }
.admin-header nav a:hover, .admin-header nav button:hover { color: var(--cyan); }

.admin-shell { width: min(calc(100% - 40px), 1320px); margin: 0 auto; padding: 50px 0 90px; }
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
    background:
        radial-gradient(circle at 20% 10%, rgba(0, 220, 232, .16), transparent 28%),
        radial-gradient(circle at 90% 85%, rgba(239, 40, 141, .18), transparent 28%),
        var(--navy);
}

.login-card {
    width: min(100%, 430px);
    padding: 42px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 32px 100px rgba(0,0,0,.28);
}
.login-card > img { width: 92px; height: 92px; border-radius: 25px; object-fit: cover; }
.login-card h1 { margin: 8px 0; font-size: 2.2rem; }
.login-card > p:not(.kicker) { margin: 0 0 26px; color: var(--muted); line-height: 1.6; }

.kicker {
    margin: 20px 0 0;
    color: var(--pink);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 32px;
}
.page-heading h1 { margin: 6px 0 8px; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.045em; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.alert {
    margin-bottom: 24px;
    padding: 15px 18px;
    border-radius: 14px;
    font-size: .9rem;
}
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert-success { border: 1px solid #b8e7d2; background: #effbf5; color: var(--success); }
.alert-error { border: 1px solid #f0bdc5; background: #fff4f5; color: #8c2435; }

.admin-button {
    display: inline-flex;
    min-height: 44px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 750;
}
.admin-button.primary { background: linear-gradient(135deg, var(--cyan), var(--pink)); color: var(--navy); }
.admin-button.secondary { border-color: var(--line); background: var(--white); color: var(--ink); }
.admin-button.small { min-height: 38px; padding-inline: 13px; font-size: .78rem; }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 20px; border-bottom: 1px solid var(--line); text-align: left; font-size: .86rem; }
th { background: #fafbfc; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); }
code { color: #535d70; font-size: .78rem; }
.row-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.row-actions a { color: #16699b; font-weight: 700; }
.row-actions form { margin: 0; }
.row-actions button { padding: 0; border: 0; background: transparent; color: var(--danger); }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.status-published { background: #e7f8ef; color: var(--success); }
.status-draft { background: #fff6d9; color: #8a6510; }
.status-archived { background: #edf0f5; color: #5d6574; }
.empty-state { padding: 70px 25px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0; color: var(--muted); }

.invitation-form { display: grid; gap: 22px; }
.form-section { padding: 32px; }
.section-title { display: flex; align-items: flex-start; gap: 16px; }
.section-title > span {
    display: grid;
    flex: 0 0 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: #eafcff;
    color: #007c86;
    font-size: .7rem;
    font-weight: 800;
}
.section-title h2 { margin: 1px 0 5px; font-size: 1.25rem; }
.section-title p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.section-title.with-action { align-items: center; justify-content: space-between; }
.section-title.with-action > .section-title { flex: 1; }

.form-grid { display: grid; gap: 18px; margin-top: 26px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: 1.25fr 1fr .45fr; }
.span-two { grid-column: span 2; }
.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; }
label > span { color: #465066; font-size: .76rem; font-weight: 750; }
label small { color: var(--muted); font-size: .7rem; line-height: 1.45; }
input, textarea, select {
    width: 100%;
    border: 1px solid #cfd5df;
    border-radius: 11px;
    outline: none;
    background: var(--white);
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
input, select { min-height: 46px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; }
input[type="file"] { padding: 10px; }
input:focus, textarea:focus, select:focus { border-color: #00a9b5; box-shadow: 0 0 0 3px rgba(0,169,181,.1); }
.input-prefix { display: flex; align-items: center; border: 1px solid #cfd5df; border-radius: 11px; overflow: hidden; background: #f6f7f9; }
.input-prefix > span { padding-left: 12px; color: var(--muted); font-size: .78rem; }
.input-prefix input { border: 0; box-shadow: none; }
.check-line { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.check-line input { width: 18px; min-height: 18px; }
.check-line.align-end { align-self: end; min-height: 46px; }

.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 26px; }
.color-field { padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.color-field input { width: 100%; height: 46px; min-height: 0; padding: 2px; border: 0; }
.color-field code { text-align: center; }

.media-manager { display: grid; gap: 24px; margin-top: 28px; }
.media-manager h3 { margin: 0 0 10px; font-size: .9rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.media-item { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f7f8fa; }
.media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.media-item > span { display: flex; align-items: center; gap: 6px; padding: 9px; color: var(--danger); font-size: .7rem; }
.media-item input { width: 15px; min-height: 15px; }

.dynamic-list { display: grid; gap: 14px; margin-top: 25px; }
.repeat-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fafbfc; }
.repeat-card .form-grid { margin-top: 16px; }
.repeat-heading { display: flex; align-items: center; justify-content: space-between; }
.repeat-heading strong { font-size: .82rem; }
.repeat-heading button { border: 0; background: transparent; color: var(--danger); font-size: .72rem; }
.optional-section { margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.optional-section .form-grid { margin-top: 18px; }
.account-form { max-width: 720px; }
.account-form > .admin-button { margin-top: 24px; }

.sticky-save {
    position: sticky;
    z-index: 10;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 17px 20px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    background: rgba(10,17,32,.95);
    color: var(--white);
    box-shadow: 0 20px 60px rgba(10,17,32,.25);
    backdrop-filter: blur(14px);
}
.sticky-save strong, .sticky-save span { display: block; }
.sticky-save span { margin-top: 4px; color: rgba(255,255,255,.53); font-size: .72rem; }

@media (max-width: 850px) {
    .admin-shell { width: min(calc(100% - 24px), 1320px); padding-top: 30px; }
    .admin-header { padding-inline: 15px; }
    .admin-brand span { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .span-two { grid-column: auto; }
    .color-grid { grid-template-columns: repeat(2, 1fr); }
    .form-section { padding: 22px; }
    .section-title.with-action { align-items: flex-start; flex-direction: column; }
    .sticky-save { align-items: stretch; flex-direction: column; }
}

@media (max-width: 500px) {
    .login-shell { padding: 14px; }
    .login-card { padding: 28px 22px; }
    .color-grid { grid-template-columns: 1fr; }
    .admin-header nav > a { display: none; }
}
