body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    background-color: #34495e;
    flex-wrap: wrap; /* Permite quebra de linha no menu */
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    white-space: nowrap; /* Evita quebra de texto dentro do botão */
}

nav ul li a:hover {
    background-color: #2c3e50;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Dashboard Cards */
.dashboard-cards {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 250px;
    text-align: center;
}

.card h3 {
    margin-top: 0;
    color: #7f8c8d;
    font-size: 1rem;
}

.card .number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0.5rem 0 0;
}

/* Forms */
.form-styled {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

.form-group textarea {
    height: 100px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-flex; /* Melhor alinhamento */
    align-items: center;
    gap: 5px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Suavidade no iOS */
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    /* box-shadow movido para o wrapper .table-responsive */
    min-width: 600px; /* Garante que a tabela não esprema demais */
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #34495e;
    color: white;
    white-space: nowrap; /* Títulos não quebram linha */
}

.table tr:hover {
    background-color: #f9f9f9;
}

/* Status Labels */
.status {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
}

.status-pending {
    background-color: #f1c40f;
    color: #fff;
}

.status-paid {
    background-color: #2ecc71;
    color: #fff;
}

.status-overdue {
    background-color: #e74c3c;
    color: #fff;
}

/* Login Page */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #ecf0f1;
    padding: 1rem; /* Padding extra para mobile */
    box-sizing: border-box;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    margin-top: 0;
    border-bottom: none;
}

.error {
    background-color: #ffdddd;
    color: #c0392b;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success {
    background-color: #dff0d8;
    color: #27ae60;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #ecf0f1;
    color: #7f8c8d;
    margin-top: auto;
}

/* RESPONSIVIDADE (MOBILE) */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
        margin-top: 1rem;
    }

    /* Menu */
    nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    nav ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    nav ul li a {
        text-align: center;
        padding: 15px;
    }

    /* Cards */
    .dashboard-cards {
        gap: 1rem;
    }
    
    .card {
        min-width: 100%; /* Card ocupa largura total em mobile */
        padding: 1rem;
    }

    /* Forms */
    .form-styled {
        padding: 1.5rem;
    }

    /* Tabelas */
    .table th, .table td {
        padding: 0.8rem 0.5rem; /* Menos padding nas células */
        font-size: 0.9rem; /* Fonte um pouco menor */
    }

    /* Ações e Filtros */
    .actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .actions .btn {
        width: 100%; /* Botões full width */
        box-sizing: border-box;
    }

    /* Header com Filtros */
    div[style*="display: flex; justify-content: space-between"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    div[style*="display: flex; justify-content: space-between"] form {
        width: 100%;
        justify-content: space-between;
    }

    /* Botões dentro da tabela */
    .btn-small {
        padding: 6px 10px;
        margin-bottom: 2px;
    }
}
