:root {
    --bg: #f7f9fb;
    --surface: #ffffff;
    --surface-strong: #eef3f6;
    --text: #17202a;
    --muted: #64748b;
    --border: #d9e2ea;
    --teal: #14b8a6;
    --teal-dark: #0f766e;
    --coral: #f97316;
    --amber: #f6c453;
    --danger: #dc2626;
    --success: #15803d;
    --shadow: 0 22px 55px rgba(15, 23, 42, .12);
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(20, 184, 166, .16), transparent 28rem),
        radial-gradient(circle at 94% 18%, rgba(249, 115, 22, .12), transparent 24rem),
        var(--bg);
    color: var(--text);
}

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

button,
input {
    font: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.brand-mark {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--teal), var(--coral));
    color: #fff;
    font-size: .82rem;
    letter-spacing: 0;
    box-shadow: 0 12px 26px rgba(20, 184, 166, .25);
}

.topnav {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 25px rgba(15, 23, 42, .06);
}

.topnav a {
    min-height: 2.5rem;
    padding: .68rem .95rem;
    border-radius: 6px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
}

.topnav a.is-active,
.topnav a:hover {
    background: var(--text);
    color: #fff;
}

.raffle-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 25rem);
    gap: clamp(1rem, 3vw, 2rem);
    width: min(118rem, calc(100vw - 2rem));
    margin: 0 auto;
    padding: clamp(.75rem, 2vw, 1.5rem) 0 2rem;
}

.kiosk-page {
    min-height: 100svh;
    overflow-x: hidden;
}

.kiosk-shell {
    display: block;
    width: min(100vw, 56rem);
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(.75rem, 2.6vw, 1.25rem);
}

.stage {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(21rem, 1fr) auto;
    min-height: calc(100vh - 8rem);
    padding: clamp(1.25rem, 3vw, 2.4rem);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(238, 243, 246, .9)),
        var(--surface);
    box-shadow: var(--shadow);
}

.kiosk-stage {
    isolation: isolate;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: calc(100svh - clamp(1.5rem, 5.2vw, 2.5rem));
    padding: clamp(.85rem, 3vw, 1.35rem);
}

.kiosk-page.is-playing .kiosk-stage,
.kiosk-page.is-celebrating .kiosk-stage {
    grid-template-rows: minmax(0, 1fr);
}

.kiosk-stage::before {
    position: absolute;
    inset: 1rem;
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 38%, rgba(20, 184, 166, .18), transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(249, 115, 22, .12), transparent 48%);
    opacity: 0;
    transform: scale(.9);
    content: "";
    transition: opacity .28s ease, transform .28s ease;
}

.kiosk-page.is-playing .kiosk-stage::before {
    opacity: 1;
    transform: scale(1);
    animation: stage-glow 1.1s ease-in-out infinite alternate;
}

.play-aura {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
    opacity: 0;
    transition: opacity .2s ease;
}

.kiosk-page.is-playing .play-aura {
    opacity: 1;
}

.play-aura span {
    position: absolute;
    width: .72rem;
    height: .72rem;
    border-radius: 999px;
    background: var(--teal);
    box-shadow: 0 0 20px rgba(20, 184, 166, .36);
    animation: joy-float 1.8s ease-in-out infinite;
}

.play-aura span:nth-child(1) {
    top: 14%;
    left: 14%;
    background: #f6c453;
}

.play-aura span:nth-child(2) {
    top: 18%;
    right: 18%;
    animation-delay: .2s;
    background: #14b8a6;
}

.play-aura span:nth-child(3) {
    top: 48%;
    left: 7%;
    animation-delay: .36s;
    background: #f97316;
}

.play-aura span:nth-child(4) {
    top: 56%;
    right: 8%;
    animation-delay: .52s;
    background: #2563eb;
}

.play-aura span:nth-child(5) {
    bottom: 22%;
    left: 22%;
    animation-delay: .68s;
    background: #22c55e;
}

