/* ==========================================================================
   CONFIGURACIÓN GLOBAL (Para todo el proyecto)
   ========================================================================== */
@import "variables.css";
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

section {
    padding: 5rem 0;
}

/* Títulos y Texto */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3.5rem;
}

.highlight {
    color: var(--primary);
}

/* Componentes Base: Botones y Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--btn-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: var(--btn-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Navbar Global */
.navbar {
    background: var(--bg-card);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 20px;
}

.logo span {
    color: #1e293b;
    margin-left: 5px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    margin-left: 2rem;
    font-weight: 500;
}

/* ==========================================================================
   ESTILOS MAESTROS DE OJITOS (PASSWORD TOGGLE) - UNIVERSAL
   Extraído para funcionar en Login, Register y Configuración
   ========================================================================== */

/* 1. Contenedor relativo para posicionar el ojo */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* 2. Espacio en el input para que el texto no toque el ojo */
.password-input-wrapper input {
    padding-right: 3rem !important;
    /* Espacio a la derecha obligatorio */
    width: 100%;
    /* Asegura que llene el contenedor */
}

/* 3. Posición absoluta del botón del ojo */
.eye-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    /* Ocupa toda la altura del input automáticamente */
    width: 3rem;
    /* Ancho fijo para zona de clic */
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    z-index: 10;
    /* Se asegura de estar encima del input */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.eye-btn:hover {
    color: var(--primary, #0D9488);
}

/* ==========================================================================
   register.html
   ========================================================================== */

.auth-container {
    display: grid;
    grid-template-columns: 600px 1fr;
    min-height: 100vh;
    align-items: stretch;
}

/* Lado Izquierdo */
.auth-sidebar {
    background-color: var(--primary);
    color: white;
    padding: 2.5rem;

    /* EFECTO FIJO: */
    position: sticky;
    top: 0;
    height: 100vh;
    /* Ocupa toda la pantalla de alto */

    /* CENTRADO VERTICAL: */
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-sidebar-content {
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-sidebar .logo {
    color: white;
    margin-bottom: 2rem;
}

.auth-sidebar h1 {
    color: white;
    font-size: 2rem;
    /* Ligeramente menor para evitar desbordes */
    margin-bottom: 1.5rem;
}

.auth-sidebar p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.auth-features {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.auth-feature-item i {
    font-size: 1.1rem;
    color: white;
    width: 20px;
    /* Ancho fijo para alinear iconos */
}

/* Lado Derecho */
.auth-form-section {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 500px;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--btn-radius);
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

/* NOTA: Los estilos de .password-input-wrapper y .eye-btn se movieron al principio */

.btn-full {
    width: 100%;
    margin-top: 1rem;
    height: 48px;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* Estados de validación */
.password-requirements {
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
    margin-left: 50px;
}

.req-item {
    font-size: 0.78rem;
    margin: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.req-item.invalid {
    color: #e74c3c;
}

.req-item.valid {
    color: #27ae60;
}

.req-item i {
    transition: transform 0.3s ease;
}

.req-item.valid i {
    transform: scale(1.1);
}

.auth-logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form-logo {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.form-header h2 {
    margin-top: 0px;
}

/* --- MEDIA QUERIES PARA RESPONSIVIDAD --- */

/* Tablets y Laptops Pequeñas */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 350px 1fr;
        /* Ancho fijo para sidebar en pantallas medianas */
    }
}

/* Tablets Verticales y Móviles */
@media (max-width: 900px) {
    .auth-container {
        grid-template-columns: 1fr;
        /* Una sola columna */
    }

    .auth-sidebar {
        display: none;
        /* Oculta sidebar en pantallas pequeñas */
    }
}

/* Celulares */
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        /* Pone Razón Social y Especialidad uno sobre otro */
        gap: 0;
    }

    .password-requirements {
        flex-direction: column;
        /* Requisitos en lista solo en pantallas muy estrechas */
        gap: 5px;
    }
}

/* ==========================================================================
   login.html — solo ajustes específicos de login vs register
   ========================================================================== */

/* El gradiente del sidebar de login lo sobreescribimos aquí */
.auth-sidebar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.auth-sidebar h1 {
    font-size: 2.8rem;
    margin: 1.5rem 0;
    line-height: 1.1;
}

/* Error de autenticación */
.forgot-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==========================================================================
   Proceso olvidaste contraseña.html
   ========================================================================== */

/* Layout para una sola columna (usado en Forgot Password) */
.single-column {
    grid-template-columns: 1fr !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
}

.step-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Estilo para el input del código */
.code-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    font-weight: bold;
    text-transform: uppercase;
    border: 2px solid var(--primary-light);
}

/* Reglas de contraseña en tiempo real */
.password-rules {
    background: #f1f3f5;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.rule {
    font-size: 0.85rem;
    color: #e63946;
    /* Rojo por defecto */
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.rule-success {
    color: #2ecc71 !important;
}

.rule i {
    font-size: 1rem;
}

/* ==========================================================================
   Dashboard.html
   ========================================================================== */

/* Layout General del Dashboard */
.dashboard-body {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-main);
}

/* Área de Contenido Principal */
.dashboard-content {
    margin-left: 280px;
    /* Espacio para el sidebar fijo */
    flex: 1;
    padding: 2rem 3rem;
    transition: all 0.3s ease;
}

/* Cabecera del Contenido */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.welcome-text h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Acciones de Cabecera (Campana, Avatar) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

/* Grid de Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-card i {
    font-size: 1.8rem;
    background: rgba(var(--primary-rgb), 0.1);
    padding: 1rem;
    border-radius: 12px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

/* ==========================================================================
   sidebar.html
   ========================================================================== */

/* BOTÓN DISPARADOR ÚNICO */
.app-side-trigger {
    display: none;
    /* Oculto en PC */
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1100;
}

/* SIDEBAR BASE */
.dashboard-sidebar {
    width: 280px;
    background: white;
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1001;
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .app-side-trigger {
        display: block !important;
        position: fixed !important;
        /* Obligamos a que se ancle a la pantalla */
        top: 20px !important;
        /* Distancia exacta desde arriba */
        left: 20px !important;
        /* Distancia exacta desde la izquierda */
        margin: 0 !important;
        /* Matamos cualquier margen automático que lo centre */
        z-index: 99999 !important;

        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 5px !important;

        color: var(--text-dark) !important;
        font-size: 1.8rem !important;
        width: auto !important;
        height: auto !important;
        cursor: pointer;
    }

    .app-side-trigger:active {
        color: var(--brand-primary) !important;
        /* Cambia a azul al tocar */
        transform: scale(0.95);
    }

    .dashboard-sidebar {
        left: -280px;
        /* Escondido a la izquierda */
    }

    /* ESTA ES LA CLAVE: Nombre único para mostrar el menú */
    .dashboard-sidebar.is-reveal-active {
        left: 0 !important;
    }

    .dashboard-content {
        margin-left: 0 !important;
        padding-top: 80px;
    }
}

.sidebar-header {
    padding: 2.5rem 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0aec0;
    margin: 20px 20px 10px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 0.3rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item:hover {
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

.nav-item.active {
    background-color: transparent;
    /* Fondo transparente */
    color: var(--primary-color);
    /* Texto en tu verde corporativo */
    font-weight: 600;
    border-right: 3px solid var(--primary-color);
    /* Línea indicadora a la derecha */
}

.nav-item .icon-box {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1.1rem;
    color: inherit;
    /* Hereda el color del padre (gris o verde) */
    background: transparent !important;
    /* Asegura que no tenga fondo */
    box-shadow: none !important;
    /* Quita sombras si las tenía */
}

/* BOTÓN CERRAR SESIÓN MEJORADO */
.sidebar-footer {
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.8rem;
    width: 100%;
    background: #fff0f0;
    color: #e03131;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #ffc9c9;
}

.btn-logout:hover {
    background: #e03131;
    color: white;
    border-color: #e03131;
    transform: translateY(-2px);
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    /* Evita que el sidebar mismo crezca, mejor que el contenido interno haga scroll */
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    /* Ocupa todo el espacio disponible entre el logo y el footer */
    overflow-y: auto;
    /* Permite scroll vertical solo aquí */
    padding: 1rem 0;
}

/* Estilo moderno para la barra de scroll */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
    /* Muy delgada */
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    /* Un color muy suave */
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    /* Se ilumina al pasar el mouse */
}

/* Estado bloqueado */
.nav-locked {
    /* opacity: 0.6;  <-- ELIMINA O COMENTA ESTA LÍNEA */
    filter: grayscale(0.8) brightness(0.8);
    /* Lo hace ver gris y oscuro sin ser transparente */
    cursor: not-allowed;
}

.nav-locked:hover {
    background: transparent !important;
    /* Evita que resalte al pasar el mouse */
}


/* El mensaje flotante */
[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    /* En lugar de ir a la derecha (left: 100%), lo ponemos centrado sobre el item */
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;

    /* Diseño visual */
    background: #0f172a !important;
    color: #fff;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 4px;
    white-space: normal;
    /* Permite que el texto baje si es largo */
    width: 160px;
    /* Ancho fijo para que no empuje nada */
    text-align: center;

    /* Capas y visibilidad */
    z-index: 9999;
    opacity: 1 !important;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 1.5s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    display: none;
    /* Evita que exista en el render hasta el hover */
    backdrop-filter: none !important;
    /* Quita efectos de transparencia de fondo */
    -webkit-backdrop-filter: none !important;
}

/* Mostrar al pasar el mouse */
[data-tooltip]:hover:before {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Bloqueo del item para que no se vea el scroll horizontal */
.dashboard-sidebar {
    overflow-x: hidden !important;
}

/* ==========================================================================
   clinica-config.html
   ========================================================================== */

.config-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centra horizontalmente */
    width: 100%;
    padding: 2rem;
}

.config-wrapper .form-actions {
    display: flex;
    justify-content: center;
    /* Centra el botón */
    margin-top: 2rem;
}

.config-wrapper .config-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1100px;
    margin-top: 1.5rem;
    box-sizing: border-box;
}

.config-wrapper .form-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.config-wrapper .logo-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.config-wrapper .logo-preview {
    width: 180px;
    /* Tamaño fijo para que sea un cuadrado */
    height: 180px;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    display: flex;
    /* Para centrar la imagen si es pequeña */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Corta lo que se salga del cuadro */
    background: #f8fafc;
}

/* La imagen dentro del contenedor */
.config-wrapper .logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Esto hace que la imagen llene el cuadro sin deformarse */
    display: block;
}

.config-wrapper .form-inputs {
    display: grid;
    gap: 1.2rem;
}

/* Evitamos que afecte a los labels del login/register */
.config-wrapper .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.config-wrapper .form-group input,
.config-wrapper .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.config-wrapper .subscription-status-box {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

/* Estilos de badges específicos para esta sección */
.config-wrapper .badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.config-wrapper .badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.config-wrapper .badge-success {
    background: #dcfce7;
    color: #166534;
}

/* Botón específico para no romper el global */
.config-wrapper .btn-save {
    background: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centra horizontalmente */
    gap: 10px;
    transition: background 0.3s;
}

.config-wrapper .btn-save:hover {
    background: var(--primary-dark);
}

/* Fila de 3 columnas */
.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Fila de 2 columnas */
.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Responsivo para móviles (se vuelven una sola columna) */
@media (max-width: 768px) {

    .form-row-3,
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ==========================================================================
   ADICIONES PARA RESPONSIVIDAD (Dashboard & Configuración)
   ========================================================================== */

@media (max-width: 1024px) {
    .dashboard-content {
        margin-left: 0 !important;
        /* El contenido usa todo el ancho */
        padding: 1.5rem;
        padding-top: 80px;
        /* Espacio para el botón de menú */
    }
}

@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .header-actions {
        justify-content: center;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        /* Una columna para las cards de stats */
    }

    .config-wrapper .form-grid {
        grid-template-columns: 1fr;
        /* Una columna para config: Logo arriba, inputs abajo */
    }

    .config-wrapper .subscription-status-box {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .config-wrapper .config-card {
        padding: 1.2rem;
    }

    .btn-save,
    .btn-logout {
        width: 100%;
        /* Botones de acción completa en móvil */
    }
}

/* ==========================================================================
   camposDinamicos.html
   ========================================================================== */

.config-campos-section {
    padding: 2rem 1rem;
}

/* Header Estilizado */
.config-campos-section .content-header {
    background: transparent !important;
    /* Quita el fondo blanco */
    box-shadow: none !important;
    /* Quita cualquier sombra */
    border: none !important;
    /* Quita bordes si los hay */
    width: 100%;
    display: flex;
    flex-direction: row;
    /* Alineación horizontal como el de pacientes */
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Para que en móvil se apile */
    gap: 1.5rem;
}

.config-campos-section #btnNuevoCampo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    border-radius: 6px;
}

.config-campos-section .welcome-text p {
    color: var(--text-muted, #64748b);
    font-size: 1rem;
}

.expedientes-section .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Botones de Acción en Header */
.config-campos-section .form-actions {
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
}

/* Tabla Personalizada */
.config-campos-section .custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.config-campos-section .custom-table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

/* Badges (Etiquetas de tipo y estado) */
.config-campos-section .badge-info {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.config-campos-section .badge-success {
    background: #dcfce7;
    color: #15803d;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Acciones y Botones Icono */
.config-campos-section .centered-actions-campos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.config-campos-section .btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Estilo específico para Editar (Naranja/Ámbar) */
.config-campos-section .btn-edit-campo {
    color: #f59e0b;
}

.config-campos-section .btn-edit-campo:hover {
    background-color: #fffbeb;
    transform: translateY(-2px);
}

/* Estilo específico para Eliminar (Rojo) */
.config-campos-section .btn-danger {
    color: #ef4444;
}

.config-campos-section .btn-danger:hover {
    background-color: #fef2f2;
    transform: translateY(-2px);
}

/* Utilidades */
.config-campos-section .text-center {
    text-align: center;
}

.modal-overlay.config-campos-section {
    position: fixed;
    top: 0;
    /* 1. Forzamos el inicio exacto */
    left: 280px !important;
    /* 2. Aseguramos que el ancho no sea mayor al espacio disponible */
    width: calc(100vw - 260px) !important;
    /* 3. El height debe ser el de la ventana */
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    /* 4. Centrado interno */
    display: none;
    /* Se cambia a flex con JS */
    justify-content: center;
    align-items: center;
    /* 5. Un z-index alto pero que no rompa otros elementos */
    z-index: 9999;
}

.modal-overlay.config-campos-section .modal-content.modal-lg {
    background: #ffffff;
    width: 100%;
    /* Tu medida de 600px para que no sea gigante en monitores grandes */
    max-width: 600px !important;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: ss-fade-up 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- MODAL FOOTER PARA PC --- */
.modal-overlay.config-campos-section .modal-footer {
    display: flex;
    justify-content: center;
    /* Centra los botones horizontalmente */
    gap: 15px;
    /* Espacio entre los botones */
    margin-top: 2rem;
    width: 100%;
    /* Asegura que ocupe todo el ancho del modal */
}

/* Opcional: Si quieres que los botones tengan un ancho fijo y no se estiren */
.modal-overlay.config-campos-section .modal-footer .btn {
    min-width: 140px;
    padding: 12px 20px;
}

@media (max-width: 768px) {
    .dashboard-content.config-campos-section {
        margin-left: 0 !important;
        /* 1. Definimos el ancho (90% o 92% para que no sea tan delgado) */
        width: 92% !important;
        /* 2. CENTRADO: margen 0 arriba/abajo y AUTO a los lados */
        margin: 15px auto !important;

        padding: 5;
        overflow-x: hidden;
        display: block;
        position: relative;
        /* 3. Opcional: un redondeado suave si es una card */
        border-radius: 12px;
    }

    .config-campos-section .container,
    .config-campos-section .table-responsive {
        /* 4. Aseguramos que lo interno no intente expandirse más que el padre */
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .config-campos-section .custom-table,
    .config-campos-section .custom-table thead,
    .config-campos-section .custom-table tbody,
    .config-campos-section .custom-table th,
    .config-campos-section .custom-table td,
    .config-campos-section .custom-table tr {
        display: block;
        width: 99.7% !important;
    }

    .config-campos-section .search-bar {
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto !important;
        position: relative !important;
        /* <--- Asegura que este sea el eje */
        display: block !important;
        padding: 0 !important;
        /* Elimina cualquier espacio interno que empuje el i */
    }

    .config-campos-section .search-bar input {
        width: 100% !important;
        padding-left: 40px !important;
        margin: 0 !important;
        display: block !important;
    }

    .config-campos-section .search-bar i {
        position: absolute !important;
        left: 12px !important;
        /* Ajustado un poco más al borde */
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        z-index: 20 !important;
        pointer-events: none;
    }

    .config-campos-section .custom-table thead {
        display: none;
    }

    .config-campos-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 16px;
        background: #fff;
    }

    .config-campos-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    /* Quitar label de Acciones y centrar */
    .config-campos-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .config-campos-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        padding-top: 1rem !important;
        border-bottom: none;
    }

    .config-campos-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.8rem;
    }

    /* Cabecera centrada */
    .config-campos-section .header-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .config-campos-section #btnNuevoPaciente {
        width: 60% !important;
        /* Para que coincida con el tamaño del buscador */
        max-width: 300px;
    }

    .config-campos-section .centered-actions-config-campos {
        width: 100%;
        gap: 1.5rem;
    }

    .modal-overlay.config-campos-section {
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0px !important;
        box-sizing: border-box !important;
        background: rgba(15, 23, 42, 0.9);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .modal-overlay.config-campos-section .modal-content.modal-lg {
        width: 90% !important;
        /* Deja un margen pequeño a los lados del cristal */
        max-width: 360px !important;
        /* Un poco más ancho como pediste */
        min-width: 280px !important;
        /* Corrección de px */
        max-height: 85vh !important;
        padding: 1.5rem !important;
        /* Más espacio interno para que luzca mejor */
        border-radius: 20px !important;
        font-size: 13px !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        display: flex;
        flex-direction: column;
    }

    /* Footer de botones: Apilados y a todo el ancho */
    .modal-overlay.config-campos-section .modal-footer {
        display: flex !important;
        flex-direction: column !important;
        /* Ocupan todo el ancho uno sobre otro */
        gap: 12px !important;
        /* Espacio de separación entre botones */
        margin-top: 20px !important;
        width: 100% !important;
    }

    .modal-overlay.config-campos-section .form-row-2 {
        display: flex;
        flex-direction: column;
        /* Para que en móvil se apilen */
        gap: 8px !important;
        /* Este es el espacio real entre los inputs de esa fila */
        margin-bottom: 8px !important;
        /* Espacio hacia la siguiente fila */
    }

    .modal-overlay.config-campos-section .form-group {
        margin-bottom: 5px !important;
    }

    .modal-overlay.config-campos-section .modal-footer .btn {
        width: 100% !important;
        /* Forzar el ancho completo */
        padding: 12px !important;
        /* Botones más fáciles de presionar en móvil */
        font-size: 0.9rem !important;
        margin: 0 !important;
        border-radius: 12px !important;
        display: block !important;
    }

    /* Opcional: Si quieres que el botón de guardar resalte más */
    .modal-overlay.config-campos-section .modal-footer .btn-primary {
        order: 1;
        /* El botón principal primero o segundo según prefieras */
    }
}


/* ==========================================================================
   globales.html — Estilos compartidos entre varias páginas
   ========================================================================== */

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th,
.custom-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

/* --- GRID PARA FORMULARIOS --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/*----------------------------------------------------------------------------------*/

/* ==========================================================================
   gestion-personal.hmtl
   ========================================================================== */
.personal-section .centered-actions-personal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.personal-section .custom-table {
    table-layout: fixed;
    width: 100%;
}

/* Colaboradores */
.personal-section .custom-table th:nth-child(1) {
    width: 27%;
}

/* Rol */
.personal-section .custom-table th:nth-child(2) {
    width: 15%;
}

/* Telefono */
.personal-section .custom-table th:nth-child(3) {
    width: 13%;
}

/* Cedula */
.personal-section .custom-table th:nth-child(4) {
    width: 12%;
}

/* Especialidad */
.personal-section .custom-table th:nth-child(5) {
    width: 13%;
}


/* Acciones */
.personal-section .custom-table th:nth-child(6) {
    width: 20%;
    text-align: center !important;
}

.personal-section .welcome-text p {
    color: var(--text-muted, #64748b);
    font-size: 1rem;
}

.personal-section #btnNuevoPersonal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    border-radius: 6px;
}

.personal-section .btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.personal-section .btn-edit-personal {
    color: #f59e0b;
}

.personal-section .btn-delete-personal {
    color: #dc3545;
}

.personal-section .btn-edit-personal:hover,
.personal-section .btn-delete-personal:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
    background: none;
}

.modal-overlay.personal-section {
    position: fixed;
    top: 0;
    left: 0;
    /* Cubre toda la pantalla */
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;

    /* Centrado absoluto usando Flexbox */
    display: none;
    /* Cambiar a 'flex' mediante JS */
    justify-content: center;
    align-items: center;
}

.modal-overlay.personal-section .modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 600px !important;
    /* Ancho máximo en Desktop */
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: ss-fade-up 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

    /* Control de desborde */
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* --- FOOTER DEL MODAL --- */
.modal-overlay.personal-section .modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 2rem;
    width: 100%;
}

.modal-overlay.personal-section .modal-footer .btn {
    min-width: 140px;
    padding: 12px 20px;
}

@media (max-width: 768px) {

    .dashboard-content.personal-section {
        margin-left: 0 !important;
        /* 1. Definimos el ancho (90% o 92% para que no sea tan delgado) */
        width: 92% !important;
        /* 2. CENTRADO: margen 0 arriba/abajo y AUTO a los lados */
        margin: 15px auto !important;

        padding: 5;
        overflow-x: hidden;
        display: block;
        position: relative;
        /* 3. Opcional: un redondeado suave si es una card */
        border-radius: 12px;
    }

    .personal-section .container,
    .personal-section .table-responsive {
        /* 4. Aseguramos que lo interno no intente expandirse más que el padre */
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .personal-section .custom-table,
    .personal-section .custom-table thead,
    .personal-section .custom-table tbody,
    .personal-section .custom-table th,
    .personal-section .custom-table td,
    .personal-section .custom-table tr {
        display: block;
        width: 99.7% !important;
    }

    .personal-section .search-bar {
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto !important;
        position: relative !important;
        /* <--- Asegura que este sea el eje */
        display: block !important;
        padding: 0 !important;
        /* Elimina cualquier espacio interno que empuje el i */
    }

    .personal-section .search-bar input {
        width: 100% !important;
        padding-left: 40px !important;
        margin: 0 !important;
        display: block !important;
    }

    .personal-section .search-bar i {
        position: absolute !important;
        left: 12px !important;
        /* Ajustado un poco más al borde */
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        z-index: 20 !important;
        pointer-events: none;
    }

    .personal-section .custom-table thead {
        display: none;
    }

    .personal-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 16px;
        background: #fff;
    }

    .personal-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    /* Quitar label de Acciones y centrar */
    .personal-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .personal-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        padding-top: 1rem !important;
        border-bottom: none;
    }

    .personal-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.8rem;
    }

    /* Cabecera centrada */
    .personal-section .header-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .personal-section #btnNuevoCampo {
        width: 60% !important;
        /* Para que coincida con el tamaño del buscador */
        max-width: 300px;
    }

    .personal-section .centered-actions-personal {
        width: 100%;
        gap: 1.5rem;
    }

    .modal-overlay.personal-section {
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0px !important;
        box-sizing: border-box !important;
        background: rgba(15, 23, 42, 0.9);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .modal-overlay.personal-section .modal-content.modal-lg {
        width: 90% !important;
        /* Deja un margen pequeño a los lados del cristal */
        max-width: 360px !important;
        /* Un poco más ancho como pediste */
        min-width: 280px !important;
        /* Corrección de px */
        max-height: 85vh !important;
        padding: 1.5rem !important;
        /* Más espacio interno para que luzca mejor */
        border-radius: 20px !important;
        font-size: 13px !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        display: flex;
        flex-direction: column;
    }

    /* Footer de botones: Apilados y a todo el ancho */
    .modal-overlay.personal-section .modal-footer {
        display: flex !important;
        flex-direction: column !important;
        /* Ocupan todo el ancho uno sobre otro */
        gap: 12px !important;
        /* Espacio de separación entre botones */
        margin-top: 20px !important;
        width: 100% !important;
    }

    .modal-overlay.personal-section .form-row-2 {
        display: flex;
        flex-direction: column;
        /* Para que en móvil se apilen */
        gap: 8px !important;
        /* Este es el espacio real entre los inputs de esa fila */
        margin-bottom: 8px !important;
        /* Espacio hacia la siguiente fila */
    }

    .modal-overlay.personal-section .form-group {
        margin-bottom: 5px !important;
    }

    .modal-overlay.personal-section .modal-footer .btn {
        width: 100% !important;
        /* Forzar el ancho completo */
        padding: 12px !important;
        /* Botones más fáciles de presionar en móvil */
        font-size: 0.9rem !important;
        margin: 0 !important;
        border-radius: 12px !important;
        display: block !important;
    }

    /* Opcional: Si quieres que el botón de guardar resalte más */
    .modal-overlay.personal-section .modal-footer .btn-primary {
        order: 1;
        /* El botón principal primero o segundo según prefieras */
    }
}

