/**
 * Vistas del Zapote - Premium Postventa Dashboard CSS
 */

:root {
    --vzw-primary: #7a1815; /* Corporate Deep Red */
    --vzw-primary-light: #9e2a2b;
    --vzw-secondary: #2d3a20; /* Corporate Earthy Green */
    --vzw-accent: #10b981;
    --vzw-accent-warn: #f59e0b;
    --vzw-accent-danger: #ef4444;
    --vzw-bg-card: rgba(255, 255, 255, 0.9);
    --vzw-text: #1e293b;
    --vzw-text-muted: #64748b;
    --vzw-border: #e2e8f0;
    --vzw-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --vzw-radius: 16px;
}

.vzw-dashboard-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--vzw-text);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--vzw-shadow);
    margin: 30px auto;
    max-width: 1600px;
    display: flex;
    gap: 30px;
    min-height: 600px;
    box-sizing: border-box;
}

/* Adjust dynamically if the WordPress Admin Bar is active */
body.admin-bar .vzw-dashboard-wrapper {
    margin-top: 32px !important;
}

/* Hide front-end builder mouseover overlays blocking dashboard interaction */
#bt_bb_fe_init_mouseover {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}

/* WP Login Form customization inside portal */
#vzw-loginform {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

#vzw-loginform p {
    margin: 0;
}

#vzw-loginform label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--vzw-secondary);
}

#vzw-loginform input[type="text"],
#vzw-loginform input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--vzw-border);
    background: #ffffff;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

#vzw-loginform input[type="text"]:focus,
#vzw-loginform input[type="password"]:focus {
    outline: none;
    border-color: var(--vzw-primary-light);
    box-shadow: 0 0 0 3px rgba(122, 24, 21, 0.15);
}

#vzw-loginform .login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--vzw-text-muted);
}

#vzw-loginform .login-remember input[type="checkbox"] {
    margin: 0;
}

#vzw-loginform .login-submit {
    margin-top: 10px;
}

#vzw-loginform #wp-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--vzw-primary) 0%, var(--vzw-primary-light) 100%);
    color: #ffffff;
    height: 46px;
    line-height: 46px;
    padding: 0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(122, 24, 21, 0.3);
    text-align: center;
}

#vzw-loginform #wp-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(122, 24, 21, 0.45);
}

/* Sidebar Navigation */
.vzw-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--vzw-radius);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.vzw-user-profile {
    padding: 10px 16px 20px 16px;
    border-bottom: 1px solid var(--vzw-border);
    margin-bottom: 16px;
}

.vzw-user-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--vzw-secondary);
}

.vzw-user-role {
    font-size: 0.85rem;
    color: var(--vzw-text-muted);
}

.vzw-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--vzw-text-muted);
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    font-size: 0.95rem;
}

.vzw-nav-item:hover {
    color: var(--vzw-primary-light);
    background: rgba(122, 24, 21, 0.05);
    transform: translateX(4px);
}

.vzw-nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--vzw-primary) 0%, var(--vzw-primary-light) 100%);
    box-shadow: 0 8px 20px -6px rgba(122, 24, 21, 0.4);
    font-weight: 600;
}

.vzw-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    overflow: hidden;
}

