:root {
    --bg-color: #020617; /* Azul muito escuro/Preto */
    --card-bg: #0f172a;  /* Azul escuro */
    --primary: #3b82f6;  /* Azul vibrante */
    --primary-hover: #2563eb;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --input-bg: #1e293b;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, #1e293b 0%, transparent 40%),
                      radial-gradient(circle at bottom left, #172554 0%, transparent 40%);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}
/* Centralizar apenas nas telas de auth */
body:has(.auth-container) { align-items: center; justify-content: center; }

.auth-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    text-align: center;
}

.logo-area {
    margin-bottom: 30px;
}

.logo-area img {
    max-height: 80px;
    margin-bottom: 0;
}

.logo-area h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.auth-footer {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Responsividade */
@media (max-width: 480px) {
    .auth-card { padding: 25px; }
}

/* --- Dashboard Layout --- */
.dashboard-wrapper {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar-logo {
    margin-bottom: 40px;
    text-align: center;
}
.sidebar-logo h2 { color: var(--primary); text-transform: uppercase; font-size: 1.2rem; }

.nav-menu { list-style: none; }
.nav-item { margin-bottom: 10px; }
.nav-link {
    display: block;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s;
    font-weight: 500;
}
.nav-link i { margin-right: 10px; width: 20px; text-align: center; }
.nav-link:hover, .nav-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.page-header { margin-bottom: 30px; }
.page-title { font-size: 1.8rem; font-weight: 600; }


.stat-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}
.stat-title { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; }
.stat-value { font-size: 2.5rem; font-weight: 700; color: var(--text-color); }

.main-footer {
    margin-top: auto;
    padding-top: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
}
.table th, .table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    background-color: rgba(0,0,0,0.2);
    font-weight: 600;
    color: var(--text-muted);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover { background-color: rgba(255,255,255,0.02); }

/* Botões e Utilitários */
.btn-sm { 
    padding: 6px 12px; 
    width: auto;
    display: inline-block;
    font-size: 0.85rem; 
    border-radius: 6px; 
    cursor: pointer; 
    border: none; 
    font-weight: 600;
    transition: opacity 0.2s;
}
.btn-sm:hover { opacity: 0.9; }

.btn-primary { background-color: var(--primary); color: white; }
.btn-danger { background-color: #ef4444; color: white; }
.btn-warning { background-color: #f59e0b; color: white; }
.btn-success { background-color: #10b981; color: white; }

.gap-2 { gap: 10px; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }

.d-flex { display: flex; gap: 10px; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.mb-4 { margin-bottom: 1.5rem; }

.card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.card-header { margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.card-title { font-size: 1.2rem; font-weight: 600; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.close-modal:hover { color: var(--text-color); }

/* Input Group com Botão */
.input-group {
    display: flex;
    gap: 10px;
}
.input-group .form-control { flex: 1; }
.btn-secondary {
    background-color: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-color); cursor: pointer; padding: 0 15px; border-radius: var(--radius);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Tabs */
.tabs { margin-bottom: 20px; border-bottom: 1px solid var(--border-color); display: flex; gap: 20px; }
.tab-btn {
    background: none; border: none; color: var(--text-muted); 
    padding: 10px 5px; cursor: pointer; font-size: 1rem; font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color 0.3s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--text-color); }

/* --- Fintech Dashboard Styles --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 25px;
}

.stats-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.chart-section {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    position: relative;
    height: 400px; /* Altura fixa para não estourar */
}

.widgets-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    flex: 1;
}

.stat-card.gradient-1 { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); border-left: 4px solid #3b82f6; }
.stat-card.gradient-2 { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); border-left: 4px solid #10b981; }
.stat-card.gradient-3 { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); border-left: 4px solid #f59e0b; }
.stat-card.gradient-4 { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); border-left: 4px solid #ef4444; }

.player-list {
    list-style: none;
    margin-top: 15px;
}
.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.player-item:last-child { border-bottom: none; }
.player-info h4 { font-size: 0.9rem; margin-bottom: 2px; }
.player-info span { font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