/* ==========================================================================
   pacientes.hmtl
   ========================================================================== */

/* --- ESTILOS GENERALES Y PC (PACIENTES) --- */
.pacientes-section .centered-actions-pacientes {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Control de anchos exclusivo para PC */
.pacientes-section .custom-table {
    table-layout: fixed;
    width: 100%;
}

/* Paciente */
.pacientes-section .custom-table th:nth-child(1) {
    width: 25%;
}

/* Contacto */
.pacientes-section .custom-table th:nth-child(2) {
    width: 18%;
}

/* CURP */
.pacientes-section .custom-table th:nth-child(3) {
    width: 19%;
}

/* Medico Tratante */
.pacientes-section .custom-table th:nth-child(4) {
    width: 17%;
}

/* Sexo */
.pacientes-section .custom-table th:nth-child(5) {
    width: 8%;
}

/* Acciones */
.pacientes-section .custom-table th:nth-child(6) {
    width: 15%;
    text-align: center !important;
}

/* Acciones */

/* Colores de botones de pacientes */



.pacientes-section .btn-start-consult:hover,
.pacientes-section .btn-edit-paciente:hover,
.pacientes-section .btn-delete-paciente:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
    background: none;
}

.pacientes-section .btn-start-consult {
    color: #198754;
}


.pacientes-section .btn-edit-paciente {
    color: #f59e0b;
}