.vzw-panel {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vzw-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Layout Grid */
.vzw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.vzw-card {
    background: var(--vzw-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--vzw-radius);
    padding: 24px;
    box-shadow: var(--vzw-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.vzw-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
}

/* Highlight property cards that have late/overdue payments */
.vzw-card.vzw-card-overdue {
    border: 2px solid #fee2e2 !important;
    background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%) !important;
    box-shadow: 0 10px 30px -5px rgba(239, 68, 68, 0.15) !important;
}

.vzw-card-title {
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    color: var(--vzw-secondary) !important;
    line-height: 1.35 !important;
}

.vzw-content-area h2 {
    font-size: 1.68rem !important;
    font-weight: 800 !important;
    color: var(--vzw-secondary) !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.015em !important;
}

.vzw-content-area .description {
    font-size: 0.88rem !important;
    color: var(--vzw-text-muted) !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.5 !important;
}

/* Status Badges */
.vzw-badge {
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vzw-badge-success { background: #d1fae5; color: #065f46; }
.vzw-badge-warning { background: #fef3c7; color: #92400e; }
.vzw-badge-danger { background: #fee2e2; color: #991b1b; }
.vzw-badge-info { background: #e0f2fe; color: #075985; }
.vzw-badge-gray { background: #f1f5f9; color: #64748b; }

/* Alert Notifications */
.vzw-alert {
    background: linear-gradient(135deg, #fee2e2 0%, #ffd1d1 100%);
    border-left: 5px solid var(--vzw-accent-danger);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.08);
}

.vzw-alert-text {
    flex-grow: 1;
}

.vzw-alert-title {
    font-weight: 700;
    font-size: 1rem;
    color: #991b1b;
    margin-bottom: 4px;
}

.vzw-alert-desc {
    font-size: 0.88rem;
    color: #7f1d1d;
}

/* Tables */
.vzw-table-container {
    background: #ffffff;
    border-radius: var(--vzw-radius);
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--vzw-shadow);
    border: 1px solid var(--vzw-border);
}

.vzw-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.vzw-table th {
    background: #f8fafc;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--vzw-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--vzw-border);
    text-align: center !important;
    white-space: nowrap !important;
}
.vzw-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--vzw-border);
    font-size: 0.95rem;
    text-align: center !important;
    white-space: nowrap !important;
}

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

.vzw-table tr:hover td {
    background: #f8fafc;
}

/* Highlight rows that are overdue / vencido */
.vzw-table tr.vzw-row-vencido td {
    background-color: #fdf2f2 !important;
}

.vzw-table tr.vzw-row-vencido:hover td {
    background-color: #fde8e8 !important;
}

/* Financial summary cards matching the columns from image reference */
.vzw-financial-card {
    background: #ffffff;
    border-radius: var(--vzw-radius);
    border: 1px solid var(--vzw-border);
    box-shadow: var(--vzw-shadow);
    padding: 30px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.vzw-financial-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--vzw-border);
    padding-bottom: 25px;
    position: relative;
}

.vzw-financial-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.vzw-stat-divider {
    width: 1px;
    height: 50px;
    background-color: var(--vzw-border);
    margin: 0 30px;
}

.vzw-stat-label {
    font-size: 0.85rem;
    color: var(--vzw-text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

.vzw-stat-val {
    font-size: 1.5rem;
    font-weight: 800;
}

.vzw-stat-val.val-pactado {
    color: #1e3a8a; /* Slate blue */
}
.vzw-stat-val.val-pagado {
    color: #2d3a20; /* Dark forest green */
}
.vzw-stat-val.val-pendiente {
    color: #b7791f; /* Earthy gold */
}

/* Floating circular PDF download button */
.vzw-btn-download-pdf {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #0b3c5d;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(11, 60, 93, 0.3);
    transition: all 0.25s ease;
    margin-left: 20px;
}

.vzw-btn-download-pdf:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(11, 60, 93, 0.45);
}

.vzw-btn-download-pdf span.dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.vzw-financial-sub-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.vzw-sub-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vzw-sub-label {
    font-size: 0.82rem;
    color: var(--vzw-text-muted);
}

.vzw-sub-val {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--vzw-secondary);
}

.vzw-sub-val.highlight-blue {
    color: #0b3c5d;
}

/* Links & buttons */
.vzw-link-download {
    color: #0066cc;
    text-decoration: underline;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.vzw-link-download:hover {
    color: #004499;
}

/* Forms & Buttons */
.vzw-form-group {
    margin-bottom: 18px;
}

.vzw-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--vzw-secondary);
}

.vzw-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--vzw-border);
    background: #ffffff;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.vzw-input:focus {
    outline: none;
    border-color: var(--vzw-primary-light);
    box-shadow: 0 0 0 3px rgba(122, 24, 21, 0.15);
}

.vzw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    text-decoration: none !important;
}

.vzw-btn-primary {
    background: linear-gradient(135deg, var(--vzw-primary) 0%, var(--vzw-primary-light) 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(122, 24, 21, 0.3);
}

.vzw-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(122, 24, 21, 0.45);
}

.vzw-btn-disabled {
    background: #cbd5e1;
    color: #64748b !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Micro-animations */
.hover-scale {
    transition: transform 0.2s ease;
}
.hover-scale:hover {
    transform: scale(1.02);
}

/* Hide Printable Area normally */
.vzw-print-only {
    display: none;
}

/* Responsiveness */
@media (max-width: 991px) {
    .vzw-dashboard-wrapper {
        flex-direction: column;
        padding: 20px;
        margin: 25px auto 20px auto !important;
    }
    
    body.admin-bar .vzw-dashboard-wrapper {
        margin-top: 60px !important;
    }
    
    .vzw-sidebar {
        width: 100%;
        box-sizing: border-box;
    }
    
    .vzw-financial-card {
        padding: 20px;
    }

    .vzw-financial-main-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        border-bottom: 1px solid var(--vzw-border);
        padding-bottom: 20px;
    }

    .vzw-stat-divider {
        display: none;
    }

    .vzw-btn-download-pdf {
        align-self: flex-end;
        margin-top: 10px;
    }

    .vzw-financial-sub-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    /* Responsive typography scales */
    .vzw-content-area h2 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
    }
    
    .vzw-card-title {
        font-size: 1.05rem !important;
    }
    
    .vzw-alert-title {
        font-size: 0.95rem !important;
    }
    
    .vzw-alert-desc {
        font-size: 0.82rem !important;
    }
}

/* Centered Admin Modals styling */
.vzw-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 99999 !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.vzw-modal-overlay.active {
    display: flex !important;
}

.vzw-modal-overlay .vzw-modal {
    background: #ffffff !important;
    border-radius: 20px !important;
    padding: 30px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    border: 1px solid var(--vzw-border) !important;
    margin: 0 !important; /* Ensure centered positioning */
}
