@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');

/* --- Variáveis de Cor e Configurações Globais --- */
:root {
    --purple-dark: #2c003e;
    --purple-medium: #4a0072;
    --purple-light: #8e44ad;
    --gold-primary: #ffd700;
    --gold-secondary: #f1c40f;
    --white: #ffffff;
    --gray-light: #f4f4f4;
    --gray-dark: #333;
    --success: #2ecc71;
    --danger: #e74c3c;
    --shadow-light: rgba(255, 215, 0, 0.4);
    --shadow-dark: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-medium));
    color: var(--gray-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- Layout Principal --- */
.main-layout {
    display: flex;
    height: 100vh;
    width: 100%; /* Usar 100% em vez de 100vw para evitar problemas com a barra de rolagem */
}

.sidebar {
    width: 250px;
    flex-shrink: 0; /* Impede que a sidebar encolha */
    background-color: var(--purple-dark);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px var(--shadow-dark);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    color: var(--gold-primary);
}

/* --- Componentes --- */
.card {
    background-color: rgba(74, 0, 114, 0.4); /* Cor com transparência para um efeito melhor */
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-dark);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--purple-light);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.card h3 {
    color: var(--gold-secondary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gold-primary);
    padding-bottom: 0.5rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.kpi {
    background: var(--purple-dark);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--purple-light);
}

.kpi p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.kpi span {
    font-size: 0.9rem;
    color: var(--gold-secondary);
}

/* --- Barra Lateral (Sidebar) --- */
.sidebar h2 {
    color: var(--gold-primary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.sidebar nav a {
    display: flex; /* Alinha ícone e texto */
    align-items: center;
    gap: 10px; /* Espaço entre ícone e texto */
    color: var(--white);
    text-decoration: none;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sidebar nav a.active, .sidebar nav a:hover {
    background-color: var(--purple-light);
    color: var(--gold-primary);
    transform: translateX(5px);
}

.sidebar .logout {
    margin-top: auto; /* Empurra o botão de sair para o final */
}

/* --- Tabelas --- */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--purple-light);
}

th {
    color: var(--gold-primary);
    text-transform: uppercase;
    font-size: 0.9rem;
}

tbody tr:hover {
    background-color: var(--purple-light);
}

.status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--purple-dark);
    text-align: center;
    min-width: 80px;
    display: inline-block;
}

.status.pago { background-color: var(--success); }
.status.pendente { background-color: var(--gold-secondary); }
.status.baixo { background-color: var(--danger); color: var(--white); }
.status.ok { background-color: var(--success); }

/* --- Formulários --- */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* Permite que os campos quebrem a linha em telas menores */
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 200px; /* Garante uma largura mínima antes de quebrar a linha */
}

label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gold-secondary);
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--purple-light);
    border: 1px solid var(--gold-secondary);
    border-radius: 5px;
    color: var(--white);
    font-family: inherit; /* Garante que a fonte seja a mesma do site */
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 8px var(--shadow-light);
}

/* --- Botões --- */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--gold-primary), var(--gold-secondary));
    color: var(--purple-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-light);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    filter: brightness(1.1);
}


/* --- Estilos da Página de Login (Agrupados) --- */
.login-container {
    background-color: var(--purple-dark);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-dark);
    text-align: center;
    width: 100%;
    max-width: 450px;
    margin: 1rem;
}

.login-container h1 {
    color: var(--gold-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-container p {
    margin-bottom: 2rem;
    font-weight: 300;
}

.login-container .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-container .demo-users {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--gray-light);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    text-transform: uppercase;
}