.pacientes-section .btn-delete-paciente {
    color: #dc3545;
}


.pacientes-section .empty-state-pacientes {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.pacientes-section .empty-state-pacientes i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
    display: block;
}

.pacientes-section #btnNuevoPaciente {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    border-radius: 6px;
}

/* --- CORRECCIÓN DEL BUSCADOR (ICONO DENTRO) --- */

/* 1. Definir el tamaño del contenedor */
.pacientes-section .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
    /* <--- CAMBIA ESTO PARA EL TAMAÑO (Ej: 300px, 500px, 50%) */
    max-width: 100%;
    /* Evita que se salga en pantallas pequeñas */
}

/* 2. Meter el icono adentro (Posición absoluta) */
.pacientes-section .search-bar i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    z-index: 10;
    pointer-events: none;
    /* Para que puedas hacer clic a través del icono */
}

/* 3. Ajustar el input para que llene el contenedor */
.pacientes-section .search-bar input {
    width: 100% !important;
    /* Llena los 450px definidos arriba */
    height: 42px;
    padding: 10px 15px 10px 40px !important;
    /* El 40px hace espacio para la lupa */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
}

.pacientes-section .search-bar input:focus {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.modal-overlay.pacientes-section {
    position: fixed;
    top: 0;
    /* 1. Forzamos el inicio exacto */
    left: 280px !important;
    /* 2. Aseguramos que el ancho no sea mayor al espacio disponible */
    width: calc(100vw - 260px) !important;
    /* 3. El height debe ser el de la ventana */
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    /* 4. Centrado interno */
    display: none;
    /* Se cambia a flex con JS */
    justify-content: center;
    align-items: center;
    /* 5. Un z-index alto pero que no rompa otros elementos */
    z-index: 9999;
}

.modal-overlay.pacientes-section .modal-content.modal-lg {
    background: #ffffff;
    width: 100%;
    /* Tu medida de 600px para que no sea gigante en monitores grandes */
    max-width: 600px !important;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: ss-fade-up 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- MODAL FOOTER PARA PC --- */
.modal-overlay.pacientes-section .modal-footer {
    display: flex;
    justify-content: center;
    /* Centra los botones horizontalmente */
    gap: 15px;
    /* Espacio entre los botones */
    margin-top: 2rem;
    width: 100%;
    /* Asegura que ocupe todo el ancho del modal */
}

/* Opcional: Si quieres que los botones tengan un ancho fijo y no se estiren */
.modal-overlay.pacientes-section .modal-footer .btn {
    min-width: 140px;
    padding: 12px 20px;
}

/* --- ESTILOS MÓVIL (MÁXIMO 768PX) --- */
@media (max-width: 768px) {

    .dashboard-content.pacientes-section {
        margin-left: 0 !important;
        /* 1. Definimos el ancho (90% o 92% para que no sea tan delgado) */
        width: 92% !important;
        /* 2. CENTRADO: margen 0 arriba/abajo y AUTO a los lados */
        margin: 15px auto !important;

        padding: 5;
        overflow-x: hidden;
        display: block;
        position: relative;
        /* 3. Opcional: un redondeado suave si es una card */
        border-radius: 12px;
    }

    .pacientes-section .container,
    .pacientes-section .table-responsive {
        /* 4. Aseguramos que lo interno no intente expandirse más que el padre */
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .pacientes-section .custom-table,
    .pacientes-section .custom-table thead,
    .pacientes-section .custom-table tbody,
    .pacientes-section .custom-table th,
    .pacientes-section .custom-table td,
    .pacientes-section .custom-table tr {
        display: block;
        width: 99.7% !important;
    }

    .pacientes-section .search-bar {
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto !important;
        position: relative !important;
        /* <--- Asegura que este sea el eje */
        display: block !important;
        padding: 0 !important;
        /* Elimina cualquier espacio interno que empuje el i */
    }

    .pacientes-section .search-bar input {
        width: 100% !important;
        padding-left: 40px !important;
        margin: 0 !important;
        display: block !important;
    }

    .pacientes-section .search-bar i {
        position: absolute !important;
        left: 12px !important;
        /* Ajustado un poco más al borde */
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        z-index: 20 !important;
        pointer-events: none;
    }

    .pacientes-section .custom-table thead {
        display: none;
    }

    .pacientes-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 16px;
        background: #fff;
    }

    .pacientes-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    /* Quitar label de Acciones y centrar */
    .pacientes-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .pacientes-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        padding-top: 1rem !important;
        border-bottom: none;
    }

    .pacientes-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.8rem;
    }

    /* Cabecera centrada */
    .pacientes-section .header-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .pacientes-section #btnNuevoPaciente {
        width: 60% !important;
        /* Para que coincida con el tamaño del buscador */
        max-width: 300px;
    }

    .pacientes-section .centered-actions-pacientes {
        width: 100%;
        gap: 1.5rem;
    }

    .modal-overlay.pacientes-section {
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0px !important;
        box-sizing: border-box !important;
        background: rgba(15, 23, 42, 0.9);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .modal-overlay.pacientes-section .modal-content.modal-lg {
        width: 90% !important;
        /* Deja un margen pequeño a los lados del cristal */
        max-width: 360px !important;
        /* Un poco más ancho como pediste */
        min-width: 280px !important;
        /* Corrección de px */
        max-height: 85vh !important;
        padding: 1.5rem !important;
        /* Más espacio interno para que luzca mejor */
        border-radius: 20px !important;
        font-size: 13px !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        display: flex;
        flex-direction: column;
    }

    /* Footer de botones: Apilados y a todo el ancho */
    .modal-overlay.pacientes-section .modal-footer {
        display: flex !important;
        flex-direction: column !important;
        /* Ocupan todo el ancho uno sobre otro */
        gap: 12px !important;
        /* Espacio de separación entre botones */
        margin-top: 20px !important;
        width: 100% !important;
    }

    .modal-overlay.pacientes-section .form-row-2 {
        display: flex;
        flex-direction: column;
        /* Para que en móvil se apilen */
        gap: 8px !important;
        /* Este es el espacio real entre los inputs de esa fila */
        margin-bottom: 8px !important;
        /* Espacio hacia la siguiente fila */
    }

    .modal-overlay.pacientes-section .form-group {
        margin-bottom: 5px !important;
    }

    .modal-overlay.pacientes-section .modal-footer .btn {
        width: 100% !important;
        /* Forzar el ancho completo */
        padding: 12px !important;
        /* Botones más fáciles de presionar en móvil */
        font-size: 0.9rem !important;
        margin: 0 !important;
        border-radius: 12px !important;
        display: block !important;
    }

    /* Opcional: Si quieres que el botón de guardar resalte más */
    .modal-overlay.pacientes-section .modal-footer .btn-primary {
        order: 1;
        /* El botón principal primero o segundo según prefieras */
    }
}

/* 1. El contenedor DEBE ser relativo para "anclar" el mensaje */
/* Contenedor del icono */
.help-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.help-tooltip-wrapper .help-icon {
    color: #3085d6;
    font-size: 1.1rem;
    padding: 0 5px;
}

/* El globo de texto */
.help-tooltip-box {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    /* 1. Posición: Lo bajamos un poco para que no se pegue al borde superior */
    top: 130%;
    left: 0;
    /* 2. Alineado a la izquierda del icono en lugar de centrado */
    transform: none;
    /* Quitamos el traslateX para evitar que se desplace fuera */

    /* 3. Forma alargada */
    width: 450px;
    /* Más ancho */
    max-width: 80vw;
    /* Pero que no supere el 80% del ancho de la pantalla en móviles */

    background-color: #1e293b;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);

    font-size: 0.85rem;
    line-height: 1.4;
    transition: all 0.2s ease;
    pointer-events: none;
}

/* 4. Ajustamos la flechita para que apunte al icono desde la nueva posición */
.help-tooltip-box::after {
    content: "";
    position: absolute;
    bottom: 100%;
    /* Ahora la flecha sale por arriba porque el tooltip está abajo */
    left: 10px;
    /* Flecha pegada a la izquierda donde está el icono */
    border-width: 7px;
    border-style: solid;
    border-color: transparent transparent #1e293b transparent;
}

/* 5. Efecto de aparición */
.help-tooltip-wrapper:hover .help-tooltip-box,
.help-tooltip-wrapper.active .help-tooltip-box {
    visibility: visible;
    opacity: 1;
    top: 110%;
    /* Sube ligeramente al mostrarse */
}

/* ==========================================================================
   consulta.hmtl
   ========================================================================== */

/* --- Estilos Específicos de Consulta --- */

.consulta-section .consultation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1001;
    border: 1px solid #e2e8f0;
}

/* Banner del Paciente */
.consulta-section .patient-banner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.consulta-section .btn-circle-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.2s;
    text-decoration: none;
}

.consulta-section .btn-circle-back:hover {
    background: var(--primary-color);
    color: white;
}

.consulta-section .patient-details h1 {
    font-size: 1.25rem;
    margin: 0;
    color: #1e293b;
}

.consulta-section .patient-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #64748b;
    align-items: center;
    margin-top: 0.2rem;
}

.consulta-section .tag-gender {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Grid de Diseño */
.consulta-section .consultation-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.consulta-section .clinical-main .card {
    margin-bottom: 20px;
    /* Esto separa Nota de Evolución de Prescripción */
}

/* Sidebar de Signos */
.consulta-section .vitals-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.consulta-section .vital-input-group {
    width: 100%;
}

.consulta-section .vital-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
}

