/* =========================================
   DEEP BLUE DASHBOARD THEME (VANILLA CSS)
   Replaces previous designs with a modern, dark navy interface.
   ========================================= */

:root {
    /* Color Palette */
    --navy-900: #0A192F;
    /* Sidebar/Darkest */
    --navy-800: #112240;
    /* Cards/Secondary */
    --navy-700: #233554;
    /* Borders/Separators */

    --royal-blue: #2563EB;
    /* Primary Action */
    --royal-light: #3B82F6;
    --royal-dark: #1D4ED8;

    --cyan-default: #06B6D4;
    --cyan-bright: #00E5FF;
    /* Accents/Glows */

    --soft-blue-bg: #F0F4F8;
    /* Main Content Background */

    --text-light: #CCD6F6;
    --text-white: #E6F1FF;
    --text-main: #0A192F;
    --text-muted: #64748B;

    /* Effects */
    --shadow-glow: 0 0 40px -10px rgba(37, 99, 235, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(10, 25, 47, 0.1);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base Reset & Typography */
#screen-client-dash {
    background-color: transparent;
    /* Outer background */
    min-height: 100vh;
    display: none;
    /* Controlled by app.js */
    justify-content: center;
    align-items: center;
    padding: 1rem;
    font-family: 'Inter', sans-serif;
}

@media (min-width: 768px) {
    #screen-client-dash {
        padding: 2rem;
    }
}

/* Main Layout Container */
.db-container {
    background-color: white;
    width: 100%;
    max-width: 1024px;
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    min-height: 600px;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .db-container {
        flex-direction: row;
    }
}

/* Sidebar Section */
.db-sidebar {
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: var(--text-light);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    border-right: 1px solid var(--navy-700);
    overflow: hidden;
    min-width: 0;
}

@media (min-width: 768px) {
    .db-sidebar {
        width: 33.333%;
    }
}

/* Sidebar Header */
.db-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}



.db-brand-icon {
    font-size: 2rem;
    color: var(--cyan-default);
    background: rgba(6, 182, 212, 0.1);
    padding: 0.5rem;
    border-radius: 0.75rem;
}

.db-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: white;
}

