/**
 * Fact Cloud theme tokens.
 *
 * Este archivo contiene solamente decisiones visuales compartidas. Los
 * componentes, el modo oscuro y los plugins viven en archivos separados.
 */
:root
{
    color-scheme: light;

    --app-font-sans: "Montserrat", "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --app-font-size: .875rem;
    --app-font-weight: 400;
    --app-font-weight-medium: 500;
    --app-font-weight-semibold: 600;
    --app-font-weight-bold: 700;

    --app-color-primary: #4f46e5;
    --app-color-primary-hover: #4338ca;
    --app-color-primary-active: #3730a3;
    --app-color-primary-rgb: 79, 70, 229;
    --app-color-success: #10b981;
    --app-color-success-hover: #059669;
    --app-color-success-rgb: 16, 185, 129;
    --app-color-warning: #f59e0b;
    --app-color-warning-hover: #d97706;
    --app-color-warning-rgb: 245, 158, 11;
    --app-color-danger: #ef4444;
    --app-color-danger-hover: #dc2626;
    --app-color-danger-rgb: 239, 68, 68;
    --app-color-info: #0ea5e9;
    --app-color-info-hover: #0284c7;
    --app-color-info-rgb: 14, 165, 233;
    --app-color-secondary: #64748b;
    --app-color-secondary-hover: #475569;
    --app-color-secondary-rgb: 100, 116, 139;
    --app-color-orange: #f97316;
    --app-color-orange-hover: #ea580c;
    --app-color-light: #ffffff;
    --app-color-light-hover: #f8fafc;
    --app-bg-light: #e2e8f0;
    --app-bg-light-border: #cbd5e1;
    --app-on-bg-light: #334155;
    --app-color-dark: #1e293b;
    --app-color-dark-hover: #0f172a;
    --app-color-dark-rgb: 30, 41, 59;
    --app-color-default: #f1f5f9;
    --app-color-default-hover: #e2e8f0;

    --app-body-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-surface-muted: #f1f5f9;
    --app-surface-elevated: #ffffff;
    --app-table-head-bg: #dbdee0;
    --app-table-hover-bg: #f7f7f9;
    --app-table-selected-bg: #e9edf8;
    --app-text: #475569;
    --app-text-muted: #8c8a95;
    --app-heading: #1e293b;
    --app-text-primary: #4f46e5;
    --app-text-success: #10b981;
    --app-text-warning: #f59e0b;
    --app-alert-warning-text: #92400e;
    --app-text-danger: #ef4444;
    --app-text-info: #0ea5e9;
    --app-text-orange: #f97316;
    --app-on-primary: #ffffff;
    --app-on-success: #ffffff;
    --app-on-warning: #ffffff;
    --app-on-danger: #ffffff;
    --app-on-info: #ffffff;
    --app-on-secondary: #ffffff;
    --app-on-accent: var(--app-on-primary);
    --app-on-light: #1e293b;
    --app-on-dark: #ffffff;
    --app-on-default: #1e293b;
    --app-border: #e2e8f0;
    --app-border-strong: #cbd5e1;
    --app-focus-ring: rgba(var(--app-color-primary-rgb), .16);
    --app-control-focus-shadow: 0 0 0 .125rem var(--app-focus-ring);

    --app-sidebar-dark-bg: #0f172a;
    --app-sidebar-dark-text: #94a3b8;
    --app-sidebar-dark-muted: #64748b;
    --app-sidebar-dark-on: #ffffff;
    --app-sidebar-dark-active-muted: #818cf8;
    --app-sidebar-dark-hover: rgba(255, 255, 255, .05);
    --app-sidebar-dark-border: rgba(255, 255, 255, .1);
    --app-color-primary-sidebar: #4f46e5;
    --app-sidebar-option-oscuro: #0f172a;
    --app-sidebar-option-claro: #f8fafc;
    --app-sidebar-option-predeterminado: #4f46e5;
    --app-sidebar-option-corporativo: #047857;
    --app-sidebar-option-confianza: #1d4ed8;
    --app-sidebar-option-premium: #6d28d9;
    --app-sidebar-option-ejecutivo: #334155;
    --app-sidebar-option-oceano: #0e7490;
    --app-sidebar-option-rubi: #be123c;
    --app-sidebar-option-ambar: #b45309;

    --app-primary-soft: #e0e7ff;
    --app-success-soft: #d1fae5;
    --app-warning-soft: #fef3c7;
    --app-danger-soft: #fee2e2;
    --app-info-soft: #e0f2fe;
    --app-secondary-soft: #f1f5f9;
    --app-orange-soft: #ffedd5;
    --app-dark-soft: #e2e8f0;

    --app-radius-xs: .25rem;
    --app-radius-sm: .375rem;
    --app-radius: .5rem;
    --app-radius-lg: .75rem;
    --app-radius-xl: 1rem;
    --app-shadow-xs: 0 1px 2px rgba(30, 41, 59, .05);
    --app-shadow-sm: 0 2px 6px rgba(30, 41, 59, .08);
    --app-shadow: 0 4px 18px rgba(30, 41, 59, .12);
    --app-shadow-lg: 0 8px 28px rgba(30, 41, 59, .15);
    --app-shadow-primary: 0 2px 6px rgba(var(--app-color-primary-rgb), .30);
    --app-shadow-success: 0 2px 6px rgba(var(--app-color-success-rgb), .30);
    --app-shadow-warning: 0 2px 6px rgba(var(--app-color-warning-rgb), .30);
    --app-shadow-danger: 0 2px 6px rgba(var(--app-color-danger-rgb), .30);
    --app-shadow-info: 0 2px 6px rgba(var(--app-color-info-rgb), .30);
    --app-shadow-secondary: 0 2px 6px rgba(var(--app-color-secondary-rgb), .30);
    --app-transition-fast: 150ms ease;
    --app-transition: 220ms cubic-bezier(.2, .8, .2, 1);

    /* Compatibilidad con los CSS existentes del proyecto. */
    --bs-font-mulish: "Mulish", sans-serif;
    --bs-font-montserrat: var(--app-font-sans);
    --bs-body-font-weight: var(--app-font-weight);
    --bs-primary: var(--app-color-primary);
    --bs-primary-hover: var(--app-color-primary-hover);
    --bs-primary-rgb: var(--app-color-primary-rgb);
    --bs-success: var(--app-color-success);
    --bs-success-hover: var(--app-color-success-hover);
    --bs-warning: var(--app-color-warning);
    --bs-warning-hover: var(--app-color-warning-hover);
    --bs-danger: var(--app-color-danger);
    --bs-danger-hover: var(--app-color-danger-hover);
    --bs-info: var(--app-color-info);
    --bs-info-hover: var(--app-color-info-hover);
    --bs-secondary: var(--app-color-secondary);
    --bs-secondary-hover: var(--app-color-secondary-hover);
    --bs-secondary-rgb: var(--app-color-secondary-rgb);
    --bs-orange: var(--app-color-orange);
    --bs-orange-hover: var(--app-color-orange-hover);
    --bs-default: var(--app-color-default);
    --bs-default-hover: var(--app-color-default-hover);
    --bs-primary_light: var(--app-primary-soft);
    --bs-success_light: var(--app-success-soft);
    --bs-warning_light: var(--app-warning-soft);
    --bs-danger_light: var(--app-danger-soft);
    --bs-info_light: var(--app-info-soft);
    --bs-secondary_light: var(--app-secondary-soft);
    --bs-orange_light: var(--app-orange-soft);
    --bs-white: var(--app-surface);
    --bs-light: var(--app-color-light);
    --bs-dark: var(--app-color-dark);
    --bs-dark-light: var(--app-surface-muted);
    --bs-gray: var(--app-text-muted);
    --bs-heading-color: var(--app-heading);
    --bs-box-shadow: var(--app-shadow-sm);
    --bs-box-shadow-xs: var(--app-shadow-xs);
    --bs-box-shadow-sm: var(--app-shadow-sm);
    --bs-box-shadow-lg: var(--app-shadow);
    --bs-box-shadow-xl: var(--app-shadow-lg);
    --bs-floating-component-shadow: var(--app-shadow);
}

