/* MegaDash Premium Design System and Visual Tokens */

:root {
    /* Theme Light Variables */
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-card: rgba(255, 255, 255, 0.75);
    --border-color: rgba(226, 232, 240, 0.8);
    --light-border: rgba(226, 232, 240, 0.8);
    
    /* Text Contrast Variables (Light Mode) */
    --text-primary: rgba(15, 23, 42, 0.96);
    --text-secondary: rgba(51, 65, 85, 0.84);
    --text-tertiary: rgba(71, 85, 105, 0.76);
    --text-muted: rgba(71, 85, 105, 0.80);
    --table-header-text: rgba(71, 85, 105, 0.82);
    --table-body-text: rgba(30, 41, 59, 0.92);
    --nav-text: rgba(51, 65, 85, 0.84);
    --nav-text-active: rgba(15, 23, 42, 0.96);
    --breadcrumb-text: rgba(100, 116, 139, 0.84);
    --breadcrumb-text-active: rgba(15, 23, 42, 0.96);
    --placeholder-text: rgba(100, 116, 139, 0.72);
    --card-title-text: rgba(15, 23, 42, 0.96);
    --card-body-text: rgba(51, 65, 85, 0.84);
    --table-first-column-text: rgba(15, 23, 42, 0.96);
    --hero-on-gradient-title: rgba(255, 255, 255, 0.96);
    --hero-on-gradient-body: rgba(255, 255, 255, 0.82);
    --hero-on-gradient-muted: rgba(255, 255, 255, 0.76);
    --nav-hover-bg: rgba(15, 23, 42, 0.05);
    --nav-hover-text: rgba(15, 23, 42, 0.96);
    --nav-active-text: #FF6B35;
    
    /* Brand Gradient */
    --gradient-brand: linear-gradient(135deg, #E63946 0%, #FF6B35 100%);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-premium-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 0 20px -2px rgba(255, 107, 53, 0.05);
}

.dark {
    /* Theme Dark Variables */
    --bg-primary: #070A13;
    --bg-secondary: #0B0F19;
    --bg-card: rgba(18, 24, 38, 0.7);
    --border-color: rgba(30, 41, 59, 0.8);
    --light-border: rgba(30, 41, 59, 0.8);
    
    /* Text Contrast Variables (Dark Mode) */
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.76);
    --text-tertiary: rgba(255, 255, 255, 0.60);
    --text-muted: rgba(255, 255, 255, 0.60);
    --table-header-text: rgba(255, 255, 255, 0.72);
    --table-body-text: rgba(255, 255, 255, 0.86);
    --nav-text: rgba(255, 255, 255, 0.72);
    --nav-text-active: rgba(255, 255, 255, 0.96);
    --breadcrumb-text: rgba(255, 255, 255, 0.64);
    --breadcrumb-text-active: rgba(255, 255, 255, 0.94);
    --placeholder-text: rgba(255, 255, 255, 0.52);
    --card-title-text: rgba(255, 255, 255, 0.92);
    --card-body-text: rgba(255, 255, 255, 0.76);
    --table-first-column-text: rgba(255, 255, 255, 0.90);
    --hero-on-gradient-title: rgba(255, 255, 255, 0.96);
    --hero-on-gradient-body: rgba(255, 255, 255, 0.82);
    --hero-on-gradient-muted: rgba(255, 255, 255, 0.76);
    --nav-hover-bg: rgba(255, 255, 255, 0.95);
    --nav-hover-text: rgba(15, 23, 42, 0.96);
    --nav-active-text: #FF8C61;
    
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-premium-hover: 0 20px 45px -15px rgba(0, 0, 0, 0.6), 0 0 25px -2px rgba(255, 107, 53, 0.12);
}

/* Custom Animations */
@keyframes loginGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

@keyframes floatElement {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(0.5deg); }
}

@keyframes floatElementReverse {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(8px) rotate(-0.5deg); }
}

/* Base custom utility classes */
.text-gradient-brand {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-brand {
    background: var(--gradient-brand);
}

.bg-gradient-brand-light {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.06) 0%, rgba(255, 107, 53, 0.06) 100%);
}

.dark .bg-gradient-brand-light {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.12) 0%, rgba(255, 107, 53, 0.12) 100%);
}

.glow-brand {
    box-shadow: 0 0 40px -5px rgba(255, 107, 53, 0.2);
}

