body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}
body.dark-mode {
    background-color: #2C2C2C;
    color: #e5e7eb;
}
.dark-mode #header {
    color: #ffffff;
}
.dark-mode #tabs {
    background-color: #383838;
    border-color: #555555;
}
.dark-mode .tabButton {
    color: #f2f2f2;
}
.dark-mode .tabButton:hover {
    background-color: #4a4a4a;
}
.dark-mode .tabButton.active {
    border-bottom-width: 4px;
    border-color: #2FC2F3;
}
.tabButton.active {
    border-bottom-width: 4px;
    border-color: #3b82f6;
}
.dark-mode #topBar {
    background-color: #383838;
}
.dark-mode #companySelect {
    background-color: #4A4A4A !important;
    color: #f2f2f2 !important;
    border-color: #666666 !important;
}
.dark-mode #saldoCard {
    background-color: #4A4A4A !important;
    color: white !important;
}
.dark-mode #clearFilter {
    background-color: #555555;
    color: #f2f2f2;
}
.dark-mode .modal-content,
.dark-mode #infoSection,
.dark-mode #analysisSection,
.dark-mode #clientesSection,
.dark-mode #agendamentosSection,
.dark-mode #resumoAnualSection,
.dark-mode #configuracoesSection,
.dark-mode #table-container {
    background-color: #383838 !important;
    color: #e5e7eb;
}
.dark-mode #resumoMensal {
    background-color: #4A4A4A !important;
}
.dark-mode #recordsTable th,
.dark-mode #clientsTable th,
.dark-mode #annualSummaryTable th {
    background-color: #4A4A4A;
    color: #f2f2f2;
    border-bottom: 1px solid #555555;
    border-right: 1px solid #555555;
}
.dark-mode #recordsTable th:last-child,
.dark-mode #clientsTable th:last-child,
.dark-mode #annualSummaryTable th:last-child {
    border-right: none;
}
.dark-mode #recordsTable td,
.dark-mode #clientsTable td,
.dark-mode #annualSummaryTable td {
    border-bottom: 1px solid #555555;
    border-right: 1px solid #555555;
    font-family: 'Courier New', monospace;
    color: #cccccc;
}
.dark-mode #recordsTable td:last-child,
.dark-mode #clientsTable td:last-child,
.dark-mode #annualSummaryTable td:last-child {
    border-right: none;
}
.dark-mode #recordsTable tbody,
.dark-mode #clientsTable tbody,
.dark-mode #appointmentsTable tbody,
.dark-mode #annualSummaryTable tbody {
    background-color: #383838;
}

#recordsTable tfoot,
#clientsTable tfoot,
#appointmentsTable tfoot,
#annualSummaryTable tfoot {
    background-color: transparent !important;
}
#recordsTable tfoot tr,
#clientsTable tfoot tr,
#appointmentsTable tfoot tr,
#annualSummaryTable tfoot tr {
    background-color: transparent !important;
}
#recordsTable tfoot td,
#clientsTable tfoot td,
#appointmentsTable tfoot td,
#annualSummaryTable tfoot td {
    padding-top: 1rem;
    border: none !important;
}

.dark-mode #recordsTable tfoot,
.dark-mode #clientsTable tfoot,
.dark-mode #appointmentsTable tfoot,
.dark-mode #annualSummaryTable tfoot {
    color: #f2f2f2 !important;
}

.dark-mode #recordsTable tbody tr:hover,
.dark-mode #clientsTable tbody tr:hover,
.dark-mode #appointmentsTable tbody tr:hover,
.dark-mode #annualSummaryTable tbody tr:hover {
    background-color: #4b5563;
}