.consulta-section .input-with-unit {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.consulta-section .input-with-unit input {
    border: none;
    background: transparent;
    padding: 0.6rem;
    width: 100%;
    font-size: 0.9rem;
}

.consulta-section .unit-label {
    background: #f1f5f9;
    padding: 0.6rem;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    border-left: 1px solid #e2e8f0;
}

/* Tarjetas */
.consulta-section .card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.consulta-section .card-header {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}

.consulta-section .card-header h3 {
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #334155;
}

.consulta-section .card-header.highlight {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
}

.consulta-section .card-body {
    padding: 1.5rem;
}

.consulta-section .form-field {
    margin-bottom: 1.2rem;
}

.consulta-section .form-field label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.consulta-section textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.8rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.consulta-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.consulta-section .prescription-area {
    background: #fffdf5;
    border: 1px dashed #eab308;
}

/* Buscador */
.consulta-section .search-input-wrapper {
    position: relative;
}

.consulta-section .icon-inner {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.consulta-section .search-input-wrapper input {
    padding-left: 2.8rem;
    width: 100%;
    height: 45px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

.consulta-section .empty-vitals {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.consulta-section .char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.consulta-section textarea[data-max-chars] {
    resize: none;
}

/* --- ESTILOS DEL MODAL (Centrado arreglado) --- */
.consulta-section .ss-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    /* Fondo oscuro semitransparente */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    /* Muy por encima de todo */
}

.consulta-section .ss-modal-content {
    background: #fff;
    width: 90%;
    max-width: 480px;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.consulta-section .ss-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.consulta-section .ss-icon-check-animated i {
    font-size: 3.5rem;
    color: #22c55e;
}

.consulta-section .ss-modal-title {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
}

.consulta-section .ss-modal-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.consulta-section .ss-modal-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.consulta-section .ss-modal-actions-list button {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.consulta-section .ss-btn-wa {
    background: #25d366;
    color: white;
}

.consulta-section .ss-btn-wa:hover {
    background: #128c7e;
}

.consulta-section .ss-btn-mail {
    background: #f1f5f9;
    color: #475569;
}

.consulta-section .ss-btn-mail:hover {
    background: #e2e8f0;
}

.consulta-section .ss-btn-back-home {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.dashboard-content.consulta-section {
    overflow: visible !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
    .consulta-section .consultation-grid {
        display: flex;
        flex-direction: column;
        /* Cambiamos a columna por defecto para que todo sea ancho total */
        gap: 1.5rem;
        width: 100%;
        margin-bottom: 20px;
    }

    .consulta-section .vitals-sidebar,
    .consulta-section .clinical-main {
        width: 100%;
        /* Ambos ocupan el mismo ancho ahora */
    }

    /* El orden que pediste: Header (0), Signos (1), Receta (2) */
    .consulta-section .vitals-sidebar {
        order: 1;

        /* Esto lo pone en medio */
    }

    .consulta-section .clinical-main {
        order: 2;
        /* Esto manda las notas y receta al final */
    }
}

@media (max-width: 768px) {
    .consulta-section .consultation-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        position: relative;
        /* En móviles quitamos el sticky por espacio */
    }

    .consulta-section .consultation-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .consulta-section .patient-meta {
        flex-wrap: wrap;
    }
}

.active-consult-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0f172a;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: white;
}

.banner-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.time-details {
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    gap: 15px;
}

.timer-badge {
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    min-width: 80px;
    text-align: center;
}

.timer-green {
    background: #059669;
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
}

.timer-orange {
    background: #d97706;
}

.timer-red {
    background: #dc2626;
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0.7;
    }
}

.pulse-icon {
    width: 10px;
    height: 10px;
    background: #00f3ff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 243, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0);
    }
}

.active-consult-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0f172a;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: white;
}

.banner-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.time-details {
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    gap: 15px;
}

.timer-badge {
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    min-width: 80px;
    text-align: center;
}

.timer-green {
    background: #059669;
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
}

.timer-orange {
    background: #d97706;
}

.timer-red {
    background: #dc2626;
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0.7;
    }
}

.pulse-icon {
    width: 10px;
    height: 10px;
    background: #00f3ff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 243, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0);
    }
}

/* ==========================================================================
   expediente.hmtl
   ========================================================================== */


/* --- ESTILOS GENERALES Y PC --- */
.expedientes-section .centered-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Control de anchos exclusivo para PC */
.expedientes-section .custom-table {
    table-layout: fixed;
    width: 100%;
}

/* Paciente */
.expedientes-section .custom-table th:nth-child(1),
.expedientes-section .custom-table td:nth-child(1) {
    width: 20%;
}

/* Diagnostico */
.expedientes-section .custom-table th:nth-child(2),
.expedientes-section .custom-table td:nth-child(2) {
    width: 25%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Acciones Receta */
.expedientes-section .custom-table th:nth-child(3),
.expedientes-section .custom-table td:nth-child(3) {
    width: 25%;
    text-align: center !important;
}

/* Acciones Expediente*/
.expedientes-section .custom-table th:nth-child(4),
.expedientes-section .custom-table td:nth-child(4) {
    width: 20%;
    text-align: center !important;
}

/* Acciones*/
.expedientes-section .custom-table th:nth-child(5),
.expedientes-section .custom-table td:nth-child(5) {
    width: 10%;
    text-align: center !important;
}

/* Colores de botones */

.expedientes-section .btn-email:hover,
.expedientes-section .btn-view:hover,
.expedientes-section .btn-whatsapp:hover,
.expedientes-section .btn-danger:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
    background: none;
}

.expedientes-section .btn-view {
    color: #0d6efd;
    transition: transform 0.2s, filter 0.2s;
}


.expedientes-section .btn-whatsapp {
    color: #198754;
    transition: transform 0.2s, filter 0.2s;
}


.expedientes-section .btn-email {
    color: #0dcaf0;
    transition: transform 0.2s, filter 0.2s;
}

.expedientes-section .btn-danger {
    color: #dc3545;
    transition: transform 0.2s, filter 0.2s;
}

.expedientes-section .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.expedientes-section #btnNvaConsulexp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    border-radius: 6px;
    margin: 0 auto;
}

.expedientes-section .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
    /* <--- CAMBIA ESTO PARA EL TAMAÑO (Ej: 300px, 500px, 50%) */
    max-width: 100%;
    /* Evita que se salga en pantallas pequeñas */
}

/* 2. Meter el icono adentro (Posición absoluta) */
.expedientes-section .search-bar i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    z-index: 10;
    pointer-events: none;
    /* Para que puedas hacer clic a través del icono */
}

/* 3. Ajustar el input para que llene el contenedor */
.expedientes-section .search-bar input {
    width: 100% !important;
    /* Llena los 450px definidos arriba */
    height: 42px;
    padding: 10px 15px 10px 40px !important;
    /* El 40px hace espacio para la lupa */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
}

.expedientes-section .search-bar input:focus {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* --- ESTILOS MÓVIL (MÁXIMO 768PX) --- */
@media (max-width: 768px) {

    .dashboard-content.expedientes-section {
        margin-left: 0 !important;
        /* 1. Definimos el ancho (90% o 92% para que no sea tan delgado) */
        width: 92% !important;
        /* 2. CENTRADO: margen 0 arriba/abajo y AUTO a los lados */
        margin: 15px auto !important;

        padding: 5;
        overflow-x: hidden;
        display: block;
        position: relative;
        /* 3. Opcional: un redondeado suave si es una card */
        border-radius: 12px;
    }

    .expedientes-section .container,
    .expedientes-section .table-responsive {
        /* 4. Aseguramos que lo interno no intente expandirse más que el padre */
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .expedientes-section .custom-table,
    .expedientes-section .custom-table thead,
    .expedientes-section .custom-table tbody,
    .expedientes-section .custom-table th,
    .expedientes-section .custom-table td,
    .expedientes-section .custom-table tr {
        display: block;
        width: 99.7% !important;
    }

    .expedientes-section .search-bar {
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto !important;
        position: relative !important;
        /* <--- Asegura que este sea el eje */
        display: block !important;
        padding: 0 !important;
        /* Elimina cualquier espacio interno que empuje el i */
    }

    .expedientes-section .search-bar input {
        width: 100% !important;
        padding-left: 40px !important;
        margin: 0 !important;
        display: block !important;
    }

    .expedientes-section .search-bar i {
        position: absolute !important;
        left: 12px !important;
        /* Ajustado un poco más al borde */
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        z-index: 20 !important;
        pointer-events: none;
    }

    .expedientes-section .custom-table thead {
        display: none;
    }

    .expedientes-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 16px;
        background: #fff;
    }

    .expedientes-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    /* Quitar label de Acciones y centrar */
    .expedientes-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .expedientes-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        padding-top: 1rem !important;
        border-bottom: none;
    }

    .expedientes-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.8rem;
    }

    /* Cabecera centrada */
    .expedientes-section .header-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .expedientes-section #btnNvaConsulexp {
        width: 60% !important;
        /* Para que coincida con el tamaño del buscador */
        max-width: 300px;
    }

    .expedientes-section .centered-actions-expedientes {
        width: 100%;
        gap: 1.5rem;
    }
}

/* ==========================================================================
    inventario.hmtl
   ========================================================================== */

.inventario-section .centered-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Control de anchos exclusivo para PC */
.inventario-section .custom-table {
    table-layout: fixed;
    width: 100%;
}

/* Producto */
.inventario-section .custom-table th:nth-child(1),
.inventario-section .custom-table td:nth-child(1) {
    width: 35%;
}

/* Stock Actual y Mínimo */
.inventario-section .custom-table th:nth-child(2),
.inventario-section .custom-table td:nth-child(2),
.inventario-section .custom-table th:nth-child(3),
.inventario-section .custom-table td:nth-child(3) {
    width: 15%;
}

/* Estado */
.inventario-section .custom-table th:nth-child(4),
.inventario-section .custom-table td:nth-child(4) {
    width: 15%;
    text-align: center !important;
}

/* Acciones */
.inventario-section .custom-table th:nth-child(5),
.inventario-section .custom-table td:nth-child(5) {
    width: 20%;
    text-align: center !important;
}

/* Estilos de Badges de Stock */
.inventario-section .badge-stock {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.inventario-section .stock-ok {
    background: #dcfce7;
    color: #166534;
}

.inventario-section .stock-alert {
    background: #fee2e2;
    color: #991b1b;
}

.inventario-section .alert-banner {
    background: #ef4444;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

/* Colores de botones y efectos */
.inventario-section .btn-edit-insumo,
.inventario-section .btn-danger:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
    background: none;
}

.inventario-section .btn-edit-insumo {
    color: #f59e0b;
    transition: transform 0.2s;
}

.inventario-section .btn-danger {
    color: #dc3545;
    transition: transform 0.2s;
}

.inventario-section .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.inventario-section .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
    max-width: 100%;
}

.inventario-section .search-bar i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    z-index: 10;
}

.inventario-section .search-bar input {
    width: 100% !important;
    height: 42px;
    padding: 10px 15px 10px 40px !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
}

.modal-overlay.inventario-section {
    position: fixed;
    top: 0;
    /* 1. Forzamos el inicio exacto */
    left: 280px !important;
    /* 2. Aseguramos que el ancho no sea mayor al espacio disponible */
    width: calc(100vw - 260px) !important;
    /* 3. El height debe ser el de la ventana */
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    /* 4. Centrado interno */
    display: none;
    /* Se cambia a flex con JS */
    justify-content: center;
    align-items: center;
    /* 5. Un z-index alto pero que no rompa otros elementos */
    z-index: 9999;
}

.modal-overlay.inventario-section .modal-content.modal-lg {
    background: #ffffff;
    width: 100%;
    /* Tu medida de 600px para que no sea gigante en monitores grandes */
    max-width: 600px !important;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: ss-fade-up 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}


.modal-overlay.inventario-section .modal-footer {
    display: flex;
    justify-content: center;
    /* Centra los botones horizontalmente */
    gap: 15px;
    /* Espacio entre los botones */
    margin-top: 2rem;
    width: 100%;
    /* Asegura que ocupe todo el ancho del modal */
}

/* Opcional: Si quieres que los botones tengan un ancho fijo y no se estiren */
.modal-overlay.inventario-section .modal-footer .btn {
    min-width: 140px;
    padding: 12px 20px;
}

.inventario-section .btnNuevoInsumo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    border-radius: 6px;
    margin: 0 auto;
}



/* --- MÓVIL (MÁXIMO 768PX) --- */
@media (max-width: 768px) {
    .dashboard-content.inventario-section {
        margin-left: 0 !important;
        width: 92% !important;
        margin: 15px auto !important;
        border-radius: 12px;
    }

    .inventario-section .custom-table,
    .inventario-section .custom-table thead,
    .inventario-section .custom-table tbody,
    .inventario-section .custom-table tr,
    .inventario-section .custom-table td {
        display: block;
        width: 100% !important;
    }

    .inventario-section .custom-table thead {
        display: none;
    }

    .inventario-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 16px;
        background: #fff;
    }

    .inventario-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    .inventario-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.8rem;
    }

    .inventario-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .inventario-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        border-bottom: none;
    }

    .inventario-section .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .inventario-section #btnNuevoInsumo {
        width: 60% !important;
        max-width: 300px;
    }
}

/* ==========================================================================
   pago.html
   ========================================================================== */

/* --- ESTILOS GENERALES Y PC --- */
.pagos-section .centered-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Control de anchos exclusivo para PC */
.pagos-section .custom-table {
    table-layout: fixed;
    width: 100%;
    align-items: center;
}

/* Paciente */
.pagos-section .custom-table th:nth-child(1),
.pagos-section .custom-table td:nth-child(1) {
    width: 25%;
}