body.dark-mode
{
    color-scheme: dark;

    --app-color-primary: #4f46e5;
    --app-color-primary-hover: #4338ca;
    --app-color-primary-active: #3730a3;
    --app-color-primary-rgb: 79, 70, 229;
    --app-color-success: #28c76f;
    --app-color-success-hover: #24b364;
    --app-color-success-rgb: 40, 199, 111;
    --app-color-warning: #ff9f43;
    --app-color-warning-hover: #e68f3c;
    --app-color-warning-rgb: 255, 159, 67;
    --app-color-danger: #ff4c51;
    --app-color-danger-hover: #e64449;
    --app-color-danger-rgb: 255, 76, 81;
    --app-color-info: #00bad1;
    --app-color-info-hover: #00a7bc;
    --app-color-info-rgb: 0, 186, 209;
    --app-color-secondary: #808390;
    --app-color-secondary-hover: #737682;
    --app-color-secondary-rgb: 128, 131, 144;
    --app-color-orange: #ff9f43;
    --app-color-orange-hover: #ffb76f;
    --app-color-light: #35364d;
    --app-color-light-hover: #41425c;
    --app-bg-light: #384551;
    --app-bg-light-border: #4e5965;
    --app-on-bg-light: #f5f5f9;
    --app-color-dark: #2b2c40;
    --app-color-dark-hover: #3b3c55;
    --app-color-dark-rgb: 43, 44, 64;
    --app-color-default: #202c3f;
    --app-color-default-hover: #2c3a50;

    --app-body-bg: #0b1120;
    --app-surface: #111827;
    --app-surface-soft: #172033;
    --app-surface-muted: #1e293b;
    --app-surface-elevated: #182235;
    --app-table-head-bg: var(--app-surface-muted);
    --app-table-hover-bg: #172033;
    --app-table-selected-bg: #202c3f;
    --app-text: #e7edf7;
    --app-text-muted: #9aa9bd;
    --app-heading: #f7f9fc;
    --app-text-primary: #818cf8;
    --app-text-success: #28c76f;
    --app-text-warning: #ff9f43;
    --app-alert-warning-text: #ffd08a;
    --app-text-danger: #ff4c51;
    --app-text-info: #00bad1;
    --app-text-orange: #ff9f43;
    --app-on-primary: #ffffff;
    --app-on-success: #ffffff;
    --app-on-warning: #ffffff;
    --app-on-danger: #ffffff;
    --app-on-info: #ffffff;
    --app-on-secondary: #ffffff;
    --app-on-accent: var(--app-on-primary);
    --app-on-light: #e7e7f1;
    --app-on-dark: #ffffff;
    --app-on-default: #e7edf7;
    --app-border: #2b3a50;
    --app-border-strong: #40516a;
    --app-focus-ring: rgba(var(--app-color-primary-rgb), .24);
    --app-control-focus-shadow: 0 0 0 .125rem var(--app-focus-ring);

    --app-primary-soft: rgba(var(--app-color-primary-rgb), .20);
    --app-success-soft: rgba(var(--app-color-success-rgb), .16);
    --app-warning-soft: rgba(var(--app-color-warning-rgb), .16);
    --app-danger-soft: rgba(var(--app-color-danger-rgb), .16);
    --app-info-soft: rgba(var(--app-color-info-rgb), .16);
    --app-secondary-soft: rgba(var(--app-color-secondary-rgb), .18);
    --app-orange-soft: rgba(var(--app-color-warning-rgb), .16);
    --app-dark-soft: rgba(219, 222, 224, .14);

    --app-shadow-xs: 0 1px 2px rgba(0, 0, 0, .24);
    --app-shadow-sm: 0 3px 10px rgba(0, 0, 0, .25);
    --app-shadow: 0 12px 30px rgba(0, 0, 0, .32);
    --app-shadow-lg: 0 24px 60px rgba(0, 0, 0, .42);
}

