html,
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root,
[data-bs-theme="dark"],
[data-theme-style="obsidian"] {
    --jy-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --jy-font-mono: 'JetBrains Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

    /* Base Surfaces (Cosmic Obsidian & Deep Velvet Slate) */
    --jy-bg-canvas: #090a0f;
    /* Root canvas background - velvet deep space obsidian, eliminates muddy corporate navy */
    --jy-bg-surface: #12131c;
    /* Cards, sidebars, main panels - sleek cosmic slate surface */
    --jy-bg-surface-elevated: #1a1c2b;
    /* Hovered states, dropdowns, modal headers, elevated cards */
    --jy-bg-surface-subtle: #0d0e17;
    /* Inset wells, table alternating rows, secondary diagnostic panels */
    --jy-bg-input: #0f111a;
    /* Solid, sleek text input & select background */

    /* Bootstrap 5 Core Overrides for Dark Mode (New Age Cosmic Obsidian & Electric Indigo) */
    --bs-body-bg: #090a0f;
    --bs-body-color: #f8fafc;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: #94a3b8;
    --bs-secondary-bg: #0d0e17;
    --bs-tertiary-color: #64748b;
    --bs-tertiary-bg: #1a1c2b;
    --bs-border-color: #222538;
    --bs-border-color-translucent: rgba(34, 37, 56, 0.6);
    --bs-card-bg: #12131c;
    --bs-card-cap-bg: #1a1c2b;
    --bs-dark: #090a0f;
    --bs-dark-rgb: 9, 10, 15;
    --bs-table-bg: #12131c;
    --bs-table-striped-bg: #0d0e17;
    --bs-table-hover-bg: #1e2133;
    --bs-table-color: #f8fafc;
    --bs-table-border-color: #222538;

    /* Solid High-Definition Hairline Borders */
    --jy-border: #222538;
    /* 1px crisp separation border */
    --jy-border-strong: #2f344e;
    /* Focused / emphasized component border */
    --jy-border-highlight: #f59e0b;
    /* Jyotish Radiant Gold highlight border */

    /* Maximum Contrast Typography */
    --jy-text-primary: #ffffff;
    /* Pure white - 19.8:1 AAA contrast against cosmic void */
    --jy-text-secondary: #cbd5e1;
    /* Slate 300 - clear, sharp readability (11.8:1 AAA) */
    --jy-text-muted: #94a3b8;
    /* Slate 400 - high-contrast meta / secondary info (6.8:1 AA) */
    --jy-text-contrast: #090a0f;
    /* Dark text for use on bright gold/amber pills */

    /* New Age Vibrant Primary: Electric Indigo & Hyper Violet */
    --jy-primary: #6366f1;
    /* Electric Indigo (Linear/Raycast modern aesthetic) */
    --jy-primary-hover: #4f46e5;
    --jy-primary-active: #4338ca;
    --jy-primary-subtle: rgba(99, 102, 241, 0.16);

    --jy-accent-gold: #f59e0b;
    /* Saffron Gold (sacred/vedic core - vibrant luminescence) */
    --jy-accent-gold-hover: #d97706;
    --jy-accent-gold-soft: rgba(245, 158, 11, 0.14);
    --jy-accent-gold-border: #b45309;

    --jy-accent-emerald: #10b981;
    /* Auspicious Emerald (Growth / Benefic) */
    --jy-accent-emerald-bright: #34d399;
    --jy-accent-emerald-soft: rgba(16, 185, 129, 0.14);
    --jy-accent-emerald-border: #059669;

    --jy-accent-rose: #f43f5e;
    /* Critical / Maraka Ruby Crimson */
    --jy-accent-rose-bright: #fb7185;
    --jy-accent-rose-soft: rgba(244, 63, 94, 0.16);
    --jy-accent-rose-border: #e11d48;

    --jy-accent-cyan: #06b6d4;
    /* Aurora Sky / Live Gochar Transits */
    --jy-accent-cyan-bright: #38bdf8;
    --jy-accent-cyan-soft: rgba(6, 182, 212, 0.14);
    --jy-accent-cyan-border: #0284c7;

    --jy-accent-purple: #a855f7;
    /* Esoteric / Karmic Amethyst */
    --jy-accent-purple-bright: #c084fc;
    --jy-accent-purple-soft: rgba(168, 85, 247, 0.16);
    --jy-accent-purple-border: #7c3aed;

    /* Structural Dimensions */
    --jy-topbar-h: 56px;
    --jy-sidebar-w: 260px;
    --jy-sidebar-w-collapsed: 68px;
    --jy-radius: 8px;
    --jy-radius-lg: 12px;
    --jy-radius-pill: 9999px;

    /* Backward compatibility */
    --kundali-bg: #090a0f;
    --kundali-border: #6366f1;
    --kundali-line: #4f46e5;
    --kundali-num: #cbd5e1;
    --kundali-default-planet: #ffffff;
    --sidebar-bg: #0d0e17;
    --card-bg-subtle: #1a1c2b;
    --header-bg: #12131c;
    --vibrant-indigo: #6366f1;
    --vibrant-purple: #a855f7;
    --vibrant-gold: #f59e0b;
    --vibrant-cyan: #38bdf8;
    --vibrant-rose: #f43f5e;
    --vibrant-emerald: #10b981;

    color-scheme: dark;
}

/* ==========================================================================
   2. LUXURY SANDSTONE / WARM IVORY THEME (Default Executive Light Palette)
   ========================================================================== */
[data-theme-style="sandstone"],
[data-theme-style="rose"],
[data-bs-theme="light"] {
    --jy-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --jy-font-mono: 'JetBrains Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

    /* Base Surfaces (Warm Sandstone Alabaster Canvas & Pure Crisp White) */
    --jy-bg-canvas: #f8f6f0;             /* Luxurious warm sandstone/ivory canvas */
    --jy-bg-surface: #ffffff;            /* Pure crisp white cards, panels, containers */
    --jy-bg-surface-elevated: #f1ede4;   /* Warm sandstone elevated state */
    --jy-bg-surface-subtle: #f5f2eb;     /* Warm sandstone subtle wells & alternating rows */
    --jy-bg-input: #ffffff;              /* Pure white form inputs */

    /* Bootstrap 5 Core Overrides */
    --bs-body-bg: #f8f6f0;
    --bs-body-color: #1c1917;            /* Deepest warm charcoal stone */
    --bs-emphasis-color: #0c0a09;
    --bs-secondary-color: #57534e;       /* Stone 600 */
    --bs-secondary-bg: #f5f2eb;
    --bs-tertiary-color: #78716c;       /* Stone 500 */
    --bs-tertiary-bg: #f1ede4;
    --bs-border-color: #e7dfd5;          /* Warm bronze/sandstone border */
    --bs-border-color-translucent: rgba(231, 223, 213, 0.7);
    --bs-dark: #f8f6f0;
    --bs-dark-rgb: 248, 246, 240;
    --bs-table-bg: #ffffff;
    --bs-table-striped-bg: #faf8f5;
    --bs-table-hover-bg: #f1ede4;
    --bs-table-color: #1c1917;
    --bs-table-border-color: #e7dfd5;

    /* Refined Warm Sandstone Borders */
    --jy-border: #e7dfd5;                /* Crisp sandstone separation border */
    --jy-border-strong: #d6c7b2;         /* Emphasized warm bronze border */
    --jy-border-highlight: #b45309;      /* Saffron Gold accent highlight */

    /* High-Definition Contrast Typography */
    --jy-text-primary: #1c1917;          /* 17:1+ contrast against white/canvas */
    --jy-text-secondary: #57534e;        /* Stone 600 - sharp, clear readability */
    --jy-text-muted: #78716c;            /* Stone 500 - high-contrast metadata */
    --jy-text-contrast: #ffffff;

    /* Saturated Royal Cobalt & Saffron Gold Accents */
    --jy-primary: #2563eb;               /* Royal Celestial Cobalt */
    --jy-primary-hover: #1d4ed8;
    --jy-primary-active: #1e40af;
    --jy-primary-subtle: #eff6ff;

    --jy-accent-gold: #b45309;           /* Saffron Amber */
    --jy-accent-gold-hover: #92400e;
    --jy-accent-gold-soft: #fef3c7;
    --jy-accent-gold-border: #d97706;

    --jy-accent-emerald: #059669;        /* Emerald */
    --jy-accent-emerald-bright: #047857;
    --jy-accent-emerald-soft: #d1fae5;
    --jy-accent-emerald-border: #10b981;

    --jy-accent-rose: #dc2626;           /* Crimson */
    --jy-accent-rose-bright: #ef4444;
    --jy-accent-rose-soft: #fee2e2;
    --jy-accent-rose-border: #f87171;

    --jy-accent-cyan: #0284c7;
    --jy-accent-cyan-bright: #0369a1;
    --jy-accent-cyan-soft: #e0f2fe;
    --jy-accent-cyan-border: #38bdf8;

    --jy-accent-purple: #7c3aed;
    --jy-accent-purple-bright: #6d28d9;
    --jy-accent-purple-soft: #ede9fe;
    --jy-accent-purple-border: #a855f7;

    --jy-topbar-h: 56px;
    --jy-sidebar-w: 260px;
    --jy-sidebar-w-collapsed: 68px;
    --jy-radius: 8px;
    --jy-radius-lg: 12px;
    --jy-radius-pill: 9999px;

    --kundali-bg: #ffffff;
    --kundali-border: #b45309;
    --kundali-line: #d6c7b2;
    --kundali-num: #1c1917;
    --kundali-default-planet: #1c1917;
    --sidebar-bg: #ffffff;
    --card-bg-subtle: #f5f2eb;
    --header-bg: #ffffff;
    --vibrant-indigo: #2563eb;
    --vibrant-purple: #7c3aed;
    --vibrant-gold: #b45309;
    --vibrant-cyan: #0284c7;
    --vibrant-rose: #dc2626;
    --vibrant-emerald: #059669;

    color-scheme: light;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb {
    background: #c1c9d2;
    border-radius: 4px;
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a4454;
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4a5568;
}

/* Sortable Table Headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

[data-bs-theme="light"] th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    color: #0d6efd !important;
}

[data-bs-theme="dark"] th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #0d6efd !important;
}

/* Theme-aware Table Styling for Main App (Home.razor) */
[data-bs-theme="light"] .table:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    --bs-table-bg: #ffffff;
    --bs-table-striped-bg: #faf8f5;
    --bs-table-hover-bg: #f1ede4;
    --bs-table-color: #1c1917;
    --bs-table-border-color: #e7dfd5;
    color: #1c1917;
}

[data-bs-theme="light"] .table:not(.astro-report-page *):not(.astro-report-modal-backdrop *) thead th {
    background-color: #f5f2eb !important;
    color: #44403c !important;
    border-bottom: 2px solid #d6c7b2 !important;
    font-weight: 700;
}

[data-bs-theme="dark"] .table:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    --bs-table-bg: #12131c;
    --bs-table-striped-bg: #0d0e17;
    --bs-table-hover-bg: #1e2133;
    --bs-table-color: #f8fafc;
    --bs-table-border-color: #222538;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .table:not(.astro-report-page *):not(.astro-report-modal-backdrop *) thead th {
    background-color: #1a1c2b !important;
    color: #ffffff !important;
    border-color: #222538 !important;
    font-weight: 700;
}