/* Fecha */
.pagos-section .custom-table th:nth-child(2),
.pagos-section .custom-table td:nth-child(2) {
    width: 15%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Monto */
.pagos-section .custom-table th:nth-child(3),
.pagos-section .custom-table td:nth-child(3) {
    width: 15%;
    text-align: center !important;
}

/* Metodo */
.pagos-section .custom-table th:nth-child(4),
.pagos-section .custom-table td:nth-child(4) {
    width: 17%;
    text-align: center !important;
}

/* Estado */
.pagos-section .custom-table th:nth-child(5),
.pagos-section .custom-table td:nth-child(5) {
    width: 13%;
    text-align: center !important;
}

/* Acciones */
.pagos-section .custom-table th:nth-child(6),
.pagos-section .custom-table td:nth-child(6) {
    width: 15%;
    text-align: center !important;
}

/* Colores de botones */


.pagos-section .btn-view:hover,
.pagos-section .btn-whatsapp:hover,
.pagos-section .btn-email:hover,
.pagos-section .btn-danger:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
    background: none;
}

.pagos-section .btn-view {
    color: #0d6efd;
    transition: transform 0.2s, filter 0.2s;
}

.pagos-section .btn-whatsapp {
    color: #198754;
    transition: transform 0.2s, filter 0.2s;
}

.pagos-section .btn-email {
    color: #0dcaf0;
    transition: transform 0.2s, filter 0.2s;
}

.pagos-section .btn-danger {
    color: #dc3545;
    transition: transform 0.2s, filter 0.2s;
}

.pagos-section .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.pagos-section #btnNuevoPago {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    border-radius: 6px;
    margin: 0 auto;
}

.pagos-section .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
    /* <--- CAMBIA ESTO PARA EL TAMAÑO (Ej: 300px, 500px, 50%) */
    max-width: 100%;
    /* Evita que se salga en pantallas pequeñas */
}

/* 2. Meter el icono adentro (Posición absoluta) */
.pagos-section .search-bar i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    z-index: 10;
    pointer-events: none;
    /* Para que puedas hacer clic a través del icono */
}

/* 3. Ajustar el input para que llene el contenedor */
.pagos-section .search-bar input {
    width: 100% !important;
    /* Llena los 450px definidos arriba */
    height: 42px;
    padding: 10px 15px 10px 40px !important;
    /* El 40px hace espacio para la lupa */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
}

.pagos-section .search-bar input:focus {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* --- ESTILOS MÓVIL (MÁXIMO 768PX) --- */
@media (max-width: 768px) {

    .dashboard-content.pagos-section {
        margin-left: 0 !important;
        /* 1. Definimos el ancho (90% o 92% para que no sea tan delgado) */
        width: 92% !important;
        /* 2. CENTRADO: margen 0 arriba/abajo y AUTO a los lados */
        margin: 15px auto !important;

        padding: 5;
        overflow-x: hidden;
        display: block;
        position: relative;
        /* 3. Opcional: un redondeado suave si es una card */
        border-radius: 12px;
    }

    .pagos-section .container,
    .pagos-section .table-responsive {
        /* 4. Aseguramos que lo interno no intente expandirse más que el padre */
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .pagos-section .custom-table,
    .pagos-section .custom-table thead,
    .pagos-section .custom-table tbody,
    .pagos-section .custom-table th,
    .pagos-section .custom-table td,
    .pagos-section .custom-table tr {
        display: block;
        width: 99.7% !important;
    }

    .pagos-section .search-bar {
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto !important;
        position: relative !important;
        /* <--- Asegura que este sea el eje */
        display: block !important;
        padding: 0 !important;
        /* Elimina cualquier espacio interno que empuje el i */
    }

    .pagos-section .search-bar input {
        width: 100% !important;
        padding-left: 40px !important;
        margin: 0 !important;
        display: block !important;
    }

    .pagos-section .search-bar i {
        position: absolute !important;
        left: 12px !important;
        /* Ajustado un poco más al borde */
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        z-index: 20 !important;
        pointer-events: none;
    }

    .pagos-section .custom-table thead {
        display: none;
    }

    .pagos-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 16px;
        background: #fff;
    }

    .pagos-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    /* Quitar label de Acciones y centrar */
    .pagos-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .pagos-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        padding-top: 1rem !important;
        border-bottom: none;
    }

    .pagos-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.8rem;
    }

    /* Cabecera centrada */
    .pagos-section .header-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .pagos-section #btnNuevoPago {
        width: 60% !important;
        max-width: 300px;
    }

    .pagos-section .centered-actions-pagos {
        width: 100%;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   productos.html
   ========================================================================== */


.productos-section .centered-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Control de anchos en Desktop */
.productos-section .custom-table {
    table-layout: fixed;
    width: 100%;
}

.productos-section .custom-table th:nth-child(1),
.productos-section .custom-table td:nth-child(1) {
    width: 30%;
}

/* Producto */
.productos-section .custom-table th:nth-child(2),
.productos-section .custom-table td:nth-child(2) {
    width: 12%;
}

/* Precio */
.productos-section .custom-table th:nth-child(3),
.productos-section .custom-table td:nth-child(3) {
    width: 12%;
}

/* Stock Actual */
.productos-section .custom-table th:nth-child(4),
.productos-section .custom-table td:nth-child(4) {
    width: 12%;
}

/* Stock Mínimo */
.productos-section .custom-table th:nth-child(5),
.productos-section .custom-table td:nth-child(5) {
    width: 14%;
}

/* Estado */
.productos-section .custom-table th:nth-child(6),
.productos-section .custom-table td:nth-child(6) {
    text-align: center;
    width: 20%;
}

/* Acciones */

/* Badges de Stock */
.productos-section .badge-stock {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.productos-section .stock-ok {
    background: #dcfce7;
    color: #166534;
}

.productos-section .stock-alert {
    background: #fee2e2;
    color: #991b1b;
}

.productos-section .alert-banner {
    background: #ef4444;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

/* Botones de acción */
.productos-section .btn-edit-producto {
    color: #f59e0b;
    transition: transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.productos-section .btn-danger {
    color: #dc3545;
    transition: transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.productos-section .btn-edit-producto:hover,
.productos-section .btn-danger:hover {
    transform: scale(1.2);
    filter: brightness(1.1);
}

/* Buscador */
.productos-section .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
    max-width: 100%;
}

.productos-section .search-bar i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
}

.productos-section .search-bar input {
    width: 100% !important;
    height: 42px;
    padding: 10px 15px 10px 40px !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* MODALES (CORREGIDOS PARA RESPONSIVE) */
.modal-overlay.productos-section {
    position: fixed;
    top: 0;
    left: 280px;
    /* Default desktop con sidebar */
    width: calc(100vw - 280px);
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.modal-overlay.productos-section .modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.productos-section .modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 2rem;
}

/* --- MEDIA QUERIES (MÓVIL) --- */
@media (max-width: 768px) {

    /* El modal ahora ocupa toda la pantalla en móvil */
    .modal-overlay.productos-section {
        left: 0 !important;
        width: 100vw !important;
    }

    .dashboard-content.productos-section {
        margin-left: 0 !important;
        width: 95% !important;
        margin: 10px auto !important;
    }

    /* Tabla responsiva tipo Card */
    .productos-section .custom-table,
    .productos-section .custom-table thead,
    .productos-section .custom-table tbody,
    .productos-section .custom-table tr,
    .productos-section .custom-table td {
        display: block;
        width: 100% !important;
    }

    .productos-section .custom-table thead {
        display: none;
    }

    .productos-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 10px;
        background: #fff;
    }

    .productos-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f1f5f9;
    }

    .productos-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748b;
        font-size: 0.8rem;
    }

    .productos-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .productos-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        border: none;
    }

    .productos-section .header-actions {
        flex-direction: column;
        gap: 10px;
    }

    .productos-section .search-bar {
        width: 100% !important;
    }

    .productos-section #btnNuevoProducto {
        width: 62% !important;
        max-width: 300px;
    }
}

/* ==========================================================================
   suscripciones.html
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;700;800&display=swap');

.sync-pricing-wrapper {
    width: 100%;
    /* ESTA ES LA CLAVE: Empuja todo el contenido 60px a la derecha 
       del borde del sidebar para que respire */
    padding-left: 80px;
    padding-right: 40px;
    padding-top: 60px;
    padding-bottom: 60px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Lo mantenemos alineado a la izquierda pero con el respiro del padding */
    position: relative;
}

/* Efecto de fondo sutil con tu color 0D9488 */
.bg-blur-teal {
    position: absolute;
    top: -150px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(80px);
    pointer-events: none;
}

.sync-main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* HEADER DE ESTADO */
.sync-user-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 60px;
}

.sync-status-box {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sync-status-icon {
    width: 45px;
    height: 45px;
    background-color: #0D9488;
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sync-tag-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sync-status-content h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
}

.sync-status-badge {
    background-color: rgba(13, 148, 136, 0.1);
    color: #0D9488;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #0D9488;
    border-radius: 50%;
    animation: sync-pulse 2s infinite;
}

/* HERO SECTION */
.sync-hero {
    text-align: center;
    margin-bottom: 60px;
}

.sync-main-title {
    font-size: 3rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -1.5px;
    margin-bottom: 15px;
}

.sync-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* GRID Y TARJETAS */
.sync-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: flex-start;
}

.sync-plan-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 28px;
    padding: 40px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sync-plan-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 50px -15px rgba(0, 0, 0, 0.1);
    border-color: #0D9488;
}

.sync-featured {
    border: 2px solid #0D9488;
    transform: scale(1.03);
}

.sync-popular-ribbon {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #0D9488;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 6px;
}

.sync-plan-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 15px;
}

.sync-price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.sync-amount {
    font-size: 3rem;
    font-weight: 800;
    color: #0f172a;
}

.sync-currency {
    font-size: 1.2rem;
    color: #64748b;
}

.sync-suffix {
    color: #64748b;
    font-size: 0.9rem;
}

.sync-card-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 30px 0;
}

.sync-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    flex-grow: 1;
}

.sync-feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #334155;
}

.sync-feature-list i {
    color: #0D9488;
    font-size: 1rem;
}

.sync-wa-highlight {
    font-weight: 700;
    color: #0D9488 !important;
}

/* BOTÓN DE ACCIÓN */
.sync-action-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background-color: #0f172a;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.sync-featured .sync-action-btn {
    background-color: #0D9488;
}

.sync-action-btn:hover {
    background-color: #000000;
    transform: scale(1.02);
}

.sync-action-btn:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* ANIMACIONES */
@keyframes sync-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(13, 148, 136, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
    }
}

/* --- RESPONSIVE PRICING SECTION --- */

@media (max-width: 1024px) {
    .sync-pricing-wrapper {
        /* Reducimos el espacio del sidebar en tablets */
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    .sync-pricing-wrapper {
        /* En móviles eliminamos el desplazamiento lateral del sidebar */
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 40px;
        align-items: center;
        /* Centramos el contenido en móvil */
    }

    .bg-blur-teal {
        width: 300px;
        height: 300px;
    }

    /* Ajuste del Header de Estado */
    .sync-user-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
        width: 100%;
    }

    .sync-status-box {
        flex-direction: column;
        gap: 10px;
    }

    /* Ajuste del Hero (Títulos) */
    .sync-main-title {
        font-size: 2rem;
        /* Título más pequeño para que no rompa */
        letter-spacing: -1px;
    }

    .sync-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }

    /* Ajuste de las Tarjetas */
    .sync-cards-grid {
        justify-content: center;
        /* Centramos las cards al apilarse */
        gap: 20px;
    }

    .sync-plan-card {
        width: 100%;
        /* Las tarjetas ocupan todo el ancho disponible */
        max-width: 400px;
        /* Pero no se deforman en pantallas medianas */
        padding: 30px 20px;
    }

    .sync-featured {
        transform: scale(1);
        /* Eliminamos el scale en móvil para evitar desbordamientos */
        order: -1;
        /* OPCIONAL: Empuja el plan destacado al principio de la lista */
    }

    .sync-featured:hover {
        transform: translateY(-5px);
        /* Un hover más sutil en móvil */
    }

    .sync-amount {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .sync-main-title {
        font-size: 1.75rem;
    }

    .sync-plan-card {
        padding: 25px 15px;
    }
}

/* ==========================================================================
   servicios.html
   ========================================================================== */

.servicios-section .centered-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Control de anchos en Desktop */
.servicios-section .custom-table {
    table-layout: fixed;
    width: 100%;
}

/* Columna: Servicio */
.servicios-section .custom-table th:nth-child(1),
.servicios-section .custom-table td:nth-child(1) {
    width: 45%;
}

/* Columna: Precio */
.servicios-section .custom-table th:nth-child(2),
.servicios-section .custom-table td:nth-child(2) {
    width: 20%;
}

