/* --- GENERAL --- */
body { 
    font-family: system-ui, -apple-system, sans-serif; 
    background-color: #f4f4f9; 
    margin: 0; 
}

/* --- CONTENEDORES INTERNOS (Dashboard, Mis Archivos, Crear Cliente) --- */
.login-container { 
    background: white; 
    padding: 2rem; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 400px; 
    margin: 4rem auto;
}

.dashboard-container { 
    max-width: 900px; 
    margin: 2rem auto; 
    padding: 2rem; 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
}

/* --- FORMULARIOS BÁSICOS INTERNOS --- */
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; color: #555;}
input[type="text"], input[type="password"], input[type="file"], select { 
    width: 100%; 
    padding: 0.5rem; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
}
button { 
    width: 100%; 
    padding: 0.75rem; 
    background: #007bff; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold;
    margin-top: 1rem;
}
button:hover { background: #0056b3; }

/* --- TABLAS Y BOTONES DASHBOARD --- */
table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
th, td { padding: 0.75rem; border: 1px solid #ddd; text-align: left; }
th { background-color: #f8f9fa; }
.section-title { border-bottom: 2px solid #eee; padding-bottom: 0.5rem; margin-top: 2rem; }

.btn-danger { color: white; background: #dc3545; padding: 0.3rem 0.6rem; text-decoration: none; border-radius: 3px; font-size: 0.85rem; }
.btn-danger:hover { background: #c82333; }

.btn-new { display: inline-block; margin-bottom: 1rem; padding: 0.5rem 1rem; background: #28a745; color: white; text-decoration: none; border-radius: 4px; }
.btn-new:hover { background: #218838; }

/* --- VISTA CLIENTE (Lista de Archivos) --- */
.file-list { list-style: none; padding: 0; }
.file-list li { background: #eee; margin-bottom: 0.5rem; padding: 1rem; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; }
.btn-download { background: #28a745; color: white; padding: 0.5rem 1rem; text-decoration: none; border-radius: 4px; font-size: 0.9rem; font-weight: bold;}
.btn-download:hover { background: #218838; }

/* --- LOGIN MODERNO (Rojo Oscuro + Difuminado) --- */
.login-body {
    /* Reemplaza la ruta con la ubicación real de tu imagen */
    background: linear-gradient(rgba(60, 0, 0, 0.3), rgba(15, 0, 0, 0.6)), url('../img/portada_rube_2025_comprimida.webp') no-repeat center center fixed;
    background-size: cover;
    font-family: system-ui, -apple-system, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-sizing: border-box;
}

.login-card {
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(10px); 
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    padding: 40px 30px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.login-header p {
    color: #777;
    font-size: 0.9rem;
    margin-top: 8px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #8b0000;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.15);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #8b0000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background: #5c0000;
}

.login-logo {
    max-width: 150px; /* Ajusta el tamaño según necesites */
    height: auto;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* --- DASHBOARD ADMIN MODERNIZADO --- */
.dashboard-body {
    background: linear-gradient(rgba(244, 247, 250, 0.85), rgba(255, 255, 255, 0.9)), url('../img/bg-panel-2.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, sans-serif;
}

.dashboard-nav {
    background: #8b0000;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1); /* Vuelve el logo blanco temporalmente si es oscuro */
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.4);
}

.dashboard-main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.full-width {
    grid-column: 1 / -1;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.25rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.card-header-flex .card-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* --- TABLAS MODERNAS Y SCROLLABLES --- */
.table-responsive {
    max-height: 350px; /* Altura máxima antes de mostrar el scroll */
    overflow-y: auto;  /* Activa el scroll vertical */
    overflow-x: auto;  /* Activa el scroll horizontal si la pantalla es muy pequeña */
    border: 1px solid #eee; /* Opcional: un borde sutil para enmarcar el área de scroll */
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0; /* Quité el margin para que el scroll se vea más limpio */
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    /* Las siguientes 3 líneas fijan el encabezado arriba */
    position: sticky; 
    top: 0; 
    z-index: 1; 
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}
/* --- BOTONES Y ALERTAS --- */
.btn-success {
    background: #28a745;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
}

.btn-success:hover { background: #218838; }

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.btn-edit {
    background: #ffc107;
    color: #212529;
    padding: 0.3rem 0.6rem;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: bold;
}
.btn-edit:hover { background: #e0a800; }

.newsletters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}
.newsletter-card {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.newsletter-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.newsletter-card h4 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 15px 0;
}
.newsletter-card .btn-primary {
    display: inline-block;
    width: auto;
    padding: 8px 15px;
    text-decoration: none;
}

.newsletter-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}
.newsletter-card {
    padding: 15px; /* Ajustado para que la imagen embone mejor */
}