/* Container Reset */
#zentia-consultant-portal {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f4f6f9;
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

#zentia-consultant-portal * {
    box-sizing: border-box;
}

/* --- Auth Screen --- */
.zentia-portal-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
}

.zentia-portal-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-top: 0;
    color: #2c3e50;
}

.login-card p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* --- Dashboard Layout --- */
.zentia-portal-dashboard {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

.portal-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-header .logo-area {
    font-size: 18px;
    font-weight: bold;
}

.portal-header .user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.portal-content {
    display: flex;
    flex: 1;
    background: #f4f6f9;
}

.portal-sidebar {
    width: 200px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px 0;
}

.portal-sidebar .nav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #555;
    transition: all 0.2s;
}

.portal-sidebar .nav-item:hover {
    background: #f0f0f1;
    color: #3498db;
}

.portal-sidebar .nav-item.active {
    background: #e8f4fd;
    color: #3498db;
    border-right: 3px solid #3498db;
    font-weight: 600;
}

.portal-sidebar .dashicons {
    margin-right: 8px;
}

.portal-main {
    flex: 1;
    padding: 30px;
}

/* --- Components --- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.portal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.portal-btn.primary {
    background: #3498db;
    color: white;
}

.portal-btn.primary:hover {
    background: #2980b9;
}

.portal-btn.outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
}

.portal-btn.outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.portal-btn.full-width {
    width: 100%;
}

.portal-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-message {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
}

.form-message.error {
    color: #e74c3c;
}

.form-message.success {
    color: #2ecc71;
}

/* --- Appointments View --- */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-header h3 {
    margin: 0;
    color: #2c3e50;
}

.filters {
    display: flex;
    gap: 5px;
    background: white;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.filter-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.filter-btn.active {
    background: #3498db;
    color: white;
}

.appointments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.appointment-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    transition: transform 0.2s;
}

.appointment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.appt-date {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.appt-date .time {
    font-weight: bold;
    color: #3498db;
}

.appt-details h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #2c3e50;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.contact-link {
    text-decoration: none;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.contact-link:hover {
    color: #3498db;
}

.appt-actions {
    border-top: 1px solid #f0f0f1;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #2ecc71;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

.status-label {
    font-size: 12px;
    font-weight: 600;
}

.status-sold {
    color: #2ecc71;
}

.status-pending {
    color: #95a5a6;
}

/* Responsive */
@media (max-width: 600px) {
    .portal-content {
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        display: flex;
        overflow-x: auto;
    }

    .portal-sidebar nav {
        display: flex;
        width: 100%;
    }

    .portal-sidebar .nav-item {
        border-right: none;
        border-bottom: 3px solid transparent;
        padding: 15px;
        white-space: nowrap;
    }

    .portal-sidebar .nav-item.active {
        border-right: none;
        border-bottom-color: #3498db;
        background: none;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* --- Dashboard View --- */
.date-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.portal-input-date {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 110px;
    font-size: 13px;
}

.portal-btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.stat-card .icon {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #3498db;
}

.stat-card.success .icon {
    color: #2ecc71;
}

.stat-card .info h4 {
    margin: 0;
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card .info .number {
    margin: 5px 0 0 0;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.chart-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* --- WordPress Theme Overrides (MODO AGRESIVO DEFINITIVO) --- */

/* 1. Ocultar elementos del tema (Header, Footer, Sidebar, Admin Bar) */
/* IMPORTANTE: Usamos :not(.portal-header) para NO ocultar la barra del portal */
#wpadminbar,
header:not(.portal-header), 
footer,
#colophon, #masthead,
.site-header, .site-footer,
.widget-area, #secondary,
.sidebar, #sidebar,
.entry-header, .page-header,
.nav-links, .post-navigation,
.comments-area,
.ast-header-breadcrumb {
    display: none !important;
}

/* 2. Resetear el lienzo (Body/HTML) */
html {
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow-x: hidden !important;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #eef2f7 !important; /* Fondo detrás del portal */
    min-height: 100vh !important;
    position: relative !important;
    width: 100vw !important;
    overflow-x: hidden !important;
}

/* 3. Anular contenedores del tema */
#page, .site, .site-content, .content-area, #primary, #content,
.container, .wrap, .site-container, .ast-container,
.entry-content, article, main, .elementor-section, .divi-section {
    position: static !important; /* Romper posicionamiento relativo */
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* 4. El Portal: Flotando sobre todo usando Viewport Units (vw) */
#zentia-consultant-portal {
    position: absolute !important;
    top: 20px !important;
    left: 2.5vw !important; /* Margen izquierdo relativo a la pantalla */
    width: 95vw !important; /* Ancho forzado al 95% de la pantalla */
    min-height: calc(100vh - 40px) !important;
    margin: 0 !important;
    z-index: 99999 !important;
    
    background-color: #f4f6f9 !important;
    border-radius: 12px !important;
    box-shadow: 0 0 40px rgba(0,0,0,0.1) !important;
    
    display: block !important;
    right: auto !important; /* Evitar conflictos */
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    #zentia-consultant-portal {
        top: 10px !important;
        left: 2vw !important;
        width: 96vw !important;
        min-height: calc(100vh - 20px) !important;
    }
}

/* 5. Ajustar el contenedor interno */
.zentia-portal-dashboard {
    width: 100%;
    height: 100%;
}