/* Columna: Fecha Actualización */
.servicios-section .custom-table th:nth-child(3),
.servicios-section .custom-table td:nth-child(3) {
    width: 20%;
}

/* Columna: Acciones */
.servicios-section .custom-table th:nth-child(4),
.servicios-section .custom-table td:nth-child(4) {
    text-align: center;
    width: 15%;
}

.servicios-section .actions-wrapper {
    display: flex;
    /* Activa Flexbox */
    justify-content: center;
    /* Centra horizontalmente */
    align-items: center;
    /* Centra verticalmente */
    gap: 15px;
    /* Espacio uniforme entre los botones */
    width: 100%;
    /* Asegura que ocupe todo el ancho de la celda */
}

.servicios-section table td[data-label="Acciones"] {
    text-align: center;
    vertical-align: middle;
}

/* Botones de acción */
.servicios-section .btn-edit-servicios,
.servicios-section .btn-danger {
    background: none;
    border: none;
    cursor: pointer;
    /* Área de clic más cómoda */
    font-size: 1.1rem;
    /* Tamaño uniforme para el icono */
    transition: transform 0.2s, filter 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.servicios-section .btn-edit-servicios {
    color: #f59e0b;
}

.servicios-section .btn-danger {
    color: #dc3545;
}

.servicios-section .btn-edit-servicios:hover,
.servicios-section .btn-danger:hover {
    transform: scale(1.2);
    filter: brightness(1.1);
}

/* Buscador */
.servicios-section .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
    max-width: 100%;
}

.servicios-section .search-bar i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
}

.servicios-section .search-bar input {
    width: 100% !important;
    height: 42px;
    padding: 10px 15px 10px 40px !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* MODALES RESPONSIVE PARA SERVICIOS */
.modal-overlay.servicios-section {
    position: fixed;
    top: 0;
    left: 280px;
    /* Default desktop con sidebar */
    width: calc(100vw - 280px);
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.modal-overlay.servicios-section .modal-content {
    background: #ffffff;
    width: 90%;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.servicios-section .modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 2rem;
}



/* --- MEDIA QUERIES (MÓVIL) --- */
@media (max-width: 768px) {
    .modal-overlay.servicios-section {
        left: 0 !important;
        width: 100vw !important;
    }

    .dashboard-content.servicios-section {
        margin-left: 0 !important;
        width: 95% !important;
        margin: 10px auto !important;
    }

    /* Tabla responsiva tipo Card */
    .servicios-section .custom-table,
    .servicios-section .custom-table thead,
    .servicios-section .custom-table tbody,
    .servicios-section .custom-table tr,
    .servicios-section .custom-table td {
        display: block;
        width: 100% !important;
    }

    .servicios-section .custom-table thead {
        display: none;
    }

    .servicios-section .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 10px;
        background: #fff;
    }

    .servicios-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f1f5f9;
    }

    .servicios-section .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748b;
        font-size: 0.8rem;
    }

    .servicios-section .custom-table td[data-label="Acciones"]::before {
        display: none;
    }

    .servicios-section .custom-table td[data-label="Acciones"] {
        justify-content: center !important;
        padding-top: 1rem !important;
        border-bottom: none;
    }

    .servicios-section .header-actions {
        flex-direction: column;
        gap: 10px;
    }

    .servicios-section .search-bar {
        width: 100% !important;
    }


    .servicios-section #btnNuevoServicio {
        width: 60% !important;
        max-width: 300px;
    }
}

/* ==========================================================================
   gastos.html
   ========================================================================== */

/* --- ESTILOS EXCLUSIVOS PARA GASTOS --- */

.gastos-section .centered-actions {
    display: flex;
    justify-content: center;
}

.gastos-section .custom-table {
    table-layout: fixed;
    width: 100%;
}

/* Fecha */
.gastos-section .custom-table th:nth-child(1),
.gastos-section .custom-table td:nth-child(1) {
    width: 15%;
}

/* Descripcion */
.gastos-section .custom-table th:nth-child(2),
.gastos-section .custom-table td:nth-child(2) {
    width: 15%;
}

/* Categoría */
.gastos-section .custom-table th:nth-child(3),
.gastos-section .custom-table td:nth-child(3) {
    width: 15%;
}

/* Monto */
.gastos-section .custom-table th:nth-child(4),
.gastos-section .custom-table td:nth-child(4) {
    width: 15%;
}

/* Método */
.gastos-section .custom-table th:nth-child(5),
.gastos-section .custom-table td:nth-child(5) {
    width: 15%;
}

/* Registrado por */
.gastos-section .custom-table th:nth-child(6),
.gastos-section .custom-table td:nth-child(6) {
    width: 15%;
}

/* Acciones */
.gastos-section .custom-table th:nth-child(7),
.gastos-section .custom-table td:nth-child(7) {
    width: 10%;
}

/* Acciones */

/* Fila de filtros */
.gastos-section .filter-row td {
    padding: 5px 10px !important;
    background: #f8fafc;
}

.gastos-section .filter-row input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.gastos-section .filter-row input:focus {
    border-color: var(--primary-color);
}

/* Estilos de datos */
.gastos-section .monto-negativo {
    color: #ef4444;
    font-weight: 700;
}

.gastos-section .badge-categoria {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.gastos-section .btn-danger {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.gastos-section .btn-danger:hover {
    transform: scale(1.2);
}

/* Modal Ajustes */
/* 1. Limitamos el ancho del modal */
.modal-overlay.gastos-section {
    position: fixed;
    top: 0;
    left: 280px;
    /* Se alinea después del sidebar */
    width: calc(100% - 280px);
    /* Ocupa el resto de la pantalla */
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    /* Fondo oscuro semi-transparente */
    backdrop-filter: blur(4px);
    z-index: 9999;

    /* CENTRADO ABSOLUTO */
    display: none;
    /* Se activa con JS como 'flex' */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* El cuadro blanco del Modal */
.modal-overlay.gastos-section .modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 550px;
    /* Evita que se vea gigante */
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s ease-out;
}

/* Animación de entrada */
@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Estructura del Formulario Interno */
.gastos-section .grid-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Dos columnas iguales */
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.gastos-section .full-width {
    grid-column: span 2;
    /* Descripción ocupa todo el ancho */
}

/* Estilo de los Inputs para que se vean alineados */
.gastos-section .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gastos-section .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.gastos-section .form-control {
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    /* Crucial para que no se desborde */
}

/* Footer de botones */
.modal-overlay.gastos-section .modal-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}


/* Responsive */
/* --- RESPONSIVE DESIGN --- */

@media (max-width: 1024px) {

    /* Si el sidebar se oculta o encoge, ajustamos el modal */
    .modal-overlay.gastos-section {
        left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {

    /* 1. Ajustes del Contenedor Principal */
    .gastos-section {
        padding: 10px;
    }

    /* 2. Transformación de la Tabla en "Cards" */
    .gastos-section .custom-table thead {
        display: none;
        /* Ocultamos los encabezados reales */
    }

    .gastos-section .custom-table,
    .gastos-section .custom-table tbody,
    .gastos-section .custom-table tr,
    .gastos-section .custom-table td {
        display: block;
        width: 100% !important;
    }

    .gastos-section .custom-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #fff;
        padding: 15px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }

    .gastos-section .custom-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0 !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
        font-size: 0.9rem;
    }

    .gastos-section .custom-table td:last-child {
        border-bottom: none;
        justify-content: center;
        /* Centramos las acciones */
        padding-top: 15px !important;
    }

    /* 3. Inyección de etiquetas dinámicas */
    .gastos-section .custom-table td::before {
        content: attr(data-label);
        /* Usa el atributo data-label del HTML */
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        font-size: 0.75rem;
        margin-right: 15px;
        text-align: left;
    }

    /* 4. Ajustes del Modal en Móvil */
    .modal-overlay.gastos-section .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 10px;
    }

    .gastos-section .grid-form {
        grid-template-columns: 1fr;
        /* Una sola columna en el formulario */
        gap: 1rem;
    }

    .gastos-section .full-width {
        grid-column: span 1;
    }

    /* 5. Filtros */
    .gastos-section .filter-row {
        display: none;
        /* Mejor ocultar la fila de filtros tipo tabla en móvil */
    }
}

.gastos-section .filter-row select,
.gastos-section .filter-row input[type="date"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #475569;
    background-color: white;
    outline: none;
}

.gastos-section .filter-row select:focus,
.gastos-section .filter-row input:focus {
    border-color: #0d9488;
}

/* ==========================================================================
   facturacion.html
   ========================================================================== */


.facturacion-section .custom-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Esto es clave para que los anchos se respeten */
}

/* Control de tamaños de columnas */

/* 1. Emisión */
.facturacion-section .custom-table th:nth-child(1),
.facturacion-section .custom-table td:nth-child(1) {
    width: 20%;
}

/* 2. UUID / Folio */
.facturacion-section .custom-table th:nth-child(2),
.facturacion-section .custom-table td:nth-child(2) {
    width: 25%;
    /* Más espacio para el UUID largo */
    word-break: break-all;
    text-align: center;
}

/* 3. Total (El que mencionaste) */
.facturacion-section .custom-table th:nth-child(3),
.facturacion-section .custom-table td:nth-child(3) {
    width: 20%;
}

/* 4. Estado */
.facturacion-section .custom-table th:nth-child(4),
.facturacion-section .custom-table td:nth-child(4) {
    width: 10%;
}

/* 5. Acciones */
.facturacion-section .custom-table th:nth-child(5),
.facturacion-section .custom-table td:nth-child(5) {
    width: 25%;
    text-align: center;
}

/* Prefijo ss-fact para evitar conflictos */
.ss-fact-main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 15px;
}

.ss-fact-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e0e6ed;
}

.ss-fact-shadow {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.ss-fact-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.ss-fact-bg-dark {
    background: #0f172a;
    color: #fff;
    border-radius: 10px 10px 0 0;
}

.ss-fact-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.ss-fact-title2 {
    color: #ffffff;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

/* Grid Form */
.ss-fact-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
}


.ss-fact-full-width {
    grid-column: span 2;
}

.ss-fact-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 0.5rem;
    display: block;
}

.ss-fact-input-text {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    transition: border 0.3s;
}

.ss-fact-input-text:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Table */
.ss-fact-table-overflow {
    overflow-x: auto;
}

.ss-fact-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ss-fact-data-table th {
    padding: 1rem;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.ss-fact-data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

/* Action Buttons */
/* --- Estilos para la Celda de Acciones --- */
.actions-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    /* Espacio entre iconos */
}

/* Base común para todos los botones de acción */
.ss-fact-icon-link,
.ss-fact-icon-btn {
    background: transparent;
    border: none;
    padding: 3px;
    cursor: pointer;
    font-size: 1.1rem;
    /* Tamaño del icono */
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Efecto hover general: un fondo suave y ligera elevación */
.ss-fact-icon-link:hover,
.ss-fact-icon-btn:hover {
    transform: translateY(-2px);
    background-color: #f8f9fa;
}

/* --- Colores Específicos por Icono --- */

/* PDF - Rojo */
.ss-pdf {
    color: #e74c3c;
}

.ss-pdf:hover {
    color: #c0392b;
    background-color: #fdedec;
}

/* XML - Gris Oscuro / Código */
.ss-xml {
    color: #34495e;
}

.ss-xml:hover {
    color: #2c3e50;
    background-color: #ebedef;
}

/* Email - Azul */
.ss-email {
    color: #3498db;
}

.ss-email:hover {
    color: #2980b9;
    background-color: #ebf5fb;
}

/* WhatsApp - Verde */
.ss-whatsapp {
    color: #27ae60;
}

.ss-whatsapp:hover {
    color: #219150;
    background-color: #eafaf1;
}

/* Cancelar/Eliminar - Gris que cambia a Rojo */
.ss-cancel {
    color: #95a5a6;
}

.ss-cancel:hover {
    color: #e74c3c;
    background-color: #fdedec;
}

/* Ajuste para el icono de WhatsApp si usas la versión 'brands' */
.fab.fa-whatsapp {
    font-weight: 400;
}

/* Alerta */
.ss-fact-alert-warning {
    background: #fff7ed;
    border-left: 4px solid #f97316;
    color: #9a3412;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.ss-fact-btn-save {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.ss-fact-btn-save:hover {
    background: #2563eb;
}

.uppercase-input {
    text-transform: uppercase;
}

/* Opcional: un estilo para que resalte cuando esté enfocado */
.ss-fact-input-text:focus {
    text-transform: uppercase;
    border-color: #3498db;
    outline: none;
}

.input-password-normal {
    text-transform: none !important;
}

#ss-fact-js-input-password {
    text-transform: none !important;
}

