/* assets/css/style.css - VERSIÓN COMPACTA & PASTEL */

/* --- 1. VARIABLES Y COLORES --- */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    
    /* Tema Pastel Claro */
    --sidebar-bg: #eef2f6;       /* Gris azulado muy suave */
    --sidebar-color: #546e7a;    /* Texto gris plomo */
    --sidebar-active-bg: #ffffff; /* Blanco para activo */
    
    /* Colores de Acento */
    --accent-color: #7e57c2;     /* Lila principal */
    --accent-hover: #673ab7;
    --heart-color: #ff6b6b;      /* CORAZÓN CORAL */
    
    --bg-body: #f8f9fa;
    --card-radius: 16px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    font-size: 0.9rem;
    color: #495057;
    overflow-x: hidden;
}

/* --- 2. SIDEBAR (MENÚ LATERAL) --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 800;
    font-size: 1.3rem;
    color: #37474f;
    white-space: nowrap;
}

.sidebar-header i {
    color: var(--heart-color) !important;
    font-size: 1.5rem;
    margin-right: 10px;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 15px 10px;
    overflow-y: auto;
}

.nav-link-custom {
    color: var(--sidebar-color);
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link-custom i {
    font-size: 1.1rem;
    min-width: 30px;
    text-align: center;
    margin-right: 10px;
    color: #90a4ae;
    transition: color 0.2s;
}

.nav-link-custom:hover {
    background-color: rgba(255,255,255,0.6);
    color: var(--accent-color);
}

.nav-link-custom.active {
    background-color: var(--sidebar-active-bg);
    color: var(--accent-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.nav-link-custom.active i {
    color: var(--accent-color);
}

.sidebar-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #b0bec5;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 15px 0 5px 16px;
}

/* --- 3. COLAPSADO --- */
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-header span { display: none; }
.sidebar.collapsed .sidebar-header i { margin-right: 0; }
.sidebar.collapsed .nav-link-custom { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .nav-link-custom i { margin-right: 0; }
.sidebar.collapsed .nav-link-custom span,
.sidebar.collapsed .sidebar-label { display: none; }

/* --- 4. CONTENIDO --- */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.topbar {
    height: 70px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- 5. BOTONES GENERALES --- */
.btn {
    border-radius: 50px;
    font-weight: 600;
    padding: 8px 20px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-primary-pastel {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 10px rgba(126, 87, 194, 0.3);
}
.btn-primary-pastel:hover {
    background-color: var(--accent-hover);
    color: #fff !important;
    transform: translateY(-2px);
}

/* Form controls */
.card { border: none; border-radius: var(--card-radius); background-color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.form-control, .form-select { border-radius: 10px; padding: 10px 12px; border: 1px solid #cfd8dc; }

/* --- 6. TABLAS BASE --- */
.table thead th {
    background-color: #e9ecef !important;
    color: #495057;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    vertical-align: middle;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { margin-left: -100%; }
    .sidebar.collapsed { margin-left: 0; width: var(--sidebar-width); }
    .main-content { margin-left: 0; width: 100%; }
}

/* ============================================================
   ESTILOS MÓDULO INSTITUTIONS
============================================================ */
.inst-card { border-radius: 10px; border: 1px solid #e5e7eb; background: #fff; }

/* LOGIN */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }

/* ============================================================
   🔥 A PARTIR DE AQUÍ: ESTILOS NUEVOS PARA SUPERADMIN
   (NO afectan al CRM, no pisan nada)
============================================================ */

/* Título de página */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #37474f;
    margin: 0;
}

/* Contenedor para título + botón */
.d-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tabla estilo CRM */
.table-std {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
}

.table-std th {
    background: #f1f3f5;
    padding: 12px;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: .5px;
    font-weight: 700;
    color: #6b7280;
}

.table-std td {
    padding: 12px;
    border-bottom: 1px solid #ececec;
    font-size: 0.9rem;
}

.table-std tr:last-child td {
    border-bottom: none;
}

/* Badge de ONG inactiva */
.badge-off {
    background-color: #fdecea;
    color: #c0392b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Botón pequeño (acciones en tabla) */
.btn-small {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--accent-color);
    color: white !important;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: 0.15s;
}
.btn-small:hover {
    background: var(--accent-hover);
}

/* Para links dentro de tarjetas o tablas */
.link-clean {
    text-decoration: none;
    color: var(--accent-color);
}
.link-clean:hover {
    text-decoration: underline;
}
/* --- LOGIN --- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
}

.login-box {
    background: #fff;
    padding: 36px 40px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    width: 360px;
    text-align: center;
}

.login-input {
    width: 100%;
    max-width: 280px;
    margin: 12px auto;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: .9rem;
    display: block;
}

.login-btn {
    width: 100%;
    max-width: 280px;
    padding: 10px 0;
    border-radius: 30px;
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
    border: none;
    margin-top: 10px;
    cursor: pointer;
}

.login-btn:hover {
    background: var(--accent-hover);
}

.login-error {
    color: #dc2626;
    margin-bottom: 10px;
    font-size: .82rem;
}

/* ============================================================
   AGREGAR AL FINAL DE assets/css/style.css
   Estilos adicionales para módulo Superadmin
============================================================ */

/* Título en login */
.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #37474f;
}

/* Topbar para páginas de superadmin */
.topbar-superadmin {
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.topbar-superadmin .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #37474f;
}

.topbar-superadmin .brand i {
    color: var(--heart-color);
}

.badge-super {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar-superadmin .user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-superadmin .user-name {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout-super {
    padding: 0.5rem 1rem;
    background: #f7fafc;
    color: #dc2626;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-logout-super:hover {
    background: #fff5f5;
    border-color: #fecaca;
}

/* Selector de organizaciones */
.org-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.org-selector-item {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #37474f;
    font-weight: 600;
    transition: all 0.2s;
}

.org-selector-item:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.org-selector-item i {
    color: #9ca3af;
    transition: color 0.2s;
}

.org-selector-item:hover i {
    color: white;
}/* ============================================================
   LOGIN PREMIUM - Diseño elegante con colores claros
   Agregar al final de assets/css/style.css
============================================================ */

/* Fondo del login */
.login-body-premium {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor principal */
.login-container-premium {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-width: 440px;
    width: 100%;
}

/* Header del login */
.login-header-premium {
    background: linear-gradient(135deg, #eef2f6 0%, #dfe5ec 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.login-icon-premium {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.login-icon-premium i {
    font-size: 2rem;
    color: var(--heart-color);
}

.login-header-premium h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.login-header-premium p {
    font-size: 0.95rem;
    color: #718096;
    margin: 0;
}

/* Cuerpo del formulario */
.login-body-content {
    padding: 2rem;
}

.form-group-premium {
    margin-bottom: 1.5rem;
}

.form-group-premium label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

/* Input con icono */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1rem;
}

.form-input-premium {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-input-premium:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.1);
}

/* Boton de login */
.btn-login-premium {
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-login-premium:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(126, 87, 194, 0.25);
}

.btn-login-premium:active {
    transform: translateY(0);
}

/* Alerta de error */
.login-alert-premium {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-alert-premium i {
    font-size: 1.2rem;
}

/* Footer del login */
.login-footer-premium {
    text-align: center;
    padding: 1.25rem 2rem;
    background: #f7fafc;
    color: #718096;
    font-size: 0.85rem;
    border-top: 1px solid #e2e8f0;
}
/* ============================================
   ESTILOS PARA MÓDULO CONTACTS (PACIENTES)
   Agregar al archivo styles.css o style.css central
   ============================================ */

/* ============================================
   FORMULARIOS (create.php, edit.php, view.php)
   ============================================ */

/* Sección Referente (quien llama) */
.referente-section { 
    display: none; 
    background-color: #fff3cd; 
    border: 2px solid #ffc107; 
    padding: 1.5rem; 
    margin-top: 1.5rem; 
    border-radius: 0.5rem;
}

.referente-section.active { 
    display: block; 
}

/* Acordeón del perfil médico */
.accordion-button:not(.collapsed) { 
    background-color: #f8f9fa; 
    color: var(--accent-color); 
    box-shadow: none; 
}

.accordion-button:focus { 
    box-shadow: none; 
    border-color: rgba(0,0,0,.125); 
}

.accordion-button { 
    font-weight: 600; 
    font-size: 0.95rem; 
}

/* Sección médica deshabilitada */
.disabled-section { 
    opacity: 0.5; 
    pointer-events: none; 
    filter: grayscale(100%); 
}

/* Botones */
.btn-pastel { 
    background-color: #e9ecef; 
    color: #495057; 
    border: none; 
}

.btn-primary-pastel { 
    background-color: #6c5ce7; 
    color: white; 
    border: none; 
}

.btn-primary-pastel:hover { 
    background-color: #5b4cc4; 
    color: white; 
}

/* Form check spacing */
.form-check { 
    margin-bottom: 0.3rem; 
}

/* ============================================
   LISTADO DE PACIENTES (index.php)
   ============================================ */

/* Acordeón - Chevron rotación */
.chevron-icon { 
    transition: transform 0.3s ease; 
}

.cursor-pointer { 
    cursor: pointer; 
}

.row-open .chevron-icon { 
    transform: rotate(180deg); 
    color: var(--accent-color); 
}

/* Acordeón - Fila de detalle */
.detail-row { 
    background-color: #f8f9fa; 
}

.detail-section { 
    padding: 1.25rem; 
}

.detail-label { 
    font-size: 0.7rem; 
    font-weight: 700; 
    color: #6c757d; 
    margin-bottom: 4px; 
    text-transform: uppercase; 
    letter-spacing: 0.3px; 
}

/* Buscador con icono */
.search-group { 
    border: 1px solid #ced4da; 
    border-radius: 8px; 
    overflow: hidden; 
    background: #fff; 
    display: flex; 
    align-items: center; 
}

.search-group .form-control { 
    border: none; 
    box-shadow: none !important; 
}

.search-group .input-group-text { 
    background: transparent; 
    border: none; 
    color: #adb5bd; 
}

/* Acordeón - Card de último caso */
.case-mini { 
    background: white; 
    border: 1px solid #dee2e6; 
    border-radius: 8px; 
    padding: 0.75rem; 
}

/* Acordeón - Items de info */
.info-item { 
    margin-bottom: 0.5rem; 
}

.info-item:last-child { 
    margin-bottom: 0; 
}


/* ============================================
   VISTA DE PACIENTE (view.php)
   ============================================ */

/* Cards de información */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: #212529;
}

/* Timeline de casos */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 3px solid #7e57c2;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* Card de caso en timeline */
.case-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.case-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Título de sección */
.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #7e57c2;
}

/* ============================================
   ESTILOS PARA AUTH (LOGIN, RECUPERAR, ETC)
   Agregar al final de assets/css/style.css
   ============================================ */

/* Toggle para ver/ocultar contraseña - IMPORTANTE: left:auto sobrescribe el estilo general */
.input-with-icon .toggle-password {
    position: absolute;
    left: auto !important;
    right: 1rem !important;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #a0aec0;
    z-index: 10;
    font-size: 1rem;
}

.input-with-icon .toggle-password:hover {
    color: var(--accent-color);
}

/* Input con ojito - padding extra a la derecha */
.form-input-premium.has-toggle {
    padding-right: 3rem !important;
}

/* Link de olvidé contraseña y volver */
.auth-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.auth-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Alerta de éxito para auth */
.login-alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-alert-success i {
    font-size: 1.2rem;
}

/* Requisitos de contraseña */
.password-requirements {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
}

.password-requirements .requirement {
    color: #666;
    margin-bottom: 5px;
}

.password-requirements .requirement i {
    width: 20px;
    text-align: center;
    position: static !important;
    transform: none !important;
    left: auto !important;
}

.password-requirements .requirement.valid {
    color: #28a745;
}

.password-requirements .requirement.invalid {
    color: #dc3545;
}

/* Feedback de coincidencia de contraseñas */
.match-feedback {
    font-size: 12px;
    margin-top: 5px;
}

/* ============================================================
   FOOTER COPYRIGHT
   Agregar al final de assets/css/style.css
============================================================ */

.footer-copyright {
    margin-top: 3rem;
    padding: 1.5rem 0;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 0.85rem;
}

.footer-copyright a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.footer-copyright a:hover {
    text-decoration: underline;
}