/**
 * ══════════════════════════════════════════════════════════════════════════
 * Dhru Fusion SaaS Panel v9.2 — SINGLE SOURCE OF TRUTH (Design Tokens)
 * ══════════════════════════════════════════════════════════════════════════
 *
 * EDIT THIS FILE TO CHANGE COLORS AND FONTS ACROSS THE ENTIRE APPLICATION:
 * - User Panel (Client Portal)
 * - Admin Panel
 * - Public Homepage & Landing Pages
 * - Login & Authentication Pages
 * - Error & System Pages
 *
 * All frameworks (Tailwind, Bootstrap, and custom CSS) consume these tokens.
 * ══════════════════════════════════════════════════════════════════════════
 */

/* ── 1. GLOBAL FONT FAMILY (Self-hosted Inter Variable Font) ── */
/* Inter Variable (Latin) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../admin/fonts/inter-latin-wght-normal-Dx4kXJAl.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter Variable (Latin Ext) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../admin/fonts/inter-latin-ext-wght-normal-DO1Apj_S.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Inter Variable (Cyrillic Ext) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../admin/fonts/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Inter Variable (Cyrillic) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../admin/fonts/inter-cyrillic-wght-normal-DqGufNeO.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Inter Variable (Greek Ext) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../admin/fonts/inter-greek-ext-wght-normal-DlzME5K_.woff2') format('woff2');
    unicode-range: U+1F00-1FFF;
}

/* Inter Variable (Greek) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../admin/fonts/inter-greek-wght-normal-CkhJZR-_.woff2') format('woff2');
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

/* Inter Variable (Vietnamese) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../admin/fonts/inter-vietnamese-wght-normal-CBcvBZtf.woff2') format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}


:root {
    /* Main typography font stack — Single Source of Truth */
    --theme-font-family: 'Inter', sans-serif;
    --theme-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* ── 2. BRAND & ACCENT COLORS (Deep Indigo & Slate Palette) ── */
    --theme-primary: #4F46E5;             /* Primary Deep Indigo */
    --theme-primary-hover: #4338CA;       /* Primary Hover Indigo Dark */
    --theme-primary-rgb: 79, 70, 229;     /* RGB components for rgba() overlays */

    --theme-secondary: #475569;           /* Secondary Slate */
    --theme-secondary-hover: #334155;     /* Slate Dark hover */
    --theme-secondary-rgb: 71, 85, 105;

    --theme-accent: #6366F1;              /* Indigo 500 Action Accent */
    --theme-accent-hover: #4F46E5;        /* Accent hover */
    --theme-accent-rgb: 99, 102, 241;

    /* ── 3. LIGHT THEME PALETTE (Default) ── */
    --theme-bg: #F8FAFC;                  /* Background Cool White (Slate-50) */
    --theme-bg-rgb: 248, 250, 252;
    --theme-card-bg: #FFFFFF;             /* Surface/Card White */
    --theme-card-bg-rgb: 255, 255, 255;
    --theme-card-hover: #F1F5F9;          /* Table hover & card highlight */
    --theme-border: #E2E8F0;              /* Border Light Slate (Slate-200) */
    --theme-border-strong: #CBD5E1;       /* Border Emphasis (Slate-300) */
    --theme-border-subtle: #F1F5F9;       /* Inner card separators */
    --theme-text: #0F172A;                /* Text Dark Slate (Slate-900) */
    --theme-text-muted: #64748B;          /* Muted Text Slate (Slate-500) */

    /* ── 4. STATUS & FEEDBACK COLORS ── */
    --theme-success: #059669;             /* Success Emerald */
    --theme-success-bg: rgba(5, 150, 105, 0.10);
    --theme-success-border: rgba(5, 150, 105, 0.20);

    --theme-warning: #D97706;             /* Warning Amber */
    --theme-warning-bg: rgba(217, 119, 6, 0.10);
    --theme-warning-border: rgba(217, 119, 6, 0.20);

    --theme-danger: #DC2626;              /* Error Red */
    --theme-danger-bg: rgba(220, 38, 38, 0.10);
    --theme-danger-border: rgba(220, 38, 38, 0.20);

    --theme-info: #0284C7;                /* Info Sky */
    --theme-info-bg: rgba(2, 132, 199, 0.10);
    --theme-info-border: rgba(2, 132, 199, 0.20);

    --theme-primary-badge-bg: rgba(79, 70, 229, 0.10);
    --theme-primary-badge-border: rgba(79, 70, 229, 0.20);

    --theme-secondary-badge-bg: rgba(100, 116, 139, 0.10);
    --theme-secondary-badge-border: rgba(100, 116, 139, 0.20);

    /* ── 5. FORM CONTROLS & SHAPES ── */
    --theme-primary-text: #FFFFFF;        /* Accessible text on primary brand elements */
    --theme-radius-sm: 6px;
    --theme-radius-md: 8px;
    --theme-radius-lg: 12px;
    --theme-radius-xl: 16px;
    --theme-radius-full: 9999px;
    --theme-input-height: 40px;
    --theme-input-bg: var(--theme-card-bg);
    --theme-input-border: var(--theme-border);
    --theme-input-border-hover: var(--theme-border-strong);
    --theme-input-border-focus: var(--theme-primary);
    --theme-input-focus-ring: rgba(var(--theme-primary-rgb), 0.15);

    /* ── Shadows (Single Source of Truth) ── */
    --theme-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --theme-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
    --theme-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    --theme-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);

    /* ── 6. BACKWARD-COMPATIBILITY FRAMEWORK MAPPINGS ── */
    /* Public & Homepage Aliases */
    --primary: var(--theme-primary);
    --primary-hover: var(--theme-primary-hover);
    --secondary: var(--theme-secondary);
    --accent: var(--theme-accent);
    --dark: var(--theme-bg);
    --dark-card: var(--theme-card-bg);
    --text-light: var(--theme-text);
    --text-muted: var(--theme-text-muted);

    /* Bootstrap Theme Aliases */
    --bs-primary: var(--theme-primary);
    --bs-primary-rgb: var(--theme-primary-rgb);
    --bs-secondary: var(--theme-secondary);
    --bs-secondary-rgb: var(--theme-secondary-rgb);
    --bs-success: var(--theme-success);
    --bs-warning: var(--theme-warning);
    --bs-danger: var(--theme-danger);
    --bs-info: var(--theme-info);
    --bs-body-bg: var(--theme-bg);
    --bs-body-bg-rgb: var(--theme-bg-rgb);
    --bs-body-color: var(--theme-text);
    --bs-card-bg: var(--theme-card-bg);
    --bs-border-color: var(--theme-border);
    --bs-body-font-family: var(--theme-font-family);
    --bs-font-sans-serif: var(--theme-font-family);

    /* Tailwind Custom / SaaS Aliases */
    --saas-navy-950: var(--theme-bg);
    --saas-navy-900: var(--theme-card-bg);
    --saas-navy-800: var(--theme-border);
    --saas-blue-600: var(--theme-primary);
    --saas-blue-500: var(--theme-accent);
    --saas-slate-900: var(--theme-text);
}