/* Paletas predefinidas. El tema predeterminado utiliza directamente :root. */
:root[data-app-palette="corporativo"]
{
    --app-color-primary: #047857;
    --app-color-primary-hover: #03694c;
    --app-color-primary-active: #065f46;
    --app-color-primary-rgb: 4, 120, 87;
    --app-color-primary-sidebar: #047857;
    --app-text-primary: #047857;
    --app-on-primary: #ffffff;
    --app-primary-soft: #d1fae5;
    --app-focus-ring: rgba(4, 120, 87, .18);
}

:root[data-app-palette="confianza"]
{
    --app-color-primary: #2563eb;
    --app-color-primary-hover: #1d4ed8;
    --app-color-primary-active: #1e40af;
    --app-color-primary-rgb: 37, 99, 235;
    --app-color-primary-sidebar: #1d4ed8;
    --app-text-primary: #1d4ed8;
    --app-on-primary: #ffffff;
    --app-primary-soft: #dbeafe;
    --app-focus-ring: rgba(37, 99, 235, .18);
}

:root[data-app-palette="premium"]
{
    --app-color-primary: #7c3aed;
    --app-color-primary-hover: #6d28d9;
    --app-color-primary-active: #5b21b6;
    --app-color-primary-rgb: 124, 58, 237;
    --app-color-primary-sidebar: #6d28d9;
    --app-text-primary: #7c3aed;
    --app-on-primary: #ffffff;
    --app-primary-soft: #ede9fe;
    --app-focus-ring: rgba(124, 58, 237, .18);
}

