:root {
    --bg: #080a0f;
    --surface: #111520;
    --surface-2: #181e2e;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f8fafc;
    --muted: #94a3b8;
    --gold: #f59e0b;
    --gold-bright: #fbbf24;
    --emerald: #10b981;
    --danger: #ef4444;
    --wa: #25d366;
    --ig: #e1306c;
    --radius: 18px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }

/* Botões e inputs compartilhados */
.btn-primary, .btn-secondary, .btn-danger, .btn-danger-sm, .btn-wa, .btn-ig {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.15s ease;
}
.btn-primary:active, .btn-secondary:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--gold), #d97706); color: #090b10; width: 100%; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; width: 100%; }
.btn-danger-sm { background: rgba(239, 68, 68, 0.16); color: #fca5a5; padding: 8px 12px; font-size: 0.82rem; border: 1px solid rgba(239,68,68,.3); }
.btn-wa { background: var(--wa); color: #052e16; }
.btn-ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); color: #fff; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0b0e16;
    color: var(--text);
    font-size: 1rem;
}
.check-row { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.check-row input { width: auto; }
.alert-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fecaca; padding: 12px; border-radius: 10px; margin-bottom: 14px; }
.alert-ok { background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.4); color: #a7f3d0; padding: 12px; border-radius: 10px; margin-bottom: 14px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* Hub / Index */
.page-hub { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle at top, #1b2236 0%, var(--bg) 65%); }
.hub-container { width: 100%; max-width: 980px; }
.hub-header { text-align: center; margin-bottom: 32px; }
.badge-gold { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(245,158,11,.15); color: var(--gold-bright); font-size: 0.8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.hub-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 12px 0 8px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.hub-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: transform .18s ease, border-color .18s ease; }
.hub-card:hover { transform: translateY(-3px); border-color: rgba(245,158,11,.5); }
.hub-icon { font-size: 2rem; }
.hub-card h2 { margin: 4px 0; font-size: 1.15rem; }
.hub-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; flex: 1; }
.hub-cta { color: var(--gold-bright); font-weight: 700; font-size: 0.9rem; margin-top: 8px; }
.hub-footer { margin-top: 28px; display: flex; justify-content: center; }
.social-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Auth */
.page-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.auth-card h1 { margin: 0 0 6px; font-size: 1.5rem; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 18px; font-size: 0.85rem; color: var(--muted); }
.auth-links a:hover { color: var(--gold-bright); }

/* Navegação interna (Tablet / Admin / Conta) */
.app-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.nav-title { display: flex; flex-direction: column; }
.nav-title small { color: var(--muted); font-size: 0.8rem; }
.nav-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-links a { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 0.85rem; font-weight: 600; }
.nav-links a.nav-exit { color: #fca5a5; }

/* ==================== VISOR DA TV (SHOPPING) ==================== */
.page-tv { height: 100vh; overflow: hidden; background: radial-gradient(circle at 20% 20%, #171d2e 0%, #07090d 75%); }
.tv-shell { height: 100vh; display: flex; flex-direction: column; padding: 18px 24px; gap: 16px; }
.tv-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: rgba(17, 21, 32, 0.82); border: 1px solid var(--border); border-radius: 16px; backdrop-filter: blur(12px); }
.tv-brand { display: flex; align-items: center; gap: 14px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 14px var(--emerald); flex-shrink: 0; }
.tv-brand strong { display: block; font-size: clamp(1.1rem, 2vw, 1.5rem); letter-spacing: 0.02em; }
.tv-brand small { display: block; color: var(--muted); font-size: 0.9rem; }
.tv-meta { display: flex; align-items: center; gap: 14px; }
.btn-sound { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: 0.85rem; }
.tv-clock { font-size: clamp(1.2rem, 2vw, 1.7rem); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold-bright); }

.tv-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.9fr 1fr; gap: 20px; }