.play-aura span:nth-child(6) {
    right: 28%;
    bottom: 18%;
    animation-delay: .84s;
    background: #ef4444;
}

.draw-stage {
    display: grid;
    min-height: 0;
    place-items: center;
}

.stage-copy h1,
.section-title h1,
.login-box h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4.4vw, 4.7rem);
    line-height: .98;
    letter-spacing: 0;
}

.stage-copy p,
.section-title p,
.login-box p {
    max-width: 42rem;
    margin: .8rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.55;
}

.wheel-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 22rem;
    padding: 1rem;
}

.kiosk-stage .wheel-wrap {
    min-height: 0;
    padding: .25rem .25rem 1rem;
}

.wheel {
    --angle: calc(360deg / var(--slice-count));
    position: relative;
    width: min(68vh, 37rem, 86vw);
    aspect-ratio: 1;
    border: .85rem solid rgba(255, 255, 255, .96);
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        #14b8a6 0 14%,
        #f97316 14% 28%,
        #f6c453 28% 42%,
        #38bdf8 42% 56%,
        #ef4444 56% 70%,
        #22c55e 70% 84%,
        #a855f7 84% 100%
    );
    box-shadow:
        0 0 0 .4rem rgba(20, 184, 166, .08),
        inset 0 0 0 1px rgba(15, 23, 42, .08),
        inset 0 0 24px rgba(15, 23, 42, .06),
        0 30px 75px rgba(15, 23, 42, .2);
    transition: transform cubic-bezier(.12, .64, .11, 1);
}

.wheel::after {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .16), transparent 16%),
        radial-gradient(circle, transparent 72%, rgba(15, 23, 42, .08) 100%);
    content: "";
    pointer-events: none;
}

.wheel::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from -90deg,
        rgba(255, 255, 255, .94) 0deg,
        rgba(255, 255, 255, .94) .9deg,
        transparent .9deg,
        transparent var(--divider-angle)
    );
    content: "";
    pointer-events: none;
}

.kiosk-stage .wheel {
    width: min(86vw, 52svh, 38rem);
}

.kiosk-page.is-playing .kiosk-stage .wheel,
.kiosk-page.is-celebrating .kiosk-stage .wheel {
    width: min(94vw, 78svh, 48rem);
}

.wheel.is-spinning {
    filter: saturate(1.08);
    animation: wheel-joy 900ms ease-in-out infinite alternate;
}

.wheel-slice {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 48%;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 2rem;
    transform-origin: left center;
    transform: rotate(calc(var(--index) * var(--angle))) translateY(-50%);
    color: #fff;
    text-shadow: 0 1px 5px rgba(15, 23, 42, .45);
    font-size: clamp(.7rem, 1vw, .86rem);
    font-weight: 850;
    line-height: 1.1;
    text-align: right;
}

.wheel-slice span {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wheel-hub {
    position: absolute;
    z-index: 3;
    inset: 35%;
    display: grid;
    place-items: center;
    border: .65rem solid #fff;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #273449, #111827 72%);
    color: #fff;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .24);
}

.wheel-hub img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    border-radius: 50%;
}

.wheel-hub span {
    display: inline-block;
}

.wheel-pointer {
    position: absolute;
    z-index: 4;
    top: .25rem;
    width: 0;
    height: 0;
    border-right: 1.25rem solid transparent;
    border-left: 1.25rem solid transparent;
    border-top: 2.4rem solid var(--text);
    filter: drop-shadow(0 8px 10px rgba(15, 23, 42, .22));
}

.participant-panel {
    display: grid;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.kiosk-stage .participant-panel {
    padding: clamp(.85rem, 2.5vw, 1rem);
}

.form-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr .8fr;
    gap: .75rem;
}

.consent-row {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.35;
}

.camera-panel {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .6rem;
    background: #f8fafc;
}