/* Greeting */
.db-greeting {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 2rem;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.db-greeting span {
    background: linear-gradient(to right, var(--cyan-bright), var(--royal-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.db-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* Status Card */
.db-status-card {
    background-color: rgba(17, 34, 64, 0.5);
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--navy-700);
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.db-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.db-status-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.db-badge {
    background-color: rgba(22, 78, 99, 0.4);
    color: var(--cyan-bright);
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.db-progress-bar {
    width: 100%;
    background-color: var(--navy-900);
    border-radius: 9999px;
    height: 0.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.db-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--cyan-default), var(--royal-light));
    border-radius: 9999px;
    width: 0%;
    /* Dynamic via JS */
    transition: width 1s ease-out;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.db-dates-row {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-family: monospace;
    font-size: 0.625rem;
    color: #64748b;
}

/* Action Card (Renovar) */
.db-nav-item {
    background-color: var(--navy-800);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--navy-700);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 2rem;
}

.db-nav-item:hover {
    border-color: rgba(6, 182, 212, 0.3);
    background-color: #1a2c4e;
}

.db-nav-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.db-icon-box {
    background-color: var(--navy-900);
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Section (Right) */
.db-content {
    background-color: var(--soft-blue-bg);
    width: 100%;
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

@media (min-width: 768px) {
    .db-content {
        width: 66.666%;
        padding: 3rem;
    }
}

/* Background Effects */
.db-blob-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 24rem;
    height: 24rem;
    background-color: rgba(219, 234, 254, 0.5);
    border-radius: 50%;
    filter: blur(64px);
    margin-right: -5rem;
    margin-top: -5rem;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.db-main-stats {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 10;
    margin-bottom: 2rem;
}

.db-glow-circle {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    width: 20rem;
    height: 20rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -10;
    border-radius: 50%;
}

.db-icon-lg-box {
    background-color: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    display: inline-flex;
    margin-bottom: 1.25rem;
}

.db-stat-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.db-amount-xxl {
    font-size: 3rem;
    font-weight: 700;
    color: var(--royal-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-break: break-all;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .db-amount-xxl {
        font-size: 4.5rem;
    }
}

.db-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #dcfce7;
    color: #15803d;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #bbf7d0;
    margin-top: 0.5rem;
}

/* Grid Stats */
.db-grid {
    display: grid;
    /* Force 2 columns on mobile, auto-fit usually makes them too small */
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 10;
}

@media (min-width: 1024px) {
    .db-grid {
        /* Desktop: 4 columns */
        grid-template-columns: repeat(4, 1fr);
    }
}

.db-grid-item {
    background-color: white;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center horizontally */
    justify-content: center;
    /* Center vertically */
    text-align: center;
    /* Ensure text is centered */
    /* Ensure text is centered */
    min-height: 110px;
    height: 100%;
    /* Force uniform height */
}

.db-grid-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.db-grid-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.db-grid-val {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.db-highlight {
    background-color: rgba(37, 99, 235, 0.05);
    /* royal/5 */
    border-color: rgba(37, 99, 235, 0.1);
}

/* Big CTA Button */
.db-cta-btn {
    width: 100%;
    background: linear-gradient(to right, var(--royal-dark), var(--royal-blue));
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.db-cta-btn:hover {
    transform: translateY(-4px);
    background: linear-gradient(to right, var(--royal-blue), var(--royal-light));
}

.db-cta-text {
    text-align: left;
}

.db-cta-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    display: block;
    color: #dbeafe;
}

.db-cta-main {
    font-size: 1.125rem;
    letter-spacing: 0.025em;
    display: block;
}

.db-cta-icon {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 0.75rem;
    backdrop-filter: blur(2px);
    display: flex;
}

/* Logout Link */
.db-logout {
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.db-logout:hover {
    color: var(--royal-dark);
    background-color: rgba(226, 232, 240, 0.5);
}

/* Material Icons Override */
.material-icons-round {
    display: inline-block;
    vertical-align: middle;
}

/* Product Badge & Photo Button */
.db-product-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    color: white;
    gap: 0.5rem;
    min-width: 0;
}

.db-product-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.db-product-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    opacity: 0.7;
    letter-spacing: 1px;
}

.db-product-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--cyan-bright);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-camera-btn {
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid var(--cyan-bright);
    color: var(--cyan-bright);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.db-camera-btn:hover {
    background: var(--cyan-bright);
    color: var(--navy-900);
    box-shadow: 0 0 15px var(--cyan-bright);
}

/* Days Left Badge */
.db-days-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    margin-top: auto;
    /* Push to bottom if flex column */
}

.db-grid-item {
    background-color: white;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center content vertically */
    text-align: center;
    min-height: 110px;
    height: 100% !important;
    /* Force uniform height explicitly */
}

.db-days-ok {
    background: #dcfce7;
    color: #166534;
}

.db-days-warn {
    background: #fef9c3;
    color: #854d0e;
}



/* MODAL FIX - PREVENTS INLINE RENDERING */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 25, 47, 0.95);
    z-index: 99999;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

#client-product-gallery {
    display: grid;
    /* Default to grid for gallery */
}

/* =========================================
   MODAL RENOVACIÓN PREMIUM
   ========================================= */
.renewal-card {
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(1);
    transition: all 0.3s ease;
}

.renewal-header {
    background: #1e3a8a;
    /* secondary */
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.renewal-icon-box {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(4px);
}

.renewal-close-btn {
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 8px;
    border-radius: 50%;
}

.renewal-close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.renewal-body {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Interest Box */
.renewal-interest-box {
    background: #eff6ff;
    /* blue-50 */
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    border: 1px solid #dbeafe;
    /* blue-100 */
    position: relative;
}

.renewal-label-small {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.renewal-amount-display {
    font-size: 48px;
    font-weight: 800;
    color: #2563eb;
    /* primary */
    line-height: 1;
    letter-spacing: -0.02em;
}

.renewal-verified-badge {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #64748b;
}

.renewal-verified-badge i {
    color: #22c55e;
    /* green-500 */
}

/* Options Grid */
.renewal-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
    padding-left: 4px;
}

.renewal-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .renewal-options-grid {
        grid-template-columns: 1fr;
    }
}

.renewal-option-card {
    padding: 20px;
    border-radius: 16px;
    background: white;
    border: 2px solid #f1f5f9;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.renewal-option-card:hover {
    border-color: #bfdbfe;
    /* blue-200 */
}

.renewal-option-card.selected {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.renewal-opt-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.renewal-opt-days {
    font-weight: 700;
    font-size: 18px;
    color: #0f172a;
}

.renewal-opt-date {
    font-size: 11px;
    color: #64748b;
}

.renewal-opt-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.badge-green {
    color: #16a34a;
    background: #dcfce7;
}

.badge-orange {
    color: #ea580c;
    background: #ffedd5;
}

.option-check-circle {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.renewal-option-card.selected .option-check-circle {
    opacity: 1;
}

/* Footer Summary */
.renewal-footer-summary {
    border-top: 1px solid #f1f5f9;
    padding-top: 24px;
    margin-top: 8px;
}

.renewal-summary-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.renewal-summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.renewal-summary-value-highlight {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
}

.renewal-steps-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.renewal-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
}

.renewal-step-dot.active {
    background: #2563eb;
}

.renewal-confirm-btn {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.renewal-confirm-btn:hover {
    background: #1d4ed8;
    box-shadow: 10px 25px -5px rgba(37, 99, 235, 0.5);
    transform: translateY(-2px);
}

@media (min-width: 600px) {
    .renewal-confirm-btn {
        width: auto;
        min-width: 240px;
    }
}

.renewal-footer-flex-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

@media (min-width: 768px) {
    .renewal-footer-flex-container {
        flex-direction: row;
    }
}

/* RENEWAL REQUESTS FEATURE */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.renewal-req-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.renewal-req-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}