/*
 * Codisys Facturation — design tokens.
 *
 * Components consume semantic variables only. The selected appearance is
 * stored locally by the theme Stimulus controller; no tenant or user data is
 * persisted in the browser.
 */
:root {
    color: var(--theme-text);
    background: var(--theme-page-background);
    color-scheme: light;
    font-family: var(--theme-font-sans);
    font-synthesis: none;

    --tenant-brand-deep: #12345b;
    --tenant-brand-accent: #079fc1;
    --tenant-brand-highlight: #0b86a4;
    --theme-font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --theme-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --theme-page-background: #f5f7fa;
    --theme-page-background-start: #f7f9fc;
    --theme-page-background-deep: #eef3f8;
    --theme-page-grid: rgba(18, 52, 91, .025);
    --theme-surface: #ffffff;
    --theme-surface-raised: #ffffff;
    --theme-surface-soft: #f0f4f8;
    --theme-header-surface: rgba(255, 255, 255, .96);
    --theme-footer-surface: #ffffff;
    --theme-sidebar-surface: #12345b;
    --theme-overlay-surface: rgba(7, 17, 28, .62);
    --theme-line: #d9e2ec;
    --theme-line-subtle: #e7edf3;
    --theme-line-strong: #94cbd8;
    --theme-text: #172033;
    --theme-text-body: #253148;
    --theme-text-label: #344258;
    --theme-text-muted: #64748b;
    --theme-text-subtle: #64748b;
    --theme-text-soft: #46566d;
    --theme-text-bright-soft: #26394e;
    --theme-danger: #c43d4b;
    --theme-warning: #9a5d00;
    --theme-success: #16865c;
    --theme-info: #2563a6;
    --theme-focus: #0b86a4;
    --theme-focus-ring: rgba(11, 134, 164, .3);

    --theme-field-background: #ffffff;
    --theme-field-border: #b9c7d5;
    --theme-field-border-hover: #7f97aa;
    --theme-sidebar-toggle-border: #c8d7e5;
    --theme-sidebar-toggle-text: #12345b;
    --theme-sidebar-toggle-background: #ffffff;
    --theme-button-primary-text: #ffffff;
    --theme-button-primary-background: #079fc1;
    --theme-button-primary-background-hover: #087f9a;
    --theme-button-secondary-text: #12345b;
    --theme-button-secondary-border: #b8c8d8;
    --theme-button-secondary-background: #ffffff;
    --theme-button-secondary-background-hover: #e8f8fb;
    --theme-code-background: #edf3f7;
    --theme-recovery-background: #f0f4f8;
    --theme-tenant-choice-border: #c7d5e3;
    --theme-tenant-choice-background: #ffffff;
    --theme-info-text: #1c5f79;
    --theme-info-surface: #e8f8fb;
    --theme-sidebar-header-tail: #12345b;
    --theme-sidebar-divider: rgba(255, 255, 255, .14);
    --theme-sidebar-user-text: #d7e4ef;
    --theme-sidebar-logout-hover: #ffffff;
    --theme-sidebar-nav-text: #d8e5ef;
    --theme-sidebar-nav-muted: #9eb3c5;
    --theme-sidebar-nav-active-text: #ffffff;
    --theme-sidebar-nav-active-muted: #c7dce9;
    --theme-registry-surface-tail: #f4f9fb;
    --theme-registry-surface-hover-tail: #e8f8fb;
    --theme-support-text: #53657a;
    --theme-meta-text: #6a7c90;
    --theme-logo-plate: #ffffff;
    --theme-white: #ffffff;
    --theme-card-background: #ffffff;
    --theme-tab-background: #f0f4f8;
    --theme-tab-background-hover: #ffffff;
    --theme-active-summary-background: #f0f4f8;
    --theme-danger-line: rgba(196, 61, 75, .28);
    --theme-danger-line-strong: rgba(196, 61, 75, .48);
    --theme-danger-surface: #fff0f1;
    --theme-warning-line: rgba(154, 93, 0, .34);
    --theme-warning-surface: #fff7e7;
    --theme-warning-text: #7c4b00;
    --theme-success-line: rgba(22, 134, 92, .32);
    --theme-duplicate-surface: #fff7e7;

    --theme-radius-xs: 6px;
    --theme-radius-sm: 6px;
    --theme-radius-control: 8px;
    --theme-radius-md: 8px;
    --theme-radius-card: 10px;
    --theme-radius-lg: 10px;
    --theme-radius-xl: 10px;
    --theme-radius-panel: 10px;
    --theme-radius-panel-mobile: 8px;
    --theme-radius-pill: 999px;
    --theme-shadow-panel: 0 1px 2px rgba(18, 52, 91, .06), 0 8px 24px rgba(18, 52, 91, .06);
    --theme-shadow-floating: 0 16px 42px rgba(7, 17, 28, .18);
    --theme-shadow-header: 0 1px 0 rgba(18, 52, 91, .08);
    --theme-shadow-field-inset: inset 0 1px 1px rgba(18, 52, 91, .03);
    --theme-shadow-tooltip: 0 8px 24px rgba(7, 17, 28, .18);
    --theme-shadow-code: 0 10px 28px rgba(7, 17, 28, .12);
    --theme-shadow-sidebar-mobile: 16px 0 42px rgba(7, 17, 28, .28);
    --theme-motion-fast: .16s ease;
    --theme-motion-tooltip: .15s ease;
    --theme-motion-medium: .2s ease;

    --surface: var(--theme-surface);
    --surface-raised: var(--theme-surface-raised);
    --surface-soft: var(--theme-surface-soft);
    --line: var(--theme-line);
    --line-strong: var(--theme-line-strong);
    --text: var(--theme-text);
    --muted: var(--theme-text-muted);
    --navy: var(--tenant-brand-deep);
    --cyan: var(--tenant-brand-accent);
    --cyan-bright: var(--tenant-brand-highlight);
    --danger: var(--theme-danger);
    --warning: var(--theme-warning);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --tenant-brand-accent: #28c3de;
    --tenant-brand-highlight: #55d7ec;
    --theme-page-background: #07111c;
    --theme-page-background-start: #07111c;
    --theme-page-background-deep: #07111c;
    --theme-page-grid: rgba(255, 255, 255, .018);
    --theme-surface: #0d1b29;
    --theme-surface-raised: #122334;
    --theme-surface-soft: #122334;
    --theme-header-surface: rgba(13, 27, 41, .96);
    --theme-footer-surface: #0d1b29;
    --theme-sidebar-surface: #07192b;
    --theme-line: #294055;
    --theme-line-subtle: #203548;
    --theme-line-strong: #387089;
    --theme-text: #e7eef7;
    --theme-text-body: #d7e2ed;
    --theme-text-label: #cad7e4;
    --theme-text-muted: #9fb0c3;
    --theme-text-subtle: #9fb0c3;
    --theme-text-soft: #bdcad8;
    --theme-text-bright-soft: #dce8f4;
    --theme-danger: #ff7d89;
    --theme-warning: #f1b24a;
    --theme-success: #4bc38d;
    --theme-info: #72a7e8;
    --theme-focus: #55d7ec;
    --theme-focus-ring: rgba(85, 215, 236, .3);
    --theme-field-background: #091725;
    --theme-field-border: #3c5368;
    --theme-field-border-hover: #5a748a;
    --theme-sidebar-toggle-border: #36536b;
    --theme-sidebar-toggle-text: #e7eef7;
    --theme-sidebar-toggle-background: #122334;
    --theme-button-primary-text: #07111c;
    --theme-button-primary-background: #28c3de;
    --theme-button-primary-background-hover: #54d0e5;
    --theme-button-secondary-text: #e7eef7;
    --theme-button-secondary-border: #3c5368;
    --theme-button-secondary-background: #122334;
    --theme-button-secondary-background-hover: #183047;
    --theme-code-background: #091725;
    --theme-recovery-background: #091725;
    --theme-tenant-choice-border: #294055;
    --theme-tenant-choice-background: #122334;
    --theme-info-text: #a9eaf4;
    --theme-info-surface: #103746;
    --theme-sidebar-header-tail: #07192b;
    --theme-sidebar-divider: rgba(255, 255, 255, .12);
    --theme-sidebar-user-text: #d2dfeb;
    --theme-sidebar-nav-text: #ccdae7;
    --theme-sidebar-nav-muted: #8399ae;
    --theme-sidebar-nav-active-text: #ffffff;
    --theme-sidebar-nav-active-muted: #a9c7d5;
    --theme-registry-surface-tail: #102536;
    --theme-registry-surface-hover-tail: #103746;
    --theme-support-text: #adbdcc;
    --theme-meta-text: #8ea2b5;
    --theme-card-background: #0d1b29;
    --theme-tab-background: #122334;
    --theme-tab-background-hover: #183047;
    --theme-active-summary-background: #122334;
    --theme-danger-line: rgba(255, 125, 137, .3);
    --theme-danger-line-strong: rgba(255, 125, 137, .48);
    --theme-danger-surface: rgba(137, 35, 47, .23);
    --theme-warning-line: rgba(241, 178, 74, .38);
    --theme-warning-surface: rgba(133, 87, 13, .22);
    --theme-warning-text: #f5c873;
    --theme-success-line: rgba(75, 195, 141, .34);
    --theme-duplicate-surface: rgba(133, 87, 13, .2);
    --theme-shadow-panel: 0 1px 2px rgba(0, 0, 0, .2), 0 12px 30px rgba(0, 0, 0, .16);
    --theme-shadow-header: 0 1px 0 rgba(255, 255, 255, .05);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) { color-scheme: dark; }
}