.camera-panel video {
    width: 6.5rem;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 7px;
    background: #111827;
    transform: scaleX(-1);
}

.camera-panel span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 750;
}

.draw-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding-top: .7rem;
    border-top: 1px solid var(--border);
}

.kiosk-page.is-playing .participant-panel,
.kiosk-page.is-celebrating .participant-panel {
    max-height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    transform: translateY(1rem) scale(.98);
}

.kiosk-page.is-playing .primary-action {
    animation: button-party 760ms ease-in-out infinite alternate;
}

.participant-panel {
    max-height: 24rem;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
        max-height .34s ease,
        opacity .24s ease,
        padding .28s ease,
        transform .28s ease,
        margin .28s ease;
}

.eyeless-label,
.result-kicker {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.draw-panel strong {
    display: block;
    margin-top: .28rem;
    font-size: clamp(1.15rem, 2vw, 1.75rem);
}

.primary-action,
.secondary-action {
    display: inline-flex;
    min-height: 3.15rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .98rem;
    font-weight: 900;
}

.primary-action {
    min-width: 10.5rem;
    padding: .9rem 1.35rem;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #fff;
    box-shadow: 0 15px 30px rgba(20, 184, 166, .25);
}

.primary-action:hover {
    transform: translateY(-1px);
}

.primary-action:disabled {
    cursor: not-allowed;
    opacity: .52;
    transform: none;
}

.secondary-action {
    padding: .8rem 1rem;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.side-rail,
.admin-side {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .06);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.panel-heading span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 750;
}

.prize-list,
.history-list {
    display: grid;
    gap: .25rem;
    padding: .65rem;
}

.prize-row,
.history-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .7rem;
    min-height: 3.6rem;
    padding: .65rem;
    border-radius: 6px;
}

.prize-row:hover,
.history-row:hover {
    background: var(--surface-strong);
}

.prize-row strong,
.history-row strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prize-row small,
.history-row small,
td small {
    display: block;
    margin-top: .15rem;
    color: var(--muted);
    font-size: .78rem;
}

.color-dot {
    display: inline-block;
    width: .9rem;
    height: .9rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--dot-color);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
}

.empty-state {
    margin: 0;
    padding: .9rem;
    color: var(--muted);
    line-height: 1.45;
}

.result-dialog {
    width: min(29rem, calc(100vw - 2rem));
    border: 0;
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
}

.result-dialog::backdrop {
    background: rgba(15, 23, 42, .58);
}

.result-dialog form {
    display: grid;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.confetti-layer {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: 42%;
    left: 50%;
    width: .58rem;
    height: .9rem;
    border-radius: 2px;
    background: var(--confetti-color);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: confetti-burst var(--confetti-duration, 2400ms) cubic-bezier(.16, .82, .24, 1) forwards;
}

.confetti-piece:nth-child(3n) {
    border-radius: 999px;
    height: .58rem;
}

.confetti-piece:nth-child(4n) {
    width: .9rem;
    height: .42rem;
}

@keyframes confetti-burst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.4) rotate(0deg);
    }

    10% {
        opacity: 1;
    }

    42% {
        opacity: 1;
        transform: translate(calc(-50% + var(--confetti-x)), calc(-50% + var(--confetti-y))) scale(1) rotate(var(--confetti-rotate));
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--confetti-x) * .72), calc(58vh + var(--confetti-fall))) scale(.86) rotate(calc(var(--confetti-rotate) * 1.8));
    }
}

@keyframes stage-glow {
    from {
        filter: blur(0);
    }

    to {
        filter: blur(4px);
    }
}

@keyframes joy-float {
    0% {
        opacity: 0;
        transform: translateY(1.2rem) scale(.55);
    }

    25% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-3.5rem) scale(1.35);
    }
}

