* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hidden {
    display: none !important;
}

h2, h3 {
    color: #2c3e50;
    margin-top: 0;
}

input, select, button {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-logout {
    width: auto;
    background-color: #e74c3c;
    padding: 8px 15px;
}

.panel {
    border-top: 2px solid #ecf0f1;
    margin-top: 20px;
    padding-top: 20px;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* Tabla responsive */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

th {
    background-color: #f8f9fa;
}

.error {
    color: red;
    font-size: 0.9em;
    text-align: center;
}

.row-ingreso { color: #27ae60; font-weight: bold; }
.row-gasto { color: #c0392b; font-weight: bold; }

/* Adaptación para móviles */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .btn-logout {
        width: 100%;
    }

    .filters {
        flex-direction: column;
        gap: 0; 
    }

    .filters input, .filters button {
        margin: 5px 0;
    }
}