#recordsTable, #clientsTable, #appointmentsTable, #annualSummaryTable {
    border-collapse: collapse;
}
.dark-mode .category-receita { background-color: #28a745; color: #fff; }
.dark-mode .category-despesa { background-color: #dc3545; color: #fff; }
.dark-mode td.debito, .dark-mode tfoot .debito { color: #FF6666 !important; }
.dark-mode td.credito, .dark-mode tfoot .credito { color: #66B2FF !important; }
.dark-mode td.saldo.debito, .dark-mode tfoot .saldo.debito { color: #FF6666 !important; }
.dark-mode td.saldo.credito, .dark-mode tfoot .saldo.credito { color: #66B2FF !important; }

.dark-mode input[type="text"],
.dark-mode input[type="search"],
.dark-mode input[type="number"],
.dark-mode input[type="date"],
.dark-mode input[type="time"],
.dark-mode select {
    background-color: #555555 !important;
    color: #f2f2f2 !important;
    border-color: #888888 !important;
}

.dark-mode h2, .dark-mode h3 {
    color: #f2f2f2;
}
.dark-mode p, .dark-mode label {
    color: #e5e7eb;
}
.dark-mode .modal-content label {
    color: #f2f2f2 !important;
}

.dark-mode .flex-1.min-w-\[300px\].max-w-\[600px\].bg-gray-50.p-4.rounded-lg.shadow-md {
    background-color: #383838 !important;
}
.category-receita { background-color: #28a745; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; }
.category-despesa { background-color: #dc3545; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; }
.type-recorrente { background-color: #06b6d4; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; }
.type-parcelado { background-color: #f97316; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; }
.type-avista { background-color: #2dd4bf; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; }

td.debito { color: red !important; }
td.credito { color: blue !important; }
td.saldo.debito { color: red !important; }
td.saldo.credito { color: blue !important; }
tfoot .debito { color: red; font-weight: bold; }
tfoot .credito { color: blue; font-weight: bold; }
tfoot .saldo { font-weight: bold; }
tfoot .saldo.debito { color: red; }
tfoot .saldo.credito { color: blue; }
.paid { background-color: #5CB85C; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; }
.not-paid { background-color: #d9534f; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; }
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
    background: #fff; padding: 15px; border-radius: 8px; width: 90%; max-width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); overflow-y: auto; max-height: 90vh;
}
#monthSelectionModal .modal-content { max-width: 280px; }
#entryForm label { margin-bottom: 8px; }
#entryForm label:last-of-type { margin-bottom: 15px; }
#recordsTable td, #annualSummaryTable td { font-family: 'Courier New', monospace; }
#recordsTable tbody td { color: #374151; font-weight: bold; }
.dark-mode #recordsTable tbody td { color: #D1D5DB; }
#clientsTable td { font-weight: bold; font-family: 'Courier New', monospace; color: #374151; }
.dark-mode #clientsTable td { font-weight: bold; color: #D1D5DB; }
@media print {
    body > *:not(#analysisSection):not(#resumoAnualSection) { display: none !important; }
    #analysisSection, #resumoAnualSection { display: block !important; padding: 0 !important; margin: 0 !important; }
    body { background-color: #fff !important; color: #000 !important; }
}
body.dark-mode #userEmailDisplay { color: #f2f2f2 !important; }
#recordsTable tfoot td:nth-child(5), #annualSummaryTable tfoot td:nth-child(1) {
    color: #88CCFF !important; font-weight: bold !important; font-size: 1.1rem; text-transform: uppercase;
}
body.dark-mode #recordsTable tfoot td:nth-child(5), body.dark-mode #annualSummaryTable tfoot td:nth-child(1) {
    color: #88CCFF !important; font-weight: bold !important; font-size: 1.1rem; text-transform: uppercase;
}
body.dark-mode #resumoMensal #totalEntradas { color: #66B2FF !important; }
body.dark-mode #resumoMensal #totalSaidas { color: #dc3545 !important; }
body.dark-mode #resumoMensal #percentPago { color: #28a745 !important; }
#appointmentsTable th, #appointmentsTable td { text-align: center !important; font-family: 'Courier New', monospace; }
#appointmentsTable td { font-weight: bold; color: #374151; }
.dark-mode #appointmentsTable td { color: #D1D5DB; }
.dark-mode #appointmentsTable th {
    background-color: #4A4A4A; color: #f2f2f2; border-bottom: 1px solid #555555;
    border-right: 1px solid #555555; font-family: 'Courier New', monospace;
}
.dark-mode #appointmentsTable th:last-child { border-right: none; }

.day-column {
    flex: 1; 
    min-width: 165px;
    background-color: #f7fafc; 
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}
.dark-mode .day-column {
    background-color: #383838;
    border-color: #4a5568;
}

.day-column h3 {
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}
.dark-mode .day-column h3 {
    color: #e5e7eb;
    border-bottom-color: #4a5568;
}

.appointment-card {
    position: relative; 
    background-color: #ffffff;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid #3b82f6; 
}
.dark-mode .appointment-card {
    background-color: #4A4A4A;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #2FC2F3; 
}

.appointment-card p {
    margin: 4px 0;
    font-size: 0.875rem;
}
.appointment-card .card-time {
    font-weight: bold;
    font-family: 'Courier New', monospace;
}
.appointment-card .card-client {
    font-style: italic;
}

.appointment-card .card-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    display: flex;
    gap: 4px;
}
.appointment-card:hover .card-actions {
    opacity: 1;
    visibility: visible;
}
.card-actions button {
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-actions button:hover {
    background-color: rgba(0,0,0,0.1);
}
.dark-mode .card-actions button:hover {
    background-color: rgba(255,255,255,0.15);
}

/* --- [REMOVIDO] Estilos antigos de fundo de linha removidos --- */

/* --- NOVOS ESTILOS PARA SELEÇÃO DE EMPRESA --- */
.company-select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-grow: 1;
    min-width: 150px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.company-select-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

body.dark-mode #companySelectionModal .modal-content {
    background-color: #383838 !important;
}

body.dark-mode .company-select-card {
    background-color: #4A4A4A;
    border-color: #555555;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .company-select-card span {
    color: #ffffff;
}

body.dark-mode .company-select-card:hover {
    border-color: #2FC2F3;
    background-color: #555555;
}

/* --- [NOVO] Estilos para status de data --- */
.status-pago,
.status-vencido,
.status-hoje,
.status-breve {
    padding: 5px 10px;
    border-radius: 15px; /* Formato de "pill" */
    font-size: 0.8rem;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    display: inline-block;
    min-width: 90px; /* Garante alinhamento visual */
}

.status-pago {
    background-color: #28a745; /* Verde */
}
.status-vencido {
    background-color: #dc3545; /* Vermelho */
}
.status-hoje {
    background-color: #ffc107; /* Amarelo */
    color: #212529; /* Texto escuro para melhor contraste */
}
.status-breve {
    background-color: #17a2b8; /* Azul info */
}