[data-bs-theme="dark"] .table:not(.astro-report-page *):not(.astro-report-modal-backdrop *) td,
[data-bs-theme="dark"] .table:not(.astro-report-page *):not(.astro-report-modal-backdrop *) tbody th {
    color: #cbd5e1 !important;
    border-color: #222538 !important;
}

[data-bs-theme="dark"] .table-striped:not(.astro-report-page *):not(.astro-report-modal-backdrop *)>tbody>tr:nth-of-type(odd)>* {
    background-color: #0d0e17 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .table-striped:not(.astro-report-page *):not(.astro-report-modal-backdrop *)>tbody>tr:nth-of-type(even)>* {
    background-color: #12131c !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .table-hover:not(.astro-report-page *):not(.astro-report-modal-backdrop *)>tbody>tr:hover>* {
    background-color: #1e2133 !important;
}

/* ==========================================================================
   Universal High-Contrast Selected Row Styling Across The Entire App
   ========================================================================== */

/* Light Theme Selected Row */
[data-bs-theme="light"] .table tbody tr.table-warning,
[data-bs-theme="light"] .table tbody tr.table-warning>td,
[data-bs-theme="light"] .table tbody tr.table-warning>th,
[data-bs-theme="light"] .table tbody tr.selected-row,
[data-bs-theme="light"] .table tbody tr.selected-row>td,
[data-bs-theme="light"] .table tbody tr.selected-row>th,
.table tbody tr.table-warning,
.table tbody tr.table-warning>td,
.table tbody tr.table-warning>th,
.table tbody tr.selected-row,
.table tbody tr.selected-row>td,
.table tbody tr.selected-row>th {
    background-color: #fef08a !important;
    /* Rich luminous gold/amber */
    color: #0f172a !important;
    /* Deep dark slate - maximum contrast */
    font-weight: 700 !important;
    box-shadow: inset 4px 0 0 #d97706 !important;
}

[data-bs-theme="light"] .table tbody tr.table-warning td,
[data-bs-theme="light"] .table tbody tr.table-warning th,
[data-bs-theme="light"] .table tbody tr.selected-row td,
[data-bs-theme="light"] .table tbody tr.selected-row th,
.table tbody tr.table-warning td,
.table tbody tr.table-warning th,
.table tbody tr.selected-row td,
.table tbody tr.selected-row th {
    color: #0f172a !important;
}

[data-bs-theme="light"] .table tbody tr.table-warning .text-muted,
[data-bs-theme="light"] .table tbody tr.table-warning .text-secondary,
[data-bs-theme="light"] .table tbody tr.selected-row .text-muted,
[data-bs-theme="light"] .table tbody tr.selected-row .text-secondary,
.table tbody tr.table-warning .text-muted,
.table tbody tr.table-warning .text-secondary,
.table tbody tr.selected-row .text-muted,
.table tbody tr.selected-row .text-secondary {
    color: #334155 !important;
}

/* Dark Theme Selected Row */
[data-bs-theme="dark"] .table tbody tr.table-warning,
[data-bs-theme="dark"] .table tbody tr.table-warning>td,
[data-bs-theme="dark"] .table tbody tr.table-warning>th,
[data-bs-theme="dark"] .table tbody tr.selected-row,
[data-bs-theme="dark"] .table tbody tr.selected-row>td,
[data-bs-theme="dark"] .table tbody tr.selected-row>th {
    background-color: #854d0e !important;
    /* Rich amber gold */
    color: #ffffff !important;
    /* Pure white - crystal clear contrast */
    font-weight: 700 !important;
    box-shadow: inset 4px 0 0 #f59e0b !important;
}

[data-bs-theme="dark"] .table tbody tr.table-warning td,
[data-bs-theme="dark"] .table tbody tr.table-warning th,
[data-bs-theme="dark"] .table tbody tr.selected-row td,
[data-bs-theme="dark"] .table tbody tr.selected-row th {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table tbody tr.table-warning .text-muted,
[data-bs-theme="dark"] .table tbody tr.table-warning .text-secondary,
[data-bs-theme="dark"] .table tbody tr.selected-row .text-muted,
[data-bs-theme="dark"] .table tbody tr.selected-row .text-secondary {
    color: #fef08a !important;
    /* Light amber secondary text */
}

/* Colored text overrides inside selected rows for maximum contrast */
[data-bs-theme="dark"] .table tbody tr.table-warning .text-danger,
[data-bs-theme="dark"] .table tbody tr.selected-row .text-danger {
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .table tbody tr.table-warning .text-primary,
[data-bs-theme="dark"] .table tbody tr.selected-row .text-primary {
    color: #93c5fd !important;
}

[data-bs-theme="dark"] .table tbody tr.table-warning .text-success,
[data-bs-theme="dark"] .table tbody tr.selected-row .text-success {
    color: #86efac !important;
}

[data-bs-theme="dark"] .table tbody tr.table-warning .text-warning,
[data-bs-theme="dark"] .table tbody tr.selected-row .text-warning {
    color: #fde047 !important;
}

[data-bs-theme="dark"] .table tbody tr.table-warning .text-info,
[data-bs-theme="dark"] .table tbody tr.selected-row .text-info {
    color: #67e8f9 !important;
}

[data-bs-theme="light"] .table tbody tr.table-warning .text-danger,
[data-bs-theme="light"] .table tbody tr.selected-row .text-danger,
.table tbody tr.table-warning .text-danger,
.table tbody tr.selected-row .text-danger {
    color: #b91c1c !important;
}

[data-bs-theme="light"] .table tbody tr.table-warning .text-primary,
[data-bs-theme="light"] .table tbody tr.selected-row .text-primary,
.table tbody tr.table-warning .text-primary,
.table tbody tr.selected-row .text-primary {
    color: #1d4ed8 !important;
}

[data-bs-theme="light"] .table tbody tr.table-warning .text-success,
[data-bs-theme="light"] .table tbody tr.selected-row .text-success,
.table tbody tr.table-warning .text-success,
.table tbody tr.selected-row .text-success {
    color: #15803d !important;
}

[data-bs-theme="light"] .table tbody tr.table-warning .text-warning,
[data-bs-theme="light"] .table tbody tr.selected-row .text-warning,
.table tbody tr.table-warning .text-warning,
.table tbody tr.selected-row .text-warning {
    color: #b45309 !important;
}

[data-bs-theme="light"] .table tbody tr.table-warning .text-info,
[data-bs-theme="light"] .table tbody tr.selected-row .text-info,
.table tbody tr.table-warning .text-info,
.table tbody tr.selected-row .text-info {
    color: #0e7490 !important;
}

/* Universal table-active High Contrast */
.table tbody tr.table-active,
.table tbody tr.table-active>td,
.table tbody tr.table-active>th {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    font-weight: 700 !important;
}

[data-bs-theme="dark"] .table tbody tr.table-active,
[data-bs-theme="dark"] .table tbody tr.table-active>td,
[data-bs-theme="dark"] .table tbody tr.table-active>th {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   Master Predictions: Timing Windows Exceeding Predicted Death Window
   ========================================================================== */

.table tbody tr.exceeds-death-window,
.table tbody tr.exceeds-death-window>td,
.table tbody tr.exceeds-death-window>th,
tr.exceeds-death-window,
tr.exceeds-death-window>td,
tr.exceeds-death-window>th {
    background-color: rgba(251, 146, 60, 0.22) !important;
    border-left: 4px solid #f97316 !important;
}

/* Light Theme: Warm Light Orange Background (#ffedd5) */
[data-bs-theme="light"] .table tbody tr.exceeds-death-window,
[data-bs-theme="light"] .table tbody tr.exceeds-death-window>td,
[data-bs-theme="light"] .table tbody tr.exceeds-death-window>th,
.theme-light .table tbody tr.exceeds-death-window,
.theme-light .table tbody tr.exceeds-death-window>td,
.theme-light .table tbody tr.exceeds-death-window>th {
    background-color: #ffedd5 !important;
    color: #431407 !important;
    border-left: 4px solid #f97316 !important;
}

[data-bs-theme="light"] .table tbody tr.exceeds-death-window .text-muted,
[data-bs-theme="light"] .table tbody tr.exceeds-death-window .text-secondary,
.theme-light .table tbody tr.exceeds-death-window .text-muted,
.theme-light .table tbody tr.exceeds-death-window .text-secondary {
    color: #7c2d12 !important;
}

/* Dark Theme: Luminous Light Translucent Orange */
[data-bs-theme="dark"] .table tbody tr.exceeds-death-window,
[data-bs-theme="dark"] .table tbody tr.exceeds-death-window>td,
[data-bs-theme="dark"] .table tbody tr.exceeds-death-window>th,
.theme-dark .table tbody tr.exceeds-death-window,
.theme-dark .table tbody tr.exceeds-death-window>td,
.theme-dark .table tbody tr.exceeds-death-window>th {
    background-color: rgba(251, 146, 60, 0.25) !important;
    border-left: 4px solid #f97316 !important;
}

[data-bs-theme="dark"] .table tbody tr.exceeds-death-window .text-muted,
[data-bs-theme="dark"] .table tbody tr.exceeds-death-window .text-secondary,
.theme-dark .table tbody tr.exceeds-death-window .text-muted,
.theme-dark .table tbody tr.exceeds-death-window .text-secondary {
    color: #fed7aa !important;
}

/* Hover States */
[data-bs-theme="light"] .table-hover>tbody>tr.exceeds-death-window:hover>*,
[data-bs-theme="light"] .table tbody tr.exceeds-death-window:hover>td,
.theme-light .table-hover>tbody>tr.exceeds-death-window:hover>*,
.theme-light .table tbody tr.exceeds-death-window:hover>td {
    background-color: #fed7aa !important;
}

[data-bs-theme="dark"] .table-hover>tbody>tr.exceeds-death-window:hover>*,
[data-bs-theme="dark"] .table tbody tr.exceeds-death-window:hover>td,
.theme-dark .table-hover>tbody>tr.exceeds-death-window:hover>*,
.theme-dark .table tbody tr.exceeds-death-window:hover>td {
    background-color: rgba(251, 146, 60, 0.35) !important;
}

[data-bs-theme="dark"] .card:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: var(--jy-bg-surface);
    border-color: var(--jy-border);
    color: #f1f5f9;
}

[data-bs-theme="dark"] .card-header:not(.astro-report-page *):not(.astro-report-modal-backdrop *):not([class*="bg-"]) {
    background-color: var(--jy-bg-surface-elevated);
    border-bottom-color: var(--jy-border);
    color: #ffffff;
}

/* Universal Clean White Table & Card Background for AstrologicalReportModal.razor */
/* High-Visibility Field Validation for Birth Details */
.jy-field-missing {
    border: 2px solid #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.08) !important;
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.3) !important;
    animation: jy-field-pulse 1.8s ease-in-out infinite;
}

@keyframes jy-field-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.35);
        border-color: #ef4444;
    }
    50% {
        box-shadow: 0 0 0 0.4rem rgba(239, 68, 68, 0.12);
        border-color: #f87171;
    }
}

.astro-report-modal-backdrop,
.astro-report-modal-backdrop *,
.astro-report-page,
.astro-report-page * {
    color-scheme: light !important;
}

