/* ============================================= */
/* ===== ESTILOS GLOBALES Y POR DEFECTO ====== */
/* ============================================= */

:root {
    --color-azul: #03A9F4;
    --color-naranja: #FF9800;
    --color-verde: #8BC34A;
    --color-gris: #6c757d;
    --color-texto: #333;
    --color-fondo: #f0f2f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-fondo);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: var(--color-texto);
}

/* Nueva clase especial SOLO para páginas centradas como el login */
.body-centrado {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 0;
    background-color: #ffffff; /* <-- AÑADE ESTA LÍNEA */
}

h2, h3, h4 {
    color: var(--color-texto);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}
th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}
th {
    background-color: #f8f9fa;
}

/* ============================================= */
/* ===== COMPONENTES REUTILIZABLES =========== */
/* ============================================= */

.main-container, .dashboard-container, .form-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-container {
    max-width: 380px;
    text-align: center;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.page-header h2 {
    margin: 0;
    border-bottom: none;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

/* --- Botones --- */
.boton-agregar, .boton-secundario, .boton-principal, button[type="submit"] {
    display: inline-block;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.boton-agregar:hover, .boton-secundario:hover, .boton-principal:hover, button[type="submit"]:hover {
    opacity: 0.85;
}

.boton-principal { background-color: var(--color-azul); }
.boton-accion-positiva { background-color: var(--color-verde); }
.boton-accion-alerta { background-color: var(--color-naranja); }
.boton-secundario { background-color: var(--color-gris); }

/* --- Formularios --- */
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
.input-group input, .input-group select, .input-group textarea {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px;
    box-sizing: border-box; font-size: 1em; font-family: inherit;
}
form button[type="submit"] {
    background-color: var(--color-azul);
}
form button[type="submit"]:hover {
    background-color: #0056b3;
}

/* --- Otros Componentes --- */
.login-logo { max-width: 180px; height: auto; margin-bottom: 20px; }
.success-message { background-color: #d4edda; color: #155724; padding: 10px; border-radius: 4px; margin-bottom: 20px; text-align: center; }
.error-message { background-color: #f8d7da; color: #721c24; padding: 10px; border-radius: 4px; margin-bottom: 20px; text-align: center; }
.deudor { color: #dc3545; font-weight: bold; }
.al-corriente { color: var(--color-verde); font-weight: bold; }
.action-links a { margin-right: 10px; color: var(--color-azul); text-decoration: none; font-weight: bold; }

/* ======================================================= */
/* ===== ESTILOS RESPONSIVOS PARA Mﾃ天ILES ================ */
/* ======================================================= */

@media (max-width: 768px) {
    body { padding: 5px; }
    .main-container, .dashboard-container, .form-container { padding: 15px; margin: 5px 0; }
    .action-bar { flex-direction: column; align-items: stretch; }
    .action-bar a { text-align: center; margin-right: 0; }
    .page-header { flex-direction: column; gap: 15px; }
    .table-responsive-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #ddd; border-radius: 4px; }
    .table-responsive-wrapper table { border: none; }
    .summary-grid { grid-template-columns: 1fr; }
}
/* --- Estilos para la Galería de Fotos --- */
.gallery-grid {
    display: grid;
    /* Crea columnas automáticas de al menos 200px de ancho */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px; /* Espacio entre las fotos */
    margin-top: 20px;
}

.photo-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    background-color: #fff;
}

.photo-card img {
    width: 100%;
    height: 150px;
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
    border-radius: 4px;
}

.photo-card p {
    font-weight: bold;
    margin-top: 10px;
    font-size: 14px;
    color: #333;
}