/**
 * Design skins.
 *
 * Ported from the Luminaux reference: each skin owns a full surface palette
 * (background, surface, border, foreground) plus its accent, not just a colour
 * swap. Every token is defined for light and dark so the accent and the surfaces
 * re-resolve on every theme change.
 *
 * Selected by the `data-skin` attribute on <body>. The server sets it from the
 * saved profile theme; the Layout Settings drawer and the Theme Settings page
 * change it instantly on click.
 *
 * A custom colour uses data-skin="custom", which matches no rule in the file, so
 * the page writes --bs-primary / --bs-primary-rgb inline on <body> instead. A
 * custom colour only overrides the accent — the surfaces keep the default skin's
 * palette.
 *
 * Tokens are consumed by layouts/admin.blade.php, which maps them onto the
 * AdminKit component classes.
 */

body[data-skin="default"] {
    --sk-background: #f6f7f9;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f1f5f9;
    --sk-foreground: #0f172a;
    --sk-muted-foreground: #64748b;
    --sk-border: #e5e8ee;
    --sk-primary: #0067ff;
    --sk-primary-hover: #0058db;
    --sk-primary-rgb: 0, 103, 255;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 0, 103, 255;
    --sk-radius-card: 0.375rem;
}

/* Slate: violet accent, blue secondary, slate-navy rail. Text is a soft
   charcoal (#3d434a) with a blue-grey secondary (#6a7185) rather than near-black. */
body[data-skin="slate"] {
    --sk-background: #f4f7f9;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f4f7f9;
    --sk-foreground: #3d434a;
    --sk-muted-foreground: #6a7185;
    --sk-border: #e6e9ef;
    --sk-primary: #7a70ba;
    --sk-primary-hover: #6a60aa;
    --sk-primary-rgb: 122, 112, 186;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 122, 112, 186;
    --sk-radius-card: 0.375rem;
    --sk-secondary: #48a3d7;
    --sk-secondary-rgb: 72, 163, 215;
}
body[data-skin="indigo"] {
    --sk-background: #f5f5fb;
    --sk-surface: #ffffff;
    --sk-surface-muted: #eeeefa;
    --sk-foreground: #1a1a2e;
    --sk-muted-foreground: #66668a;
    --sk-border: #e4e4f4;
    --sk-primary: #4f46e5;
    --sk-primary-hover: #4338ca;
    --sk-primary-rgb: 79, 70, 229;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 79, 70, 229;
    --sk-radius-card: 0.375rem;
}
body[data-skin="aqua"] {
    --sk-background: #f2f6f6;
    --sk-surface: #ffffff;
    --sk-surface-muted: #e8efef;
    --sk-foreground: #0b1b1c;
    --sk-muted-foreground: #5a6b6c;
    --sk-border: #dce7e7;
    --sk-primary: #1597a5;
    --sk-primary-hover: #0f7e8a;
    --sk-primary-rgb: 21, 151, 165;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 21, 151, 165;
    --sk-radius-card: 0.375rem;
}
/* The reference brand palette, taken from its own compiled tokens:
   --color-primary #088178, --color-primary-dark #056d6e,
   --color-primary-darker #04535c, --color-primary-light #5ed9ba,
   --color-primary-lighter #caf8e4. The dark rail and the pale active pill in
   the sidebar block below are derived from --sk-primary, so they land on the
   same #04535c and #caf8e4 as the original. */
