/**
 * Xinkco shell primitive tokens.
 * Values are aligned to the licensed ModernAdmin 5.3.8 source. Reusable
 * component semantics belong in app.css; scoped CSS consumes these tokens.
 */

:root,
[data-theme="light"] {
    /* Layout */
    --shell-header-height: 64px;
    --shell-sidebar-width: 260px;
    --shell-sidebar-collapsed-width: 72px;
    --shell-footer-height: 48px;

    /* ModernAdmin-aligned palette */
    --shell-bg: #f0f4f9;
    --shell-surface: #ffffff;
    --shell-surface-muted: #f8fafc;
    --shell-surface-hover: #f1f5f9;
    --shell-border: #e2e8f0;
    --shell-text: #1e293b;
    --shell-heading: #0f172a;
    --shell-text-muted: #64748b;
    --shell-primary: #1a66c4;
    --shell-primary-contrast: #ffffff;
    --shell-primary-soft: rgb(26 102 196 / 0.1);
    --shell-success: #198754;
    --shell-warning: #f59e0b;
    --shell-warning-text: #854d0e;
    --shell-danger: #dc3545;
    --shell-danger-soft: rgb(220 53 69 / 0.08);
    --shell-danger-border: rgb(220 53 69 / 0.24);
    --shell-info: #0dcaf0;

    /* Documented compatibility aliases */
    --shell-accent: var(--shell-primary);
    --shell-muted: var(--shell-text-muted);
    --shell-muted-surface: var(--shell-surface-muted);
    --shell-border-color: var(--shell-border);
    --xk-shell-text: var(--shell-text);
    --xk-shell-muted: var(--shell-text-muted);
    --xk-shell-surface: var(--shell-surface);
    --xk-shell-border-color: var(--shell-border);

    /* Shell chrome */
    --shell-header-bg: var(--shell-surface);
    --shell-header-border: var(--shell-border);
    --shell-sidebar-bg: #ffffff;
    --shell-sidebar-text: var(--shell-text);
    --shell-sidebar-hover: var(--shell-surface-hover);
    --shell-sidebar-active: var(--shell-primary);
    --shell-overlay-bg: rgb(15 23 42 / 0.5);

    /* Spacing */
    --shell-spacing-1: 0.25rem;
    --shell-spacing-2: 0.5rem;
    --shell-spacing-3: 0.75rem;
    --shell-spacing-4: 1rem;
    --shell-spacing-5: 1.5rem;

    /* Radius */
    --shell-radius-sm: 0.375rem;
    --shell-radius-md: 0.625rem;
    --shell-radius-lg: 0.875rem;
    --shell-radius-xl: 1rem;
    --shell-radius-pill: 999px;
    --shell-card-radius: 0.375rem;

    /* Shadow */
    --shell-shadow-color: 15 23 42;
    --shell-shadow-sm: 0 1px 3px rgb(var(--shell-shadow-color) / 0.08);
    --shell-shadow-md: 0 0.5rem 1.5rem rgb(var(--shell-shadow-color) / 0.1);
    --shell-shadow-lg: 0 1rem 3rem rgb(var(--shell-shadow-color) / 0.18);
    --shell-card-shadow: var(--shell-shadow-sm);

    /* Table */
    --shell-table-header-bg: #f8fafc;
    --shell-table-hover-bg: #f1f5f9;
    --shell-table-selected-bg: rgb(26 102 196 / 0.09);
    --shell-table-stripe-bg: #fafafa;
    --shell-table-badge-radius: 0.125rem;
    --shell-table-control-radius: 0.125rem;
    --shell-table-control-size: 2rem;

    /* Forms */
    --shell-input-bg: #ffffff;
    --shell-input-border: var(--shell-border);
    --shell-input-focus-border: var(--shell-primary);
    --shell-input-focus-ring: rgb(26 102 196 / 0.25);

    /* Transition and typography */
    --shell-transition-fast: 0.2s ease;
    --shell-transition-base: 0.3s ease;
    --shell-font-body: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --shell-font-heading: "Roboto", sans-serif;
    --shell-font-mono: "Roboto Mono", "Fira Code", Consolas, monospace;

    /* KPI tokens retained for the shared KPI contract */
    --shell-kpi-label-color: var(--shell-text-muted);
    --shell-kpi-label-font-size: 0.8125rem;
    --shell-kpi-label-font-weight: 500;
    --shell-kpi-label-letter-spacing: 0.02em;
    --shell-kpi-value-color: var(--shell-heading);
    --shell-kpi-value-font-size: 1.75rem;
    --shell-kpi-value-font-weight: 700;
    --shell-kpi-value-line-height: 1.2;
    --shell-kpi-value-letter-spacing: 0;
    --shell-kpi-prefix-color: var(--shell-text-muted);
    --shell-kpi-prefix-font-size: 0.875rem;
    --shell-kpi-prefix-font-weight: 500;
    --shell-kpi-supporting-color: var(--shell-text-muted);
    --shell-kpi-supporting-font-size: 0.8125rem;
    --shell-kpi-supporting-font-weight: 400;
    --shell-kpi-supporting-line-height: 1.35;
    --shell-kpi-trend-positive: #22c55e;
    --shell-kpi-trend-negative: #ef4444;
    --shell-kpi-trend-neutral: #06b6d4;
    --shell-kpi-trend-font-size: 0.8125rem;
    --shell-kpi-trend-font-weight: 500;
    --shell-kpi-trend-context-color: var(--shell-text-muted);
    --shell-kpi-icon-size: 40px;
    --shell-kpi-icon-font-size: 1.125rem;
    --shell-kpi-icon-radius: 0.25rem;
    --shell-kpi-icon-primary-color: var(--shell-primary);
    --shell-kpi-icon-primary-bg: var(--shell-primary-soft);
    --shell-kpi-icon-success-color: #22c55e;
    --shell-kpi-icon-success-bg: rgb(34 197 94 / 0.15);
    --shell-kpi-icon-warning-color: var(--shell-warning);
    --shell-kpi-icon-warning-bg: rgb(245 158 11 / 0.15);
    --shell-kpi-icon-danger-color: #ef4444;
    --shell-kpi-icon-danger-bg: rgb(239 68 68 / 0.15);
    --shell-kpi-icon-info-color: #06b6d4;
    --shell-kpi-icon-info-bg: rgb(6 182 212 / 0.15);
    --shell-kpi-icon-muted-color: var(--shell-text-muted);
    --shell-kpi-icon-muted-bg: rgb(100 116 139 / 0.15);
}

