/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* NAVBAR */
.navbar {
    background: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-user a {
    color: #667eea;
    text-decoration: none;
    margin-left: 15px;
}

.nav-user a:hover {
    text-decoration: underline;
}

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

h1 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

/* LOGIN PAGE */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.login-container h2 {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.erro {
    background: #ff4444;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* MENU CARDS */
.menu-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.card p {
    color: #666;
}

/* STATS CARDS */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-card h3 {
    margin-bottom: 15px;
    color: #666;
}

.stat-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-card.red .stat-value {
    color: #ff4444;
}

.stat-card.green .stat-value {
    color: #44aa44;
}

.stat-subtitle {
    color: #888;
    font-size: 1.1rem;
}

/* MELHORIAS PARA CARDS DE ESTATÍSTICAS */
.stat-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.stat-card.orange .stat-value,
.stat-card.orange .stat-value-money {
    color: #ff8800;
}

.stat-value-money {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* TABLES */
.section-title {
    color: #fff;
    margin: 40px 0 20px 0;
    font-size: 1.8rem;
}

.table-container {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background: #f8f9ff;
}

.data-table .valor {
    font-weight: bold;
    color: #667eea;
}

.text-center {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

/* ========================================
   TABELA DE QUOTAS POR PAGAR
   ======================================== */

.dividas-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* LINHA PRINCIPAL DO SÓCIO - BASE */
.socio-row td {
    padding: 12px 20px;
    font-size: 1rem;
}

.socio-nome-col {
    width: 40%;
    font-size: 1.05rem;
}

.socio-numero-col {
    width: 25%;
    font-weight: 500;
}

.socio-total-col {
    width: 35%;
    text-align: right;
    font-size: 1rem;
    font-weight: 600;
}

/* LINHAS DOS ANOS - AZUL CLARO */
.ano-row {
    background: #bbdefb;
}

.ano-detalhes {
    padding: 10px 20px 10px 40px;
    color: #0d47a1;
    font-size: 0.95rem;
}

/* ESPAÇAMENTO ENTRE SÓCIOS */
.spacer-row {
    height: 15px;
    background: transparent;
}

.spacer-row td {
    padding: 0;
    border: none;
}

/* HOVER EFFECTS */
.ano-row:hover {
    background: #90caf9;
}

/* ÍCONE DE EXPANDIR/COLAPSAR */
.expand-icon {
    display: inline-block;
    margin-right: 10px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.socio-row {
    cursor: pointer;
}

.socio-row:active {
    opacity: 0.9;
}

/* ========================================
   CORES DINÂMICAS PARA LINHAS DE SÓCIOS
   ======================================== */

/* VERDE - só ano atual */
.socio-verde {
    background: #c8e6c9 !important;
}

.socio-verde td {
    color: #1b5e20 !important;
}

.socio-verde:hover {
    background: #a5d6a7 !important;
}

.socio-verde .expand-icon {
    color: #2e7d32 !important;
}

/* LARANJA - ano atual + ano anterior */
.socio-laranja {
    background: #ffe0b2 !important;
}

.socio-laranja td {
    color: #e65100 !important;
}

.socio-laranja:hover {
    background: #ffcc80 !important;
}

.socio-laranja .expand-icon {
    color: #e65100 !important;
}

/* VERMELHO - anos anteriores */
.socio-vermelho {
    background: #ffcdd2 !important;
}

.socio-vermelho td {
    color: #b71c1c !important;
}

.socio-vermelho:hover {
    background: #ef9a9a !important;
}

.socio-vermelho .expand-icon {
    color: #b71c1c !important;
}

/* LEGENDA DE CORES */
.legenda-cores {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legenda-box {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
}

.verde-box {
    background: #c8e6c9;
}

.laranja-box {
    background: #ffe0b2;
}

.vermelho-box {
    background: #ffcdd2;
}

.legenda-texto {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

/* EMPTY MESSAGE */
.empty-message {
    background: white;
    border-radius: 16px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.empty-text {
    font-size: 1.5rem;
    color: #666;
    font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .navbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th, .data-table td {
        padding: 8px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .socio-row td {
        display: block;
        width: 100%;
        padding: 8px 15px;
    }
    
    .socio-total-col {
        text-align: left;
        font-size: 1.1rem;
        padding-top: 12px;
        border-top: 1px dashed rgba(0,0,0,0.1);
    }
    
    .ano-detalhes {
        padding-left: 30px;
    }
    
    .empty-message {
        padding: 60px 20px;
    }
    
    .legenda-cores {
        flex-direction: column;
        gap: 10px;
        padding: 12px 20px;
    }
}
