/* Light-mode compatibility layer for legacy Annie/iSmartOffice pages */
:root {
    --legacy-bg: #F8FAFC;
    --legacy-surface: #FFFFFF;
    --legacy-card: rgba(255, 255, 255, 0.94);
    --legacy-border: #E2E8F0;
    --legacy-text: #0F172A;
    --legacy-secondary: #64748B;
    --legacy-muted: #94A3B8;
}

body.portal-light {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 52%, #FFFFFF 100%) !important;
    color: var(--legacy-text) !important;
}

body.portal-light > .fixed.inset-0 {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 52%, #FFFFFF 100%) !important;
}

body.portal-light > .fixed[class*="blur"] {
    display: none !important;
}

body.portal-light header {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: var(--legacy-border) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.portal-light .glass-card {
    background: var(--legacy-card) !important;
    border-color: var(--legacy-border) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

body.portal-light .glass-card:hover {
    background: #FFFFFF !important;
    border-color: #CBD5E1 !important;
}

body.portal-light .text-white { color: var(--legacy-text) !important; }
body.portal-light .text-gray-400 { color: var(--legacy-secondary) !important; }
body.portal-light .text-gray-500 { color: var(--legacy-muted) !important; }
body.portal-light .text-gray-300 { color: #475569 !important; }
body.portal-light .bg-primary .text-white,
body.portal-light .bg-danger .text-white,
body.portal-light .bg-warning .text-white,
body.portal-light [class*="bg-gradient-to-br"] .text-white,
body.portal-light button.text-white,
body.portal-light a.text-white { color: #FFFFFF !important; }

body.portal-light [class*="bg-white/5"],
body.portal-light [class*="bg-white/10"] {
    background-color: #F8FAFC !important;
}

body.portal-light [class*="hover:bg-white/5"]:hover,
body.portal-light [class*="hover:bg-white/10"]:hover {
    background-color: #EEF2F7 !important;
}

body.portal-light [class*="border-white/5"],
body.portal-light [class*="border-white/10"] {
    border-color: var(--legacy-border) !important;
}

body.portal-light input,
body.portal-light select,
body.portal-light textarea {
    background: #FFFFFF !important;
    border-color: var(--legacy-border) !important;
    color: var(--legacy-text) !important;
}

body.portal-light input::placeholder,
body.portal-light textarea::placeholder {
    color: var(--legacy-muted) !important;
}

body.portal-light table thead {
    background: #F8FAFC !important;
}

body.portal-light tbody,
body.portal-light .divide-y > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--legacy-border) !important;
}

body.portal-light .loading-spinner {
    border-color: #E2E8F0;
    border-top-color: #2563EB;
}