@keyframes wheel-joy {
    from {
        box-shadow:
            0 0 0 .4rem rgba(20, 184, 166, .08),
            inset 0 0 0 1px rgba(15, 23, 42, .08),
            inset 0 0 24px rgba(15, 23, 42, .06),
            0 30px 75px rgba(15, 23, 42, .2);
    }

    to {
        box-shadow:
            0 0 0 .65rem rgba(246, 196, 83, .22),
            inset 0 0 0 1px rgba(255, 255, 255, .2),
            inset 0 0 28px rgba(255, 255, 255, .08),
            0 34px 90px rgba(20, 184, 166, .28);
    }
}

@keyframes panel-breathe {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-3px);
    }
}

@keyframes button-party {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.025);
    }
}

#resultPrize {
    font-size: clamp(2rem, 7vw, 3.6rem);
    line-height: 1;
}

.result-person {
    display: block;
    color: var(--text);
    font-size: clamp(1.15rem, 4vw, 1.8rem);
    font-weight: 850;
    line-height: 1.15;
}

.admin-login-page {
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-box {
    width: min(28rem, 100%);
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.login-box h1 {
    margin-top: 2rem;
}

.admin-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 27rem);
    gap: clamp(1rem, 2.5vw, 1.6rem);
    width: min(118rem, calc(100vw - 2rem));
    margin: 0 auto;
    padding: clamp(.75rem, 2vw, 1.5rem) 0 2rem;
}

.admin-main {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}

.stat-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .06);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stat-card strong {
    display: block;
    margin-top: .4rem;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: .95;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
    gap: 1rem;
}

.embedded-table {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.compact-title {
    margin-top: .6rem;
}

.compact-title h1 {
    font-size: clamp(1.6rem, 2.7vw, 2.4rem);
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.section-title h1 {
    font-size: clamp(2rem, 3.6vw, 3.8rem);
}

.notice {
    padding: .8rem 1rem;
    border-radius: var(--radius);
    font-weight: 750;
}

.notice.success {
    border: 1px solid rgba(21, 128, 61, .2);
    background: rgba(21, 128, 61, .08);
    color: var(--success);
}

.notice.error {
    border: 1px solid rgba(220, 38, 38, .22);
    background: rgba(220, 38, 38, .08);
    color: var(--danger);
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .06);
}

table {
    width: 100%;
    min-width: 45rem;
    border-collapse: collapse;
}

th,
td {
    padding: .95rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--surface-strong);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

td {
    font-size: .95rem;
}

tr:last-child td {
    border-bottom: 0;
}

.table-prize {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .7rem;
    white-space: nowrap;
}

.icon-link,
.danger-link {
    border: 0;
    background: transparent;
    color: var(--teal-dark);
    cursor: pointer;
    font-size: .86rem;
    font-weight: 850;
}

.danger-link {
    color: var(--danger);
}

.form-stack,
.form-grid {
    display: grid;
    gap: .9rem;
    padding: 1rem;
}

.login-box .form-stack {
    padding: 1rem 0 0;
}

label {
    display: grid;
    gap: .4rem;
    color: var(--text);
    font-size: .84rem;
    font-weight: 850;
}

input {
    width: 100%;
    min-height: 2.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    padding: .75rem .85rem;
    outline: none;
}

input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, .14);
}

input[type="color"] {
    padding: .2rem;
}

