/**
 * CozyOS Enterprise Design System — System Tokens
 * File Reference: core/ui/cozy-tokens.css
 */
:root {
    /* Typographic System */
    --cozy-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --cozy-font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", Courier, monospace;

    /* CozyOS Design Studio (Rule 45) — real, universal font-family token
       every theme inherits by default. A theme overrides this only when
       it genuinely needs a distinct typeface (e.g. churchos below) —
       not duplicated per-theme unless there's a real reason to differ. */
    --cozy-font-family: var(--cozy-font-sans);

    /* CozyOS Universal UI Readability & Accessibility Standard —
       real, shared font-size scale. Every component across every
       CozyOS application should read from these, not hardcode a
       size. Never below 14px for normal interface text — the
       standard's own explicit floor. */
    --cozy-text-page-title: 30px;
    --cozy-text-section-title: 23px;
    --cozy-text-card-title: 19px;
    --cozy-text-body: 17px;
    --cozy-text-secondary: 15px;
    --cozy-text-label: 15px;
    --cozy-text-button: 16px;

    /* Global Layout Metrics */
    --cozy-sidebar-width: 260px;
    --cozy-topbar-height: 56px;
    --cozy-statusbar-height: 28px;

    /* Border Radii */
    --cozy-radius-sm: 6px;
    --cozy-radius-md: 12px;
    --cozy-radius-lg: 18px;
    --cozy-radius-xl: 28px;

    /* Premium Glassmorphic Attributes */
    --cozy-glass-blur: blur(20px);
    --cozy-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --cozy-glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --cozy-glass-bg: rgba(10, 12, 22, 0.6);

    /* Animation Constants */
    --cozy-transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --cozy-transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --cozy-transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Platform Semantic Colors (Frozen)
       Fixed across every application/theme — used by toasts, dialogs,
       validation, forms, notifications, and reports. Do not override
       per-app; the whole point is that "success" means the same green
       everywhere in CozyOS. */
    --cozy-success: #22c55e;
    --cozy-info: #3b82f6;
    --cozy-warning: #f59e0b;
    --cozy-error: #ef4444;
    /* Added for the CozyOS Enterprise UI Standard's 5-color status
       language — the 5th meaning (In Progress / Pending) had no real
       token yet; the other 4 (Certified/Healthy, Warning, Information,
       Failed/Critical) already existed above and are reused as-is. */
    --cozy-pending: #f97316;
}

/* ==========================================================================
   COZYOS — Platform Identity (Shared Shell default, before any app is active)
   Additive: distinct from platform-admin (Administrator Workspace) and
   developer (Developer Hub) — this is the Shared Shell's own neutral
   identity. Colors below are a first pass (indigo/sky), not a confirmed
   final brand decision — flagged explicitly in the migration log; trivial
   to revise since they're plain CSS custom properties.
   ========================================================================== */