.premium-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-card-hover:hover {
    box-shadow: var(--shadow-premium-hover);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

/* Custom thin scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Sidebar Specific Scrollbar */
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #E2E8F0;
}
.dark .sidebar-scroll::-webkit-scrollbar-thumb {
    background: #1E293B;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #CBD5E1;
}
.dark .sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Funnel chart widget styling */
.funnel-step-bar {
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* A4 Executive PDF Report Styling */
.pdf-container, .pdf-preview-container {
    width: 100%;
    max-width: 800px;
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    padding: 48px;
    margin: 0 auto;
}
.pdf-container {
    aspect-ratio: 1 / 1.414; /* A4 aspect ratio */
}

/* Shimmer placeholder animation */
.shimmer-bg {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmerLoad 1.5s infinite;
}

@keyframes shimmerLoad {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Stepper state line connectors */
.stepper-line {
    height: 2px;
    background: var(--border-color);
    flex-grow: 1;
    margin: 0 16px;
}
.stepper-line.active {
    background: linear-gradient(90deg, #E63946, #FF6B35);
}

/* Slide up entrance animations */
.animate-slide-up {
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* WhatsApp speech bubble mockup */
.wa-bubble-green {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px 12px 12px 0px;
}
.dark .wa-bubble-green {
    background: #202c33;
    border: 1px solid #2d3d47;
    color: #E2E8F0;
}

/* Active navigation pill styling */
.nav-pill-active {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.08) 0%, rgba(255, 107, 53, 0.08) 100%);
    color: #FF6B35;
    font-weight: 600;
}
.dark .nav-pill-active {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.16) 0%, rgba(255, 107, 53, 0.16) 100%);
    color: #FF8C61;
}

/* Smooth Transitions for Theme Swapping */
* {
    transition-property: background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Custom segmented control active status */
.role-segmented-active {
    background-color: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dark .role-segmented-active {
    background-color: #1E293B;
    color: #F8FAFC;
}

/* Custom Utility Classes mapping to CSS variables */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-card { background-color: var(--bg-card); }
.border-color { border-color: var(--border-color); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

/* Spacing and Grid Layouts */
.gap-xs { gap: 8px; }
.gap-sm { gap: 12px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }

.mb-xs { margin-bottom: 8px; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }

.mt-xs { margin-top: 8px; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Responsive Grids */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Premium Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid transparent;
    gap: 8px;
    padding: 10px 16px;
    font-size: 12px;
    outline: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn:active {
    transform: scale(0.98);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-primary {
    background: var(--gradient-brand);
    color: #FFFFFF;
}
.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
    filter: brightness(1.05);
}
.btn-secondary {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-muted);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}
.btn-danger {
    background-color: #EF4444;
    color: #FFFFFF;
}
.btn-danger:hover {
    background-color: #DC2626;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 8px;
}
.btn-sm i, .btn-sm svg {
    width: 13px !important;
    height: 13px !important;
}
.btn-lg {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 16px;
}

/* Forms styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group.full-width {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}
.form-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}
.form-textarea {
    resize: vertical;
}
.form-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Wizard Containers */
.wizard-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-premium);
}
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    margin-top: 24px;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover {
    box-shadow: var(--shadow-premium-hover);
    border-color: rgba(255, 107, 53, 0.2);
}
.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 6px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Dropzones styling */
.dropzone {
    border: 2px dashed var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.dropzone:hover {
    border-color: var(--primary-orange);
    background-color: rgba(255, 107, 53, 0.04);
}
.dropzone-uploaded {
    border-color: #10B981;
    background-color: rgba(16, 185, 129, 0.04);
}

/* Email preview specific styling */
.preview-toggle-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.preview-toggle-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}
.preview-toggle-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}
.email-preview-container {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: #FFFFFF;
    color: #0F172A;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s;
}
.email-preview-container.mobile-mode {
    max-width: 320px;
    margin: 0 auto;
}
.email-preview-header {
    border-bottom: 1px solid #F1F5F9;
    background-color: #F8FAFC;
    padding: 12px 16px;
    font-size: 11px;
    color: #64748B;
    line-height: 1.6;
}
.email-preview-body-scroll {
    height: 300px;
    overflow-y: auto;
}
.email-body-mock {
    padding: 24px;
}
.email-logo-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #F1F5F9;
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.email-hero-img-mock {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-radius: 8px;
    margin-bottom: 16px;
}
.email-body-text {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 20px;
}
.email-cta-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF !important;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 24px;
}
.email-footer-mock {
    border-top: 1px solid #F1F5F9;
    padding-top: 16px;
    font-size: 10px;
    color: #94A3B8;
    line-height: 1.5;
}