.field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.check-row {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.check-row input {
    width: 1.15rem;
    min-height: 1.15rem;
}

.center-action {
    width: 100%;
}

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

    .stage {
        min-height: auto;
    }

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

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

@media (max-width: 720px) {
    .topbar,
    .section-title,
    .draw-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        display: grid;
    }

    .topnav {
        overflow-x: auto;
    }

    .draw-panel,
    .form-row,
    .stat-grid,
    .dashboard-grid,
    .side-rail,
    .admin-side,
    .field-pair {
        grid-template-columns: 1fr;
    }

    .primary-action {
        width: 100%;
    }

    .wheel {
        width: min(27rem, 84vw);
    }

    .kiosk-stage .wheel {
        width: min(88vw, 46svh, 31rem);
    }

    .kiosk-page.is-playing .kiosk-stage .wheel,
    .kiosk-page.is-celebrating .kiosk-stage .wheel {
        width: min(94vw, 78svh, 42rem);
    }

    .kiosk-shell {
        padding: .65rem;
    }

    .kiosk-stage {
        min-height: calc(100svh - 1.3rem);
        padding: .75rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Bootstrap-like admin shell */
.admin-dashboard-page {
    min-height: 100vh;
    background: #eaf1f6;
    color: #071426;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    width: 15.25rem;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.4rem .85rem 1rem;
    background: #101827;
    color: #dbeafe;
}

.admin-brand {
    display: grid;
    grid-template-columns: 2.45rem minmax(0, 1fr);
    align-items: center;
    gap: .72rem;
    padding: .2rem .45rem;
}

.admin-brand-mark {
    display: grid;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    border-radius: 8px;
    background: #16a34a;
    color: #fff;
    font-size: .82rem;
    font-weight: 900;
}

.admin-brand strong,
.admin-brand small {
    display: block;
}

.admin-brand strong {
    color: #fff;
    font-size: .92rem;
}

.admin-brand small {
    margin-top: .2rem;
    color: #b7c7dc;
    font-size: .78rem;
}

.admin-menu {
    display: grid;
    gap: .32rem;
}

.menu-label {
    margin: 1rem .42rem .28rem;
    color: #9db5d1;
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-menu a,
.admin-menu button {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    align-items: center;
    min-height: 2.55rem;
    gap: .55rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #e8f1ff;
    cursor: pointer;
    padding: .55rem .55rem;
    text-align: left;
    font-size: .84rem;
    font-weight: 800;
}

.admin-menu a span,
.admin-menu button span {
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, .09);
    color: #bde4d1;
    font-size: .78rem;
}

.admin-menu a.is-active,
.admin-menu a:hover,
.admin-menu button:hover {
    background: #166534;
    color: #fff;
}

.admin-logout {
    display: grid;
    min-height: 2.5rem;
    margin-top: auto;
    place-items: center;
    border-radius: 7px;
    background: #fff;
    color: #071426;
    font-size: .83rem;
    font-weight: 850;
}

.admin-workspace {
    min-height: 100vh;
    margin-left: 15.25rem;
}

.admin-topbar {
    display: flex;
    min-height: 4.2rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #d7e1ea;
    background: rgba(255, 255, 255, .86);
    padding: .85rem 1.2rem;
}

.admin-topbar strong,
.admin-topbar span {
    display: block;
}

.admin-topbar strong {
    font-size: .95rem;
}

.admin-topbar span {
    margin-top: .14rem;
    color: #61718a;
    font-size: .76rem;
}

.admin-content {
    display: grid;
    gap: 1rem;
    width: min(78rem, calc(100vw - 17.25rem));
    margin: 0 auto;
    padding: 1.45rem 0 2rem;
}

.admin-hero {
    display: flex;
    min-height: 8.2rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 8px;
    background: linear-gradient(115deg, #155f33, #1d7c69 50%, #2d6cdf);
    color: #fff;
    padding: 1.9rem 1.7rem;
}

.admin-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1;
}

.admin-hero p {
    margin: .65rem 0 0;
    color: #fff;
    font-size: .95rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.hero-actions span {
    min-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 999px;
    padding: .35rem .8rem;
    font-size: .78rem;
    font-weight: 850;
}

.btn {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    cursor: pointer;
    padding: .58rem .82rem;
    font-size: .82rem;
    font-weight: 850;
}

.btn-primary {
    border: 1px solid #15803d;
    background: #15803d;
    color: #fff;
}

.btn-light {
    border: 1px solid #15803d;
    background: #15803d;
    color: #fff;
}

.btn-outline {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #071426;
}

.admin-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}

.admin-stat-card,
.admin-card {
    border: 1px solid #d7e1ea;
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .06);
}

.admin-stat-card {
    position: relative;
    min-height: 6.4rem;
    overflow: hidden;
    padding: 1.05rem 1rem;
}

.admin-stat-card::after {
    position: absolute;
    top: -2.3rem;
    right: -1.9rem;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: rgba(22, 101, 52, .08);
    content: "";
}

.admin-stat-card span {
    display: block;
    color: #586985;
    font-size: .76rem;
}

.admin-stat-card strong {
    display: block;
    margin-top: .85rem;
    font-size: clamp(1.55rem, 3vw, 2.05rem);
    line-height: 1;
}

.admin-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, .65fr);
    gap: 1rem;
}