[data-theme="dark"] {
    --shell-bg: #0f172a;
    --shell-surface: #1e293b;
    --shell-surface-muted: #0f172a;
    --shell-surface-hover: #334155;
    --shell-border: #334155;
    --shell-text: #e2e8f0;
    --shell-heading: #f8fafc;
    --shell-text-muted: #94a3b8;
    --shell-primary: #60a5fa;
    --shell-primary-contrast: #0f172a;
    --shell-primary-soft: rgb(96 165 250 / 0.15);
    --shell-warning-text: #fbbf24;
    --shell-danger-soft: rgb(248 113 113 / 0.12);
    --shell-danger-border: rgb(248 113 113 / 0.32);
    --shell-header-bg: var(--shell-surface);
    --shell-sidebar-bg: var(--shell-surface);
    --shell-sidebar-hover: var(--shell-surface-hover);
    --shell-shadow-color: 0 0 0;
    --shell-card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3);
    --shell-table-header-bg: #0f172a;
    --shell-table-hover-bg: #334155;
    --shell-table-selected-bg: rgb(96 165 250 / 0.15);
    --shell-table-stripe-bg: #1a2332;
    --shell-input-bg: #0f172a;
    --shell-input-focus-ring: rgb(96 165 250 / 0.25);
    --shell-kpi-icon-primary-bg: rgb(96 165 250 / 0.15);
    --shell-kpi-icon-success-color: #4ade80;
    --shell-kpi-icon-success-bg: rgb(74 222 128 / 0.15);
    --shell-kpi-icon-warning-color: #fbbf24;
    --shell-kpi-icon-warning-bg: rgb(251 191 36 / 0.15);
    --shell-kpi-icon-danger-color: #f87171;
    --shell-kpi-icon-danger-bg: rgb(248 113 113 / 0.15);
    --shell-kpi-icon-info-color: #22d3ee;
    --shell-kpi-icon-info-bg: rgb(34 211 238 / 0.15);
    --shell-kpi-icon-muted-bg: rgb(148 163 184 / 0.15);
}