/* PDF report formatting classes (always light/paper styling) */
.pdf-preview-container {
    background: #FFFFFF !important;
    color: #0F172A !important;
    border: 1px solid #E2E8F0 !important;
    padding: 40px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05) !important;
}
.pdf-header {
    border-bottom: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
}
.pdf-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
}
.pdf-kpi-box {
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    background-color: #F8FAFC !important;
    text-align: center !important;
}
.pdf-kpi-value {
    font-size: 20px !important;
    font-weight: 800 !important;
    margin-top: 4px !important;
}
.pdf-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
    color: #334155 !important;
}
.pdf-table th {
    background-color: #F8FAFC !important;
    color: #64748B !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid #E2E8F0 !important;
    text-align: left !important;
}
.pdf-table td {
    padding: 10px 12px !important;
    border-bottom: 1px solid #F1F5F9 !important;
}
.pdf-footer {
    border-top: 1px solid #E2E8F0 !important;
    padding-top: 16px !important;
    margin-top: 32px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 10px !important;
    color: #94A3B8 !important;
}

/* Locked view container */
.locked-view-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    border-radius: 24px;
    padding: 48px 24px;
    text-align: center;
    box-shadow: var(--shadow-premium);
}
.empty-state-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Modal dark mode support */
.modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}
.modal-content .border-b, .modal-content .border-t {
    border-color: var(--border-color) !important;
}
.modal-content .bg-white {
    background-color: var(--bg-card) !important;
}
.modal-content .bg-slate-50 {
    background-color: var(--bg-secondary) !important;
}
.modal-content .text-slate-900 {
    color: var(--text-primary) !important;
}
.modal-content .text-slate-600, .modal-content .text-slate-700 {
    color: var(--text-secondary) !important;
}
.modal-content .hover\:bg-slate-50:hover {
    background-color: var(--bg-secondary) !important;
}

/* Toast dark mode support */
.toast {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
.toast .text-slate-800 {
    color: var(--text-primary) !important;
}
.toast .bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}
.toast .bg-rose-50 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}
.toast .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}
.toast .bg-sky-50 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Bento Grid Layout styling */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Floating abstract panels in Hero */
.floating-hero-panel {
    animation: floatElement 6s ease-in-out infinite;
}
.floating-hero-panel-delayed {
    animation: floatElementReverse 8s ease-in-out infinite;
}

/* Bento card hover glows */
.bento-card-glow {
    position: relative;
    overflow: hidden;
}
.bento-card-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,107,53,0.1), rgba(230,57,70,0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.bento-card-glow:hover::after {
    opacity: 1;
}

/* macOS App Dock */
.mac-dock-container {
    display: flex;
    justify-content: center;
    width: 100%;
}
.mac-dock {
    display: inline-flex;
    align-items: flex-end;
    gap: 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 10px 24px;
    border-radius: 24px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.dark .mac-dock {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(30, 41, 59, 0.8);
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.5);
}
.dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom center;
}
.dock-item:hover {
    transform: scale(1.18) translateY(-6px);
}
.dock-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}
.dock-item:hover .dock-icon-wrapper {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.dock-active-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #FF6B35;
    margin-top: 4px;
    opacity: 0.8;
}
.dark .dock-active-dot {
    background-color: #FF8C61;
}

/* Tooltip for dock */
.dock-tooltip {
    position: absolute;
    bottom: 64px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.dock-item:hover .dock-tooltip {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Logo custom sizes and scaling rules (Internal logos increased by 20%, login page logos left unchanged) */
.brand-logo-header {
    height: clamp(50px, 5.4vw, 77px) !important;
    width: auto;
    object-fit: contain;
    max-height: 77px;
}
.brand-logo-login-header {
    height: clamp(48px, 5.5vw, 72px) !important;
    width: auto;
    object-fit: contain;
}
.brand-logo-login-card {
    height: clamp(56px, 6.5vw, 84px) !important;
    width: auto;
    object-fit: contain;
}
.brand-logo-launcher {
    height: clamp(58px, 6.6vw, 86px) !important;
    width: auto;
    object-fit: contain;
}

/* ==========================================
   TEXT CONTRAST & LEGIBILITY OVERRIDES
   ========================================== */

/* General overrides (Excluding login page, PDF reports, WhatsApp and Email previews to keep light mocks clean) */
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) h1,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) h2,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) h3,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) h4 {
    color: var(--text-primary) !important;
}

