/* Reset de Caixa e Margens */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Scrollbar Customizada Estilo Terminal */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: var(--radius-sm);
}

/* Layout Containers & Grid */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
    box-sizing: border-box;
    width: 100%;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Força exatamente 2 colunas iguais por linha */
.cards-grid--row {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
}

/* Garante que itens do grid não estourem o container (regra fundamental do CSS Grid) */
.cards-grid > *,
.cards-grid--row > * {
    min-width: 0;
}

/* Uma coluna só (card cheio) em telas pequenas */
@media (max-width: 900px) {
    .cards-grid--row {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Blur Container */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-normal);
}

.glass-panel:hover {
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: var(--shadow-card), 0 4px 20px rgba(99, 102, 241, 0.04);
}

.icon-svg {
    width: 1.1rem;
    height: 1.1rem;
    stroke: currentColor;
    fill: none;
    display: inline-block;
    vertical-align: middle;
    transition: transform var(--transition-fast), stroke var(--transition-fast);
}

.logo-icon-svg {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
    animation: pulse-glow 2.5s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.3)); }
    50% { filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.6)); }
}

/* Badges e Botões Padrão */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-buy { background: rgba(16, 185, 129, 0.15); color: var(--color-buy); }
.badge-sell { background: rgba(239, 68, 68, 0.15); color: var(--color-sell); }
.badge-accent { background: rgba(59, 130, 246, 0.15); color: var(--color-accent); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}
.btn-accent {
    background: var(--color-accent);
    color: #ffffff;
}
.btn-accent:hover {
    background: var(--color-accent-hover);
}

/* Sistema de Toast Notifications Visuais */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border-left: 4px solid var(--color-accent);
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.toast-item.toast-success { border-left-color: var(--color-buy); }
.toast-item.toast-warning { border-left-color: var(--color-warning); }
.toast-item.toast-error { border-left-color: var(--color-sell); }
.toast-item.toast-info { border-left-color: var(--color-accent); }

.toast-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Navbar Principal */
.navbar {
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
}
.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.logo-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.logo-title small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bonus-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.bonus-widget:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color-highlight);
    transform: translateY(-1px);
}

.btn-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-profile:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-color-highlight);
    transform: translateY(-1px);
}

.btn-profile .user-name {
    color: var(--text-primary);
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--color-sell);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #fb7185;
}


/* Abas de Navegação */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}
.tab-btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-weight: 600;
    cursor: pointer;
}
.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color-highlight);
}
.tab-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card Timeline & Paywall Overlay */
.card-timeline-container {
    padding: 1.25rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.card-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.control-select {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 0.15rem;
    border: 1px solid var(--border-color);
}
.btn-tf, .btn-mode {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.btn-tf.active, .btn-mode.active-live {
    background: var(--color-accent);
    color: #ffffff;
}
.btn-mode.active-hist {
    background: var(--color-warning);
    color: #ffffff;
}

.chart-wrapper {
    position: relative;
    height: 380px;
    width: 100%;
}

/* Paywall Lock Overlay */
.paywall-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-md);
}
.paywall-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}
.lock-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Modal de Resgate À La Carte */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

dialog.native-auth-dialog {
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    background: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    max-width: 500px;
    width: 90vw;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
    margin: auto;
}

dialog.native-auth-dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.modal-content {
    max-width: 650px;
    width: 100%;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-fast);
}
.plan-card:hover {
    border-color: var(--border-color-highlight);
    transform: translateY(-2px);
}

.plan-card h5 {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}
.plan-cost {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-buy);
    margin-bottom: 0.75rem;
}
.plan-cost span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}
.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    width: 100%;
}

/* Formulários e Autenticação */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.btn-auth-group {
    display: flex;
    gap: 0.5rem;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
}
.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--color-sell);
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.25rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}
.form-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}
.form-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}
.form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.auth-hint {
    padding: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    text-align: left;
    border-left: 3px solid var(--color-warning);
}
.auth-hint code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: var(--color-warning);
}