/* ══════════════════════════════════════════════════════════════════════════
   DARK THEME PALETTE (Deep Slate & Indigo SaaS)
   Applied automatically when .dark class (User) or 
   [data-bs-theme="dark"] (Admin) is active.
   ══════════════════════════════════════════════════════════════════════════ */
:root.dark,
:root[data-bs-theme="dark"],
:root[data-theme="dark"],
.dark,
[data-bs-theme="dark"],
[data-theme="dark"],
html.dark,
html[data-theme="dark"] {
    --theme-bg: #0B0F19;                  /* Deep Slate/Indigo Canvas */
    --theme-bg-rgb: 11, 15, 25;
    --theme-card-bg: #111827;             /* Dark Slate Surface */
    --theme-card-bg-rgb: 17, 24, 39;
    --theme-card-hover: #1E293B;          /* Elevated hover */
    --theme-border: #1E293B;              /* Dark Slate Border */
    --theme-border-strong: #334155;       /* Dark Border Emphasis (Slate-700) */
    --theme-border-subtle: #1E293B;       /* Inner line separators */
    --theme-text: #F8FAFC;                /* Cool White pure readable text */
    --theme-text-muted: #94A3B8;          /* Slate-400 muted text */

    /* Accessible Primary in Dark Mode */
    --theme-primary: #818CF8;             /* Indigo-400 accessible on dark */
    --theme-primary-hover: #A5B4FC;
    --theme-primary-rgb: 129, 140, 248;
    --theme-secondary: #94A3B8;
    --theme-accent: #818CF8;
    --theme-accent-rgb: 129, 140, 248;
    --theme-success: #34D399;
    --theme-success-bg: rgba(52, 211, 153, 0.14);
    --theme-success-border: rgba(52, 211, 153, 0.25);

    --theme-warning: #FBBF24;
    --theme-warning-bg: rgba(251, 191, 36, 0.14);
    --theme-warning-border: rgba(251, 191, 36, 0.25);

    --theme-danger: #F87171;
    --theme-danger-bg: rgba(248, 113, 113, 0.14);
    --theme-danger-border: rgba(248, 113, 113, 0.25);

    --theme-info: #38BDF8;
    --theme-info-bg: rgba(56, 189, 248, 0.14);
    --theme-info-border: rgba(56, 189, 248, 0.25);

    --theme-primary-badge-bg: rgba(129, 140, 248, 0.14);
    --theme-primary-badge-border: rgba(129, 140, 248, 0.25);

    --theme-secondary-badge-bg: rgba(148, 163, 184, 0.14);
    --theme-secondary-badge-border: rgba(148, 163, 184, 0.25);

    /* Bootstrap Dark Overrides */
    --bs-body-bg: var(--theme-bg);
    --bs-body-bg-rgb: var(--theme-bg-rgb);
    --bs-body-color: var(--theme-text);
    --bs-card-bg: var(--theme-card-bg);
    --bs-border-color: var(--theme-border);

    /* Public Dark Overrides */
    --dark: var(--theme-bg);
    --dark-card: var(--theme-card-bg);
    --text-light: var(--theme-text);
    --text-muted: var(--theme-text-muted);

    /* Tailwind Custom Dark Overrides */
    --saas-navy-950: var(--theme-bg);
    --saas-navy-900: var(--theme-card-bg);
    --saas-navy-800: var(--theme-border);

    /* Accessible Primary Text & Dark Form States */
    --theme-primary-text: #FFFFFF;
    --theme-input-focus-ring: rgba(var(--theme-primary-rgb), 0.22);
    --theme-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --theme-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.5);
    --theme-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
    --theme-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
}

/* ── 7. GLOBAL FONT ENFORCEMENT ── */
html,
body,
button,
input,
optgroup,
select,
textarea,
.font-sans {
    font-family: var(--theme-font-family) !important;
}
