/* Admin design tokens behind the Tailwind surface/text/accent utilities.
   Light at :root, dark at .w-theme-dark; loaded admin-wide. */

:root {
    --surface: #ffffff;
    --surface-2: #f5f5f5;      /* neutral-100 — fields, chips */
    --surface-hover: #f0f0f0;  /* between neutral-50 and 100 */
    --surface-even: #fafafa;   /* neutral-50 — subtle zebra */
    --border: #e5e5e5;         /* neutral-200 — visible on white */
    --border-strong: #d4d4d4;  /* neutral-300 */
    --txt: #171717;            /* neutral-900 */
    --txt-2: #525252;          /* neutral-600 */
    --txt-3: #737373;          /* neutral-500 */
    --accent: #4338ca;         /* indigo-700 — primary; links, active, focus */
    --accent-soft: #e0e7ff;    /* indigo-100 */
    --on-text: #15803d;
    --on-soft: #dcfce7;
    --staff-bg: #e0e7ff;       /* indigo-100 */
    --staff-text: #3730a3;     /* indigo-800 */
    --muted: #a3a3a3;          /* neutral-400 — legible on white */
    --perm-off: #d4d4d4;       /* neutral-300 */
}

.w-theme-dark {
    --surface: #262626;        /* neutral-800 — matches Wagtail sidebar/menus */
    --surface-2: #404040;      /* neutral-700 */
    --surface-hover: #404040;  /* neutral-700 */
    --surface-even: #2e2e2e;   /* between neutral-800 and 700 for subtle zebra */
    --border: #404040;         /* neutral-700 */
    --border-strong: #525252;  /* neutral-600 */
    --txt: #f5f5f5;            /* neutral-100 */
    --txt-2: #a3a3a3;          /* neutral-400 */
    --txt-3: #737373;          /* neutral-500 */
    --accent: #6366f1;         /* indigo-500 — brighter for dark contrast */
    --accent-soft: #312e81;    /* indigo-900 */
    --on-text: #4ade80;
    --on-soft: #14271d;
    --staff-bg: #312e81;       /* indigo-900 */
    --staff-text: #a5b4fc;     /* indigo-300 */
    --muted: #737373;          /* neutral-500 */
    --perm-off: #525252;       /* neutral-600 */
}

/* ------------------------------------------------------------------ *
 * Data-view palette: richer tokens for custom data views (inspect
 * pages, dashboards, report screens). Scoped to the view root (.di) so
 * it overrides nothing in the surrounding admin chrome, and follows the
 * global .w-theme-dark trigger -- no per-view theme toggle.
 *
 * --primary derives from --accent, so a per-client brand change is a
 * single token (override --accent / --accent-soft above).
 * ------------------------------------------------------------------ */

.di {
    --font: -apple-system, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
    /* light (default) */
    --bg:        #f6f6f5;
    --surface:   #ffffff;
    --raised:    #fafafa;
    --border:    #e6e6e4;
    --border-2:  #dad9d6;
    --text:      #1c1c1a;
    --muted:     #6b6b67;
    --faint:     #9a9a96;
    --primary:   var(--accent);
    --primary-2: var(--accent);
    --pos:       #16a34a;
    --pos-bg:    rgba(22, 163, 74, .08);
    --neg:       #dc2626;
    --neg-bg:    rgba(220, 38, 38, .07);
    --warn:      #b45309;
    --warn-bg:   rgba(180, 83, 9, .08);
    /* Avatar bubble background (e.g. starrers); emerald, distinct from the
       indigo accent. Reads well on both themes, so no dark override. */
    --avatar-bg: linear-gradient(135deg, #34d399, #059669);
}

.w-theme-dark .di {
    --bg:        #141414;
    --surface:   #1c1c1c;
    --raised:    #232323;
    --border:    #2e2e2e;
    --border-2:  #383838;
    --text:      #ededed;
    --muted:     #a0a0a0;
    --faint:     #6f6f6f;
    --primary:   var(--accent);
    --primary-2: #818cf8;
    --pos:       #4ade80;
    --pos-bg:    rgba(74, 222, 128, .10);
    --neg:       #f87171;
    --neg-bg:    rgba(248, 113, 113, .12);
    --warn:      #fbbf24;
    --warn-bg:   rgba(251, 191, 36, .12);
}

/* On paper, force the light palette regardless of the active theme. */

@media print {
    .di {
        --bg:        #ffffff;
        --surface:   #ffffff;
        --raised:    #fafafa;
        --border:    #e6e6e4;
        --border-2:  #dad9d6;
        --text:      #1c1c1a;
        --muted:     #6b6b67;
        --faint:     #9a9a96;
        --primary:   var(--accent);
        --primary-2: var(--accent);
        --pos:       #16a34a;
        --pos-bg:    rgba(22, 163, 74, .08);
        --neg:       #dc2626;
        --neg-bg:    rgba(220, 38, 38, .07);
        --warn:      #b45309;
        --warn-bg:   rgba(180, 83, 9, .08);
    }
}
