/* Estilos gerais */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; background: #f0f2f5; }
.container { max-width: 1100px; margin: 20px auto; padding: 25px; border-radius: 8px; box-shadow: 0 0 15px rgba(0,0,0,0.1); }
.login-container { max-width: 400px; margin: 100px auto; padding: 40px; background-color: #fff; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.1); text-align: center; }
h1, h2 { color: #333; border-bottom: 2px solid #eee; padding-bottom: 10px; }
h2 { font-size: 1.5em; margin-top: 30px; }
a { color: #007BFF; text-decoration: none; }
.header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.header h1 { font-size: 1.8em; }
.nav-link { font-size: 14px; text-decoration: none; margin-left: 15px; }
.table-wrapper { overflow-x: auto; }

/* Formulários */
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="date"] {
    width: calc(100% - 22px); padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px;
}
.form-cadastro { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 30px; }
.form-cadastro label { grid-column: 1 / -1; font-weight: bold; margin-bottom: -5px; }

/* ===== INÍCIO DA CORREÇÃO DE ALINHAMENTO FINO ===== */
button, .btn {
    background-color: #007BFF;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* Garante a mesma fonte */
    text-decoration: none;
    display: inline-block;
    margin: 2px;
    box-sizing: border-box; /* Garante consistência no tamanho */
    text-align: center; /* Centraliza o texto dentro do botão */
    vertical-align: middle; /* Alinha os elementos na linha */
    line-height: normal; /* Normaliza a altura da linha */
}
/* ===== FIM DA CORREÇÃO ===== */

button:hover, .btn:hover { background-color: #0056b3; }

/* Tabela */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { border: 1px solid #ddd; padding: 12px; text-align: left; vertical-align: middle; }
th { background-color: #f2f2f2; }
.pagamento-row { background-color: #fdfdfd; }
.pagamento-info { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.status-pago { background-color: #e8f5e9; }
.status-pendente { background-color: #fffde7; }

/* Estilo para o cabeçalho de info do cliente */
.client-info-header { background: #f9f9f9; padding: 20px; border-radius: 8px; margin-bottom: 30px; border: 1px solid #ddd; }
.client-info-header h3 { margin-top: 0; border: none; }
.client-info-header p { margin: 5px 0; color: #555; }

/* Badge de Status */
.badge { padding: 5px 10px; border-radius: 12px; font-weight: bold; font-size: 0.9em; text-align: center; min-width: 80px; display: inline-block; }
.status-pendente .badge { background-color: #fbc02d; color: #333; }
.status-pago .badge { background-color: #4caf50; color: white; }

/* Botões de Ação Específicos */
.btn-pago { background-color: #4caf50; }
.btn-pago:hover { background-color: #43a047; }
.btn-pendente { background-color: #fbc02d; color: #333;}
.btn-pendente:hover { background-color: #f9a825; }
.btn-editar { background-color: #546e7a; }
.btn-editar:hover { background-color: #455a64; }
.btn-novo-pagamento { background-color: #17a2b8; }
.btn-novo-pagamento:hover { background-color: #138496; }
.btn-excluir { background-color: #dc3545; }
.btn-excluir:hover { background-color: #c82333; }
small { color: #7f8c8d; }


/* CÓDIGO RESPONSIVO PARA CELULAR */
@media screen and (max-width: 768px) {
    .container {
        margin: 10px; padding: 15px;
    }
    .form-cadastro {
        grid-template-columns: 1fr;
    }
    .header {
        text-align: center;
    }
    .header h1 {
        width: 100%; margin-bottom: 10px;
    }
    h2 {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    h2 form {
        margin-top: 10px;
    }
    
    /* LÓGICA PARA A TABELA RESPONSIVA */
    .responsive-table {
        border: 0;
    }
    .responsive-table thead {
        display: none;
    }
    .responsive-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 10px 5px;
        font-size: 15px;
        border: none;
        border-bottom: 1px dotted #ccc;
    }
    .responsive-table tr td:last-child {
        border-bottom: 0;
    }
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        padding-right: 15px;
    }
    .responsive-table td[data-label="Ações"] {
        display: block;
        padding-top: 15px;
        text-align: center;
    }
    .responsive-table td[data-label="Ações"] form,
    .responsive-table td[data-label="Ações"] a {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }
    .responsive-table td[data-label="Ações"] .btn {
        width: 100%;
    }
}