/* Evita que el usuario seleccione el icono como texto */
#ss-fact-js-toggle-eye {
    user-select: none;
    transition: color 0.2s ease;
}

@media screen and (max-width: 768px) {

    /* 1. Forzar Formulario a 1 columna */
    .ss-fact-grid-layout {
        grid-template-columns: 1fr !important;
        padding: 1rem !important;
    }

    .ss-fact-full-width {
        grid-column: span 1 !important;
    }

    /* 2. Destruir por completo la estructura de tabla */
    .facturacion-section .custom-table,
    .ss-fact-data-table,
    .ss-fact-data-table thead,
    .ss-fact-data-table tbody,
    .ss-fact-data-table tr,
    .ss-fact-data-table th,
    .ss-fact-data-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 3. Esconder encabezados superiores */
    .ss-fact-data-table thead {
        display: none !important;
    }

    /* 4. Convertir cada fila (tr) en una tarjeta independiente */
    .ss-fact-data-table tr {
        margin-bottom: 1.5rem !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    /* 5. Alinear datos en cada "renglón" de la tarjeta */
    .ss-fact-data-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        text-align: right !important;
        padding: 12px 15px !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    /* Quitar borde a la última celda de acciones y centrarla */
    .ss-fact-data-table td:last-child {
        border-bottom: none !important;
        justify-content: center !important;
        background-color: #f8fafc;
    }

    /* 6. Inyectar la etiqueta (Emisión, Total, etc.) a la izquierda */
    .ss-fact-data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: #64748b;
        text-align: left;
        margin-right: 15px;
        flex-shrink: 0;
    }

    /* 7. Controlar el UUID para que no desborde la pantalla */
    .facturacion-section .custom-table td:nth-child(2) {
        word-break: break-all !important;
        font-size: 0.85rem;
    }

    /* Centrar botones de acción */
    .actions-wrapper {
        width: 100%;
        justify-content: center !important;
    }
}

/* ==========================================================================
   ESTILOS RESCATADOS DE dashboard.css
   (Citas Timeline, Filtros, Modal Pago, Tooltips)
   ========================================================================== */

/* --- TIMELINE / AGENDA VIEW --- */
.agenda-view-container { margin-top: 20px; }

.view-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.timeline-viewport {
    height: 700px;
    overflow-y: auto;
    position: relative;
    background: var(--slate-50, #f8fafc);
    cursor: crosshair;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.5rem;
    position: relative;
    min-height: 100%;
}

.cita-card.filtered-out { display: none !important; }

.cita-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: grid;
    grid-template-columns: 0.5fr 1.5fr 1fr 1.5fr 0.8fr;
    align-items: center;
    padding: 1.25rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    gap: 15px;
}

