:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1a2332;
    --muted: #5c6b7a;
    --primary: #2d5a3d;
    --primary-dark: #1e3d29;
    --accent: #c9a227;
    --danger: #b42318;
    --success: #067647;
    --warning: #b54708;
    --border: #dde3ea;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(20, 35, 55, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header, .admin-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.header-inner, .admin-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: .75rem; }
.brand-icon { font-size: 2rem; }
.brand small { display: block; opacity: .85; }

.admin-header nav { display: flex; gap: .75rem; flex-wrap: wrap; }
.admin-header a { color: #fff; text-decoration: none; font-weight: 600; }

.main-content { padding-bottom: 2rem; }
.site-footer {
    padding: 1.5rem 0 2rem;
    color: var(--muted);
    font-size: .95rem;
    text-align: center;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.hero h1 { margin-top: 0; color: var(--primary-dark); }
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .5rem 1rem;
}

.valor-destaque { font-size: 1.15rem; color: var(--primary-dark); }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 1rem; }

.badge {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}
.badge-success { background: #dcfae6; color: var(--success); }
.badge-warning { background: #fef0c7; color: var(--warning); }
.badge-danger { background: #fee4e2; color: var(--danger); }
.badge-muted { background: #eef2f6; color: var(--muted); }

.alert {
    padding: .85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.alert-success { background: #dcfae6; color: var(--success); }
.alert-danger { background: #fee4e2; color: var(--danger); }
.alert-warning { background: #fef0c7; color: var(--warning); }

.info-box ul { padding-left: 1.2rem; }
.info-box li { margin-bottom: .35rem; }

.sorteio-banner {
    background: linear-gradient(135deg, #fef0c7, #fde68a);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}
.sorteio-banner h3 { margin-top: 0; }
.field-hint { display: block; font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.sorteio-admin .sorteio-lista { margin: .5rem 0 0; padding-left: 1.2rem; }
.comprovante-sorteio { margin-bottom: 1rem; }

.field { display: block; margin-bottom: 1rem; }
.field > span, .field > legend { display: block; font-weight: 600; margin-bottom: .35rem; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: #fff;
}
.field-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.flex-1 { flex: 1 1 180px; }
.flex-2 { flex: 2 1 260px; }

.radio-inline, .checkbox-line, .radio-block {
    display: block;
    margin: .35rem 0;
    font-weight: 400;
}
.radio-block {
    padding: .65rem .75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1rem;
    border-radius: 10px;
    border: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #eef2f6; color: var(--text); }
.btn-whatsapp { background: #128c7e; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .35rem .55rem; font-size: .85rem; }
.btn-block { width: 100%; }

.pix-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    align-items: start;
}
.pix-qr img, .pix-qr canvas {
    width: 100%;
    max-width: 280px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.pix-dados dl { display: grid; grid-template-columns: 120px 1fr; gap: .25rem .75rem; }
.pix-dados dt { color: var(--muted); font-size: .9rem; }
.pix-dados dd { margin: 0; }

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.link-save {
    width: 100%;
    padding: .6rem;
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: .85rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.stat-card span { display: block; color: var(--muted); font-size: .85rem; }
.stat-card strong { font-size: 1.6rem; color: var(--primary-dark); }

.filtros-admin {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.filtros-admin input, .filtros-admin select { flex: 1 1 180px; padding: .6rem; border-radius: 8px; border: 1px solid var(--border); }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td {
    padding: .65rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
}
.data-table th { background: #f8fafc; }
.acoes-cell { min-width: 180px; }
.confirmar-pagamento { margin-top: .5rem; }
.confirmar-pagamento form { margin-top: .5rem; display: grid; gap: .35rem; }
.confirmar-pagamento input { width: 100%; padding: .45rem; border: 1px solid var(--border); border-radius: 6px; }

.login-card { max-width: 420px; margin: 2rem auto; }

.qr-reader {
    width: 100%;
    max-width: 420px;
    margin: 1rem auto;
    border-radius: 12px;
    overflow: hidden;
}
.checkin-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
}
.checkin-result.ok { background: #dcfae6; }
.checkin-result.fail { background: #fee4e2; }
.checkin-result-card.ok { border-left: 4px solid var(--success); }
.checkin-result-card.fail { border-left: 4px solid var(--danger); }

.comprovante-page { background: #eef1f5; padding: 1rem 0 2rem; }
.comprovante {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.comprovante-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.comprovante-body {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
}
.comprovante-info dl, .comprovante-qr { margin: 0; }
.comprovante-info dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: .35rem .75rem;
}
.comprovante-info dt { color: var(--muted); }
.comprovante-info dd { margin: 0; }
.comprovante-qr { text-align: center; border: 1px dashed var(--border); border-radius: 12px; padding: 1rem; }
.codigo-grande { font-size: 1.25rem; font-weight: 800; letter-spacing: .05em; color: var(--primary-dark); }
.comprovante-actions { margin-top: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; }

.comprovante-actions { margin-top: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; }

.whatsapp-float {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem .9rem .75rem .75rem;
    background: #25d366;
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    transition: transform .2s ease, box-shadow .2s ease;
}
.whatsapp-float:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55);
    color: #fff;
}
.whatsapp-float svg { flex-shrink: 0; }
.whatsapp-float-label { white-space: nowrap; }

@media (max-width: 480px) {
    .whatsapp-float {
        right: 1rem;
        bottom: 1rem;
        padding: .85rem;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        justify-content: center;
    }
    .whatsapp-float-label { display: none; }
    .whatsapp-float svg { width: 30px; height: 30px; }
}

@media (max-width: 768px) {
    .pix-grid, .comprovante-body {
        grid-template-columns: 1fr;
    }
    .pix-qr { text-align: center; }
    .comprovante-header { flex-direction: column; }
    .data-table { font-size: .82rem; }
    .admin-header nav { width: 100%; }
}