.admin-card {
    overflow: hidden;
}

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.2rem .7rem;
}

.admin-card-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.admin-card-head p {
    margin: .35rem 0 0;
    color: #586985;
    font-size: .78rem;
}

.card-actions {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-table {
    min-width: 44rem;
}

.admin-table th {
    background: #f7fafc;
}

.admin-table td {
    background: #fff;
}

.link-button {
    border: 0;
    background: transparent;
    color: #1766c2;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 850;
}

.status-pill {
    display: inline-flex;
    min-height: 1.7rem;
    align-items: center;
    border-radius: 999px;
    padding: .22rem .65rem;
    font-size: .74rem;
    font-weight: 850;
}

.status-pill.is-on {
    background: #dcfce7;
    color: #166534;
}

.status-pill.is-off {
    background: #f1f5f9;
    color: #64748b;
}

.rank-list {
    display: grid;
    gap: .25rem;
    padding: 0 1rem 1rem;
}

.rank-row {
    display: flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: .87rem;
}

.rank-row:last-child {
    border-bottom: 0;
}

.rank-row strong {
    color: #0f5132;
}

.admin-modal {
    width: min(40rem, calc(100vw - 2rem));
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.admin-modal::backdrop {
    background: rgba(15, 23, 42, .55);
}

.modal-box {
    display: grid;
    gap: 0;
    background: #fff;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.1rem;
}

.modal-head h2 {
    margin: 0;
    font-size: 1.08rem;
}

.modal-close {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-size: 1.15rem;
}

.modal-form {
    padding: 1.1rem;
}

.modal-check {
    align-self: end;
    min-height: 2.9rem;
}

.current-logo-preview {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    align-items: center;
    gap: .85rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .75rem;
    background: #f8fafc;
}

.current-logo-preview img {
    width: 5rem;
    height: 5rem;
    object-fit: contain;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    border-top: 1px solid #e2e8f0;
    padding: .9rem 1.1rem;
}

.modal-copy {
    margin: 0;
    padding: 1.1rem;
    color: #475569;
    line-height: 1.45;
}

.detail-list {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 1.1rem;
}

.detail-list div {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: .75rem;
}

.detail-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-list dt {
    color: #64748b;
    font-size: .78rem;
    font-weight: 850;
}

.detail-list dd {
    margin: 0;
    font-weight: 750;
}

.detail-photo-row img {
    width: min(14rem, 100%);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

@media (max-width: 1100px) {
    .admin-sidebar {
        position: static;
        width: auto;
    }

    .admin-dashboard-page {
        display: grid;
    }

    .admin-workspace {
        margin-left: 0;
    }

    .admin-content {
        width: min(100% - 1rem, 78rem);
    }
}

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

    .menu-label {
        grid-column: 1 / -1;
    }

    .admin-hero,
    .admin-topbar,
    .admin-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions,
    .card-actions {
        justify-content: stretch;
    }

    .hero-actions,
    .hero-actions .btn,
    .card-actions .btn {
        width: 100%;
    }

    .admin-stat-row,
    .admin-card-grid {
        grid-template-columns: 1fr;
    }

    .detail-list div {
        grid-template-columns: 1fr;
        gap: .25rem;
    }
}