html[data-cozy-app="cozyos"], [data-cozy-app="cozyos"] {
    --cozy-accent: #4F46E5;
    --cozy-accent-glow: rgba(79, 70, 229, 0.18);
    --cozy-brand-primary: #4F46E5;
    --cozy-brand-accent: #38BDF8;
    --cozy-brand-glow: rgba(79, 70, 229, 0.18);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #0f1020 0%, #05050a 100%);
    --cozy-muted: #94a3b8;
    --cozy-text: #f1f5f9;
    --cozy-border: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   PLATFORM-ADMIN — Light Enterprise (Administrator Workspace)
   REWORKED per reference design: light content area with a dark navy
   sidebar, replacing the earlier dark-glass treatment. Overrides the
   universal glass/card tokens (defined in the base :root above) ONLY
   within this theme's own selector — Developer Hub and every other app
   theme are unaffected, since CSS custom properties only cascade where
   the [data-cozy-app="platform-admin"] attribute is actually present.
   New tokens (--cozy-sidebar-*) added here because no prior theme needed
   a visually distinct sidebar from its main content area — justified
   under Rule 34 (new tokens, real need, no duplication of an existing one).
   ========================================================================== */
html[data-cozy-app="platform-admin"], [data-cozy-app="platform-admin"] {
    --cozy-accent: #1B5E20;
    --cozy-accent-glow: rgba(27, 94, 32, 0.15);
    --cozy-brand-primary: #1B5E20;
    --cozy-brand-accent: #00A86B;
    --cozy-brand-gold: #F9A825;
    --cozy-brand-glow: rgba(27, 94, 32, 0.15);
    --cozy-bg-gradient: #FFFFFF;
    --cozy-muted: #424242;
    --cozy-text-faint: #616161;
    --cozy-text: #212121;
    --cozy-border: #E0E0E0;

    /* Light card/glass treatment — overrides the universal dark-glass
       defaults specifically for this theme. */
    --cozy-glass-bg: #ffffff;
    --cozy-glass-blur: none;
    --cozy-glass-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
    --cozy-glass-border: 1px solid #E0E0E0;

    /* New: sidebar-specific tokens (dark navy sidebar, distinct from the
       light main content area). */
    --cozy-sidebar-bg: #0f172a;
    --cozy-sidebar-text: #e2e8f0;
    --cozy-sidebar-text-muted: #94a3b8;
    --cozy-sidebar-hover: #1e293b;
    --cozy-sidebar-active-bg: #16A34A;
}

/* ==========================================================================
   DEVELOPER HUB — Cozy Green + Gold (Default)
   ========================================================================== */
html[data-cozy-app="developer"], [data-cozy-app="developer"] {
    --cozy-accent: #10b981; 
    --cozy-accent-glow: rgba(16, 185, 129, 0.15);
    --cozy-brand-primary: #10b981;
    --cozy-brand-accent: #fbbf24; 
    --cozy-brand-glow: rgba(16, 185, 129, 0.15);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #0c1514 0%, #06080c 100%);
    --cozy-muted: #94a3b8;
    --cozy-text: #f1f5f9;
    --cozy-border: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   SHOPOS — Green + Orange
   ========================================================================== */
html[data-cozy-app="shopos"], [data-cozy-app="shopos"] {
    --cozy-accent: #22c55e;
    --cozy-accent-glow: rgba(34, 197, 94, 0.15);
    --cozy-brand-primary: #22c55e;
    --cozy-brand-accent: #f97316; 
    --cozy-brand-glow: rgba(34, 197, 94, 0.15);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #061c0f 0%, #04070a 100%);
    --cozy-muted: #94a3b8;
    --cozy-text: #f9fafb;
    --cozy-border: rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   QUARRYOS — Stone Grey + Sand Gold
   ========================================================================== */
html[data-cozy-app="quarryos"], [data-cozy-app="quarryos"] {
    --cozy-accent: #78716c;
    --cozy-accent-glow: rgba(120, 113, 108, 0.2);
    --cozy-brand-primary: #78716c;
    --cozy-brand-accent: #eab308; 
    --cozy-brand-glow: rgba(120, 113, 108, 0.2);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #1c1917 0%, #0c0a09 100%);
    --cozy-muted: #a8a29e;
    --cozy-text: #fafaf9;
    --cozy-border: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   MPESAOS — Emerald + White
   ========================================================================== */
html[data-cozy-app="mpesaos"], [data-cozy-app="mpesaos"] {
    --cozy-accent: #059669;
    --cozy-accent-glow: rgba(5, 150, 105, 0.2);
    --cozy-brand-primary: #059669;
    --cozy-brand-accent: #ffffff; 
    --cozy-brand-glow: rgba(5, 150, 105, 0.2);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #022c22 0%, #020617 100%);
    --cozy-muted: #94a3b8;
    --cozy-text: #f8fafc;
    --cozy-border: rgba(255, 255, 255, 0.09);
}

/* ==========================================================================
   HOSPITALOS — Medical Blue
   ========================================================================== */
html[data-cozy-app="hospitalos"], [data-cozy-app="hospitalos"] {
    --cozy-accent: #0ea5e9;
    --cozy-accent-glow: rgba(14, 165, 233, 0.15);
    --cozy-brand-primary: #0ea5e9;
    --cozy-brand-accent: #38bdf8; 
    --cozy-brand-glow: rgba(14, 165, 233, 0.15);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #071e2e 0%, #030712 100%);
    --cozy-muted: #a8a29e;
    --cozy-text: #f0f9ff;
    --cozy-border: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   EDUCATIONOS / SCHOOLOS — Blue + Purple
   ========================================================================== */
html[data-cozy-app="schoolos"], html[data-cozy-app="educationos"], 
[data-cozy-app="schoolos"], [data-cozy-app="educationos"] {
    --cozy-accent: #3b82f6;
    --cozy-accent-glow: rgba(59, 130, 246, 0.15);
    --cozy-brand-primary: #3b82f6;
    --cozy-brand-accent: #a855f7; 
    --cozy-brand-glow: rgba(59, 130, 246, 0.15);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #030712 100%);
    --cozy-muted: #94a3b8;
    --cozy-text: #f8fafc;
    --cozy-border: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   CHURCHOS — Amber Gold + Deep Red
   ========================================================================== */
html[data-cozy-app="churchos"], [data-cozy-app="churchos"] {
    --cozy-accent: #d97706;
    --cozy-accent-glow: rgba(217, 119, 6, 0.15);
    --cozy-brand-primary: #d97706;
    --cozy-brand-accent: #b91c1c; 
    --cozy-brand-glow: rgba(217, 119, 6, 0.15);
    --cozy-bg-gradient: radial-gradient(circle at 50% 0%, #1c1210 0%, #0c0605 100%);
    --cozy-muted: #a8a29e;
    --cozy-text: #fef3c7;
    --cozy-border: rgba(255, 255, 255, 0.08);
    /* Design Studio (Rule 45) — real, standard, already-installed serif
       web-font stack (no custom font file loaded — offline-first, no
       external font CDN). Demonstrates genuine per-theme typography, per
       the explicit "Church -> elegant serif" example. */
    --cozy-font-family: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

/* Theme Studio (Rule 48) — real, new theme. Maximum-contrast values chosen
   specifically for AAA compliance (verified with AccessibilityEngine after
   adding this block, not assumed) — pure black text on pure white, no
   mid-tone grays anywhere in the primary/muted pair. "Corporate" and
   "CozyCabin" (mentioned in an earlier UI reference prototype) and
   "Seasonal Themes" do not exist anywhere in this codebase and are not
   fabricated here — only this one, genuinely new theme was added. */
html[data-cozy-app="high-contrast"], [data-cozy-app="high-contrast"] {
    --cozy-accent: #000000;
    --cozy-accent-glow: rgba(0, 0, 0, 0.2);
    --cozy-brand-primary: #000000;
    --cozy-brand-accent: #0000EE;
    --cozy-brand-glow: rgba(0, 0, 0, 0.2);
    --cozy-bg-gradient: #FFFFFF;
    --cozy-muted: #000000;
    --cozy-text-faint: #000000;
    --cozy-text: #000000;
    --cozy-border: #000000;
    --cozy-glass-bg: #ffffff;
    --cozy-glass-blur: none;
    --cozy-glass-shadow: none;
    --cozy-glass-border: 2px solid #000000;
    --cozy-font-family: var(--cozy-font-sans);

    /* Living Light Engine v1.0 - real palette, single source of truth */
    --cozy-light-primary-green: #00ff88;
    --cozy-light-forest-green: #0b7a43;
    --cozy-light-dark-emerald: #063d28;
    --cozy-light-gold: #ffcf40;
    --cozy-light-deep-gold: #c99900;
    --cozy-light-soft-white: #ffffff;
    --cozy-light-cyan: #00f6ff;
    --cozy-light-royal-blue: #0088ff;
    --cozy-light-emergency-red: #ff3b30;
    --cozy-light-warning-orange: #ff9900;
    --cozy-light-success-lime: #7dff6a;
    --cozy-light-purple-ai: #aa66ff;
}