:root[data-app-palette="ejecutivo"]
{
    --app-color-primary: #334155;
    --app-color-primary-hover: #1e293b;
    --app-color-primary-active: #0f172a;
    --app-color-primary-rgb: 51, 65, 85;
    --app-color-primary-sidebar: #334155;
    --app-text-primary: #334155;
    --app-on-primary: #ffffff;
    --app-primary-soft: #e2e8f0;
    --app-focus-ring: rgba(51, 65, 85, .18);
}

:root[data-app-palette="oceano"]
{
    --app-color-primary: #0e7490;
    --app-color-primary-hover: #0f6177;
    --app-color-primary-active: #155e75;
    --app-color-primary-rgb: 14, 116, 144;
    --app-color-primary-sidebar: #0e7490;
    --app-text-primary: #0e7490;
    --app-on-primary: #ffffff;
    --app-primary-soft: #cffafe;
    --app-focus-ring: rgba(14, 116, 144, .18);
}

:root[data-app-palette="rubi"]
{
    --app-color-primary: #be123c;
    --app-color-primary-hover: #9f1239;
    --app-color-primary-active: #881337;
    --app-color-primary-rgb: 190, 18, 60;
    --app-color-primary-sidebar: #be123c;
    --app-text-primary: #be123c;
    --app-on-primary: #ffffff;
    --app-primary-soft: #ffe4e6;
    --app-focus-ring: rgba(190, 18, 60, .18);
}

:root[data-app-palette="ambar"]
{
    --app-color-primary: #b45309;
    --app-color-primary-hover: #92400e;
    --app-color-primary-active: #78350f;
    --app-color-primary-rgb: 180, 83, 9;
    --app-color-primary-sidebar: #b45309;
    --app-text-primary: #b45309;
    --app-on-primary: #ffffff;
    --app-primary-soft: #fef3c7;
    --app-focus-ring: rgba(180, 83, 9, .18);
}

:root[data-app-palette="corporativo"] body.dark-mode
{
    --app-color-primary: #047857;
    --app-color-primary-hover: #03694c;
    --app-color-primary-active: #065f46;
    --app-color-primary-rgb: 4, 120, 87;
    --app-text-primary: #34d399;
    --app-on-primary: #ffffff;
    --app-primary-soft: rgba(4, 120, 87, .24);
    --app-focus-ring: rgba(4, 120, 87, .30);
}

:root[data-app-palette="confianza"] body.dark-mode
{
    --app-color-primary: #1d4ed8;
    --app-color-primary-hover: #1e40af;
    --app-color-primary-active: #1e3a8a;
    --app-color-primary-rgb: 29, 78, 216;
    --app-text-primary: #93c5fd;
    --app-on-primary: #ffffff;
    --app-primary-soft: rgba(29, 78, 216, .24);
    --app-focus-ring: rgba(29, 78, 216, .30);
}

:root[data-app-palette="premium"] body.dark-mode
{
    --app-color-primary: #6d28d9;
    --app-color-primary-hover: #5b21b6;
    --app-color-primary-active: #4c1d95;
    --app-color-primary-rgb: 109, 40, 217;
    --app-text-primary: #c4b5fd;
    --app-on-primary: #ffffff;
    --app-primary-soft: rgba(109, 40, 217, .24);
    --app-focus-ring: rgba(109, 40, 217, .30);
}

:root[data-app-palette="ejecutivo"] body.dark-mode
{
    --app-color-primary: #334155;
    --app-color-primary-hover: #1e293b;
    --app-color-primary-active: #0f172a;
    --app-color-primary-rgb: 51, 65, 85;
    --app-text-primary: #cbd5e1;
    --app-on-primary: #ffffff;
    --app-primary-soft: rgba(51, 65, 85, .24);
    --app-focus-ring: rgba(51, 65, 85, .30);
}

:root[data-app-palette="oceano"] body.dark-mode
{
    --app-color-primary: #0e7490;
    --app-color-primary-hover: #0f6177;
    --app-color-primary-active: #155e75;
    --app-color-primary-rgb: 14, 116, 144;
    --app-text-primary: #67e8f9;
    --app-on-primary: #ffffff;
    --app-primary-soft: rgba(14, 116, 144, .24);
    --app-focus-ring: rgba(14, 116, 144, .30);
}