[data-bs-theme="dark"] .astro-report-modal-backdrop,
[data-bs-theme="dark"] .astro-report-modal-backdrop .modal-content,
[data-bs-theme="dark"] .astro-report-modal-backdrop .astro-report-page,
[data-bs-theme="dark"] .astro-report-page,
[data-bs-theme="dark"] .astro-report-page .card,
[data-bs-theme="dark"] .astro-report-page .bg-white,
[data-bs-theme="dark"] .astro-report-page .bg-body-tertiary,
.astro-report-modal-backdrop .modal-content,
.astro-report-modal-backdrop .astro-report-page,
.astro-report-page,
.astro-report-page .card,
.astro-report-page .bg-white,
.astro-report-page .bg-body-tertiary {
    --bs-body-bg: #ffffff !important;
    --bs-body-color: #1e293b !important;
    --bs-table-bg: #ffffff !important;
    --bs-table-color: #1e293b !important;
    --bs-table-striped-bg: #f8fafc !important;
    --bs-table-striped-color: #1e293b !important;
    --bs-table-hover-bg: #f1f5f9 !important;
    --bs-table-border-color: #cbd5e1 !important;
    --bs-card-bg: #ffffff !important;
    --bs-card-color: #1e293b !important;
    --bs-card-border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
}

/* Base Table Background & Borders for Astrological Dossier */
.astro-report-modal-backdrop table,
.astro-report-modal-backdrop .table,
.astro-report-page table,
.astro-report-page .table {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.astro-report-page table > :not(caption) > * > * {
    border-color: #cbd5e1 !important;
}

/* Authentic Contextual Table Highlights (Preserve rich hues) */
.astro-report-page .table-primary,
.astro-report-page tr.table-primary,
.astro-report-page tr.table-primary > td,
.astro-report-page tr.table-primary > th,
.astro-report-page .table-primary-subtle,
.astro-report-page .table-primary-subtle > * {
    background-color: #eff6ff !important;
    color: #1e3a8a !important;
}

.astro-report-page .table-success,
.astro-report-page tr.table-success,
.astro-report-page tr.table-success > td,
.astro-report-page tr.table-success > th,
.astro-report-page .table-success-subtle,
.astro-report-page .table-success-subtle > * {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
}

.astro-report-page .table-warning,
.astro-report-page tr.table-warning,
.astro-report-page tr.table-warning > td,
.astro-report-page tr.table-warning > th,
.astro-report-page .table-warning-subtle,
.astro-report-page .table-warning-subtle > * {
    background-color: #fffbeb !important;
    color: #92400e !important;
}

.astro-report-page .table-danger,
.astro-report-page tr.table-danger,
.astro-report-page tr.table-danger > td,
.astro-report-page tr.table-danger > th,
.astro-report-page .table-danger-subtle,
.astro-report-page .table-danger-subtle > * {
    background-color: #fef2f2 !important;
    color: #991b1b !important;
}

.astro-report-page .table-info,
.astro-report-page tr.table-info,
.astro-report-page tr.table-info > td,
.astro-report-page tr.table-info > th,
.astro-report-page .table-info-subtle,
.astro-report-page .table-info-subtle > * {
    background-color: #f0f9ff !important;
    color: #075985 !important;
}

.astro-report-page .table-secondary,
.astro-report-page tr.table-secondary,
.astro-report-page tr.table-secondary > td,
.astro-report-page tr.table-secondary > th,
.astro-report-page .table-secondary-subtle,
.astro-report-page .table-secondary-subtle > * {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
}

/* Card Header Colors */
.astro-report-page .card-header.bg-primary,
.astro-report-page .card-header.bg-primary-subtle,
.astro-report-page .bg-primary-subtle {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}

.astro-report-page .card-header.bg-success,
.astro-report-page .card-header.bg-success-subtle,
.astro-report-page .bg-success-subtle {
    background-color: #dcfce7 !important;
    color: #15803d !important;
}

.astro-report-page .card-header.bg-warning,
.astro-report-page .card-header.bg-warning-subtle,
.astro-report-page .bg-warning-subtle {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
}

.astro-report-page .card-header.bg-danger,
.astro-report-page .card-header.bg-danger-subtle,
.astro-report-page .bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

.astro-report-page .card-header.bg-info,
.astro-report-page .card-header.bg-info-subtle,
.astro-report-page .bg-info-subtle {
    background-color: #e0f2fe !important;
    color: #0284c7 !important;
}

.astro-report-page .card-header:not([class*="bg-"]) {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

.astro-report-page thead th,
.astro-report-page .table thead th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    font-weight: 700 !important;
}

/* Alternating Striped Rows */
.astro-report-page .table-striped > tbody > tr:nth-of-type(odd):not([class*="table-"]) > * {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

.astro-report-page .table-striped > tbody > tr:nth-of-type(even):not([class*="table-"]) > * {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

/* Crisp Solid Badges in Dossier */
.astro-report-page .badge.bg-primary { background-color: #2563eb !important; color: #ffffff !important; }
.astro-report-page .badge.bg-success { background-color: #059669 !important; color: #ffffff !important; }
.astro-report-page .badge.bg-danger { background-color: #dc2626 !important; color: #ffffff !important; }
.astro-report-page .badge.bg-warning { background-color: #d97706 !important; color: #ffffff !important; }
.astro-report-page .badge.bg-info { background-color: #0284c7 !important; color: #ffffff !important; }
.astro-report-page .badge.bg-secondary { background-color: #64748b !important; color: #ffffff !important; }
.astro-report-page .badge.bg-dark { background-color: #0f172a !important; color: #ffffff !important; }

/* Kundali Chart Theming */
.kundali-chart-box {
    position: relative;
    border: 2px solid var(--kundali-border, #64748b) !important;
    background-color: var(--kundali-bg, #ffffff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.kundali-svg-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.kundali-house-number {
    font-size: 10px;
    color: var(--kundali-num, #64748b);
    margin-bottom: 2px;
    font-weight: 600;
}

/* Sidebar navigation enhancements */
.sidebar-nav .nav-link {
    transition: all 0.15s ease-in-out;
    border-radius: 6px;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

[data-bs-theme="dark"] .sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link.active {
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.25);
}

/* Inputs & Form adjustments */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    border-color: #3b4452;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: #5897fb;
    box-shadow: 0 0 0 0.25rem rgba(88, 151, 251, 0.25);
}

/* Monospace Reports */
.monospace-report {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.45;
}

/* General */
h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0d6efd;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

code {
    color: #c02d76;
}

/* Disable scrollbars during PDF export to capture full tables */
.exporting-pdf .table-responsive,
.exporting-pdf .overflow-auto,
.exporting-pdf .overflow-y-auto,
.exporting-pdf .scroll-container {
    overflow: visible !important;
    max-height: none !important;
}

/* Print styles for high quality PDF export via native browser print */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 6mm;
    }

    /* Hide specific non-printable UI elements and workstation chrome */
    .hide-on-print,
    .sidebar-nav,
    .border-end,
    #blazor-error-ui,
    .btn,
    button,
    .no-print,
    .jy-topbar,
    .jy-sidebar,
    .jy-sidebar-footer,
    .jy-suite-nav-container,
    .sidebar-overlay,
    .jy-session-banner,
    .jy-cat-dropdown-menu,
    .modal-header,
    .astro-report-action-bar {
        display: none !important;
    }

    /* Reset structural containers to allow multi-page flow (remove fixed heights, overflows, and viewports) */
    html,
    body,
    #app,
    .app,
    .jy-workstation,
    .jy-workstation-body,
    .jy-canvas,
    main,
    .d-flex,
    .h-100,
    .vh-100,
    .min-vh-100,
    .astro-report-inline-container,
    .astro-report-modal-backdrop,
    .modal,
    .modal-dialog,
    .modal-dialog.modal-fullscreen,
    .modal-content,
    .modal-body,
    .card-body,
    .astro-report-wrapper,
    .d-flex[style*="overflow: hidden"],
    .bg-body[style*="overflow-y: auto"] {
        position: static !important;
        inset: auto !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        transform: none !important;
        z-index: auto !important;
        float: none !important;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Format inputs and select dropdowns as clean text */
    input,
    select {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        font-weight: bold !important;
        color: #000000 !important;
        padding: 0 !important;
    }

    /* Disable scrollbars and expand tables */
    .table-responsive,
    .overflow-auto,
    .overflow-y-auto {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    thead {
        display: table-header-group !important;
    }

    th,
    td {
        border: 1px solid #94a3b8 !important;
        color: #000000 !important;
        background-color: #ffffff !important;
        font-size: 11px !important;
    }

    /* High contrast color overrides */
    .card,
    .bg-body-tertiary,
    .bg-body,
    .bg-dark,
    .bg-secondary,
    .border-secondary,
    .border-warning,
    .border-success,
    .border-danger,
    .border-primary {
        background-color: #ffffff !important;
        color: #000000 !important;
        border-color: #cbd5e1 !important;
        box-shadow: none !important;
    }

    .text-primary,
    .text-warning,
    .text-info,
    .text-success,
    .text-danger,
    .text-muted,
    .text-body-secondary,
    .text-white,
    .text-white-50,
    .text-light,
    .text-secondary {
        color: #000000 !important;
    }

    /* Artistic Birth Details */
    .print-birth-details {
        border: 2px double #000000 !important;
        padding: 20px !important;
        text-align: center !important;
        margin-bottom: 25px !important;
        border-radius: 8px !important;
        background-color: #fdfbf7 !important;
        /* Slight sepia/warm tone for print, some browsers may support it if print backgrounds are enabled */
    }

    .print-birth-details h6 {
        font-family: "Georgia", serif !important;
        font-size: 1.4rem !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        letter-spacing: 2px !important;
        border-bottom: 1px solid #000000 !important;
        padding-bottom: 10px !important;
        margin-bottom: 15px !important;
    }

    .print-birth-details .row {
        justify-content: center !important;
    }

    .print-birth-details input,
    .print-birth-details select {
        text-align: center !important;
        font-size: 1.1rem !important;
        font-family: "Georgia", serif !important;
    }

    .print-birth-details label {
        text-transform: uppercase !important;
        font-size: 0.8rem !important;
        letter-spacing: 1px !important;
        color: #555555 !important;
    }

    .badge {
        border: 1px solid #475569 !important;
        color: #000000 !important;
        background: #f1f5f9 !important;
    }

    /* Kundali Chart Vector Scaled */
    svg {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid !important;
    }

    .kundali-chart-box {
        background-color: #ffffff !important;
        border: 2px solid #000000 !important;
        box-shadow: none !important;
    }

    .kundali-svg-line {
        stroke: #000000 !important;
    }

    text {
        fill: #000000 !important;
    }

    /* Page Breaks */
    .pdf-page-break {
        page-break-before: always !important;
        break-before: page !important;
    }

    .avoid-page-break {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Astrological Dossier Report Specific Print Rules */
    .astro-report-modal-backdrop {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .modal-dialog.modal-fullscreen {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .modal-content {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .modal-body {
        padding: 0 !important;
        overflow: visible !important;
    }

    .astro-report-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .astro-report-page {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 255mm !important;
        max-height: none !important;
        padding: 8mm 6mm !important;
        margin: 0 0 10mm 0 !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        border: 2px solid #0f2b48 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-after: always !important;
        break-after: page !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        box-sizing: border-box !important;
        display: block !important;
        clear: both !important;
    }

    .astro-report-page:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }

    .astro-report-page table {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .astro-report-page .card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        border: 1px solid #94a3b8 !important;
    }

    .astro-report-page .astro-report-executive-banner {
        background: #0f172a !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: #ffffff !important;
        border-left: 5px solid #eab308 !important;
    }

    .astro-report-page .astro-report-executive-banner * {
        color: #ffffff !important;
    }

    .astro-report-page .astro-report-executive-banner .text-warning,
    .astro-report-page .astro-report-executive-banner h5 {
        color: #fde047 !important;
    }

    .astro-report-page .astro-report-executive-banner .text-white-50,
    .astro-report-page .astro-report-executive-banner .text-light {
        color: #e2e8f0 !important;
    }
}

/* Astrological Dossier Screen Preview Styling */
.astro-report-wrapper {
    max-width: 820px;
    margin: 0 auto;
}

.astro-report-page {
    background: #ffffff;
    color: #1e293b;
    border: 2px solid #1e3a8a;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
}

[data-bs-theme="dark"] .astro-report-page {
    background: #ffffff;
    /* Keep reports on pure white background for authenticity & print parity */
    color: #1e293b;
}

.astro-report-page .card {
    background: #ffffff !important;
    color: #1e293b !important;
}

.astro-report-page th,
.astro-report-page td {
    color: #1e293b !important;
}

.astro-report-page .text-primary {
    color: #1e3a8a !important;
}

.astro-report-page .bg-primary-subtle {
    background-color: #e0e7ff !important;
}

.astro-report-page .bg-secondary-subtle {
    background-color: #f1f5f9 !important;
}

.astro-report-page .bg-light-subtle {
    background-color: #f8fafc !important;
}

/* ==========================================================================
   SOLID VIBRANT BUTTON & INTERACTIVE COMPONENT STYLING
   No muddy gradients, no washed-out pastel buttons, crisp high-contrast tactile feel
   ========================================================================== */

/* Universal Button Base */
.btn {
    font-family: var(--jy-font-sans);
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: #2563eb !important;
    border: 1px solid #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #1d4ed8 !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
}

/* Light Mode Buttons */
[data-bs-theme="light"] .btn-warning {
    background-color: #d97706 !important;
    border: 1px solid #b45309 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

[data-bs-theme="light"] .btn-warning:hover,
[data-bs-theme="light"] .btn-warning:focus {
    background-color: #b45309 !important;
    border-color: #92400e !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-info {
    background-color: #0284c7 !important;
    border: 1px solid #0369a1 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

[data-bs-theme="light"] .btn-info:hover {
    background-color: #0369a1 !important;
    border-color: #075985 !important;
    color: #ffffff !important;
}

/* Dark Mode Buttons */
[data-bs-theme="dark"] .btn-warning {
    background-color: #d97706 !important;
    border: 1px solid #f59e0b !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

[data-bs-theme="dark"] .btn-warning:hover,
[data-bs-theme="dark"] .btn-warning:focus {
    background-color: #f59e0b !important;
    border-color: #fbbf24 !important;
    color: #0b101b !important;
}

[data-bs-theme="dark"] .btn-info {
    background-color: #0284c7 !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

[data-bs-theme="dark"] .btn-info:hover {
    background-color: #0369a1 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #059669 !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.btn-success:hover {
    background-color: #047857 !important;
    border-color: #065f46 !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #dc2626 !important;
    border: 1px solid #b91c1c !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.btn-danger:hover {
    background-color: #b91c1c !important;
    border-color: #991b1b !important;
    color: #ffffff !important;
}

/* Secondary & Outline Buttons */
[data-bs-theme="dark"] .btn-outline-secondary {
    background-color: #12131c !important;
    border-color: #2f344e !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #1e2133 !important;
    border-color: #3d4466 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    background-color: #12131c !important;
    border-color: #6366f1 !important;
    color: #818cf8 !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-warning {
    background-color: #12131c !important;
    border-color: #d97706 !important;
    color: #fbbf24 !important;
}

[data-bs-theme="dark"] .btn-outline-warning:hover {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-info {
    background-color: #12131c !important;
    border-color: #0284c7 !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .btn-outline-info:hover {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Nav Pills (High-Contrast Solid Selection) */
.nav-pills .nav-link {
    background-color: #131420 !important;
    border: 1px solid #222538 !important;
    color: #cbd5e1 !important;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-pills .nav-link:hover {
    background-color: #1e2133 !important;
    border-color: #2f344e !important;
    color: #ffffff !important;
}

.nav-pills .nav-link.active {
    background-color: #6366f1 !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Solid Saturated Badges (High Contrast, Zero Washed-out Tints) */
.badge {
    font-family: var(--jy-font-sans);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 3px 8px;
    border-radius: 4px;
}

[data-bs-theme="dark"] .badge.bg-primary {
    background-color: #2563eb !important;
    border: 1px solid #3b82f6 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-success {
    background-color: #059669 !important;
    border: 1px solid #10b981 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-warning {
    background-color: #d97706 !important;
    border: 1px solid #f59e0b !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

[data-bs-theme="dark"] .badge.bg-warning-subtle {
    background-color: #291e0a !important;
    border: 1px solid #b45309 !important;
    color: #fde047 !important;
}

[data-bs-theme="dark"] .badge.bg-danger {
    background-color: #dc2626 !important;
    border: 1px solid #ef4444 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-info {
    background-color: #0284c7 !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-info-subtle {
    background-color: #0c2338 !important;
    border: 1px solid #0369a1 !important;
    color: #7dd3fc !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #1a1c2b !important;
    border: 1px solid #2f344e !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .badge.bg-dark {
    background-color: #0f111a !important;
    border: 1px solid #222538 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="light"] .badge.bg-primary {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .badge.bg-success {
    background-color: #059669 !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .badge.bg-warning {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .badge.bg-danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .badge.bg-info {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .badge.bg-secondary {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

/* ==========================================================================
   STRICT DARK TEXT RULE ENFORCEMENT & UTILITY OVERRIDES (WCAG AAA)
   ========================================================================== */
[data-bs-theme="dark"] :not(.astro-report-page):not(.astro-report-modal-backdrop) .text-dark,
[data-bs-theme="dark"] .text-dark:not(.astro-report-page *):not(.astro-report-modal-backdrop *),
[data-bs-theme="dark"] .text-black:not(.astro-report-page *):not(.astro-report-modal-backdrop *),
[data-bs-theme="dark"] .text-body-secondary.text-dark {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .text-muted:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    color: #94a3b8 !important;
    /* 6.61:1 AA high contrast */
}

[data-bs-theme="dark"] .text-secondary:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    color: #cbd5e1 !important;
    /* 11.45:1 AAA high contrast */
}

[data-bs-theme="dark"] .table-light:not(.astro-report-page *):not(.astro-report-modal-backdrop *),
[data-bs-theme="dark"] thead.table-light:not(.astro-report-page *):not(.astro-report-modal-backdrop *) th {
    background-color: #1a1c2b !important;
    color: #ffffff !important;
    border-color: #222538 !important;
}

[data-bs-theme="dark"] .table-secondary:not(.astro-report-page *):not(.astro-report-modal-backdrop *),
[data-bs-theme="dark"] tr.table-secondary:not(.astro-report-page *):not(.astro-report-modal-backdrop *) th,
[data-bs-theme="dark"] tr.table-secondary:not(.astro-report-page *):not(.astro-report-modal-backdrop *) td {
    background-color: #161824 !important;
    color: #cbd5e1 !important;
    border-color: #222538 !important;
}

[data-bs-theme="dark"] .bg-body-tertiary:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #12131c !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .bg-body-secondary:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #1a1c2b !important;
    color: #cbd5e1 !important;
}

/* Solid Form Controls (Zero low-contrast blur) */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f111a !important;
    border-color: #2f344e !important;
    color: #ffffff !important;
    font-weight: 500;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    background-color: #121422 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .form-label {
    color: #cbd5e1 !important;
    font-weight: 600;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #1a1c2b !important;
    border-color: #2f344e !important;
    color: #cbd5e1 !important;
}

/* Solid Professional Cards */
[data-bs-theme="dark"] .card:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #12131c !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .card:not(.astro-report-page *):not(.astro-report-modal-backdrop *):not([class*="border-"]) {
    border: 1px solid #222538 !important;
}

[data-bs-theme="dark"] .card-header:not(.astro-report-page *):not(.astro-report-modal-backdrop *):not([class*="bg-"]) {
    background-color: #1a1c2b !important;
    border-bottom: 1px solid #222538 !important;
    color: #ffffff !important;
    font-weight: 700;
}

/* Dark Mode Refined Theme Accent Borders & Subtle Backgrounds */
[data-bs-theme="dark"] .border-primary {
    border-color: #6366f1 !important;
}
[data-bs-theme="dark"] .border-success {
    border-color: #10b981 !important;
}
[data-bs-theme="dark"] .border-info {
    border-color: #06b6d4 !important;
}
[data-bs-theme="dark"] .border-warning {
    border-color: #f59e0b !important;
}
[data-bs-theme="dark"] .border-danger {
    border-color: #ef4444 !important;
}

[data-bs-theme="dark"] .bg-body {
    background-color: #12131c !important;
}

[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: #0d0e17 !important;
}

[data-bs-theme="dark"] .bg-primary-subtle {
    background-color: rgba(99, 102, 241, 0.16) !important;
    color: #818cf8 !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
}

[data-bs-theme="dark"] .bg-success-subtle {
    background-color: rgba(5, 150, 105, 0.16) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-bs-theme="dark"] .bg-info-subtle {
    background-color: rgba(2, 132, 199, 0.16) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

[data-bs-theme="dark"] .bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.16) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

/* Refined Tactile Button Aesthetics in Dark Mode */
[data-bs-theme="dark"] .btn-outline-primary {
    color: #60a5fa;
    border-color: #3b82f6;
    background-color: rgba(37, 99, 235, 0.08);
}
[data-bs-theme="dark"] .btn-outline-primary:hover {
    color: #ffffff;
    background-color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}
[data-bs-theme="dark"] .btn-outline-success {
    color: #34d399;
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.08);
}
[data-bs-theme="dark"] .btn-outline-success:hover {
    color: #ffffff;
    background-color: #059669;
    border-color: #059669;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
[data-bs-theme="dark"] .btn-outline-info {
    color: #38bdf8;
    border-color: #0284c7;
    background-color: rgba(2, 132, 199, 0.08);
}
[data-bs-theme="dark"] .btn-outline-info:hover {
    color: #ffffff;
    background-color: #0284c7;
    border-color: #0284c7;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}
[data-bs-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #334155;
    background-color: rgba(51, 65, 85, 0.15);
}
[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: #ffffff;
    background-color: #1e293b;
    border-color: #475569;
}

/* ==========================================================================
   KP ASTRO 108 — CELESTIAL PRECISION WORKSTATION SHELL
   ========================================================================== */

.jy-workstation {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--jy-bg-canvas);
    color: var(--jy-text-primary);
}

/* --- Top Application Bar --- */
.jy-topbar {
    height: var(--jy-topbar-h, 56px);
    min-height: var(--jy-topbar-h, 56px);
    background-color: var(--jy-bg-surface);
    border-bottom: 1px solid var(--jy-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.jy-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--jy-text-primary);
    user-select: none;
}

.jy-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: var(--jy-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #fff;
    border: 1px solid var(--jy-primary-hover);
}

.jy-brand-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--jy-text-primary);
}

.jy-brand-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--jy-accent-gold-soft);
    color: var(--jy-accent-gold);
    border: 1px solid var(--jy-accent-gold-border);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Active Profile Pill in Topbar */
.jy-profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px;
    background-color: var(--jy-bg-surface-subtle);
    border: 1px solid var(--jy-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    max-width: 440px;
}

.jy-profile-pill:hover {
    border-color: var(--jy-primary);
    background-color: var(--jy-bg-surface-elevated);
}

.jy-profile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    border: 1px solid #059669;
    flex-shrink: 0;
}

.jy-profile-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--jy-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.jy-profile-meta {
    font-size: 11px;
    color: var(--jy-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Topbar Action Buttons */
.jy-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jy-btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--jy-bg-surface-subtle);
    border: 1px solid var(--jy-border);
    color: var(--jy-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
}

.jy-btn-icon:hover {
    background-color: var(--jy-bg-surface-elevated);
    border-color: var(--jy-primary);
    color: var(--jy-text-primary);
}

/* --- Workstation Main Layout Split --- */
.jy-workstation-body {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* --- Sidebar Navigation --- */
.jy-sidebar {
    width: var(--jy-sidebar-w, 260px);
    min-width: var(--jy-sidebar-w, 260px);
    height: 100%;
    background-color: var(--jy-bg-surface);
    border-right: 1px solid var(--jy-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1020;
    user-select: none;
}

.jy-sidebar.collapsed {
    width: var(--jy-sidebar-w-collapsed, 68px);
    min-width: var(--jy-sidebar-w-collapsed, 68px);
}

.jy-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
}

.jy-sidebar-group {
    margin-bottom: 16px;
}

.jy-sidebar-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--jy-text-muted);
    padding: 6px 10px 4px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jy-sidebar.collapsed .jy-sidebar-group-title {
    text-align: center;
    padding: 4px 0;
    font-size: 9px;
}

.jy-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--jy-text-secondary);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    margin-bottom: 2px;
    position: relative;
    white-space: nowrap;
}

.jy-sidebar-item:hover {
    color: var(--jy-text-primary);
    background-color: var(--jy-bg-surface-elevated);
}

.jy-sidebar-item.active {
    color: #ffffff !important;
    background-color: var(--jy-primary) !important;
    font-weight: 700;
}

.jy-sidebar-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background-color: var(--jy-accent-gold);
    border-radius: 0 2px 2px 0;
}

.jy-sidebar-item.disabled,
.jy-sidebar-item-locked {
    color: var(--jy-text-muted) !important;
    background: transparent !important;
    cursor: not-allowed !important;
}

.jy-sidebar-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.jy-sidebar-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jy-sidebar.collapsed .jy-sidebar-label,
.jy-sidebar.collapsed .jy-sidebar-badge {
    display: none;
}

.jy-sidebar.collapsed .jy-sidebar-item {
    justify-content: center;
    padding: 8px 0;
}

.jy-sidebar-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: var(--jy-bg-surface-subtle);
    border: 1px solid var(--jy-border);
    color: var(--jy-text-secondary);
    font-weight: 600;
}

/* Sidebar Footer */
.jy-sidebar-footer {
    padding: 8px;
    border-top: 1px solid var(--jy-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--jy-bg-surface-subtle);
}

/* --- Suite Navigation Horizontal Command Bar --- */
.jy-suite-nav-container {
    background-color: var(--jy-bg-surface-subtle);
    border: 1px solid var(--jy-border);
    border-radius: 8px;
    padding: 4px 6px;
}

.jy-cat-trigger-btn {
    background-color: var(--jy-bg-surface);
    border: 1px solid var(--jy-border);
    color: var(--jy-text-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.jy-cat-trigger-btn:hover {
    background-color: var(--jy-bg-surface-elevated);
    border-color: var(--jy-primary);
}

.jy-cat-dropdown-menu {
    background-color: var(--jy-bg-surface);
    border: 1px solid var(--jy-border);
    border-radius: 8px;
    padding: 6px;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    z-index: 1060;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.jy-cat-menu-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--jy-text-muted);
    letter-spacing: 0.08em;
    padding: 4px 8px;
}

.jy-cat-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--jy-text-secondary);
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.jy-cat-menu-item:hover {
    background-color: var(--jy-bg-surface-elevated);
    color: var(--jy-text-primary);
}

.jy-cat-menu-item.active {
    background-color: var(--jy-primary);
    color: #ffffff;
}

.jy-module-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    background-color: var(--jy-bg-surface);
    border: 1px solid var(--jy-border);
    color: var(--jy-text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.jy-module-pill:hover {
    background-color: var(--jy-bg-surface-elevated);
    border-color: var(--jy-border-strong);
    color: var(--jy-text-primary);
}

.jy-module-pill.active {
    background-color: var(--jy-primary) !important;
    border-color: var(--jy-primary) !important;
    color: #ffffff !important;
    font-weight: 700;
}

.jy-module-pill.disabled-pill {
    background-color: var(--jy-bg-surface-subtle) !important;
    border-color: var(--jy-border) !important;
    color: var(--jy-text-muted) !important;
    cursor: not-allowed;
}

/* --- Workspace Canvas Area --- */
.jy-canvas {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background-color: var(--jy-bg-canvas);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

[data-bs-theme="light"] .jy-canvas {
    background-color: var(--jy-bg-canvas, #f8f6f0);
}

/* --- Workstation Cards --- */
.jy-card {
    background-color: var(--jy-bg-surface);
    border: 1px solid var(--jy-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.jy-card-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--jy-border);
    background-color: var(--jy-bg-surface-subtle);
    border-radius: 7px 7px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jy-card-title {
    font-size: 13.5px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--jy-text-primary);
}

.jy-card-body {
    padding: 14px;
}

/* --- Tables & Data Grids --- */
.jy-table-container {
    border: 1px solid var(--jy-border);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--jy-bg-surface);
}

.jy-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 12.5px;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--jy-bg-surface);
    color: var(--jy-text-primary);
}

.jy-table thead th {
    background-color: var(--jy-bg-surface-subtle);
    color: var(--jy-text-secondary);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 10px;
    border-bottom: 1px solid var(--jy-border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.jy-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--jy-border);
    color: var(--jy-text-primary);
    vertical-align: middle;
}

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

.jy-table-hover tbody tr:hover td {
    background-color: var(--jy-bg-surface-elevated);
}

/* --- Modern Kundali Container --- */
.jy-chart-workstation-box {
    background-color: var(--kundali-bg, #ffffff);
    border: 2px solid var(--kundali-border, #b45309);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    position: relative;
    user-select: none;
    overflow: hidden;
}

/* --- Responsive Layout Breakpoints --- */
@media (max-width: 991.98px) {
    .jy-sidebar {
        position: fixed;
        top: var(--jy-topbar-h, 56px);
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.6);
        z-index: 1040;
    }

    .jy-sidebar.show-mobile {
        transform: translateX(0);
    }

    .jy-profile-pill {
        max-width: 220px;
    }
}

/* --- HUD & Specialized Studio Styling --- */
.hud-card {
    background-color: var(--jy-bg-surface) !important;
    border: 1px solid var(--jy-border) !important;
    border-radius: 8px;
    color: var(--jy-text-primary) !important;
}

.hud-card .text-muted {
    color: var(--jy-text-muted) !important;
}

.text-gold {
    color: var(--jy-accent-gold) !important;
}

/* --- Master Studio Header System --- */
.jy-studio-header {
    background-color: var(--jy-bg-surface) !important;
    border: 1px solid var(--jy-border) !important;
    border-left: 4px solid var(--jy-border-highlight) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    color: var(--jy-text-primary) !important;
}

.jy-studio-header.header-cobalt {
    border-left-color: #2563eb !important;
}

.jy-studio-header.header-emerald {
    border-left-color: #059669 !important;
}

.jy-studio-header.header-purple {
    border-left-color: #7c3aed !important;
}

.jy-studio-header.header-cyan {
    border-left-color: #0284c7 !important;
}

.jy-studio-header.header-crimson {
    border-left-color: #dc2626 !important;
}

.jy-session-banner {
    background-color: var(--jy-bg-surface);
    border: 1px solid var(--jy-border);
    border-left: 4px solid var(--jy-border-highlight);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    color: var(--jy-text-primary);
}

.jy-input-deck {
    background-color: var(--jy-bg-surface);
    border: 1px solid var(--jy-border);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.jy-place-dropdown {
    background-color: var(--jy-bg-surface) !important;
    border: 1px solid var(--jy-border) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
}

.jy-place-item {
    background-color: var(--jy-bg-surface) !important;
    border-bottom: 1px solid var(--jy-border) !important;
    color: var(--jy-text-primary) !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.jy-place-item:hover {
    background-color: var(--jy-bg-surface-elevated) !important;
    color: var(--jy-primary) !important;
}

.jy-subnav-container {
    background-color: var(--jy-bg-surface-subtle);
    border: 1px solid var(--jy-border);
    border-radius: 8px;
}

/* ==========================================================================
   Universal High-Contrast Dark Surface & Alert Overrides
   Prevents any low-contrast white-on-light or dark-on-dark across the app
   ========================================================================== */
[data-bs-theme="dark"] .bg-light-subtle:not(.astro-report-page *):not(.astro-report-modal-backdrop *),
[data-bs-theme="dark"] .bg-light:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #1a1c2b !important;
    border-color: #222538 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .table tbody tr.table-danger,
[data-bs-theme="dark"] .table tbody tr.table-danger>td,
[data-bs-theme="dark"] .table tbody tr.table-danger>th {
    background-color: #3b1114 !important;
    color: #fca5a5 !important;
    font-weight: 600;
}

[data-bs-theme="dark"] .table tbody tr.table-danger td,
[data-bs-theme="dark"] .table tbody tr.table-danger th {
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .table tbody tr.table-success,
[data-bs-theme="dark"] .table tbody tr.table-success>td,
[data-bs-theme="dark"] .table tbody tr.table-success>th {
    background-color: #064e3b !important;
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .table tbody tr.table-info,
[data-bs-theme="dark"] .table tbody tr.table-info>td,
[data-bs-theme="dark"] .table tbody tr.table-info>th {
    background-color: #0c4a6e !important;
    color: #7dd3fc !important;
}

[data-bs-theme="dark"] .badge.bg-success-subtle {
    background-color: #064e3b !important;
    color: #a7f3d0 !important;
    border: 1px solid #059669 !important;
}

[data-bs-theme="dark"] .badge.bg-danger-subtle {
    background-color: #450a0a !important;
    color: #fca5a5 !important;
    border: 1px solid #dc2626 !important;
}

[data-bs-theme="dark"] .badge.bg-warning-subtle {
    background-color: #451a03 !important;
    color: #fde047 !important;
    border: 1px solid #d97706 !important;
}

[data-bs-theme="dark"] .badge.bg-info-subtle {
    background-color: #082f49 !important;
    color: #7dd3fc !important;
    border: 1px solid #0284c7 !important;
}

/* ==========================================================================
   Universal High-Contrast Protection: NO White Text on Light Backgrounds
   ========================================================================== */

/* 1. Light backgrounds must NEVER allow white or washed-out text */
.bg-light,
.bg-light-subtle,
.bg-white,
.table-light,
.table-light th,
.table-light td,
.alert-light,
.card.bg-light,
.card.bg-white {
    color: #0f172a !important;
}

/* Force dark readable text for all child text nodes that attempt text-white/text-light over light surfaces */
.bg-light .text-white,
.bg-light-subtle .text-white,
.bg-white .text-white,
.table-light .text-white,
.alert-light .text-white,
.card.bg-light .text-white,
.card.bg-white .text-white {
    color: #0f172a !important;
}

.bg-light .text-light,
.bg-light-subtle .text-light,
.bg-white .text-light,
.table-light .text-light,
.alert-light .text-light,
.card.bg-light .text-light,
.card.bg-white .text-light {
    color: #334155 !important;
}

/* 2. Light badges safety */
.badge.bg-light,
.badge.bg-white,
.badge.bg-light-subtle {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

.badge.bg-warning {
    color: #0f172a !important;
}

.badge.bg-warning.text-white {
    color: #0f172a !important;
}

/* 3. Dark Theme Table-Light and Light Badge Elevation:
   In dark mode, light tables and badges become rich solid navy slate surfaces with crisp text */
[data-bs-theme="dark"] thead.table-light,
[data-bs-theme="dark"] thead.table-light th,
[data-bs-theme="dark"] tr.table-light,
[data-bs-theme="dark"] tr.table-light td,
[data-bs-theme="dark"] tr.table-light th,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light>th,
[data-bs-theme="dark"] .table-light>td {
    background-color: #1a1c2b !important;
    color: #f8fafc !important;
    border-color: #222538 !important;
}

[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-white,
[data-bs-theme="dark"] .badge.bg-light-subtle,
[data-bs-theme="dark"] .badge.bg-light.text-dark,
[data-bs-theme="dark"] .badge.bg-white.text-dark,
[data-bs-theme="dark"] .badge.bg-light-subtle.text-dark,
[data-bs-theme="dark"] .badge.bg-secondary.text-dark,
[data-bs-theme="dark"] .badge.bg-dark.text-dark {
    background-color: #1a1c2b !important;
    color: #f8fafc !important;
    border: 1px solid #2f344e !important;
}

[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .badge.bg-info.text-dark {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
}

[data-bs-theme="dark"] .badge.bg-success,
[data-bs-theme="dark"] .badge.bg-success.text-dark {
    background-color: #059669 !important;
    color: #ffffff !important;
    border: 1px solid #10b981 !important;
}

[data-bs-theme="dark"] .badge.bg-primary,
[data-bs-theme="dark"] .badge.bg-primary.text-dark {
    background-color: #6366f1 !important;
    color: #ffffff !important;
    border: 1px solid #818cf8 !important;
}

[data-bs-theme="dark"] .badge.bg-danger,
[data-bs-theme="dark"] .badge.bg-danger.text-dark {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #ef4444 !important;
}

[data-bs-theme="dark"] .badge.bg-warning-subtle,
[data-bs-theme="dark"] .badge.bg-warning-subtle.text-dark {
    background-color: #3b2606 !important;
    color: #fde047 !important;
    border: 1px solid #b45309 !important;
}

[data-bs-theme="dark"] .badge.bg-warning {
    background-color: #f59e0b !important;
    color: #090a0f !important;
    font-weight: 700 !important;
    border: 1px solid #d97706 !important;
}

[data-bs-theme="dark"] .alert-light {
    background-color: #12131c !important;
    color: #e2e8f0 !important;
    border-color: #222538 !important;
}

[data-bs-theme="dark"] .card-header.bg-body-tertiary {
    background-color: #12131c !important;
    color: #f8fafc !important;
    border-bottom: 1px solid #222538 !important;
}

/* Dark mode: prevent dark text collisions inside tables, cards, headers, and alerts */
[data-bs-theme="dark"] tr.table-secondary,
[data-bs-theme="dark"] tr.table-secondary td,
[data-bs-theme="dark"] tr.table-secondary th,
[data-bs-theme="dark"] thead.table-secondary,
[data-bs-theme="dark"] thead.table-secondary th,
[data-bs-theme="dark"] .table-secondary.text-dark {
    background-color: #1c1f30 !important;
    color: #f8fafc !important;
    border-color: #2f344e !important;
}

[data-bs-theme="dark"] thead.table-secondary.text-dark th,
[data-bs-theme="dark"] tr.table-secondary.text-dark th,
[data-bs-theme="dark"] tr.table-secondary.text-dark td {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .card-header.bg-info.text-dark {
    background-color: #0369a1 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] tr.table-success,
[data-bs-theme="dark"] tr.table-success>td,
[data-bs-theme="dark"] tr.table-success>th {
    background-color: #064e3b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] tr.table-success .text-muted,
[data-bs-theme="dark"] tr.table-success .text-secondary {
    color: #a7f3d0 !important;
}

/* Universal dark mode text-dark safeguard: outside of bright saffron warning buttons/badges, force crisp white/light text */
[data-bs-theme="dark"] div.text-dark:not(.btn-warning):not(.badge.bg-warning),
[data-bs-theme="dark"] span.text-dark:not(.btn-warning):not(.badge.bg-warning):not(.badge.bg-warning-subtle),
[data-bs-theme="dark"] strong.text-dark:not(.btn-warning):not(.badge.bg-warning),
[data-bs-theme="dark"] p.text-dark:not(.btn-warning):not(.badge.bg-warning),
[data-bs-theme="dark"] td.text-dark,
[data-bs-theme="dark"] th.text-dark,
[data-bs-theme="dark"] summary.text-dark,
[data-bs-theme="dark"] .card-body .text-dark:not(.btn-warning):not(.badge.bg-warning),
[data-bs-theme="dark"] .card-header .text-dark:not(.btn-warning):not(.badge.bg-warning),
[data-bs-theme="dark"] .alert .text-dark:not(.alert-warning) {
    color: #f8fafc !important;
}

/* 2. Light Mode Contrast Invariants */
[data-bs-theme="light"] .badge.bg-warning,
[data-bs-theme="light"] .badge.bg-warning.text-white {
    background-color: #f59e0b !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    border: 1px solid #d97706 !important;
}

[data-bs-theme="light"] .badge.bg-info,
[data-bs-theme="light"] .badge.bg-info.text-dark {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid #0369a1 !important;
}

[data-bs-theme="light"] tr.table-success,
[data-bs-theme="light"] tr.table-success>td,
[data-bs-theme="light"] tr.table-success>th {
    background-color: #d1fae5 !important;
    color: #064e3b !important;
}

[data-bs-theme="light"] tr.table-success .text-muted,
[data-bs-theme="light"] tr.table-success .text-secondary {
    color: #065f46 !important;
}

/* Ensure surfaces with .bg-light or .bg-white in dark mode are styled as elevated dark surfaces */
[data-bs-theme="dark"] div.bg-light:not(.astro-report-page *):not(.astro-report-modal-backdrop *),
[data-bs-theme="dark"] div.bg-white:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #1a1c2b !important;
    color: #f8fafc !important;
    border-color: #222538 !important;
}

[data-bs-theme="dark"] table.bg-white:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #12131c !important;
    color: #f8fafc !important;
    border-color: #222538 !important;
}

/* ==========================================================================
   LUXURY SANDSTONE LIGHT THEME SURFACES & COMPONENT STYLING
   ========================================================================== */
[data-bs-theme="light"] body {
    background-color: #f8f6f0 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-workstation {
    background-color: #f8f6f0 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-canvas {
    background-color: #f8f6f0 !important;
}

[data-bs-theme="light"] .jy-topbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e7dfd5 !important;
    box-shadow: 0 1px 4px rgba(28, 25, 23, 0.05) !important;
}

[data-bs-theme="light"] .jy-topbar-brand,
[data-bs-theme="light"] .jy-brand-title {
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-brand-logo {
    background-color: #b45309 !important;
    border-color: #92400e !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .jy-brand-badge {
    background-color: #f5f2eb !important;
    color: #b45309 !important;
    border: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .jy-profile-pill {
    background-color: #f5f2eb !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-profile-pill:hover {
    background-color: #f1ede4 !important;
    border-color: #b45309 !important;
}

[data-bs-theme="light"] .jy-profile-name {
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-profile-meta {
    color: #78716c !important;
}

[data-bs-theme="light"] .jy-btn-icon {
    background-color: #f5f2eb !important;
    border: 1px solid #e7dfd5 !important;
    color: #57534e !important;
}

[data-bs-theme="light"] .jy-btn-icon:hover {
    background-color: #f1ede4 !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
}

[data-bs-theme="light"] .jy-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .jy-sidebar-group-title {
    color: #b45309 !important;
}

[data-bs-theme="light"] .jy-sidebar-item {
    color: #57534e !important;
}

[data-bs-theme="light"] .jy-sidebar-item:hover {
    color: #2563eb !important;
    background-color: #f5f2eb !important;
}

[data-bs-theme="light"] .jy-sidebar-item.active {
    color: #ffffff !important;
    background-color: #2563eb !important;
    font-weight: 700 !important;
}

[data-bs-theme="light"] .jy-sidebar-item.active::before {
    background-color: #b45309 !important;
}

[data-bs-theme="light"] .jy-sidebar-badge {
    background-color: #f5f2eb !important;
    border: 1px solid #e7dfd5 !important;
    color: #2563eb !important;
}

[data-bs-theme="light"] .jy-sidebar-footer {
    background-color: #f5f2eb !important;
    border-top: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .jy-suite-nav-container {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .jy-cat-trigger-btn {
    background-color: #f5f2eb !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-cat-trigger-btn:hover {
    background-color: #f1ede4 !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
}

[data-bs-theme="light"] .jy-cat-dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    box-shadow: 0 4px 20px rgba(28, 25, 23, 0.08) !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-card,
[data-bs-theme="light"] .card:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
    box-shadow: 0 2px 6px rgba(28, 25, 23, 0.04) !important;
}

[data-bs-theme="light"] .jy-card-header,
[data-bs-theme="light"] .card-header:not(.astro-report-page *):not(.astro-report-modal-backdrop *) {
    background-color: #f5f2eb !important;
    border-bottom: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-card-title {
    color: #1c1917 !important;
}

/* Jyotish Workstation Light Mode Surface Overhauls */
[data-bs-theme="light"] .jy-input-deck {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.04) !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-studio-header {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    border-left: 4px solid #b45309 !important;
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.04) !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-studio-header h5,
[data-bs-theme="light"] .jy-studio-header .text-warning {
    color: #b45309 !important;
}

[data-bs-theme="light"] .jy-studio-header .text-light {
    color: #57534e !important;
}

[data-bs-theme="light"] .jy-session-banner {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    border-left: 4px solid #2563eb !important;
    box-shadow: 0 1px 4px rgba(28, 25, 23, 0.04) !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-subnav-container {
    background-color: #f5f2eb !important;
    border: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .jy-subnav-container .nav-link:not(.active) {
    color: #57534e !important;
}

[data-bs-theme="light"] .jy-place-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    box-shadow: 0 12px 32px rgba(28, 25, 23, 0.1) !important;
}

[data-bs-theme="light"] .jy-place-item {
    background-color: #ffffff !important;
    border-bottom: 1px solid #eee8df !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .jy-place-item:hover {
    background-color: #f1ede4 !important;
    color: #2563eb !important;
}

[data-bs-theme="light"] .hud-card {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.04) !important;
}

[data-bs-theme="light"] .hud-card .text-muted {
    color: #78716c !important;
}

[data-bs-theme="light"] .jy-chart-workstation-box {
    background-color: #ffffff !important;
    border: 2px solid #b45309 !important;
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.08) !important;
}

[data-bs-theme="light"] .metric-card,
[data-bs-theme="light"] .yoga-card,
[data-bs-theme="light"] .domain-badge-card,
[data-bs-theme="light"] .modal-dialog-custom,
[data-bs-theme="light"] .modal-header-custom,
[data-bs-theme="light"] .modal-nav-tabs,
[data-bs-theme="light"] .modal-footer-custom,
[data-bs-theme="light"] .glass-card,
[data-bs-theme="light"] .avastha-box,
[data-bs-theme="light"] .planet-avatar,
[data-bs-theme="light"] .house-avatar,
[data-bs-theme="light"] .category-pills .pill-btn {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #e7dfd5 !important;
    color: #1c1917 !important;
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.04) !important;
}

[data-bs-theme="light"] .jy-table-container {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .jy-table thead th {
    background-color: #f5f2eb !important;
    color: #57534e !important;
    border-bottom: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .jy-table tbody tr {
    border-bottom: 1px solid #eee8df !important;
}

[data-bs-theme="light"] .jy-table tbody tr:hover {
    background-color: #f1ede4 !important;
}

[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15) !important;
}

[data-bs-theme="light"] .input-group-text {
    background-color: #f5f2eb !important;
    border: 1px solid #e7dfd5 !important;
    color: #57534e !important;
}

[data-bs-theme="light"] .btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-primary:hover,
[data-bs-theme="light"] .btn-primary:focus {
    background-color: #1d4ed8 !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-outline-primary {
    border-color: #2563eb !important;
    color: #2563eb !important;
}

[data-bs-theme="light"] .btn-outline-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-outline-secondary {
    border-color: #e7dfd5 !important;
    color: #57534e !important;
}

[data-bs-theme="light"] .btn-outline-secondary:hover {
    background-color: #f5f2eb !important;
    border-color: #d6c7b2 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .modal-content {
    background-color: #ffffff !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .modal-header,
[data-bs-theme="light"] .modal-footer {
    background-color: #f5f2eb !important;
    border-color: #eee8df !important;
}

/* ==========================================================================
   UNIVERSAL TABLE & BOX LIGHT MODE OVERHAUL (ZERO LEAKY DARK ELEMENTS)
   ========================================================================== */

/* 1. UNIVERSAL TABLES: Reset all Bootstrap 5 table variables, box-shadows, and dark skins */
[data-bs-theme="light"] table,
[data-bs-theme="light"] .table,
[data-bs-theme="light"] .table-dark,
[data-bs-theme="light"] table.table-dark,
[data-bs-theme="light"] .table:not(.astro-report-page *):not(.astro-report-modal-backdrop *),
[data-bs-theme="light"] table[style*="background"],
[data-bs-theme="light"] table[style*="background-color"] {
    --bs-table-color: #1c1917 !important;
    --bs-table-bg: #ffffff !important;
    --bs-table-border-color: #e7dfd5 !important;
    --bs-table-striped-bg: #faf8f5 !important;
    --bs-table-striped-color: #1c1917 !important;
    --bs-table-active-bg: #f1ede4 !important;
    --bs-table-active-color: #1c1917 !important;
    --bs-table-hover-bg: #f1ede4 !important;
    --bs-table-hover-color: #1c1917 !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-bg-state: transparent !important;
    --bs-table-bg-type: transparent !important;
    color: #1c1917 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #e7dfd5 !important;
}

/* Eliminate Bootstrap's 9999px dark cell box-shadow */
[data-bs-theme="light"] .table > :not(caption) > * > *,
[data-bs-theme="light"] .table-dark > :not(caption) > * > *,
[data-bs-theme="light"] .table td,
[data-bs-theme="light"] .table th,
[data-bs-theme="light"] .table-dark td,
[data-bs-theme="light"] .table-dark th {
    color: var(--bs-table-color, #1c1917) !important;
    background-color: var(--bs-table-bg, #ffffff) !important;
    border-color: #e7dfd5 !important;
    box-shadow: none !important;
}

/* Universal Thead Overhaul: Clean, warm sandstone header with deep slate text */
[data-bs-theme="light"] thead,
[data-bs-theme="light"] thead.table-dark,
[data-bs-theme="light"] thead.table-secondary,
[data-bs-theme="light"] thead.bg-black,
[data-bs-theme="light"] thead.bg-dark,
[data-bs-theme="light"] thead th,
[data-bs-theme="light"] thead td,
[data-bs-theme="light"] thead.table-dark th,
[data-bs-theme="light"] thead.table-dark td,
[data-bs-theme="light"] thead.bg-black th,
[data-bs-theme="light"] thead.bg-black td,
[data-bs-theme="light"] .table > thead > tr > th,
[data-bs-theme="light"] .table > thead > tr > td,
[data-bs-theme="light"] thead[style*="background"],
[data-bs-theme="light"] thead[style*="background-color"],
[data-bs-theme="light"] thead[style*="background"] th,
[data-bs-theme="light"] thead[style*="background-color"] th {
    --bs-table-bg: #f5f2eb !important;
    --bs-table-color: #57534e !important;
    background: #f5f2eb !important;
    background-color: #f5f2eb !important;
    color: #57534e !important;
    border-bottom: 2px solid #e7dfd5 !important;
    border-color: #e7dfd5 !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

/* Table body rows and cells */
[data-bs-theme="light"] tbody,
[data-bs-theme="light"] tbody tr,
[data-bs-theme="light"] tbody td,
[data-bs-theme="light"] tbody th,
[data-bs-theme="light"] .table-dark tbody,
[data-bs-theme="light"] .table-dark tbody tr,
[data-bs-theme="light"] .table-dark tbody td,
[data-bs-theme="light"] .table-dark tbody th {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1c1917 !important;
    border-color: #eee8df !important;
    box-shadow: none !important;
}

/* Striped alternating rows */
[data-bs-theme="light"] .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-bs-theme="light"] .table-dark.table-striped > tbody > tr:nth-of-type(odd) > *,
[data-bs-theme="light"] .table-striped > tbody > tr:nth-of-type(odd),
[data-bs-theme="light"] .table-dark.table-striped > tbody > tr:nth-of-type(odd) {
    background: #faf8f5 !important;
    background-color: #faf8f5 !important;
    color: #1c1917 !important;
    box-shadow: none !important;
}

[data-bs-theme="light"] .table-striped > tbody > tr:nth-of-type(even) > *,
[data-bs-theme="light"] .table-dark.table-striped > tbody > tr:nth-of-type(even) > *,
[data-bs-theme="light"] .table-striped > tbody > tr:nth-of-type(even),
[data-bs-theme="light"] .table-dark.table-striped > tbody > tr:nth-of-type(even) {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1c1917 !important;
    box-shadow: none !important;
}

[data-bs-theme="light"] .table-hover > tbody > tr:hover > *,
[data-bs-theme="light"] .table-dark.table-hover > tbody > tr:hover > *,
[data-bs-theme="light"] .table-hover > tbody > tr:hover,
[data-bs-theme="light"] .table-dark.table-hover > tbody > tr:hover {
    background: #f1ede4 !important;
    background-color: #f1ede4 !important;
    color: #1c1917 !important;
    box-shadow: none !important;
}

/* Table footers */
[data-bs-theme="light"] tfoot,
[data-bs-theme="light"] tfoot.table-dark,
[data-bs-theme="light"] tfoot.bg-black,
[data-bs-theme="light"] tfoot td,
[data-bs-theme="light"] tfoot th {
    background: #f5f2eb !important;
    background-color: #f5f2eb !important;
    color: #1c1917 !important;
    border-color: #e7dfd5 !important;
    box-shadow: none !important;
}

/* 2. UNIVERSAL DARK BOXES & CONTAINERS (.bg-dark, .bg-black, .bg-secondary) */
[data-bs-theme="light"] .bg-dark:not(.btn),
[data-bs-theme="light"] .bg-black:not(.btn),
[data-bs-theme="light"] .card.bg-dark,
[data-bs-theme="light"] .card.bg-black,
[data-bs-theme="light"] div.bg-dark,
[data-bs-theme="light"] div.bg-black,
[data-bs-theme="light"] ul.bg-dark,
[data-bs-theme="light"] ul.bg-black,
[data-bs-theme="light"] nav.bg-dark,
[data-bs-theme="light"] nav.bg-black,
[data-bs-theme="light"] section.bg-dark,
[data-bs-theme="light"] section.bg-black,
[data-bs-theme="light"] ul.nav-pills.bg-dark,
[data-bs-theme="light"] ul.nav-pills.bg-black {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1c1917 !important;
    border-color: #e7dfd5 !important;
}

/* Opacity variants: e.g. bg-dark bg-opacity-25, bg-black bg-opacity-30, bg-secondary bg-opacity-25 */
[data-bs-theme="light"] [class*="bg-dark"][class*="bg-opacity"],
[data-bs-theme="light"] [class*="bg-black"][class*="bg-opacity"],
[data-bs-theme="light"] [class*="bg-secondary"][class*="bg-opacity"] {
    background: #f5f2eb !important;
    background-color: #f5f2eb !important;
    color: #1c1917 !important;
    border-color: #e7dfd5 !important;
}

/* Card Headers, Bodies, and Footers */
[data-bs-theme="light"] .card-header.bg-dark,
[data-bs-theme="light"] .card-header.bg-black,
[data-bs-theme="light"] .card-header.bg-secondary,
[data-bs-theme="light"] .card-header[class*="bg-opacity"],
[data-bs-theme="light"] .card-header.bg-body-tertiary,
[data-bs-theme="light"] .card-header.bg-secondary-subtle,
[data-bs-theme="light"] .modal-header.bg-dark,
[data-bs-theme="light"] .modal-header.bg-black {
    background: #f5f2eb !important;
    background-color: #f5f2eb !important;
    color: #1c1917 !important;
    border-bottom: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .card-body.bg-dark,
[data-bs-theme="light"] .card-body.bg-black,
[data-bs-theme="light"] .card-body.bg-body-tertiary {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e1b2e !important;
}

/* Badges with dark styling (including the 49 top-summary badges in all studios) */
[data-bs-theme="light"] .badge.bg-dark,
[data-bs-theme="light"] .badge.bg-black,
[data-bs-theme="light"] div.badge.bg-dark,
[data-bs-theme="light"] div.badge.bg-black,
[data-bs-theme="light"] span.badge.bg-dark,
[data-bs-theme="light"] span.badge.bg-black {
    background: #f5f2eb !important;
    background-color: #f5f2eb !important;
    color: #b45309 !important;
    border: 1px solid #e7dfd5 !important;
}

/* Nav Pills & Tab Headers */
[data-bs-theme="light"] .nav-pills .nav-link:not(.active) {
    background-color: #f5f2eb !important;
    color: #57534e !important;
    border: 1px solid #e7dfd5 !important;
}

[data-bs-theme="light"] .nav-pills .nav-link:not(.active):hover {
    background-color: #f1ede4 !important;
    color: #2563eb !important;
    border-color: #2563eb !important;
}

[data-bs-theme="light"] .nav-pills .nav-link.text-light:not(.active) {
    color: #57534e !important;
}

/* Form Controls & Inputs */
[data-bs-theme="light"] .form-control.bg-dark,
[data-bs-theme="light"] .form-select.bg-dark,
[data-bs-theme="light"] input.bg-dark,
[data-bs-theme="light"] select.bg-dark {
    background-color: #ffffff !important;
    color: #1c1917 !important;
    border-color: #e7dfd5 !important;
}

[data-bs-theme="light"] .input-group-text.bg-dark {
    background-color: #f5f2eb !important;
    color: #57534e !important;
    border-color: #e7dfd5 !important;
}

/* Alerts */
[data-bs-theme="light"] .alert-dark {
    background-color: #f5f2eb !important;
    color: #1c1917 !important;
    border: 1px solid #e7dfd5 !important;
}

/* Borders */
[data-bs-theme="light"] .border-secondary,
[data-bs-theme="light"] .border-dark,
[data-bs-theme="light"] [class*="border-secondary"][class*="border-opacity"] {
    border-color: #e7dfd5 !important;
}

/* 3. INLINE DARK BACKGROUND RESCUE (TARGETS ANY HTML TAG) */
[data-bs-theme="light"] *[style*="#1a1c2b"],
[data-bs-theme="light"] *[style*="#12131c"],
[data-bs-theme="light"] *[style*="#090a0f"],
[data-bs-theme="light"] *[style*="#0d0e17"],
[data-bs-theme="light"] *[style*="#0f111a"],
[data-bs-theme="light"] *[style*="#222538"],
[data-bs-theme="light"] *[style*="#18233c"],
[data-bs-theme="light"] *[style*="#121a2d"],
[data-bs-theme="light"] *[style*="#0d1424"],
[data-bs-theme="light"] *[style*="#0b101b"],
[data-bs-theme="light"] *[style*="#0b0f19"],
[data-bs-theme="light"] *[style*="#1a2744"],
[data-bs-theme="light"] *[style*="#151e33"],
[data-bs-theme="light"] *[style*="#0f172a"],
[data-bs-theme="light"] *[style*="#11141c"],
[data-bs-theme="light"] *[style*="#0f2338"],
[data-bs-theme="light"] *[style*="#1e1438"],
[data-bs-theme="light"] *[style*="#1e293b"],
[data-bs-theme="light"] *[style*="#1c2844"],
[data-bs-theme="light"] *[style*="#0e1628"],
[data-bs-theme="light"] *[style*="#1e3c72"],
[data-bs-theme="light"] *[style*="#1e1b4b"],
[data-bs-theme="light"] *[style*="#091e3a"],
[data-bs-theme="light"] *[style*="#172554"],
[data-bs-theme="light"] *[style*="rgba(15, 23, 42"],
[data-bs-theme="light"] *[style*="rgba(15,23,42"],
[data-bs-theme="light"] *[style*="rgba(30, 41, 59"],
[data-bs-theme="light"] *[style*="rgba(30,41,59"],
[data-bs-theme="light"] *[style*="rgba(18, 26, 45"],
[data-bs-theme="light"] *[style*="rgba(18,26,45"],
[data-bs-theme="light"] *[style*="rgba(24, 35, 60"],
[data-bs-theme="light"] *[style*="rgba(15, 16, 38"],
[data-bs-theme="light"] *[style*="rgba(11, 16, 27"],
[data-bs-theme="light"] *[style*="rgba(10, 14, 24"],
[data-bs-theme="light"] *[style*="rgba(20, 24, 35"],
[data-bs-theme="light"] *[style*="rgba(22, 27, 40"],
[data-bs-theme="light"] *[style*="rgba(30, 27, 75"],
[data-bs-theme="light"] *[style*="rgba(46, 16, 101"],
[data-bs-theme="light"] *[style*="rgba(59, 17, 20"],
[data-bs-theme="light"] *[style*="rgba(41, 30, 10"],
[data-bs-theme="light"] *[style*="rgba(0, 0, 0, 0."],
[data-bs-theme="light"] *[style*="rgba(0,0,0,0."] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #1c1917 !important;
    border-color: #e7dfd5 !important;
}

/* Small inner panels & wells */
[data-bs-theme="light"] *.p-2[style*="background"],
[data-bs-theme="light"] *.p-2.5[style*="background"],
[data-bs-theme="light"] *.p-3[style*="background"],
[data-bs-theme="light"] *.rounded[style*="background"],
[data-bs-theme="light"] *[style*="rgba(255, 255, 255, 0.03"],
[data-bs-theme="light"] *[style*="rgba(255,255,255,0.03"] {
    background: #f5f2eb !important;
    background-color: #f5f2eb !important;
    background-image: none !important;
    color: #1c1917 !important;
    border-color: #e7dfd5 !important;
}

/* Linear gradients replaced with crisp sandstone/ivory gradients (exempting executive white-label report banners) */
[data-bs-theme="light"] *[style*="linear-gradient(135deg, #1e293b"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, #1e1b4b"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, #0f172a"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, #091e3a"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(145deg, #121a2d"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, rgba(30, 27, 75"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, rgba(46, 16, 101"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, rgba(13, 148, 136"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, rgba(234, 179, 8"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="linear-gradient(135deg, rgba(225, 29, 72, 0.15), rgba(15, 23, 42"]:not(.astro-report-executive-banner),
[data-bs-theme="light"] *[style*="radial-gradient(circle at center, rgba(225, 29, 72, 0.15) 0%, rgba(15, 23, 42"]:not(.astro-report-executive-banner) {
    background: linear-gradient(135deg, #ffffff 0%, #f8f6f0 100%) !important;
    background-color: #ffffff !important;
    background-image: linear-gradient(135deg, #ffffff 0%, #f8f6f0 100%) !important;
    color: #1c1917 !important;
    border: 1px solid #e7dfd5 !important;
}

/* 4. SPECIFIC STUDIO ENCLOSURES */
[data-bs-theme="light"] .executive-decision-card,
[data-bs-theme="light"] .life-timeline-scrubber-card,
[data-bs-theme="light"] .multi-track-horizon-card {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
    box-shadow: 0 4px 14px rgba(28, 25, 23, 0.05) !important;
}

[data-bs-theme="light"] .executive-decision-card .card-header,
[data-bs-theme="light"] .life-timeline-scrubber-card .scrubber-temporal-deck,
[data-bs-theme="light"] .multi-track-horizon-card .card-header {
    background: #f5f2eb !important;
    border-bottom: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
}

[data-bs-theme="light"] .swimlanes-wrapper,
[data-bs-theme="light"] .curve-container {
    background: #f5f2eb !important;
    border: 1px solid #e7dfd5 !important;
    color: #1c1917 !important;
}

/* 5. TYPOGRAPHY CONTRAST REINFORCEMENTS */
[data-bs-theme="light"] .text-light:not(.btn):not(.badge),
[data-bs-theme="light"] .text-white:not(.btn):not(.badge),
[data-bs-theme="light"] *[style*="color: #f8fafc"],
[data-bs-theme="light"] *[style*="color: #ffffff"] {
    color: #1c1917 !important;
}

[data-bs-theme="light"] p.text-light,
[data-bs-theme="light"] span.text-light,
[data-bs-theme="light"] div.text-light,
[data-bs-theme="light"] td.text-light,
[data-bs-theme="light"] th.text-light,
[data-bs-theme="light"] p.text-white,
[data-bs-theme="light"] span.text-white,
[data-bs-theme="light"] div.text-white,
[data-bs-theme="light"] td.text-white,
[data-bs-theme="light"] th.text-white {
    color: #1c1917 !important;
}

[data-bs-theme="light"] h1.text-light,
[data-bs-theme="light"] h2.text-light,
[data-bs-theme="light"] h3.text-light,
[data-bs-theme="light"] h4.text-light,
[data-bs-theme="light"] h5.text-light,
[data-bs-theme="light"] h6.text-light,
[data-bs-theme="light"] h1.text-white,
[data-bs-theme="light"] h2.text-white,
[data-bs-theme="light"] h3.text-white,
[data-bs-theme="light"] h4.text-white,
[data-bs-theme="light"] h5.text-white,
[data-bs-theme="light"] h6.text-white {
    color: #1c1917 !important;
}

[data-bs-theme="light"] .text-secondary {
    color: #57534e !important;
}

[data-bs-theme="light"] .text-muted {
    color: #78716c !important;
}

/* Light Mode Utility Rescues: Button Outlines, Warm Warning Contrast, and Muted Text */
[data-bs-theme="light"] .btn-outline-light {
    color: #57534e !important;
    border-color: #e7dfd5 !important;
    background-color: transparent !important;
}

[data-bs-theme="light"] .btn-outline-light:hover,
[data-bs-theme="light"] .btn-outline-light:focus {
    color: #1c1917 !important;
    background-color: #f5f2eb !important;
    border-color: #d6c7b2 !important;
}

[data-bs-theme="light"] .text-warning:not(.btn):not(.badge):not(.sacred-invocation):not(.astro-report-executive-banner *):not(.astro-report-title) {
    color: #b45309 !important;
}

[data-bs-theme="light"] .text-white-50:not(.badge):not(.astro-report-executive-banner *) {
    color: #78716c !important;
}

/* Focus highlight animation when navigating tabs or subtabs */
.jy-focus-highlight {
    animation: jyFocusPulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-radius: 8px;
}

@keyframes jyFocusPulse {
    0% {
        box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.45);
        outline: 2px solid var(--jy-primary, #2563eb);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(37, 99, 235, 0.2);
    }
    100% {
        box-shadow: none;
        outline: none;
    }
}

.jy-domain-ribbon {
    backdrop-filter: blur(8px);
    transition: all 0.2s ease-in-out;
}

[data-bs-theme="light"] .jy-domain-ribbon {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #e7dfd5 !important;
}

[data-bs-theme="dark"] .jy-domain-ribbon {
    background-color: rgba(18, 19, 28, 0.95) !important;
    border-color: #222538 !important;
}

/* ==========================================================================
   Global Task Navigation & Link Processing Banner
   ========================================================================== */
.kp-processing-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(14, 20, 36, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid #2563eb;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
    pointer-events: none;
}

.kp-processing-banner.active {
    display: flex !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
}

.kp-processing-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 7px 18px;
}

.kp-processing-banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kp-processing-banner-text {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.kp-processing-banner-progress {
    width: 100%;
    height: 2.5px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc, #38bdf8);
    background-size: 200% 100%;
    animation: kpIndeterminateProgress 1.1s infinite linear;
}

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

[data-bs-theme="light"] .kp-processing-banner {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 2px solid #2563eb;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.22);
}

[data-bs-theme="light"] .kp-processing-banner-text {
    color: #0f172a;
}




