/* =========================================
   VARIÁVEIS DE CORES E TEMA
   ========================================= */
:root {
    --primary-color: #17324d; 
    --bg-body: #e0f7fa; 
    --bg-table: #ffffff; 
    --text-color: #333333;
}

/* =========================================
   ESTRUTURA GERAL DA PÁGINA
   ========================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Container principal */
main, .container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* Utilitários de Espaçamento e Texto */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.mb-blank { margin-bottom: 20px !important; }
.mt-blank { margin-top: 20px !important; }

h1, h2, h3 {
    text-align: center;
    color: var(--primary-color);
}

/* =========================================
   HEADER E FOOTER
   ========================================= */
header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

header .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

header a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    margin-left: 15px;
}

header a:hover {
    text-decoration: underline;
    color: #e0f7fa;
}

footer {
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: center;
    padding: 15px 20px;
    margin-top: auto;
    font-size: 0.9rem;
}

/* =========================================
   FORMULÁRIOS E BOTÕES
   ========================================= */
form {
    margin-bottom: 20px;
}

input, select, button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

button, .btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px 15px;
    font-weight: 600;
    border-radius: 4px;
    transition: background 0.2s;
    display: inline-block;
}

button:hover, .btn:hover {
    background-color: #0f2236;
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
    border: 0;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 600;
    font-size: 0.88rem;
}

/* =========================================
   TABELAS DE DÉBITOS E ADMIN
   ========================================= */
.table-wrap {
    overflow-x: auto;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    background-color: var(--bg-table);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background-color: var(--bg-table); 
}

table th, 
table td {
    padding: 10px 12px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #edf2f7;
    white-space: nowrap;
}

table th:last-child, 
table td:last-child {
    border-right: none;
}

table th {
    text-align: center !important;
    vertical-align: middle;
    background-color: #f8fafc;
    color: #334155;
    font-weight: 700;
    line-height: 1.2;
    border-bottom: 2px solid #cbd5e1;
}

table td.align-center, table th.align-center { text-align: center; }
table td.align-right, table th.align-right { text-align: right; }
table td.align-left, table th.align-left { text-align: left; }

table tfoot tr {
    background-color: #f1f5f9;
    font-weight: bold;
    border-top: 2px solid #cbd5e1;
}

table tfoot td {
    padding: 10px;
    color: #0f172a;
}

/* =========================================
   ABAS DO ADMIN
   ========================================= */
.admin-tabs { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 25px; 
    border-bottom: 2px solid #cbd5e1; 
}

.tab-btn { 
    padding: 10px 18px; 
    background: #e2e8f0; 
    border: none; 
    border-radius: 6px 6px 0 0; 
    cursor: pointer; 
    font-weight: bold; 
    text-decoration: none; 
    color: #334155; 
}

.tab-btn.active { 
    background: var(--primary-color); 
    color: #ffffff; 
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* =========================================
   BADGES E MENSAGENS DE ALERTA
   ========================================= */
.badge { 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-weight: bold; 
    font-size: 0.78rem; 
    display: inline-block;
}
.badge-aberto { background: #fef3c7; color: #92400e; }
.badge-pago { background: #d1fae5; color: #065f46; }
.badge-cancelado { background: #f3f4f6; color: #374151; }

.sucesso { background: #d1fae5; color: #065f46; padding: 12px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #a7f3d0; }
.erro { background: #fee2e2; color: #991b1b; padding: 12px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #fca5a5; }