body[data-skin="sellzy"] {
    --sk-background: #f5f9f9;
    --sk-surface: #ffffff;
    --sk-surface-muted: #eaf3f2;
    --sk-foreground: #0b1f21;
    --sk-muted-foreground: #5b7375;
    --sk-border: #dceae9;
    --sk-primary: #088178;
    --sk-primary-hover: #056d6e;
    --sk-primary-rgb: 8, 129, 120;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 8, 129, 120;
    --sk-radius-card: 0.375rem;
}
body[data-skin="lime"] {
    --sk-background: #fbfbf6;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f0f1ea;
    --sk-foreground: #0b0f0a;
    --sk-muted-foreground: #6b6e63;
    --sk-border: #e5e6dd;
    --sk-primary: #9ccc1f;
    --sk-primary-hover: #8bb913;
    --sk-primary-rgb: 156, 204, 31;
    --sk-primary-foreground: #0b0f0a;
    --sk-ring-rgb: 156, 204, 31;
    --sk-radius-card: 0.375rem;
}
body[data-skin="lilac"] {
    --sk-background: #f6f3fa;
    --sk-surface: #ffffff;
    --sk-surface-muted: #efeaf4;
    --sk-foreground: #2a2733;
    --sk-muted-foreground: #6e6a7c;
    --sk-border: #e6def0;
    --sk-primary: #6d5ba6;
    --sk-primary-hover: #5d4d92;
    --sk-primary-rgb: 109, 91, 166;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 109, 91, 166;
    --sk-radius-card: 0.375rem;
}
body[data-skin="prism"] {
    --sk-background: #f6f6fb;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f0f0f7;
    --sk-foreground: #1b1b2e;
    --sk-muted-foreground: #6a6a82;
    --sk-border: #e7e7f1;
    --sk-primary: #6d28d9;
    --sk-primary-hover: #5b21b6;
    --sk-primary-rgb: 109, 40, 217;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 109, 40, 217;
    --sk-radius-card: 0.375rem;
}
body[data-skin="midnight"] {
    --sk-background: #f4f6fb;
    --sk-surface: #ffffff;
    --sk-surface-muted: #eef1f8;
    --sk-foreground: #1a2236;
    --sk-muted-foreground: #5b6577;
    --sk-border: #e1e6f0;
    --sk-primary: #4f5bd5;
    --sk-primary-hover: #3f49c0;
    --sk-primary-rgb: 79, 91, 213;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 79, 91, 213;
    --sk-radius-card: 0.375rem;
}
body[data-skin="ocean"] {
    --sk-background: #f0f6fc;
    --sk-surface: #ffffff;
    --sk-surface-muted: #e6f0f9;
    --sk-foreground: #0c2030;
    --sk-muted-foreground: #51687a;
    --sk-border: #d7e6f1;
    --sk-primary: #0a84ff;
    --sk-primary-hover: #0a6fd6;
    --sk-primary-rgb: 10, 132, 255;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 10, 132, 255;
    --sk-radius-card: 0.375rem;
}
body[data-skin="graphite"] {
    --sk-background: #f5f5f6;
    --sk-surface: #ffffff;
    --sk-surface-muted: #ededee;
    --sk-foreground: #1a1a1c;
    --sk-muted-foreground: #6b6b70;
    --sk-border: #e2e2e4;
    --sk-primary: #2b2b30;
    --sk-primary-hover: #18181b;
    --sk-primary-rgb: 43, 43, 48;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 43, 43, 48;
    --sk-radius-card: 0.375rem;
}
body[data-skin="emerald"] {
    --sk-background: #f1f8f4;
    --sk-surface: #ffffff;
    --sk-surface-muted: #e6f2ea;
    --sk-foreground: #0c1f17;
    --sk-muted-foreground: #51695e;
    --sk-border: #d7e8de;
    --sk-primary: #059669;
    --sk-primary-hover: #047857;
    --sk-primary-rgb: 5, 150, 105;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 5, 150, 105;
    --sk-radius-card: 0.375rem;
}
body[data-skin="amber"] {
    --sk-background: #fcf9f0;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f4eede;
    --sk-foreground: #221a08;
    --sk-muted-foreground: #6f6450;
    --sk-border: #ece3cf;
    --sk-primary: #f59e0b;
    --sk-primary-hover: #e08c00;
    --sk-primary-rgb: 245, 158, 11;
    --sk-primary-foreground: #1f1500;
    --sk-ring-rgb: 245, 158, 11;
    --sk-radius-card: 0.375rem;
}
body[data-skin="coral"] {
    --sk-background: #fdf4f2;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f8e9e5;
    --sk-foreground: #2a1815;
    --sk-muted-foreground: #7a5f59;
    --sk-border: #f0ddd7;
    --sk-primary: #ff6b5e;
    --sk-primary-hover: #ed5648;
    --sk-primary-rgb: 255, 107, 94;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 255, 107, 94;
    --sk-radius-card: 0.375rem;
}
body[data-skin="console"] {
    --sk-background: #f3f6f3;
    --sk-surface: #ffffff;
    --sk-surface-muted: #eaf0ea;
    --sk-foreground: #13211a;
    --sk-muted-foreground: #5c6f60;
    --sk-border: #dce6dd;
    --sk-primary: #15803d;
    --sk-primary-hover: #166534;
    --sk-primary-rgb: 21, 128, 61;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 21, 128, 61;
    --sk-radius-card: 0.375rem;
}
body[data-skin="bento"] {
    --sk-background: #f1eee6;
    --sk-surface: #fcfbf8;
    --sk-surface-muted: #ece8de;
    --sk-foreground: #1a1714;
    --sk-muted-foreground: #7a736b;
    --sk-border: #e3ddd0;
    --sk-primary: #ff5a1f;
    --sk-primary-hover: #e84d17;
    --sk-primary-rgb: 255, 90, 31;
    --sk-primary-foreground: #ffffff;
    --sk-ring-rgb: 255, 90, 31;
    --sk-radius-card: 0.375rem;
}

