/* ============================================================
   ORION DESIGN TOKENS  (design-system v1.1.0)
   The single source of every color, radius, shadow, spacing and
   type value in the app. Raw hex is allowed ONLY in this file,
   *_pdf.html / invoice_preview.html (print), generated email
   HTML, and agent_office/ (deliberately themed).
   Docs: .github/instructions/design-system.instructions.md
   (Dark mode was built and then removed by user decision
   2026-07-06 — the var() indirection stays, so re-adding a
   theme later is a token-block, not a migration.)
   ============================================================ */

:root {
    /* ── Surfaces & text ── */
    --o-bg: #f6f7f9;
    --o-surface: #ffffff;
    --o-surface-2: #f9fafb;
    --o-surface-3: #f3f4f6;
    --o-border: #e5e7eb;
    --o-border-strong: #d1d5db;
    --o-text: #111827;
    --o-text-2: #374151;
    --o-text-muted: #6b7280;
    /* v1.0.75: #9ca3af was ~2.6:1 on white (fails WCAG AA) yet is used for real
       text (status labels, file sizes, placeholders). Darkened to clear 4.5:1
       even on the darkest surface (--o-surface-3). Converges toward muted by
       necessity — faint text still needs to be readable. */
    --o-text-faint: #697079;

    /* ── Brand (blue — the ONE primary) ── */
    --o-primary: #2563eb;
    --o-primary-hover: #1d4ed8;
    --o-primary-active: #1e40af;
    --o-primary-soft: #eff6ff;
    --o-primary-soft-text: #1d4ed8;
    --o-focus-ring: rgba(37, 99, 235, 0.25);

    /* ── Semantic status ── */
    --o-success: #059669;
    --o-success-hover: #047857;
    --o-success-soft: #ecfdf5;
    --o-success-soft-text: #047857;
    --o-warning: #d97706;
    --o-warning-soft: #fffbeb;
    --o-warning-soft-text: #b45309;
    --o-danger: #dc2626;
    --o-danger-hover: #b91c1c;
    --o-danger-soft: #fef2f2;
    --o-danger-soft-text: #b91c1c;
    --o-info: #0284c7;
    --o-info-soft: #f0f9ff;
    --o-info-soft-text: #0369a1;
    --o-neutral-soft: #f3f4f6;
    --o-neutral-soft-text: #4b5563;

    /* ── Chrome (constant across themes) ── */
    --o-topbar-bg: #101322;
    --o-topbar-text: #ffffff;
    --o-topbar-muted: rgba(255, 255, 255, 0.65);

    /* ── Charts (read by charts.js at render time) ── */
    --o-chart-1: #2563eb;
    --o-chart-2: #f59e0b;
    --o-chart-3: #10b981;
    --o-chart-4: #ef4444;
    --o-chart-5: #64748b;
    --o-chart-grid: #e5e7eb;
    --o-chart-text: #6b7280;

    /* ── Radius scale ── */
    --o-radius-sm: 6px;    /* code chips, tiny elements */
    --o-radius: 8px;       /* buttons, inputs, selects */
    --o-radius-lg: 12px;   /* cards, table containers, filter bars */
    --o-radius-xl: 16px;   /* modals, drawers, sheets */
    --o-radius-full: 999px;/* pills, avatars */

    /* ── Shadow scale ── */
    --o-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --o-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
    --o-shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --o-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
    --o-shadow-xl: 0 24px 60px rgba(16, 24, 40, 0.22);

    /* ── Spacing ── */
    --o-sp-1: 0.25rem;
    --o-sp-2: 0.5rem;
    --o-sp-3: 0.75rem;
    --o-sp-4: 1rem;
    --o-sp-5: 1.25rem;
    --o-sp-6: 1.5rem;
    --o-sp-8: 2rem;
    --o-sp-12: 3rem;

    /* ── Type ── */
    --o-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, Helvetica, Arial, sans-serif;
    --o-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --o-text-xs: 0.72rem;   /* badges, table th */
    --o-text-sm: 0.8rem;    /* meta, labels, submenu */
    --o-text-base: 0.875rem;/* body, tables, buttons */
    --o-text-md: 0.95rem;   /* inputs, lede */
    --o-text-lg: 1.1rem;    /* section headings (h2) */
    --o-text-xl: 1.35rem;   /* page title (h1) */
    --o-text-2xl: 1.7rem;   /* dashboard hero */

    /* ── Z-index ── */
    --o-z-topbar: 1100;  /* must beat Frappe Gantt's sticky header (1000) */
    --o-z-drawer: 1150;
    --o-z-modal: 1200;
    --o-z-toast: 1300;

    /* ── Bootstrap bridge (residual BS markup blends in) ── */
    --bs-body-bg: var(--o-bg);
    --bs-body-color: var(--o-text);
    --bs-border-color: var(--o-border);
    --bs-body-font-family: var(--o-font-sans);
    --bs-link-color: var(--o-primary);
    --bs-link-hover-color: var(--o-primary-hover);
    --bs-secondary-bg: var(--o-surface-2);
    --bs-card-bg: var(--o-surface);
    --bs-card-border-color: var(--o-border);
    --bs-card-border-radius: var(--o-radius-lg);
}