.cita-card:hover {
    transform: translateX(8px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.cita-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    height: 100%; width: 6px;
    background: #94a3b8;
    transition: width 0.3s ease;
}

.cita-card:hover::before { width: 10px; }
.cita-card:has(.programada)::before { background: #3b82f6; }
.cita-card:has(.confirmada)::before { background: #10b981; }

.hora-badge {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}

.hora-badge i { font-size: 0.8rem; color: #475569; margin-bottom: 4px; }

.info-principal { display: flex; flex-direction: column; gap: 4px; }
.info-secundaria { display: flex; flex-direction: column; gap: 8px; }

.paciente-nombre {
    margin: 0; font-size: 1.2rem; font-weight: 700; color: #0f172a;
    display: flex; align-items: center; gap: 10px;
}

.detalle-item {
    font-size: 0.95rem; margin: 0; color: #475569;
    display: flex; align-items: center; gap: 8px;
}

.detalle-item .label {
    font-weight: 600; color: #94a3b8;
    text-transform: uppercase; font-size: 0.7rem; margin-right: 4px;
}

.status-pill {
    width: fit-content; padding: 6px 12px; border-radius: 8px;
    font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
}

.status-pill.programada { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.status-pill.confirmada { background: #f0fdf4; color: #0D9488; border: 1px solid #99f7ef; }

/* --- FILTROS TIMELINE --- */
.filters-container {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    background: white; padding: 15px; border-radius: 16px;
    border: 1px solid #e2e8f0; margin-bottom: 20px;
}

.search-wrapper { flex: 2; min-width: 250px; }
#searchPacienteTimeline { width: 100%; padding-left: 35px; }
#filterMEDICOTimeline { flex: 1.2; min-width: 180px; }
#filterEstadoTimeline { flex: 0.8; min-width: 150px; }
.filter-date-wrapper { flex: 1.5; display: flex; gap: 8px; min-width: 300px; }
#filterFechaTimeline { flex: 1; border: 1.5px solid #e2e8f0; font-weight: 600; color: #1e293b; transition: all 0.3s ease; }
#filterFechaTimeline:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); outline: none; }

#btnAllDates {
    flex: 1; white-space: nowrap;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1.5px solid #e2e8f0; color: #475569; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px; font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 20px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer; position: relative; overflow: hidden;
}

#btnAllDates:hover { background: #1e293b; color: #fff; border-color: #1e293b; transform: translateY(-1px); }
#btnAllDates i { font-size: 0.9rem; transition: transform 0.3s ease; }
#btnAllDates:hover i { transform: scale(1.1) rotate(-5deg); color: #3b82f6; }
#btnAllDates:active { transform: translateY(0); filter: brightness(0.9); }

.no-results-container {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; background: rgba(248, 250, 252, 0.5);
    border: 2px dashed #e2e8f0; border-radius: 20px; color: #64748b;
    text-align: center; margin-top: 20px; animation: fadeIn 0.4s ease-out;
}

.no-results-container i { font-size: 3rem; color: #cbd5e1; margin-bottom: 15px; }
.no-results-container p { font-size: 1.1rem; font-weight: 700; color: #334155; margin: 0; }
.no-results-container span { font-size: 0.9rem; color: #94a3b8; margin-top: 5px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Fecha pill */
.fecha-container { display: flex; align-items: center; justify-content: center; padding: 0 10px; }
.fecha-pill { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; padding: 6px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.fecha-pill i { color: #3b82f6; font-size: 0.9rem; }

/* SweetAlert2 Custom */
.my-loading-modal .swal2-actions, .my-loading-modal .swal2-confirm,
.my-loading-modal .swal2-cancel, .my-loading-modal .swal2-deny { display: none !important; }
.my-loading-modal .swal2-loader { display: flex !important; border-color: #3b82f6 transparent #3b82f6 transparent !important; }
.my-loading-modal .swal2-actions { display: flex !important; visibility: visible !important; }
.swal2-container { z-index: 10001 !important; }
.swal2-styled { display: flex; align-items: center; gap: 8px; padding: 12px 24px !important; font-weight: 600 !important; border-radius: 12px !important; transition: transform 0.2s ease; }
.swal2-styled:hover { transform: scale(1.05); }
.swal2-loader { border-color: #3b82f6 transparent #3b82f6 transparent !important; }

/* Tooltip de ayuda */
.help-tooltip-container { position: relative; display: inline-flex; align-items: center; }
.help-icon { color: #94a3b8; transition: color 0.2s ease; }
.help-icon:hover { color: #6366f1; }

.help-tooltip-content {
    display: none; position: absolute; bottom: 180%; left: 50%; transform: translateX(-50%);
    width: 360px; background: rgba(255,255,255,0.8); backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); color: #475569; padding: 12px 16px;
    border-radius: 12px; border: 1px solid rgba(0,0,0,0.08); font-size: 0.85rem;
    line-height: 1.5; z-index: 100; box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    pointer-events: none; animation: fadeInTooltip 0.3s ease-out;
}

@keyframes fadeInTooltip {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.help-tooltip-content::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px;
    border-width: 6px; border-style: solid;
    border-color: rgba(255,255,255,0.8) transparent transparent transparent;
}

.help-tooltip-container:hover .help-tooltip-content { display: block; }

/* Modal Footer Helpers */
.modal-footer-centered { display: flex; justify-content: center; align-items: center; gap: 15px; padding: 20px 0; width: 100%; border-top: 1px solid #f0f0f0; margin-top: 15px; }

/* Botones de cantidad en modal pago */
.btn-cantidad { width: 28px; height: 28px; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; cursor: pointer; font-weight: 700; transition: all 0.2s; }
.btn-cantidad:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-delete-small { background: none; border: none; color: #ef4444; cursor: pointer; padding: 4px; border-radius: 6px; transition: background 0.2s; }
.btn-delete-small:hover { background: #fef2f2; }

/* ==========================================================================
   ESTILOS RESCATADOS DE super-admin.css
   (Clases ._zsa_* para el panel super admin)
   ========================================================================== */

:root {
    --zsa-accent: #6366f1;
    --zsa-accent-soft: rgba(99, 102, 241, 0.08);
    --zsa-bg: #f3f4f6;
    --zsa-card: rgba(255, 255, 255, 0.9);
    --zsa-text-h: #111827;
    --zsa-text-p: #6b7280;
    --zsa-border: #e5e7eb;
    --zsa-success: #10b981;
    --zsa-warning: #f59e0b;
    --zsa-danger: #ef4444;
}

._zsa_master_root { background: radial-gradient(at top left, #ffffff, #f3f4f6); font-family: 'Plus Jakarta Sans', sans-serif; color: var(--zsa-text-p); margin: 0; min-height: 100vh; }
._zsa_viewport { margin-left: 280px; padding: 2.5rem; }
._zsa_hero_header { margin-bottom: 3rem; }
._zsa_header_content { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.5rem; }
._zsa_badge_top { background: var(--zsa-accent-soft); color: var(--zsa-accent); padding: 0.4rem 1rem; border-radius: 100px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
._zsa_main_title { color: var(--zsa-text-h); font-size: 2.5rem; font-weight: 800; margin: 0.8rem 0; }

._zsa_glass_input { background: var(--zsa-card); backdrop-filter: blur(10px); border: 1px solid var(--zsa-border); padding: 0.8rem 1.2rem; border-radius: 16px; display: flex; align-items: center; width: 400px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
._zsa_glass_input i { color: var(--zsa-accent); }
._zsa_glass_input input { background: transparent; border: none; color: var(--zsa-text-h); margin-left: 12px; width: 100%; outline: none; }
._zsa_glass_input input::placeholder { color: var(--zsa-text-p); }
._zsa_kbd { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.75rem; padding: 2px 6px; font-family: monospace; }

._zsa_stats_grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
._zsa_stat_card { background: var(--zsa-card); border: 1px solid var(--zsa-border); padding: 1.5rem; border-radius: 20px; display: flex; align-items: center; gap: 1.2rem; transition: transform 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); }
._zsa_stat_card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }
._zsa_stat_icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
._zsa_bg_blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
._zsa_bg_green { background: rgba(16,185,129,0.1); color: #10b981; }
._zsa_bg_purple { background: rgba(168,85,247,0.1); color: #a855f7; }
._zsa_stat_val { display: block; font-size: 1.5rem; font-weight: 700; color: var(--zsa-text-h); }
._zsa_stat_label { font-size: 0.9rem; color: var(--zsa-text-p); }

._zsa_glass_card { background: var(--zsa-card); backdrop-filter: blur(12px); border: 1px solid var(--zsa-border); border-radius: 24px; padding: 1.5rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.03); }
._zsa_table_header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding: 0 1rem; }
._zsa_card_title { color: var(--zsa-text-h); font-weight: 700; margin: 0; }
._zsa_btn_export { background: white; border: 1px solid var(--zsa-border); color: var(--zsa-text-p); padding: 0.6rem 1.2rem; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: all 0.2s; }
._zsa_btn_export:hover { background: #f9fafb; border-color: #d1d5db; }

._zsa_table { width: 100%; border-collapse: separate; border-spacing: 0 0.8rem; }
._zsa_table th { padding: 1rem; font-size: 0.75rem; text-transform: uppercase; color: var(--zsa-text-p); letter-spacing: 1px; text-align: left; }
._zsa_table_row { background: white; transition: all 0.2s ease, transform 0.2s ease; }
._zsa_table_row:hover { background: #fdfdfd; transform: scale(1.005); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); }
._zsa_table_row td { padding: 1.2rem 1rem; border-top: 1px solid var(--zsa-border); border-bottom: 1px solid var(--zsa-border); color: var(--zsa-text-h); }
._zsa_table_row td:first-child { border-left: 1px solid var(--zsa-border); border-radius: 12px 0 0 12px; }
._zsa_table_row td:last-child { border-right: 1px solid var(--zsa-border); border-radius: 0 12px 12px 0; }

._zsa_user_cell { display: flex; gap: 1rem; align-items: center; }
._zsa_avatar { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.1rem; }
._zsa_user_meta { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
._zsa_name { color: var(--zsa-text-h); font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
._zsa_sub { font-size: 0.8rem; color: var(--zsa-text-p); font-weight: 500; }
._zsa_tag { background: var(--zsa-accent-soft); color: var(--zsa-accent); padding: 0.3rem 0.8rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; }
._zsa_plan_name { font-weight: 600; color: var(--zsa-text-h); display: block; }
._zsa_reg_date { font-size: 0.8rem; color: var(--zsa-text-p); }

._zsa_status_dot { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; }
._zsa_dot { width: 8px; height: 8px; border-radius: 50%; position: relative; }
._zsa_dot::after { content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%; animation: _zsa_pulse 2s infinite; }
._zsa_dot_success { color: var(--zsa-success); } ._zsa_dot_success ._zsa_dot { background: var(--zsa-success); } ._zsa_dot_success ._zsa_dot::after { background: var(--zsa-success); }
._zsa_dot_warning { color: var(--zsa-warning); } ._zsa_dot_warning ._zsa_dot { background: var(--zsa-warning); } ._zsa_dot_warning ._zsa_dot::after { background: var(--zsa-warning); }
._zsa_dot_danger { color: var(--zsa-danger); } ._zsa_dot_danger ._zsa_dot { background: var(--zsa-danger); } ._zsa_dot_danger ._zsa_dot::after { background: var(--zsa-danger); }

@keyframes _zsa_pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.5); opacity: 0; } }

._zsa_action_group { display: flex; gap: 8px; justify-content: flex-end; }
._zsa_btn_tool { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--zsa-border); background: white; color: var(--zsa-text-p); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
._zsa_btn_tool:hover { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
._zsa_tool_view:hover { background: var(--zsa-accent-soft); color: var(--zsa-accent); border-color: var(--zsa-accent); }
._zsa_tool_ban:hover { background: rgba(239,68,68,0.08); color: var(--zsa-danger); border-color: var(--zsa-danger); }
._zsa_text_right { text-align: right; }
._zsa_col_id { color: var(--zsa-accent); font-weight: 600; font-family: monospace; }
._zsa_email_wrapper { display: flex; align-items: center; gap: 8px; }
._zsa_email_icon { font-size: 0.85rem; color: var(--zsa-accent); opacity: 0.6; }
._zsa_tag_email { background: #f8fafc; color: var(--zsa-text-h); padding: 0.4rem 0.7rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; border: 1px solid var(--zsa-border); transition: all 0.2s ease; }
._zsa_table_row:hover ._zsa_tag_email { border-color: var(--zsa-accent); color: var(--zsa-accent); }

/* ==========================================================================
   SISTEMA RESPONSIVO ESTANDARIZADO
   Breakpoints unificados (reemplaza los 6 inconsistentes anteriores)
   XS: <480px | SM: <768px | MD: <1024px | LG: <1280px
   ========================================================================== */

/* --- BACKDROP DEL SIDEBAR (visible cuando el menú está abierto en móvil) --- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-backdrop.active { display: block; }

/* --- MD: Tablets (max-width: 1024px) --- */
@media (max-width: 1024px) {
    /* Filtros timeline en columna */
    .filters-container { flex-direction: column; align-items: stretch; }
    .search-wrapper, #filterMEDICOTimeline, #filterEstadoTimeline, .filter-date-wrapper { flex: 1; width: 100%; }

    /* Cita card en 2 columnas */
    .cita-card { grid-template-columns: 80px 1fr; gap: 1rem; padding: 1.25rem; }
    .info-secundaria, .info-accion { grid-column: span 2; }

    /* Super admin viewport */
    ._zsa_viewport { margin-left: 0; padding: 1.5rem; padding-top: 80px; }
    ._zsa_stats_grid { grid-template-columns: repeat(2, 1fr); }
    ._zsa_glass_input { width: 100%; }
}

/* --- SM: Móviles (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Dashboard body */
    .dashboard-body { flex-direction: column; }

    /* Content header simplificado */
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding-top: 60px;
    }

    .header-actions { width: 100%; justify-content: flex-end; }

    /* Stats en 2 columnas ajustadas */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    /* Cita card en 1 columna (stack) */
    .cita-card {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 0.75rem;
    }

    .cita-card .hora-badge { display: inline-flex; width: auto; }

    /* Tablas con scroll horizontal */
    .table-wrapper, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Modales full-screen en móvil */
    .modal-overlay { align-items: flex-end !important; }
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 90vh !important;
        overflow-y: auto;
    }

    /* Super admin */
    ._zsa_stats_grid { grid-template-columns: 1fr; }
    ._zsa_header_content { flex-direction: column; align-items: flex-start; gap: 1rem; }
    ._zsa_action_group { justify-content: flex-start; }

    /* Filtros de fecha en stack */
    .filter-date-wrapper { flex-direction: column; min-width: unset; }

    /* Auth pages responsive */
    .auth-container { grid-template-columns: 1fr; }
    .auth-sidebar { display: none; }
    .auth-form-section { padding: 2rem 1.5rem; }

    /* Formularios: 1 columna */
    .form-row, .form-row-2, .form-row-3, .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    /* Config wrapper */
    .config-wrapper .form-grid { grid-template-columns: 1fr; }
    .config-wrapper .subscription-status-box { flex-direction: column; gap: 1rem; }
    .config-wrapper .config-card { padding: 1.2rem; }

    /* Timeline viewport reducido */
    .timeline-viewport { height: 400px; }

    /* no-results */
    .no-results-container { padding: 30px 15px; }
}

/* --- XS: Móviles pequeños (max-width: 480px) --- */
@media (max-width: 480px) {
    /* Stats en 1 columna */
    .stats-grid { grid-template-columns: 1fr; }

    /* Contenido principal sin padding lateral excesivo */
    .dashboard-content { padding: 1rem; padding-top: 70px; }

    /* Botones de acción a todo el ancho */
    .btn-full, .btn-save, .btn-logout { width: 100%; }

    /* Requisitos de contraseña en lista */
    .password-requirements { flex-direction: column; gap: 5px; }

    /* Sidebar: ancho reducido en pantallas muy pequeñas */
    .dashboard-sidebar { width: 260px; }

    /* Auth sidebar h1 más pequeño */
    .auth-sidebar h1 { font-size: 1.8rem; }

    /* Reducir padding de modales */
    .modal-content { padding: 1.25rem !important; }

    /* Cita card compacto */
    .cita-card { padding: 0.75rem; font-size: 0.9rem; }
    .paciente-nombre { font-size: 1rem; }

    /* Texto de welcome */
    .welcome-text h1 { font-size: 1.4rem; }

    /* Super admin grids */
    ._zsa_stats_grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ==========================================================================
   clinica-config.html — Mi Perfil y Configuración
   ========================================================================== */

.config-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.config-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-title i {
    font-size: 1.1rem;
    color: var(--primary);
    flex-shrink: 0;
}

.form-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Grids de formulario: 1, 2 y 3 columnas */
.form-row-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Input de solo lectura */
.input-readonly {
    background: #f8fafc !important;
    color: #64748b !important;
    cursor: not-allowed;
    border-color: #e2e8f0 !important;
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.input-group-phone {
    display: flex;
    align-items: center;
}

.input-group-phone input {
    flex: 1;
}

/* Botón principal de guardar config */
.btn-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--btn-radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.3);
}

/* ==========================================================================
   suscripciones.html — Planes y Pagos
   ========================================================================== */

.sync-pricing-wrapper {
    position: relative;
    overflow: hidden;
}

.bg-blur-teal {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
    border-radius: 50%;
}

.sync-main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.sync-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.sync-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.sync-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

.sync-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sync-plan-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sync-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

.sync-featured {
    border: 2px solid #0d9488;
    box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.2);
}

.sync-popular-ribbon {
    position: absolute;
    top: 18px;
    right: -28px;
    background: linear-gradient(135deg, #0d9488, #0ea5e9);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 5px 40px;
    transform: rotate(45deg);
    text-transform: uppercase;
}

.sync-card-top {
    text-align: center;
    margin-bottom: 1rem;
}

.sync-plan-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.sync-price-wrapper {
    margin: 1rem 0;
}

.sync-currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
    align-self: flex-start;
    margin-top: 6px;
}

.sync-amount {
    font-size: 2.8rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -1px;
    line-height: 1;
}

.sync-suffix {
    font-size: 0.85rem;
    color: #64748b;
    margin-left: 3px;
}

.sync-card-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 1rem 0;
}

.sync-feature-list {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #475569;
}

.sync-feature-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sync-feature-list li i {
    flex-shrink: 0;
    width: 18px;
}

.sync-action-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    border: none;
    cursor: pointer;
    background: #0d9488;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.sync-action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.sync-user-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: #ffffff;
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Responsive específico de clinica-config y suscripciones */
@media (max-width: 768px) {
    .config-wrapper {
        padding: 1rem;
    }

    .config-card {
        padding: 1.25rem;
        border-radius: 14px;
    }

    .section-title {
        font-size: 1rem;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .sync-main-container {
        padding: 1rem;
    }

    .sync-main-title {
        font-size: 1.6rem;
    }

    .sync-hero {
        padding: 1.5rem 0.5rem;
    }

    .sync-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sync-user-header {
        flex-direction: column;
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .sync-main-title {
        font-size: 1.3rem;
    }

    .sync-plan-card {
        padding: 1.25rem;
    }

    .config-card {
        padding: 1rem;
    }
}

/* ==========================================================================
   CORRECCIÓN GLOBAL DE MODALES EN MÓVIL
   Problema: Los overlays tienen left:280px (ancho del sidebar) en desktop.
   En móvil el sidebar se oculta, por lo que el overlay quedaba descentrado.
   Fix: En ≤768px, resetear todos los overlays a left:0 / width:100vw.
   ========================================================================== */
@media (max-width: 768px) {
    .modal-overlay.config-campos-section,
    .modal-overlay.pacientes-section,
    .modal-overlay.personal-section,
    .modal-overlay.inventario-section,
    .modal-overlay.productos-section,
    .modal-overlay.servicios-section,
    .modal-overlay.gastos-section {
        left: 0 !important;
        width: 100vw !important;
        padding: 1rem;
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
    }

    /* Contenido del modal: full-width con margen, scroll si es muy alto */
    .modal-overlay.config-campos-section .modal-content,
    .modal-overlay.config-campos-section .modal-content.modal-lg,
    .modal-overlay.pacientes-section .modal-content,
    .modal-overlay.pacientes-section .modal-content.modal-lg,
    .modal-overlay.personal-section .modal-content,
    .modal-overlay.personal-section .modal-content.modal-lg,
    .modal-overlay.inventario-section .modal-content,
    .modal-overlay.inventario-section .modal-content.modal-lg,
    .modal-overlay.productos-section .modal-content,
    .modal-overlay.productos-section .modal-content.modal-lg,
    .modal-overlay.servicios-section .modal-content,
    .modal-overlay.gastos-section .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1.25rem !important;
        border-radius: 16px !important;
        margin: 0 !important;
    }

    /* Footer de botones en columna en móvil muy pequeño */
    .modal-overlay .modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .modal-overlay .modal-footer .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* En pantallas muy pequeñas el modal es prácticamente full-screen */
    .modal-overlay.config-campos-section,
    .modal-overlay.pacientes-section,
    .modal-overlay.personal-section,
    .modal-overlay.inventario-section,
    .modal-overlay.productos-section,
    .modal-overlay.servicios-section,
    .modal-overlay.gastos-section {
        padding: 0.5rem;
    }

    .modal-overlay.config-campos-section .modal-content,
    .modal-overlay.config-campos-section .modal-content.modal-lg,
    .modal-overlay.pacientes-section .modal-content,
    .modal-overlay.pacientes-section .modal-content.modal-lg,
    .modal-overlay.personal-section .modal-content,
    .modal-overlay.personal-section .modal-content.modal-lg,
    .modal-overlay.inventario-section .modal-content,
    .modal-overlay.inventario-section .modal-content.modal-lg,
    .modal-overlay.productos-section .modal-content,
    .modal-overlay.productos-section .modal-content.modal-lg,
    .modal-overlay.servicios-section .modal-content,
    .modal-overlay.gastos-section .modal-content {
        border-radius: 12px !important;
        padding: 1rem !important;
        max-height: 95vh;
    }
}