/* ── Custom colour ──
   data-skin="custom" matches none of the named skins above, so it needs the full
   surface palette here or every --sk-* token resolves to nothing and the page
   loses its background, text and borders. Only the accent is left to the inline
   custom property written by the layout / skin-script; the surfaces below match
   the default skin so a custom colour looks like a recolour of the base theme. */
body[data-skin="custom"] {
    --sk-background: #f6f7f9;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f1f5f9;
    --sk-foreground: #0f172a;
    --sk-muted-foreground: #64748b;
    --sk-border: #e5e8ee;
    --sk-primary-hover: #0058db;
    --sk-primary-foreground: #ffffff;
    --sk-radius-card: 0.375rem;
}
body[data-theme="dark"][data-skin="custom"] {
    --sk-background: #0b1120; --sk-surface: #111827; --sk-surface-muted: #1e293b;
    --sk-foreground: #e5e7eb; --sk-muted-foreground: #94a3b8; --sk-border: #1f2937;
    --sk-primary-hover: #4d96ff; --sk-primary-foreground: #ffffff;
}

/* ── Dark variants ──
   Each skin re-declares the whole palette: lighter accents for legibility and
   deeper, tinted surfaces so dark mode still reads as the same skin. */
body[data-theme="dark"][data-skin="slate"] {
    --sk-primary: #7a70ba; --sk-primary-hover: #8d84c6; --sk-primary-rgb: 122, 112, 186;
    --sk-primary-foreground: #ffffff; --sk-ring-rgb: 122, 112, 186;
}
body[data-theme="dark"][data-skin="default"] {
    --sk-background: #0b1120; --sk-surface: #111827; --sk-surface-muted: #1e293b;
    --sk-foreground: #e5e7eb; --sk-muted-foreground: #94a3b8; --sk-border: #1f2937;
    --sk-primary: #2b7fff; --sk-primary-hover: #4d96ff; --sk-primary-rgb: 43, 127, 255;
    --sk-primary-foreground: #ffffff; --sk-ring-rgb: 43, 127, 255;
}
body[data-theme="dark"][data-skin="sellzy"] {
    --sk-background: #01100f; --sk-surface: #052020; --sk-surface-muted: #0a2e2d;
    --sk-foreground: #dcefec; --sk-muted-foreground: #86b1ae; --sk-border: #0f3b38;
    /* The reference's own dark accent, --color-primary-light. */
    --sk-primary: #5ed9ba; --sk-primary-hover: #8ae5cc; --sk-primary-rgb: 94, 217, 186;
    --sk-primary-foreground: #01100f; --sk-ring-rgb: 94, 217, 186;
}
body[data-theme="dark"][data-skin="indigo"] {
    --sk-background: #0c0c1a; --sk-surface: #16162c; --sk-surface-muted: #1f1f3a;
    --sk-foreground: #e8e8f5; --sk-muted-foreground: #9a9ac0; --sk-border: #26264a;
    --sk-primary: #818cf8; --sk-primary-hover: #a5b4fc; --sk-primary-rgb: 129, 140, 248;
    --sk-primary-foreground: #0c0c1a; --sk-ring-rgb: 129, 140, 248;
}
body[data-theme="dark"][data-skin="aqua"] {
    --sk-background: #001011; --sk-surface: #07211f; --sk-surface-muted: #0c2e2b;
    --sk-foreground: #dcefef; --sk-muted-foreground: #8fb3b2; --sk-border: #123733;
    --sk-primary: #3aafb9; --sk-primary-hover: #4fc2cc; --sk-primary-rgb: 58, 175, 185;
    --sk-primary-foreground: #001011; --sk-ring-rgb: 58, 175, 185;
}
body[data-theme="dark"][data-skin="lime"] {
    --sk-background: #0a0d0a; --sk-surface: #12160f; --sk-surface-muted: #1a1f16;
    --sk-foreground: #eaeee2; --sk-muted-foreground: #9da396; --sk-border: #242a1e;
    --sk-primary: #a9dc1a; --sk-primary-hover: #b8e83a; --sk-primary-rgb: 169, 220, 26;
    --sk-primary-foreground: #0a0d0a; --sk-ring-rgb: 169, 220, 26;
}
body[data-theme="dark"][data-skin="lilac"] {
    --sk-background: #16131c; --sk-surface: #201c29; --sk-surface-muted: #2a2536;
    --sk-foreground: #e8e2f0; --sk-muted-foreground: #a39cb3; --sk-border: #322c40;
    --sk-primary: #a78bdb; --sk-primary-hover: #b79ee6; --sk-primary-rgb: 167, 139, 219;
    --sk-primary-foreground: #16131c; --sk-ring-rgb: 167, 139, 219;
}
body[data-theme="dark"][data-skin="prism"] {
    --sk-background: #0e0e1a; --sk-surface: #17172a; --sk-surface-muted: #1f1f38;
    --sk-foreground: #e9e9f6; --sk-muted-foreground: #9b9bb6; --sk-border: #29294a;
    --sk-primary: #a78bfa; --sk-primary-hover: #b9a4fc; --sk-primary-rgb: 167, 139, 250;
    --sk-primary-foreground: #0e0e1a; --sk-ring-rgb: 167, 139, 250;
}
body[data-theme="dark"][data-skin="midnight"] {
    --sk-background: #0a0e1a; --sk-surface: #121829; --sk-surface-muted: #1b2236;
    --sk-foreground: #e3e8f5; --sk-muted-foreground: #97a1bb; --sk-border: #232c44;
    --sk-primary: #7c86f0; --sk-primary-hover: #919af5; --sk-primary-rgb: 124, 134, 240;
    --sk-primary-foreground: #0a0e1a; --sk-ring-rgb: 124, 134, 240;
}
body[data-theme="dark"][data-skin="ocean"] {
    --sk-background: #04121f; --sk-surface: #0a1f30; --sk-surface-muted: #0f2b40;
    --sk-foreground: #d8ecf8; --sk-muted-foreground: #8aa9bd; --sk-border: #163a52;
    --sk-primary: #3aa0ff; --sk-primary-hover: #57b0ff; --sk-primary-rgb: 58, 160, 255;
    --sk-primary-foreground: #04121f; --sk-ring-rgb: 58, 160, 255;
}
body[data-theme="dark"][data-skin="graphite"] {
    --sk-background: #0c0c0d; --sk-surface: #161618; --sk-surface-muted: #1f1f22;
    --sk-foreground: #ededee; --sk-muted-foreground: #9a9aa0; --sk-border: #292a2d;
    --sk-primary: #e4e4e7; --sk-primary-hover: #ffffff; --sk-primary-rgb: 228, 228, 231;
    --sk-primary-foreground: #161618; --sk-ring-rgb: 228, 228, 231;
}
body[data-theme="dark"][data-skin="emerald"] {
    --sk-background: #04120c; --sk-surface: #08231a; --sk-surface-muted: #0d2e22;
    --sk-foreground: #d7f0e4; --sk-muted-foreground: #8db8a6; --sk-border: #123a2c;
    --sk-primary: #10b981; --sk-primary-hover: #34d399; --sk-primary-rgb: 16, 185, 129;
    --sk-primary-foreground: #04120c; --sk-ring-rgb: 16, 185, 129;
}
body[data-theme="dark"][data-skin="amber"] {
    --sk-background: #140f03; --sk-surface: #1f1808; --sk-surface-muted: #2a2110;
    --sk-foreground: #f1e9d6; --sk-muted-foreground: #b3a587; --sk-border: #342a14;
    --sk-primary: #fbbf24; --sk-primary-hover: #fcd34d; --sk-primary-rgb: 251, 191, 36;
    --sk-primary-foreground: #140f03; --sk-ring-rgb: 251, 191, 36;
}
body[data-theme="dark"][data-skin="coral"] {
    --sk-background: #1a0f0d; --sk-surface: #261714; --sk-surface-muted: #32201c;
    --sk-foreground: #f5e2dd; --sk-muted-foreground: #c0a098; --sk-border: #3d2823;
    --sk-primary: #ff7d72; --sk-primary-hover: #ff968c; --sk-primary-rgb: 255, 125, 114;
    --sk-primary-foreground: #1a0f0d; --sk-ring-rgb: 255, 125, 114;
}
body[data-theme="dark"][data-skin="console"] {
    --sk-background: #0a0f0b; --sk-surface: #0f150f; --sk-surface-muted: #161d16;
    --sk-foreground: #d3e8d6; --sk-muted-foreground: #7c9580; --sk-border: #1e2a1f;
    --sk-primary: #22c55e; --sk-primary-hover: #34d76b; --sk-primary-rgb: 34, 197, 94;
    --sk-primary-foreground: #06120a; --sk-ring-rgb: 34, 197, 94;
}
body[data-theme="dark"][data-skin="bento"] {
    --sk-background: #16130f; --sk-surface: #201c16; --sk-surface-muted: #2a251d;
    --sk-foreground: #f0ebe2; --sk-muted-foreground: #a39a8c; --sk-border: #332d24;
    --sk-primary: #ff6b35; --sk-primary-hover: #ff7d4d; --sk-primary-rgb: 255, 107, 53;
    --sk-primary-foreground: #1a1714; --sk-ring-rgb: 255, 107, 53;
}

