/* Onisiro Universal Theme Contract (Phase 2D-pre.2)
   -------------------------------------------------------------------------
   Framework-agnostic semantic theme tokens — the SAME contract the authenticated
   app-kit (Tailwind) shell uses, exposed on :root / [data-theme] so non-app-kit
   renderers (public, guest/auth, legacy string, inline) can converge WITHOUT being
   forced onto the .app-kit-root DOM. This file is intentionally NOT attached to any
   renderer in this prerequisite slice; later slices <link> it one family at a time.

   Light is the default; the dark override re-points the same tokens to the approved
   Zinc dark palette. BOTH structural canvases are fixed semantic colours (light #FFFFFF,
   dark #09090B) and can never be replaced by tenant branding — branding is limited to
   approved logo/mark/accent affordances. Compatibility aliases resolve to the semantic
   tokens — there is no second palette. */

:root {
  /* Light semantic tokens. The structural canvas is a FIXED colour, not brand-derived. */
  --app-bg: #FFFFFF;
  --app-surface: #FFFFFF;
  --app-surface-raised: #F8FAFC;
  --app-border: #E2E8F0;
  --app-border-strong: #64748B;
  --app-text: #0F172A;
  --app-muted: #475569;
  --app-focus: #2563EB;

  /* Brand accent (primary action / selected nav / brand mark). Amber/orange is the
     approved accent; tenant branding may override ONLY via the sanitised --tenant-accent
     with a contrast-aware foreground — never the structural or financial tokens. */
  --app-accent: var(--tenant-accent, #EF6E15);
  --app-accent-foreground: var(--tenant-accent-foreground, #111827);

  /* Financial status — light foregrounds tuned to >=4.5:1 on white; bg/border are
     emerald/rose/amber-500 at 10%/20% opacity (theme-independent tints). */
  --app-positive: #047857; --app-positive-bg: rgba(16,185,129,.10); --app-positive-border: rgba(16,185,129,.20);
  --app-negative: #BE123C; --app-negative-bg: rgba(244,63,94,.10);  --app-negative-border: rgba(244,63,94,.20);
  --app-warning:  #B45309; --app-warning-bg:  rgba(245,158,11,.10); --app-warning-border:  rgba(245,158,11,.20);

  /* Back-compat aliases -> one authoritative semantic value per role (no competing palette). */
  --app-text-muted: var(--app-muted);
  --bg: var(--app-bg); --surface: var(--app-surface); --surface2: var(--app-surface-raised);
  --line: var(--app-border); --text: var(--app-text); --muted: var(--app-muted); --focus-ring: var(--app-focus);
  --accent: var(--app-accent); --color-accent: var(--app-accent);

  color-scheme: light;
}

[data-theme="dark"] {
  /* Approved Zinc dark palette. --app-bg is a FIXED literal (never brand-derived) so
     tenant branding cannot replace the dark canvas. Essential boundaries/focus use
     --app-border-strong / --app-focus (>=3:1); --app-border is decorative only. */
  --app-bg: #09090B;
  --app-surface: #18181B;
  --app-surface-raised: #27272A;
  --app-border: #27272A;
  --app-border-strong: #71717A;
  --app-text: #F4F4F5;
  --app-muted: #A1A1AA;
  --app-focus: #60A5FA;
  --app-accent: var(--tenant-accent, #F59E0B);
  --app-accent-foreground: var(--tenant-accent-foreground, #111827);

  /* Dark status foregrounds (tints/borders are theme-independent, defined above). */
  --app-positive: #34D399;
  --app-negative: #FB7185;
  --app-warning:  #FBBF24;

  color-scheme: dark;
}