/* Secondary and descriptive texts */
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) p:not(.tag):not(.badge) {
    color: var(--text-secondary) !important;
}

/* Card titles and body texts */
.premium-card h3, .premium-card h4, .card h3, .card h4, .card-title {
    color: var(--card-title-text) !important;
}
.premium-card p, .premium-card span:not(.tag):not(.badge), .card p, .card span:not(.tag):not(.badge) {
    color: var(--card-body-text) !important;
}

/* Table overrides */
table:not(.pdf-table) th {
    color: var(--table-header-text) !important;
}
table:not(.pdf-table) td {
    color: var(--table-body-text) !important;
}
/* Table first column overrides (Legibility & semi-bold style) */
table:not(.pdf-table):not(.email-preview-container table) td:first-child {
    color: var(--table-first-column-text) !important;
    font-weight: 600 !important;
}

/* Sidebar navigation & controls */
.sidebar-item:not(.nav-pill-active) {
    color: var(--nav-text) !important;
}
.sidebar-item:not(.nav-pill-active) span {
    color: var(--nav-text) !important;
}
.sidebar-item:not(.nav-pill-active) i,
.sidebar-item:not(.nav-pill-active) svg {
    color: var(--nav-text) !important;
}

/* Sidebar items interaction states (hover, focus, active, selected) */
.sidebar-item:not(.nav-pill-active):hover,
.sidebar-item:not(.nav-pill-active):focus,
.sidebar-item:not(.nav-pill-active):active {
    background-color: var(--nav-hover-bg) !important;
    color: var(--nav-hover-text) !important;
}
.sidebar-item:not(.nav-pill-active):hover *,
.sidebar-item:not(.nav-pill-active):focus *,
.sidebar-item:not(.nav-pill-active):active * {
    color: var(--nav-hover-text) !important;
}

/* Sidebar items active/selected state */
.sidebar-item.nav-pill-active {
    color: var(--nav-active-text) !important;
}
.sidebar-item.nav-pill-active * {
    color: var(--nav-active-text) !important;
}

/* Sidebar headers ("Navegación", "Administración") */
.sidebar .text-\[10px\] {
    color: var(--text-muted) !important;
}

/* Breadcrumbs in header */
.flex.items-center.text-xs.font-medium.text-slate-400 span:not(.font-bold),
.flex.items-center.text-xs.font-medium.text-slate-450 span:not(.font-bold) {
    color: var(--breadcrumb-text) !important;
}
.flex.items-center.text-xs.font-medium.text-slate-400 span.font-bold,
.flex.items-center.text-xs.font-medium.text-slate-450 span.font-bold {
    color: var(--breadcrumb-text-active) !important;
}

/* Inputs & Search placeholders */
input::placeholder, textarea::placeholder {
    color: var(--placeholder-text) !important;
}
input, textarea, select {
    color: var(--text-primary) !important;
}

