/* Estilos Globais */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    display: flex;
    color: #333;
}

/* ======================================================
   Página de Login (CORRIGIDO)
   ====================================================== */
.login-container {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: auto; 
}

.login-header { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 25px; }
.login-icon { width: 36px; height: 36px; }
.login-header h2 { margin: 0; font-size: 2rem; }

/* --- Abas de Login (Refined) --- */
.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background-color: #e9ecef;
    padding: 5px;
    border-radius: 8px;
}
.tab-button {
    flex: 1;
    padding: 10px;
    background-color: transparent;
    color: #495057;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}
.tab-button.active {
    background-color: #ffffff;
    color: #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-form { display: none; /* Esconde os formulários por padrão */ }
.login-form.active { display: flex; flex-direction: column; /* Mostra apenas o formulário ativo */ }

.login-container label { margin-bottom: 5px; color: #555; font-weight: 600; }
.login-container input { padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; box-sizing: border-box; }
.login-container button[type="submit"] { padding: 12px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; }
.login-container button[type="submit"]:hover { background-color: #0056b3; }
.error-message { color: #dc3545; margin-bottom: 15px; text-align: center; min-height: 1.2em;}

/* ======================================================
   Layout Principal do Painel
   ====================================================== */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: left 0.3s ease-in-out;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    height: 100vh; 
    box-sizing: border-box;
}

/* ======================================================
   Componentes do Painel
   ====================================================== */

/* --- Barra Lateral --- */
.sidebar-header h2 { font-size: 1.5rem; margin-bottom: 30px; display: flex; align-items: center; }
.sidebar-header .sidebar-icon { width: 28px; height: 28px; margin-right: 10px; }
.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav a { display: flex; align-items: center; padding: 12px 15px; text-decoration: none; color: #555; border-radius: 6px; margin-bottom: 5px; font-weight: 500; transition: background-color 0.2s, color 0.2s; }
.sidebar nav a:hover, .sidebar nav a.active { background-color: #e9f5ff; color: #007bff; }
.sidebar nav a i { margin-right: 15px; width: 20px; }
.sidebar-footer { margin-top: auto; }
.user-info { display: flex; align-items: center; padding: 10px; background-color: #f1f3f5; border-radius: 6px; }
.user-info i { margin-right: 10px; }
.user-info div { display: flex; flex-direction: column; }
.user-info strong { font-size: 0.9rem; }
.logout-link { display: flex; align-items: center; padding: 12px 15px; text-decoration: none; color: #555; border-radius: 6px; margin-top: 10px; }
.logout-link:hover { background-color: #ffebee; color: #dc3545; }

/* --- Cards --- */
.cards-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card { background-color: #ffffff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 25px; display: flex; justify-content: space-between; align-items: flex-start; position: relative; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.card-content h3 { margin: 0 0 5px 0; font-size: 1rem; color: #ffffff; opacity: 0.9; }
.card-content p { margin: 0; font-size: 2.2rem; font-weight: 700; color: #ffffff; }
.card-icon-wrapper { background-color: rgba(255, 255, 255, 0.2); border-radius: 50%; width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; font-size: 1.8rem; color: #ffffff; }
.card-blue { background: linear-gradient(45deg, #007bff, #0056b3); }
.card-green { background: linear-gradient(45deg, #28a745, #1e7e34); }
.card-yellow { background: linear-gradient(45deg, #ffc107, #d39e00); }
.card-red { background: linear-gradient(45deg, #dc3545, #b02a37); }

/* --- Tabelas e Botões --- */
.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.main-header > h1, .main-header > div {
    flex-grow: 1;
    text-align: center;
}
.primary-button { background-color: #007bff; color: white; border: none; border-radius: 6px; padding: 10px 15px; font-size: 1rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background-color 0.2s, transform 0.2s; }
.primary-button:hover { background-color: #0056b3; transform: scale(1.05); }
.table-container { background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 15px; text-align: left; border-bottom: 1px solid #e9ecef; }
table th { background-color: #f8f9fa; font-weight: 600; }

/* --- Modais --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); }
.modal-content { background-color: #fefefe; margin: 10% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 8px; animation: slide-down 0.3s ease-out; }
@keyframes slide-down { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e9ecef; padding-bottom: 10px; margin-bottom: 20px; }
.close-button { color: #aaa; font-size: 28px; font-weight: bold; background: none; border: none; cursor: pointer; }
.form-group { margin-bottom: 15px; }
.form-group-row { display: flex; gap: 20px; }
.form-group-row .form-group { flex: 1; }
.form-group label { display: block; margin-bottom: 5px; }
.form-group input, .form-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.modal-footer { text-align: right; margin-top: 20px; }

/* --- Status de Pagamento (Vendas a Prazo) --- */
tr.status-overdue {
    background-color: #f8d7da !important; /* Vermelho */
}
tr.status-due {
    background-color: #fff3cd !important; /* Amarelo */
}
tr.status-paid {
    background-color: #d1ecf1 !important; /* Azul */
}

/* --- Distintivos de Status de Assinatura --- */
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}
.status-badge.status-paid { background-color: #28a745; } /* Verde para "Em dia" */
.status-badge.status-due { background-color: #ffc107; color: #333; } /* Amarelo para "Vence em breve" */
.status-badge.status-overdue { background-color: #dc3545; } /* Vermelho para "Vencido" */
.status-badge.status-pending { background-color: #6c757d; } /* Cinza para "Não iniciada" */
