:root {
    --bg: #fdfaf5;
    --surface: #ffffff;
    --surface-alt: #f8f4ec;
    --ink: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #dcfce7;
    --accent-red: #dc2626;
    --accent-red-light: #fee2e2;
    --accent-gold: #d97706;
    --accent-gold-light: #fef3c7;
    --accent-blue: #0284c7;
    --accent-blue-light: #e0f2fe;
    --accent-purple: #7e22ce;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 3rem;
}

/* TOP BAR / HUB HEADER */
.top-banner {
    background: linear-gradient(135deg, #14532d 0%, #166534 55%, #991b1b 100%);
    color: #fff;
    padding: 0.9rem 1rem 1.25rem;
    position: relative;
    box-shadow: var(--shadow-md);
}

.top-banner-inner {
    max-width: 780px;
    margin: 0 auto;
}

.hub-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.back-site-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.14);
    padding: 6px 12px;
    border-radius: 999px;
    transition: background 0.2s;
}

.back-site-link:hover {
    background: rgba(255, 255, 255, 0.24);
}

.admin-shortcut-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
}

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

.hero-logo-box {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    background: #fff;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.hero-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hero-titles h1 {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.hero-badge {
    display: inline-block;
    background: #fef08a;
    color: #854d0e;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 9px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.hero-titles p {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.92);
    margin-top: 3px;
}

/* HUB NAVIGATION TABS */
.hub-tabs {
    max-width: 780px;
    margin: -14px auto 1rem;
    padding: 0 1rem;
    position: relative;
    z-index: 5;
}

.hub-tabs-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--surface);
    padding: 6px;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.hub-tab-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 6px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.18s;
}

.hub-tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(21, 128, 61, 0.28);
}

/* MAIN CONTAINER */
.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

/* BALANCED 2-PHOTO GALLERY */
.photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0.95rem;
}

.photo-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--border);
    aspect-ratio: 4 / 3.4;
    max-height: 220px;
    cursor: pointer;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s;
}

.photo-card:hover img {
    transform: scale(1.03);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 16px 8px 6px;
    text-align: center;
}

/* INFO PILLS & PROGRESS */
.info-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 0.95rem;
}

.info-chip {
    background: var(--surface-alt);
    border: 1px solid #e7e0d3;
    border-radius: 12px;
    padding: 9px 11px;
}

.info-chip-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.info-chip-value {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--ink);
    margin-top: 1px;
}

.info-chip-value.highlight {
    color: var(--primary);
    font-size: 1.08rem;
}

/* STOCK COUNTER BAR */
.stock-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 1rem;
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.stock-available-badge {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.stock-meta {
    font-size: 0.78rem;
    color: #166534;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #bbf7d0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #15803d);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    padding: 13px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
    width: 100%;
    text-align: center;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-red {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--ink);
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-amber {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.btn-whatsapp {
    background: #16a34a;
    color: #fff;
}

.btn-sm {
    padding: 8px 13px;
    font-size: 0.82rem;
    width: auto;
}

/* FORMS */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--ink);
}

.form-hint {
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 4px;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 1rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.14);
}

/* QUANTITY SELECTOR */
.qty-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.qty-preset-btn {
    background: var(--surface-alt);
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 4px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--ink);
}

.qty-preset-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-step-btn {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    font-size: 1.35rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--ink);
    flex-shrink: 0;
}

.total-calc-banner {
    background: #fefce8;
    border: 1.5px solid #fde047;
    border-radius: 12px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.total-calc-banner span {
    font-size: 0.88rem;
    font-weight: 700;
    color: #713f12;
}

.total-calc-banner strong {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary-dark);
}

/* PIX PAYMENT BOX */
.pix-box {
    background: #f8fafc;
    border: 2px dashed var(--primary);
    border-radius: 15px;
    padding: 1.1rem;
    margin: 1rem 0;
}

.pix-key-pill {
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: monospace;
    font-size: 0.98rem;
    font-weight: 700;
    word-break: break-all;
    text-align: center;
    margin: 8px 0;
    color: var(--ink);
}

.qr-container {
    text-align: center;
    margin: 12px auto;
    background: #fff;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    max-width: 230px;
}

.qr-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* STATUS BADGES */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-reservado_aguardando {
    background: #fef3c7;
    color: #92400e;
}

.status-comprovante_enviado {
    background: #e0f2fe;
    color: #075985;
}

.status-declarado_sem_comprovante {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fb923c;
}

.status-aprovado {
    background: #dcfce7;
    color: #166534;
}

.status-rejeitado, .status-cancelado {
    background: #fee2e2;
    color: #991b1b;
}

.status-expirado {
    background: #f1f5f9;
    color: #475569;
}

/* LUCKY NUMBERS CHIPS */
.lucky-numbers-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 8px 0;
}

.lucky-number-pill {
    background: linear-gradient(135deg, #15803d, #166534);
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    padding: 6px 13px;
    border-radius: 10px;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
}

/* PROGRESS BAR FOR UPLOAD */
.upload-progress-wrap {
    margin: 10px 0;
    display: none;
}

.upload-progress-wrap.active {
    display: block;
}

.upload-bar-bg {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.upload-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.25s;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 18px;
    max-width: 460px;
    width: 100%;
    padding: 1.35rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    max-height: 92vh;
    overflow-y: auto;
}

/* ADMIN SPECIFIC */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .admin-stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.admin-stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 11px;
    box-shadow: var(--shadow-sm);
}

.admin-stat-card .lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.admin-stat-card .val {
    font-size: 1.2rem;
    font-weight: 900;
    margin-top: 3px;
}

.numbers-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 6px;
}

.number-cell {
    border-radius: 8px;
    padding: 7px 4px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 800;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #64748b;
}

.number-cell.sold {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
    cursor: pointer;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #fff;
    padding: 11px 18px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 420px) {
    .hero-titles h1 {
        font-size: 1.18rem;
    }
    .photo-card {
        aspect-ratio: 1 / 1;
        max-height: 175px;
    }
}

