:root {
    --primary: #0f766e;
    --secondary: #059669;
    --text: #1f2937;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --surface: #ffffff;
    --background: #f8fafc;
}

* { 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(255 255 255 / 96%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 18px rgb(15 23 42 / 5%);
    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; }
.site-logo { display: block; width: auto; height: 44px; max-width: min(240px, 60vw); object-fit: contain; }
.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: #334155;
    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; }
.nav-links > span { padding: .35rem .55rem; color: var(--text-muted); font-size: .9rem; white-space: nowrap; }
.nav-account { display: flex; align-items: center; gap: .15rem; }
.nav-account > span { min-width: 0; padding: .35rem .4rem; 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%);
}
.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; }
@media (max-width: 650px) {
    .navbar { align-items: center; flex-direction: row; flex-wrap: wrap; gap: .35rem .5rem; padding: .55rem .75rem; }
    .logo { flex: 0 1 auto; min-height: 36px; min-width: 0; }
    .site-logo { height: 36px; max-width: min(34vw, 150px); }
    .nav-links { flex: 1 1 150px; justify-content: flex-end; gap: .15rem; margin: 0; }
    .nav-links > a { min-height: 38px; padding: .4rem .45rem; font-size: .82rem; }
    .nav-account { flex: 1 0 100%; justify-content: flex-end; }
    .nav-account > span { max-width: calc(100vw - 100px); overflow: hidden; padding: .2rem .35rem; text-overflow: ellipsis; font-size: .82rem; }
    .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; }
}
