:root {
    --primary: #a78bfa;
    --secondary: #34d399;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #293548;
    --surface: #151f2e;
    --background: #0b1220;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: .75rem max(1rem, calc((100% - 1100px) / 2));
    background: rgb(15 23 42 / 96%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 18px rgb(0 0 0 / 25%);
    position: sticky;
    top: 0;
    z-index: 20;
}
.logo {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -.02em;
    white-space: nowrap;
    text-decoration: none;
}
.logo:hover { text-decoration: none; }
.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    flex-wrap: wrap;
    min-width: 0;
}
.nav-links > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: .5rem .75rem;
    border-radius: 9px;
    color: #dbe4f0;
    font-size: .93rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .16s ease, color .16s ease;
}
.nav-links > a:hover { background: #f1f5f9; color: var(--primary); text-decoration: none; }
.nav-links > a:focus-visible { outline: 3px solid #5eead4; outline-offset: 2px; }
.nav-links > a[href="/admin"] { background: #ecfdf5; color: var(--primary) !important; }
.nav-links > a[href="/admin"]:hover { background: #d1fae5; }
.nav-links > a[href="/logout"] { background: #fff1f2; color: #be123c !important; }
.nav-links > a[href="/logout"]:hover { background: #ffe4e6; }
.logout-form { margin: 0; }
.logout-form button { min-height: 40px; padding: .5rem .75rem; color: #ef4444; background: transparent; border: 0; border-radius: 9px; font: inherit; font-size: .93rem; font-weight: 650; cursor: pointer; }
.logout-form button:hover { background: rgb(239 68 68 / 12%); }
.nav-links > span { padding: .35rem .55rem; color: var(--text-muted); font-size: .9rem; white-space: nowrap; }
.container { width: min(1100px, calc(100% - 2rem)); margin: 2rem auto; }
.card, .stat-card {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgb(15 23 42 / 4%);
}
.instant-prizes {
    margin: .85rem 0;
    padding: .85rem 1rem;
    color: var(--text);
    background: linear-gradient(135deg, rgb(167 139 250 / 13%), rgb(52 211 153 / 8%));
    border: 1px solid rgb(167 139 250 / 35%);
    border-radius: 10px;
}
.instant-prizes > strong { color: var(--primary); }
.instant-prizes ul { display: grid; gap: .35rem; margin: .55rem 0 0; padding-left: 1.2rem; }
.instant-prizes li { color: var(--text-muted); }
.instant-prizes li strong { color: var(--text); }
.instant-prizes-note { margin: .65rem 0 0; color: var(--text-muted); font-size: .83rem; }
.grid-acoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 340px)); justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.raffle-prize-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 215px;
    object-fit: cover;
    object-position: center;
    margin: 0 0 1rem;
    border-radius: 10px;
    background: #f1f5f9;
}
.btn {
    display: inline-block;
    width: 100%;
    padding: .75rem 1rem;
    color: white;
    background: var(--primary);
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}
.btn:hover { filter: brightness(.94); text-decoration: none; }
input, select, textarea { font: inherit; }
.progress-bar-bg { height: 9px; overflow: hidden; background: #e2e8f0; border-radius: 999px; }
.progress-bar-fill { height: 100%; background: var(--secondary); border-radius: inherit; }
.ranking-list { padding-left: 1.25rem; }
.ranking-item { padding: .2rem 0; }
.order-number-widget { width: min(100%, 22rem); min-width: 0; white-space: normal; }
.order-number-count { margin: 0 0 .4rem; color: var(--text-muted); font-size: .82rem; }
.order-number-toggle, .order-number-page-button {
    min-height: 38px;
    padding: .45rem .7rem;
    color: var(--primary);
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
}
.order-number-toggle:hover, .order-number-page-button:hover:not(:disabled) { background: #d1fae5; }
.order-number-browser { margin-top: .6rem; padding: .65rem; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 10px; }
.order-number-browser[hidden], .order-number-pagination[hidden], .order-number-message[hidden] { display: none; }
.order-number-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); gap: .35rem; max-height: 14rem; overflow-y: auto; }
.order-number-chip { display: inline-flex; justify-content: center; padding: .28rem .4rem; color: #075985; background: #e0f2fe; border-radius: 6px; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-number-chip.is-winner { color: #166534; background: #bbf7d0; outline: 2px solid #22c55e; }
.order-number-message { margin: .5rem 0 0; color: var(--text-muted); font-size: .85rem; }
.order-number-pagination { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .6rem; color: var(--text-muted); font-size: .78rem; }
.order-number-page-button { min-height: 34px; padding: .35rem .5rem; font-size: .8rem; }
.order-number-page-button:disabled { opacity: .45; cursor: not-allowed; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: top; }
.table th { background: #f1f5f9; font-size: .9rem; }
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-pago { color: #166534; background: #dcfce7; }
.badge-pendente { color: #92400e; background: #fef3c7; }
.socios-hero { padding: clamp(1.4rem, 4vw, 2.5rem); background: radial-gradient(ellipse at 90% 10%, #312e8166, transparent 45%), var(--surface); }
.socios-hero h1 { margin: .5rem 0; font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.04em; }
.socios-hero p { max-width: 48rem; color: var(--text-muted); }
.socios-banner { padding: 1.5rem; background: radial-gradient(ellipse at 90% 10%, #312e8155, transparent 45%), var(--surface); }
.socios-banner h1 { margin: .35rem 0; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.socios-banner p { color: var(--text-muted); }
.invite-landing { padding: clamp(1.5rem, 5vw, 3rem); border-color: #6653a8; background: radial-gradient(ellipse at 95% 5%, #6d5bd044, transparent 50%), var(--surface); }
.invite-landing h1 { margin: .5rem 0; font-size: clamp(1.8rem, 4.5vw, 3rem); }
.invite-landing p { max-width: 42rem; color: var(--text-muted); }
.invite-notice { display: grid; gap: .2rem; margin-bottom: 1rem; padding: .9rem 1rem; color: #ddd6fe; background: #201c38; border: 1px solid #51458d; border-radius: 10px; }
.invite-notice span { color: #c4b5fd; font-size: .9rem; }
.eyebrow { color: var(--secondary); font-size: .75rem; font-weight: 800; letter-spacing: .15em; }
.invite-row { display: flex; gap: .65rem; margin-top: .6rem; }
.invite-row input { min-width: 0; flex: 1; padding: .75rem; color: var(--text); background: var(--background); border: 1px solid var(--border-color); border-radius: 8px; }
.invite-row .btn { width: auto; }
.socios-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.stat-card span { display: block; color: var(--text-muted); }
.stat-card strong { display: block; margin-top: .4rem; color: var(--secondary); font-size: 1.8rem; }
.container > .card { margin-bottom: 1rem; }
.container h1, .container h2, .container h3 { color: #f8fafc; }
.table th { color: #e2e8f0; background: #202c3e; }
.table td { color: #dbe4f0; }
.public-transparency > summary, .order-number-browser, .public-transparency-results { background: #101a29; }
.public-transparency-list li { color: #dbe4f0; background: #1b293a; border-color: var(--border-color); }
.order-number-chip { color: #bae6fd; background: #12314a; }
.order-number-toggle, .order-number-page-button, .transparency-button, .public-transparency-pagination button { color: #ddd6fe; background: #29254b; border-color: #51458d; }
input, select, textarea { color: var(--text); background-color: #101a29; border-color: var(--border-color); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 650px) {
    .navbar { align-items: stretch; flex-direction: column; gap: .55rem; padding: .75rem 1rem .85rem; }
    .logo { min-height: 36px; }
    .nav-links { justify-content: flex-start; gap: .25rem; margin: 0 -.2rem; }
    .nav-links > a { min-height: 42px; padding: .55rem .7rem; font-size: .9rem; }
    .nav-links > span { width: 100%; padding: .35rem .7rem 0; }
    .invite-row { flex-direction: column; }
    .invite-row .btn { width: 100%; }
    .order-number-widget { width: min(68vw, 18rem); }
    .table { display: block; overflow-x: auto; white-space: nowrap; }
    .my-orders-table { display: block; overflow: visible; white-space: normal; }
    .my-orders-table thead { display: none; }
    .my-orders-table tbody { display: block; }
    .my-orders-table tbody tr { display: block; margin-bottom: .8rem; padding: .55rem .75rem; background: var(--surface); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 3px 12px rgb(15 23 42 / 4%); }
    .my-orders-table tbody td { display: block; width: 100%; padding: .5rem 0; border-bottom: 1px solid #f1f5f9; white-space: normal; }
    .my-orders-table tbody td:last-child { border-bottom: 0; }
}