/* A custom colour keeps the default skin's surfaces and overrides only the accent,
   which the page writes inline. Excluded so the mapping below cannot win. */
body[data-skin="custom"] {
    --sk-background: #f6f7f9;
    --sk-surface: #ffffff;
    --sk-surface-muted: #f1f5f9;
    --sk-foreground: #0f172a;
    --sk-muted-foreground: #64748b;
    --sk-border: #e5e8ee;
    --sk-primary-hover: #0058db;
    --sk-primary-foreground: #ffffff;
    --sk-radius-card: 0.375rem;
}
body[data-theme="dark"][data-skin="custom"] {
    --sk-background: #0b1120;
    --sk-surface: #111827;
    --sk-surface-muted: #1e293b;
    --sk-foreground: #e5e7eb;
    --sk-muted-foreground: #94a3b8;
    --sk-border: #1f2937;
}

/* ── Semantic colours ──
   Sourced from the reference's default skin; these do not vary per skin. */
:root,
body[data-skin] {
    --sk-success: #16a34a;
    --sk-warning: #d97706;
    --sk-danger: #dc2626;
    --sk-info: #0ea5e9;
}
body[data-theme="dark"][data-skin] {
    --sk-success: #4ade80;
    --sk-warning: #fbbf24;
    --sk-danger: #f87171;
    --sk-info: #38bdf8;
}