:root[data-app-palette="rubi"] body.dark-mode
{
    --app-color-primary: #be123c;
    --app-color-primary-hover: #9f1239;
    --app-color-primary-active: #881337;
    --app-color-primary-rgb: 190, 18, 60;
    --app-text-primary: #fda4af;
    --app-on-primary: #ffffff;
    --app-primary-soft: rgba(190, 18, 60, .24);
    --app-focus-ring: rgba(190, 18, 60, .30);
}

:root[data-app-palette="ambar"] body.dark-mode
{
    --app-color-primary: #b45309;
    --app-color-primary-hover: #92400e;
    --app-color-primary-active: #78350f;
    --app-color-primary-rgb: 180, 83, 9;
    --app-text-primary: #fcd34d;
    --app-on-primary: #ffffff;
    --app-primary-soft: rgba(180, 83, 9, .24);
    --app-focus-ring: rgba(180, 83, 9, .30);
}

/* Variantes fijas del sidebar; la opcion automatica se adapta mas abajo. */
:root[data-app-sidebar="primary"],
:root[data-app-sidebar="predeterminado"],
:root[data-app-sidebar="corporativo"],
:root[data-app-sidebar="confianza"],
:root[data-app-sidebar="premium"],
:root[data-app-sidebar="ejecutivo"],
:root[data-app-sidebar="oceano"],
:root[data-app-sidebar="rubi"],
:root[data-app-sidebar="ambar"],
:root[data-app-sidebar="personalizado"]
{
    --app-sidebar-config-text: #ffffff;
    --app-sidebar-config-muted: rgba(255, 255, 255, .70);
    --app-sidebar-config-hover: rgba(255, 255, 255, .12);
    --app-sidebar-config-active: rgba(255, 255, 255, .20);
    --app-sidebar-config-active-text: #ffffff;
    --app-sidebar-config-border: rgba(255, 255, 255, .16);
}

:root[data-app-sidebar="primary"] { --app-sidebar-config-bg: var(--app-color-primary-sidebar); }
:root[data-app-sidebar="predeterminado"] { --app-sidebar-config-bg: var(--app-sidebar-option-predeterminado); }
:root[data-app-sidebar="corporativo"] { --app-sidebar-config-bg: var(--app-sidebar-option-corporativo); }
:root[data-app-sidebar="confianza"] { --app-sidebar-config-bg: var(--app-sidebar-option-confianza); }
:root[data-app-sidebar="premium"] { --app-sidebar-config-bg: var(--app-sidebar-option-premium); }
:root[data-app-sidebar="ejecutivo"] { --app-sidebar-config-bg: var(--app-sidebar-option-ejecutivo); }
:root[data-app-sidebar="oceano"] { --app-sidebar-config-bg: var(--app-sidebar-option-oceano); }
:root[data-app-sidebar="rubi"] { --app-sidebar-config-bg: var(--app-sidebar-option-rubi); }
:root[data-app-sidebar="ambar"] { --app-sidebar-config-bg: var(--app-sidebar-option-ambar); }

:root[data-app-sidebar="oscuro"]
{
    --app-sidebar-config-bg: var(--app-sidebar-option-oscuro);
    --app-sidebar-config-text: #f8fafc;
    --app-sidebar-config-muted: #cbd5e1;
    --app-sidebar-config-hover: rgba(255, 255, 255, .07);
    --app-sidebar-config-active: var(--app-color-primary-sidebar);
    --app-sidebar-config-active-text: #ffffff;
    --app-sidebar-config-border: rgba(255, 255, 255, .10);
}

:root[data-app-sidebar="claro"]
{
    --app-sidebar-config-bg: var(--app-sidebar-option-claro);
    --app-sidebar-config-text: #334155;
    --app-sidebar-config-muted: #64748b;
    --app-sidebar-config-hover: #e2e8f0;
    --app-sidebar-config-active: var(--app-color-primary-sidebar);
    --app-sidebar-config-active-text: #ffffff;
    --app-sidebar-config-border: #e2e8f0;
}

/* La opcion automatica acompaña al modo general de la aplicacion. */
:root[data-app-sidebar="claro"] body.dark-mode
{
    --app-sidebar-config-bg: var(--app-sidebar-option-oscuro);
    --app-sidebar-config-text: #f8fafc;
    --app-sidebar-config-muted: #cbd5e1;
    --app-sidebar-config-hover: rgba(255, 255, 255, .07);
    --app-sidebar-config-active: var(--app-color-primary-sidebar);
    --app-sidebar-config-active-text: #ffffff;
    --app-sidebar-config-border: rgba(255, 255, 255, .10);
}