/* Mini Perfil do Usuário */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.profile-card {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: left;
}
.profile-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.profile-value {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 0.2rem;
}

.profile-bonus-box {
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: left;
}
.profile-bonus-box h5 {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.bonus-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.bonus-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.passes-table-wrapper {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.passes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}
.passes-table th, .passes-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.passes-table th {
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
}

@keyframes pulse-live {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ============================================================
   Card 04 - Console de Alertas de Exaustão
   ============================================================ */

.exaustao-console {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

/* Linha de status de cada player */
.player-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast);
}
.player-status-row:hover {
    border-color: rgba(255,255,255,0.12);
}

.player-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 90px;
}

.player-valor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 90px;
    text-align: right;
}

.player-pct-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}
.player-pct-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}

/* Badges de status */
.status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 99px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-badge.exaustao-venda {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.35);
    animation: pulse-badge 1.4s ease infinite;
}
.status-badge.exaustao-compra {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
    animation: pulse-badge 1.4s ease infinite;
}
.status-badge.venda {
    background: rgba(244, 63, 94, 0.1);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.2);
}
.status-badge.compra {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}
.status-badge.venda-fraca {
    background: rgba(251, 113, 133, 0.07);
    color: #fda4af;
    border-color: rgba(251,113,133,0.15);
}
.status-badge.compra-fraca {
    background: rgba(52, 211, 153, 0.07);
    color: #6ee7b7;
    border-color: rgba(52,211,153,0.15);
}
.status-badge.neutro {
    background: rgba(148, 163, 184, 0.08);
    color: #94a3b8;
    border-color: rgba(148,163,184,0.18);
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
    50% { box-shadow: 0 0 8px 2px currentColor; opacity: 0.85; }
}

/* Log de alertas */
.alertas-log {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.alerta-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    border: 1px solid transparent;
}
.alerta-row.exaustao-venda {
    background: rgba(244, 63, 94, 0.06);
    border-color: rgba(244, 63, 94, 0.15);
}
.alerta-row.exaustao-compra {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.15);
}

/* Escalas de Alertas de Volume */
.badge-escala {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-transform: uppercase;
}

.badge-escala.escala-nivel-1 {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-escala.escala-nivel-2 {
    background: rgba(249, 115, 22, 0.18);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.badge-escala.escala-nivel-3 {
    background: rgba(225, 29, 72, 0.2);
    color: #fb7185;
    border: 1px solid rgba(225, 29, 72, 0.5);
    box-shadow: 0 0 8px rgba(225, 29, 72, 0.25);
}

.badge-escala.escala-nivel-4 {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(244, 63, 94, 0.3));
    color: #fef08a;
    border: 1px solid #eab308;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.5);
    animation: pulse-ultra-badge 1.2s infinite ease-in-out;
}

/* Linhas do Log por Nível */
.alerta-row.nivel-atencao {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

.alerta-row.nivel-relevante {
    background: rgba(249, 115, 22, 0.07);
    border-color: rgba(249, 115, 22, 0.25);
}

.alerta-row.nivel-forte {
    background: rgba(225, 29, 72, 0.1);
    border-color: rgba(225, 29, 72, 0.35);
}

.alerta-row.nivel-ultra {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid #eab308;
    box-shadow: inset 0 0 10px rgba(234, 179, 8, 0.15);
}

.alerta-ultra-pulse {
    animation: pulse-ultra-row 1.5s infinite ease-in-out;
}

.row-pulse-ultra {
    border-color: #eab308 !important;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}

@keyframes pulse-ultra-badge {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px #eab308); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 8px #f43f5e); }
}

@keyframes pulse-ultra-row {
    0%, 100% { border-color: rgba(234, 179, 8, 0.4); }
    50% { border-color: rgba(244, 63, 94, 0.9); box-shadow: 0 0 12px rgba(244, 63, 94, 0.3); }
}

.alerta-hora {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    padding-top: 1px;
}
.alerta-msg {
    color: var(--text-primary);
    line-height: 1.4;
}