/* ── Sidebar ──
   The rail is a deep tint of the skin's own accent, mirroring the reference,
   whose rail is bg-primary-darker (#04535c) under a #088178 primary rather than
   a neutral grey. It used to be a fixed #141414 for every skin, so the sidebar
   ignored the theme entirely.

   Mixed from --sk-primary rather than written out per skin so the custom colour
   skin — which sets an arbitrary accent at runtime — tints the rail too.

   The two text tokens are the load-bearing ones. Rows sit on a near-black rail,
   so the accent itself is unreadable as text (graphite's #2b2b30 measures 1.31:1
   there). --sk-sidebar-accent is the accent lightened toward white, which clears
   4.5:1 on every skin, and is what the active row and the dots use. */
body[data-skin] {
    --sk-sidebar: color-mix(in srgb, var(--sk-primary) 26%, #06080d);
    --sk-sidebar-accent: color-mix(in srgb, #ffffff 45%, var(--sk-primary));
    /* The current page's row, mirroring the reference's bg-primary-lighter /
       text-primary pairing: a pale pill carrying a dark ink of the same accent.
       Tinting toward the accent instead does not work here — the rail is
       already a dark tint of that accent, so a further tint only reaches 1.2:1
       against it and never reads as "selected". */
    --sk-sidebar-active: color-mix(in srgb, #ffffff 82%, var(--sk-primary));
    /* 60% ink, not less: at 45% the light accents (graphite, lime, amber in
       dark mode) left the label at 3.7:1 on its own pill. */
    --sk-sidebar-active-ink: color-mix(in srgb, #06080d 60%, var(--sk-primary));
    --sk-sidebar-border: rgba(255, 255, 255, 0.1);
    --sk-sidebar-text: rgba(255, 255, 255, 0.7);
    --sk-sidebar-text-strong: #ffffff;
    --sk-sidebar-text-muted: rgba(255, 255, 255, 0.4);
    --sk-sidebar-hover: rgba(255, 255, 255, 0.1);
    --sk-sidebar-icon: rgba(255, 255, 255, 0.6);
    /* Section heading ("USER MANAGEMENT"). Reuses --sk-sidebar-accent (the
       same lightened-toward-white mix the active row/dots already use, which
       clears 4.5:1 on every rail) so every skin gets a colourful, on-brand
       heading instead of a flat grey — only Sellzy still states its own
       literal colour below, to match the reference site exactly. */
    --sk-sidebar-heading: var(--sk-sidebar-accent);
}

/* The reference rail, written out rather than mixed.
   It sits after the generic block above on purpose: both selectors carry one
   attribute (body[data-skin] vs body[data-skin="sellzy"]) and a later rule
   wins, so a sellzy override placed in its own skin block further up the file
   would be overridden by the generic one.

   Values are the reference's own tokens: the rail is bg-primary-darker
   #04535c, labels are primary-light #5ed9ba, the current row is
   bg-primary-lighter #caf8e4 carrying primary #088178 ink, and the section
   headings are warning-light #ffe16a. The generic 26%-toward-black mix lands on
   a near-black rail for this primary, so the brand colour has to be stated. */
body[data-skin="sellzy"] {
    --sk-sidebar: #04535c;
    --sk-sidebar-accent: #5ed9ba;
    --sk-sidebar-active: #caf8e4;
    --sk-sidebar-active-ink: #088178;
    --sk-sidebar-heading: #ffe16a;
}

/* Slate's rail is a fixed slate-navy, not a tint of its accent. The current row
   is a lighter slate step (#374462) and the section headings a soft white. */
body[data-skin="slate"] {
    --sk-sidebar: #2a3650;
    --sk-sidebar-active: #374462;
    --sk-sidebar-heading: rgba(255, 255, 255, 0.7);
}

/* ══ Rails per skin ══
   The generic mix above (26% accent into near-black) turned warm accents to mud:
   lime went olive, amber and bento brown, coral maroon. Each rail is now stated:
   cool hues get a deep shade of their own colour at Sellzy's depth (OKLCH
   L 0.405, chroma scaled with the accent so vivid skins get richer rails); warm
   hues, whose deep shades are always olive or brown, sit on a neutral slate the
   accent can glow against; graphite stays a near-black charcoal. Sellzy and
   Slate keep their own rails above. Must stay below the generic block. */
body[data-skin="default"] { --sk-sidebar: #2c4879; }
body[data-skin="indigo"] { --sk-sidebar: #3e4378; }
body[data-skin="aqua"] { --sk-sidebar: #1d5158; }
body[data-skin="lime"] { --sk-sidebar: #29313f; }  /* neutral slate: warm accent */
body[data-skin="lilac"] { --sk-sidebar: #4a4366; }
body[data-skin="prism"] { --sk-sidebar: #4b3e75; }
body[data-skin="midnight"] { --sk-sidebar: #3c4572; }
body[data-skin="ocean"] { --sk-sidebar: #294a74; }
body[data-skin="graphite"] { --sk-sidebar: #202225; }
body[data-skin="emerald"] { --sk-sidebar: #25543f; }
body[data-skin="amber"] { --sk-sidebar: #29313f; }  /* neutral slate: warm accent */
body[data-skin="coral"] { --sk-sidebar: #29313f; }  /* neutral slate: warm accent */
body[data-skin="console"] { --sk-sidebar: #2e5336; }
body[data-skin="bento"] { --sk-sidebar: #29313f; }  /* neutral slate: warm accent */

/* ── Map the skin onto the tokens AdminKit components already read ──
   A custom colour is excluded because skin-script writes --bs-primary and
   --bs-primary-rgb inline on <body>; an inline declaration outranks this rule
   anyway, so mapping it here would be redundant. */
body[data-skin]:not([data-skin="custom"]) {
    --bs-primary: var(--sk-primary);
    --bs-primary-rgb: var(--sk-primary-rgb);
}

/* ── Shape overrides ──
   One minimal radius throughout, so the surface card, the skin picker boxes and
   the form fields all share a corner shape. The console/bento skins previously
   varied the radius, which made the same control look different per skin. */
body[data-skin] .surface-card,
body[data-skin] .lss-skin-box {
    border-radius: var(--sk-radius-card, 0.375rem);
}
/* The preview strip sits inside a box, so it steps in by the same amount the
   layout's --sk-radius-inset does for nested elements. */
body[data-skin] .lss-skin-box .lss-skin-preview {
    border-radius: 0.25rem;
}

/* ══ Secondary accent ══
   A second brand colour beside --sk-primary (charts, secondary badges, the
   .text/.bg/.btn-theme-secondary hooks in admin.css). Deliberately not mapped
   onto Bootstrap's --bs-secondary: that one is the grey of every Cancel button
   and of .text-secondary muted copy. Skins without their own use this blue; a
   user's own pick is written by theme.css with a higher-specificity selector. */
body[data-skin] {
    --sk-secondary: #48a3d7;
    --sk-secondary-rgb: 72, 163, 215;
    --sk-chart-3: #d77748;
    --sk-chart-4: #c95e9e;
}

/* ══ Chart palette per skin ══
   Four series colours, read by the dashboard charts and the .text-chart-* /
   .bg-chart-* legend dots: primary, a secondary picked to sit beside it, then a
   warm orange and pink. Warm skins (amber, coral, bento) swap 3 and 4 for cool
   blue and violet, and pink-leaning ones replace pink, so no chart repeats a
   hue. Must stay below the generic block above: same specificity, later wins. */
body[data-skin="default"] { --sk-secondary: #06b6d4; --sk-secondary-rgb: 6, 182, 212; }
body[data-skin="slate"] { --sk-secondary: #48a3d7; --sk-secondary-rgb: 72, 163, 215; }
body[data-skin="indigo"] { --sk-secondary: #0ea5e9; --sk-secondary-rgb: 14, 165, 233; }
body[data-skin="aqua"] { --sk-secondary: #3b82f6; --sk-secondary-rgb: 59, 130, 246; }
body[data-skin="sellzy"] { --sk-secondary: #48a3d7; --sk-secondary-rgb: 72, 163, 215; }
body[data-skin="lime"] { --sk-secondary: #10b981; --sk-secondary-rgb: 16, 185, 129; }
body[data-skin="lilac"] { --sk-secondary: #d17ba8; --sk-secondary-rgb: 209, 123, 168; --sk-chart-4: #48a3d7; }
body[data-skin="prism"] { --sk-secondary: #db2777; --sk-secondary-rgb: 219, 39, 119; --sk-chart-4: #48a3d7; }
body[data-skin="midnight"] { --sk-secondary: #22b8cf; --sk-secondary-rgb: 34, 184, 207; }
body[data-skin="ocean"] { --sk-secondary: #5e5ce6; --sk-secondary-rgb: 94, 92, 230; }
body[data-skin="graphite"] { --sk-secondary: #8a8f98; --sk-secondary-rgb: 138, 143, 152; --sk-chart-3: #c4c7cc; --sk-chart-4: #5f636b; }
body[data-skin="emerald"] { --sk-secondary: #0ea5e9; --sk-secondary-rgb: 14, 165, 233; }
body[data-skin="amber"] { --sk-secondary: #ef6c4a; --sk-secondary-rgb: 239, 108, 74; --sk-chart-3: #48a3d7; --sk-chart-4: #7a70ba; }
body[data-skin="coral"] { --sk-secondary: #f7b538; --sk-secondary-rgb: 247, 181, 56; --sk-chart-3: #48a3d7; --sk-chart-4: #7a70ba; }
body[data-skin="console"] { --sk-secondary: #65a30d; --sk-secondary-rgb: 101, 163, 13; }
body[data-skin="bento"] { --sk-secondary: #ffb020; --sk-secondary-rgb: 255, 176, 32; --sk-chart-3: #48a3d7; --sk-chart-4: #7a70ba; }

/* ══ Light mode: one page background for every skin ══
   #f4f7f9 behind white cards. :not([data-theme="dark"]) lifts this above the
   per-skin blocks (one extra attribute), so it wins regardless of file order.
   --sk-divider is the dashed rule colour for table rows and card footers. */
body[data-skin]:not([data-theme="dark"]) {
    --sk-background: #f4f7f9;
    --sk-surface: #ffffff;
    --sk-divider: #d2d4da;
}

/* ══ Dark mode: one slate-navy palette for every skin ══
   Only the accent still varies per skin (the blocks above). Page #374462, cards,
   header, footer and rail #2a3650, raised controls back on #374462. The text
   levels are the reference's white-at-opacity values flattened onto the card
   surface, so they stay correct wherever a token is reused as a background:
   90% #eaebee headings, 80% #d4d7dc labels, 70% #bfc3cb body copy (set in
   admin.css), 60% #aaafb9 muted, 10% #3f4a62 borders, 30% #6a7284 dividers.
   It sits after every per-skin dark block, so with equal specificity it wins. */
body[data-theme="dark"][data-skin] {
    --sk-background: #374462;
    --sk-surface: #2a3650;
    --sk-surface-muted: #374462;
    --sk-foreground: #eaebee;
    --sk-muted-foreground: #aaafb9;
    --sk-border: #3f4a62;
    --sk-divider: #6a7284;
    --sk-label: #d4d7dc;
    --sk-body-text: #bfc3cb;
}

/* ══ Readable sidebar headings ══
   The headings and the brand "AI" pill use --sk-sidebar-accent, the accent
   mixed toward white. 45% was enough on the old near-black rails; on the
   lighter per-skin rails above, these skins need a little more white to keep
   the small 9.6px headings at 4.5:1 or better. */
body[data-skin="default"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 55%, var(--sk-primary)); }
body[data-skin="indigo"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 58%, var(--sk-primary)); }
body[data-skin="aqua"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 46%, var(--sk-primary)); }
body[data-skin="lilac"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 54%, var(--sk-primary)); }
body[data-skin="prism"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 61%, var(--sk-primary)); }
body[data-skin="midnight"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 54%, var(--sk-primary)); }
body[data-skin="ocean"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 48%, var(--sk-primary)); }
body[data-skin="emerald"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 51%, var(--sk-primary)); }
body[data-skin="console"] { --sk-sidebar-accent: color-mix(in srgb, #ffffff 56%, var(--sk-primary)); }

/* ══ Readable primary buttons ══
   Button text is always white. Where white on a skin's accent falls under 4.5:1,
   --sk-btn-bg (read by admin.css) is a deeper shade of the same accent: OKLCH
   lightness lowered just until white passes, hue and chroma kept, so lime stays
   green and amber stays orange instead of greying out as a black mix would.
   Skins not listed keep the plain accent. */
body[data-skin="slate"]:not([data-theme="dark"]) { --sk-btn-bg: #746ab4; }
body[data-skin="aqua"]:not([data-theme="dark"]) { --sk-btn-bg: #09808d; }
body[data-skin="lime"]:not([data-theme="dark"]) { --sk-btn-bg: #607f05; }
body[data-skin="ocean"]:not([data-theme="dark"]) { --sk-btn-bg: #0373e0; }
body[data-skin="emerald"]:not([data-theme="dark"]) { --sk-btn-bg: #01855d; }
body[data-skin="amber"]:not([data-theme="dark"]) { --sk-btn-bg: #a46802; }
body[data-skin="coral"]:not([data-theme="dark"]) { --sk-btn-bg: #d24139; }
body[data-skin="bento"]:not([data-theme="dark"]) { --sk-btn-bg: #d34203; }
body[data-theme="dark"][data-skin="sellzy"] { --sk-btn-bg: #03846c; }
body[data-theme="dark"][data-skin="slate"] { --sk-btn-bg: #746ab4; }
body[data-theme="dark"][data-skin="default"] { --sk-btn-bg: #186fed; }
body[data-theme="dark"][data-skin="indigo"] { --sk-btn-bg: #626ad2; }
body[data-theme="dark"][data-skin="aqua"] { --sk-btn-bg: #078189; }
body[data-theme="dark"][data-skin="lime"] { --sk-btn-bg: #5f7e02; }
body[data-theme="dark"][data-skin="lilac"] { --sk-btn-bg: #8367b4; }
body[data-theme="dark"][data-skin="prism"] { --sk-btn-bg: #7f61cc; }
body[data-theme="dark"][data-skin="midnight"] { --sk-btn-bg: #636ad1; }
body[data-theme="dark"][data-skin="ocean"] { --sk-btn-bg: #0477ce; }
body[data-theme="dark"][data-skin="graphite"] { --sk-btn-bg: #747477; }
body[data-theme="dark"][data-skin="emerald"] { --sk-btn-bg: #08855c; }
body[data-theme="dark"][data-skin="amber"] { --sk-btn-bg: #946e03; }
body[data-theme="dark"][data-skin="coral"] { --sk-btn-bg: #c74a43; }
body[data-theme="dark"][data-skin="console"] { --sk-btn-bg: #03863b; }
body[data-theme="dark"][data-skin="bento"] { --sk-btn-bg: #cf4500; }
