:root {
    --bg: #f5efff;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: #faf7ff;
    --text: #221533;
    --muted: #705f87;
    --line: rgba(81, 50, 120, 0.14);
    --brand: #7c3aed;
    --brand-deep: #581c87;
    --accent: #a855f7;
    --shadow: 0 24px 80px rgba(72, 28, 126, 0.14);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans Thai", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(192, 132, 252, 0.35), transparent 36%),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.24), transparent 30%),
        linear-gradient(135deg, #f7f2ff 0%, #efe7ff 100%);
    color: var(--text);
    min-height: 100vh;
}

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

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

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

.brand {
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 24px rgba(88, 28, 135, 0.12);
    padding: 8px;
}

.pill,
.button,
button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pill,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button,
button,
input[type="submit"] {
    font-family: inherit;
    background: linear-gradient(135deg, var(--brand) 0%, #c084fc 100%);
    color: white;
    padding: 13px 18px;
    font-weight: 700;
    box-shadow: 0 16px 30px rgba(124, 58, 237, 0.24);
}

.button.ghost,
.ghost {
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line);
}

.button.soft,
.soft {
    background: rgba(15, 118, 110, 0.11);
    color: var(--accent);
    box-shadow: none;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
}

.hero,
.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    padding: 26px;
}

.hero h1,
.page-header h1 {
    font-size: clamp(2rem, 3vw, 3.5rem);
    line-height: 1;
    margin: 0 0 12px;
}

.hero-copy {
    padding: 14px;
}

.kicker {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--brand-deep);
    font-weight: 700;
    margin-bottom: 14px;
}

.subtitle,
.meta,
.empty {
    color: var(--muted);
}

.form-card,
.panel {
    padding: 22px;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

input,
textarea,
select {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px 15px;
    font: inherit;
    background: rgba(255, 255, 255, 0.88);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.section {
    margin-top: 22px;
}

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

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

.card {
    background: var(--panel-strong);
    border-radius: 22px;
    border: 1px solid var(--line);
    padding: 18px;
    box-shadow: 0 12px 26px rgba(77, 49, 21, 0.08);
}

.compact-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.panel-subsection {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.attendee-picker {
    max-height: 320px;
    overflow: auto;
}

.status {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
}

.status.live {
    color: #6d28d9;
    background: rgba(167, 139, 250, 0.22);
}

.status.closed {
    color: #7c2d12;
    background: rgba(251, 191, 36, 0.16);
}

.status.pending {
    color: #5b21b6;
    background: rgba(216, 180, 254, 0.25);
}

.qr-wrap {
    display: grid;
    place-items: center;
    min-height: 160px;
    padding: 12px;
    background: white;
    border-radius: 22px;
    border: 1px dashed rgba(15, 23, 42, 0.15);
}

.vote-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
}

.vote-option input {
    width: auto;
}

.score-row {
    margin-bottom: 14px;
}

.bar {
    height: 14px;
    border-radius: 999px;
    background: rgba(28, 26, 23, 0.08);
    overflow: hidden;
}

.bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand) 0%, #d8b4fe 100%);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 12px 10px;
}

.page-header {
    margin-bottom: 18px;
}

.hero-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 28px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(216, 180, 254, 0.28));
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow);
}

.hero-banner.has-cover {
    background-size: cover;
    background-position: center;
}

.hero-banner.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(28, 19, 43, 0.72), rgba(70, 38, 104, 0.54));
}

.hero-banner-content {
    position: relative;
    z-index: 1;
}

.hero-banner.has-cover h1,
.hero-banner.has-cover .subtitle,
.hero-banner.has-cover .kicker {
    color: #fff;
}

.hero-banner.has-cover .kicker {
    background: rgba(255, 255, 255, 0.16);
}

.footer-note {
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.95rem;
}

.inline-alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(35, 144, 104, 0.08);
    color: #146c43;
    border: 1px solid rgba(35, 144, 104, 0.2);
}

.inline-alert.is-error {
    background: rgba(214, 76, 76, 0.08);
    color: #8b1e1e;
    border-color: rgba(214, 76, 76, 0.22);
}

.site-footer {
    margin-top: 44px;
    padding: 10px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.site-footer a {
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--brand-deep);
}

.hero-media {
    position: relative;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(216, 180, 254, 0.24));
}

.hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.card-cover {
    width: calc(100% + 36px);
    margin: -18px -18px 14px;
    height: 150px;
    object-fit: cover;
    object-position: center;
    border-radius: 22px 22px 0 0;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.inline-form {
    margin: 0;
}

.table-wrap {
    max-height: 60vh;
    overflow: auto;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(28, 19, 43, 0.46);
}

.modal-panel {
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 22px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

.duplicate-attendee-row {
    background: rgba(214, 76, 76, 0.08);
}

.duplicate-attendee-row td {
    border-color: rgba(214, 76, 76, 0.18);
}

.attendee-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.duplicate-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(214, 76, 76, 0.14);
    color: #b42318;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 900px) {
    .hero,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .shell {
        width: min(100% - 20px, 1120px);
    }

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