/* Custom helper classes mapping to contrast variables */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Preserve semantic text colors */
.text-emerald-500, .dark .text-emerald-400 { color: #10B981 !important; }
.text-emerald-600 { color: #059669 !important; }
.text-red-500, .dark .text-red-400 { color: #EF4444 !important; }
.text-red-600 { color: #DC2626 !important; }
.text-amber-500, .dark .text-amber-400 { color: #F59E0B !important; }
.text-brand-orange, .text-brand-coral { color: #FF6B35 !important; }
.text-sky-500, .dark .text-sky-400 { color: #0EA5E9 !important; }
.text-teal-500 { color: #14B8A6 !important; }
.text-purple-500 { color: #A855F7 !important; }

/* ==========================================
   HERO GRADIENT CONTRAST & LOGO SCALING
   ========================================== */

/* Red/Orange Hero Text Contrast Overrides (Forces white/off-white text on gradient backgrounds, boosted specificity) */
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .bg-gradient-brand h2,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .bg-gradient-brand h3,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .bg-gradient-brand h4,
.bg-gradient-brand h2, 
.bg-gradient-brand h3, 
.bg-gradient-brand h4 {
    color: var(--hero-on-gradient-title) !important;
}

:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .bg-gradient-brand p:not(.tag):not(.badge),
.bg-gradient-brand p:not(.tag):not(.badge) {
    color: var(--hero-on-gradient-body) !important;
}

:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .bg-gradient-brand span:not(.btn span):not(.bg-white span),
.bg-gradient-brand span:not(.btn span):not(.bg-white span) {
    color: var(--hero-on-gradient-muted) !important;
}

/* Badge "Centro de Control Global" */
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .bg-gradient-brand span.bg-white\/15,
.bg-gradient-brand span.bg-white\/15 {
    color: rgba(255, 255, 255, 0.92) !important;
}

/* Floating panels over the hero (with boosted specificity to win over general overrides) */
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel *,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel-delayed * {
    color: rgba(255, 255, 255, 0.90) !important;
}
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel span,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel-delayed span {
    color: rgba(255, 255, 255, 0.90) !important;
}
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel div,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel-delayed div {
    color: rgba(255, 255, 255, 0.76) !important;
}
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel .text-sm,
:not(.login-screen):not(.pdf-container):not(.pdf-preview-container):not(.email-preview-container):not(.wa-bubble-green) .floating-hero-panel-delayed .text-sm {
    color: rgba(255, 255, 255, 0.96) !important;
}

/* Grow PDF preview logo by 20% (32px -> 38px) */
.pdf-container img[alt="MegaDash Logo"],
.pdf-preview-container img[alt="MegaDash Logo"] {
    height: 38px !important;
}

/* WhatsApp Variable Badge & overrides */
.wa-variable-badge {
    background-color: rgba(255, 107, 53, 0.08) !important;
    border: 1px solid rgba(255, 107, 53, 0.2) !important;
    color: #FF6B35 !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin: 0 4px !important;
}
.dark .wa-variable-badge {
    background-color: rgba(255, 107, 53, 0.16) !important;
    border: 1px solid rgba(255, 107, 53, 0.3) !important;
    color: #FF8C61 !important;
}
.wa-bubble-green .wa-variable-badge {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: inherit !important;
    font-weight: inherit !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: inherit !important;
    display: inline !important;
    margin: 0 !important;
}
.wa-bubble-green span:not(.wa-variable-badge) {
    color: inherit !important;
}

/* ==========================================
   WORKSPACE MODAL REDESIGN
   ========================================== */

/* Large Workspace Modal Dimensions */
.modal-workspace {
    width: 88vw !important;
    max-width: 1380px !important;
    height: 90vh !important;
    max-height: 90vh !important;
    border-radius: 28px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--border-color) !important;
}

/* Modal Header Inside Workspace Modal */
.modal-workspace > div:first-child {
    flex-shrink: 0 !important;
    padding: 24px 32px !important;
    border-bottom: 1px solid var(--border-color) !important;
    background-color: var(--bg-card) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Modal Body Inside Workspace Modal */
.modal-workspace > div:nth-child(2) {
    flex-grow: 1 !important;
    overflow-y: auto !important;
    max-height: none !important;
    padding: 32px !important;
    background-color: var(--bg-secondary) !important;
    min-height: 0 !important; /* critical for overflow-y child inside flex */
}

/* Modal Footer Inside Workspace Modal */
.modal-workspace > div:last-child {
    flex-shrink: 0 !important;
    padding: 20px 32px !important;
    border-t: 1px solid var(--border-color) !important;
    background-color: var(--bg-card) !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03) !important;
    backdrop-filter: blur(8px) !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
}

.dark .modal-workspace > div:last-child {
    background-color: rgba(18, 24, 38, 0.8) !important;
}

/* Editor Section Card styles */
.editor-section-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    padding: 28px !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s ease;
}
.editor-section-card:hover {
    box-shadow: var(--shadow-md) !important;
}

/* Inputs & Labels size boosts inside workspace modal */
.modal-workspace label {
    font-size: 13px !important; /* 2px boost from 11px */
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-secondary) !important;
}
.modal-workspace input, 
.modal-workspace select {
    height: 48px !important; /* min height 48px */
    font-size: 15px !important; /* 2px boost */
    border-radius: 12px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.2s ease !important;
}
.modal-workspace textarea {
    font-size: 15px !important; /* 2px boost */
    border-radius: 14px !important;
    padding: 16px !important;
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.2s ease !important;
}

.modal-workspace input:focus,
.modal-workspace select:focus,
.modal-workspace textarea:focus {
    border-color: #FF6B35 !important;
    background-color: var(--bg-card) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15) !important;
    outline: none !important;
}

/* Custom Scrollbar for Modal Workspace Body */
.modal-workspace > div:nth-child(2)::-webkit-scrollbar {
    width: 8px;
}
.modal-workspace > div:nth-child(2)::-webkit-scrollbar-track {
    background: transparent;
}
.modal-workspace > div:nth-child(2)::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.3);
    border-radius: 9999px;
}
.modal-workspace > div:nth-child(2)::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.5);
}

/* Sticky Column Preview Container */
.sticky-preview {
    position: sticky !important;
    top: 10px !important;
    align-self: start !important;
    z-index: 10 !important;
}
@media (max-width: 1024px) {
    .sticky-preview {
        position: static !important;
        align-self: stretch !important;
    }
}

/* ==========================================
   WHATSAPP CHAT SIMULATOR REALISM
   ========================================== */

/* Background with beige/doodle theme */
.whatsapp-chat-bg {
    background-color: #efeae2 !important;
    background-image: radial-gradient(circle, #dfd8cf 1.2px, transparent 1.2px) !important;
    background-size: 16px 16px !important;
    position: relative;
}

.dark .whatsapp-chat-bg {
    background-color: #0b141a !important;
    background-image: radial-gradient(circle, #1a2329 1.2px, transparent 1.2px) !important;
}

/* Encryption Card */
.whatsapp-encrypt-box {
    background-color: #ffeecf !important;
    border: 1px solid rgba(245, 226, 191, 0.5) !important;
    color: #604b2c !important;
    font-size: 11px !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    text-align: center;
    max-width: 90%;
    margin: 8px auto !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    line-height: 1.45 !important;
    font-weight: 500 !important;
}

.dark .whatsapp-encrypt-box {
    background-color: rgba(255, 238, 207, 0.06) !important;
    border: 1px solid rgba(255, 238, 207, 0.15) !important;
    color: #ffd699 !important;
}

/* Asymmetric WhatsApp speech bubble */
.wa-bubble-green {
    background-color: #ffffff !important;
    border: none !important;
    border-radius: 12px 12px 12px 0px !important;
    color: #111b21 !important;
    box-shadow: 0 1.5px 2px rgba(0, 0, 0, 0.12) !important;
    position: relative;
    max-width: 85% !important;
    width: 100% !important;
}

.dark .wa-bubble-green {
    background-color: #202c33 !important;
    color: #e9edef !important;
    border: none !important;
}

/* WhatsApp Image Header Integration */
.wa-bubble-image-container {
    padding: 4px 4px 0 4px !important;
    width: 100% !important;
    box-sizing: border-box;
}
.wa-bubble-image-container img,
.wa-bubble-image-container .wa-image-placeholder {
    border-radius: 10px 10px 0 0 !important;
    width: 100% !important;
    object-fit: cover;
}

/* Quick Replies style */
.wa-quick-reply-btn {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: #008069 !important; /* WhatsApp business green teal */
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    text-align: center;
    box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.wa-quick-reply-btn:hover {
    background-color: #f7f7f7 !important;
    transform: translateY(-1px);
}
.dark .wa-quick-reply-btn {
    background-color: #202c33 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #25d366 !important; /* Bright green in dark mode */
}
.dark .wa-quick-reply-btn:hover {
    background-color: #2a3942 !important;
}

/* CTA buttons style (inside bubble) */
.wa-cta-btn-row {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 11px 0 !important;
    text-align: center !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #008069 !important; /* WhatsApp standard green teal */
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.wa-cta-btn-row:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}
.dark .wa-cta-btn-row {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #25d366 !important; /* WhatsApp business bright green */
}
.dark .wa-cta-btn-row:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Red / Yellow badges for missing variable samples */
.wa-variable-badge-missing {
    background-color: rgba(239, 68, 68, 0.08) !important;
    border: 1px dashed rgba(239, 68, 68, 0.4) !important;
    color: #EF4444 !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 4px !important;
}
.dark .wa-variable-badge-missing {
    background-color: rgba(239, 68, 68, 0.16) !important;
    border: 1px dashed rgba(239, 68, 68, 0.5) !important;
    color: #F87171 !important;
}

.wa-variable-badge-warning {
    background-color: rgba(245, 158, 11, 0.08) !important;
    border: 1px dashed rgba(245, 158, 11, 0.4) !important;
    color: #D97706 !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 4px !important;
}
.dark .wa-variable-badge-warning {
    background-color: rgba(245, 158, 11, 0.16) !important;
    border: 1px dashed rgba(245, 158, 11, 0.5) !important;
    color: #FBBF24 !important;
}

/* Variable Card styles inside editor */
.variable-card-row {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    transition: all 0.2s ease;
}
.variable-card-row:hover {
    border-color: rgba(255, 107, 53, 0.3) !important;
}