/* Propagandas na TV */
.tv-ads { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,0.45); }
.ads-stage { position: relative; flex: 1; width: 100%; height: 100%; }
.ad-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.65s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.ad-slide.active { opacity: 1; pointer-events: auto; }
.ad-slide img, .ad-slide video { width: 100%; height: 100%; object-fit: cover; }
.ad-overlay { position: absolute; inset: auto 0 0 0; padding: 28px 32px; background: linear-gradient(transparent, rgba(5,7,12,0.92)); text-align: left; }
.ad-overlay h2 { margin: 0 0 6px; font-size: clamp(1.5rem, 2.8vw, 2.4rem); }
.ad-overlay p { margin: 0; color: #e2e8f0; font-size: clamp(1rem, 1.4vw, 1.25rem); }
.ad-promo { padding: 48px; background: radial-gradient(circle at top right, rgba(245,158,11,0.22), transparent 55%), linear-gradient(135deg, #121827, #0b0e17); }
.ad-badge { display: inline-block; padding: 8px 18px; border-radius: 999px; background: var(--gold); color: #090b10; font-weight: 900; font-size: 0.9rem; letter-spacing: 0.08em; margin-bottom: 18px; }
.ad-promo h2 { font-size: clamp(2rem, 4vw, 3.6rem); margin: 0 0 14px; line-height: 1.1; }
.ad-promo p { font-size: clamp(1.1rem, 1.8vw, 1.6rem); color: #cbd5e1; max-width: 720px; margin: 0; line-height: 1.45; }
.ads-dots { position: absolute; bottom: 14px; right: 20px; display: flex; gap: 8px; z-index: 3; }
.ads-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.ads-dot.active { background: var(--gold-bright); width: 24px; border-radius: 999px; }

/* Painel de Senhas na TV */
.tv-tickets { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.current-ticket-card { background: linear-gradient(160deg, #1b2236 0%, #101522 100%); border: 2px solid rgba(245, 158, 11, 0.55); border-radius: 24px; padding: 24px 20px; text-align: center; box-shadow: 0 0 40px rgba(245, 158, 11, 0.16); transition: transform 0.25s ease; }
.current-ticket-card.pulse { animation: ticketPulse 1s ease 2; }
@keyframes ticketPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(245,158,11,0.2); }
    50% { transform: scale(1.03); box-shadow: 0 0 70px rgba(251,191,36,0.65); border-color: var(--gold-bright); }
}
.ticket-caption { display: block; font-size: 1rem; font-weight: 800; letter-spacing: 0.16em; color: var(--gold-bright); }
.ticket-number { font-size: clamp(4.2rem, 7.5vw, 7.2rem); font-weight: 900; line-height: 1.05; margin: 10px 0; color: #ffffff; font-variant-numeric: tabular-nums; text-shadow: 0 6px 24px rgba(0,0,0,0.6); }
.ticket-label { display: inline-block; padding: 8px 18px; border-radius: 999px; background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.4); color: #6ee7b7; font-weight: 700; font-size: 1.05rem; }

.history-card { flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px 20px; display: flex; flex-direction: column; }
.history-card h3 { margin: 0 0 12px; font-size: 0.9rem; letter-spacing: 0.12em; color: var(--muted); }
.ticket-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.ticket-history li { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 1.25rem; font-weight: 800; }
.ticket-history li span.h-label { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.ticket-history li.history-empty { justify-content: center; color: var(--muted); font-size: 0.95rem; font-weight: 500; }

.tv-social { display: flex; gap: 10px; justify-content: center; }
.tv-pill { flex: 1; text-align: center; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 0.9rem; }
.tv-wa { background: rgba(37, 211, 102, 0.16); color: #86efac; border: 1px solid rgba(37, 211, 102, 0.35); }
.tv-ig { background: rgba(225, 48, 108, 0.16); color: #f9a8d4; border: 1px solid rgba(225, 48, 108, 0.35); }

/* ==================== PAINEL DO TABLET ==================== */
.tablet-layout { max-width: 1060px; margin: 0 auto; padding: 18px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.tablet-caller, .tablet-status { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.tablet-display { text-align: center; margin-bottom: 14px; }
.display-hint { font-size: 0.85rem; color: var(--muted); }
.ticket-input { margin-top: 8px; text-align: center; font-size: 2.8rem; font-weight: 900; letter-spacing: 0.08em; padding: 14px; border-radius: 14px; border: 2px solid rgba(245,158,11,0.45); background: #090c12; color: var(--gold-bright); }
.label-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.pill { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); padding: 8px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; }
.pill.active { background: rgba(245,158,11,0.2); border-color: var(--gold); color: var(--gold-bright); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.key { min-height: 60px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 1.5rem; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.key:active { background: #263047; transform: scale(0.97); }
.key-action { color: var(--gold-bright); }

.btn-call-primary { width: 100%; min-height: 58px; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--emerald), #059669); color: #fff; font-size: 1.2rem; font-weight: 900; letter-spacing: 0.04em; cursor: pointer; }
.caller-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tablet-feedback { margin-top: 10px; min-height: 22px; text-align: center; font-size: 0.9rem; color: #6ee7b7; font-weight: 600; }

.status-box { text-align: center; padding: 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 16px; }
.status-big { display: block; font-size: 3rem; font-weight: 900; color: var(--gold-bright); margin: 4px 0; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-head h3 { margin: 0; font-size: 1rem; }
.tablet-history-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tablet-history-list li { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.tablet-history-list button { border: 0; border-radius: 8px; padding: 6px 10px; background: rgba(245,158,11,0.2); color: var(--gold-bright); font-weight: 700; cursor: pointer; }
.tablet-social { display: flex; gap: 10px; margin-top: 16px; }
.tablet-social a { flex: 1; text-align: center; }

/* ==================== ADMIN & LGPD ==================== */
.admin-grid { max-width: 1040px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel-card h2 { margin: 0 0 12px; font-size: 1.2rem; }
.panel-full { grid-column: 1 / -1; }
.ads-list { display: flex; flex-direction: column; gap: 10px; }
.ad-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.ad-item-info { display: flex; flex-direction: column; gap: 4px; }
.badge-type { font-size: 0.72rem; color: var(--gold-bright); font-weight: 800; }
.ad-item-actions { display: flex; gap: 8px; }

/* Responsividade Mobile/Tablet e TV menor */
@media (max-width: 900px) {
    .page-tv { height: auto; min-height: 100vh; overflow-y: auto; }
    .tv-shell { height: auto; min-height: 100vh; }
    .tv-main { grid-template-columns: 1fr; }
    .tv-ads { min-height: 300px; }
    .tablet-layout { grid-template-columns: 1fr; }
}
