/* ui-kit.css — The shared UI kit alone: tokens + stat tile, status badge, tag, alert, notification.
   For a page with its own <head>; a page of the core's layout has it in fastpluggy.css.
   Auto-generated by scripts/build-css.sh from 01-tokens.css and 10-ui-kit.css — do not edit directly.
   =========================================================== */

/* === 01-tokens.css === */

/* 01-tokens.css — FastPluggy Design Token System
   Proxy-inspired SIGNAL design system
   =========================================================== */

/* -----------------------------------------------------------
   1. Design Token System — Dark-first baseline
   ----------------------------------------------------------- */
:root {
    /* Surface layers — Tabler neutral palette (no blue tint) */
    --c-bg:             #0a0a0a;   /* neutral-950 */
    --c-surface:        #171717;   /* neutral-900 */
    --c-elevated:       #262626;   /* neutral-800 */
    --c-overlay:        #404040;   /* neutral-700 */

    /* Borders — RGBA for depth */
    --c-border:         rgba(255, 255, 255, 0.072);
    --c-border-subtle:  rgba(255, 255, 255, 0.042);
    --c-border-str:     rgba(255, 255, 255, 0.14);

    /* Text — 3-level hierarchy (no blue tint) */
    --c-text:           #e5e5e5;   /* neutral-200 */
    --c-text-muted:     #a3a3a3;   /* neutral-400 */
    --c-text-subtle:    #737373;   /* neutral-500 — was 600, too low contrast on dark bg */

    /* Text on Tabler's tinted (bg-*-lt) and solid (bg-*) colours: see 02-tabler-bridge.css */
    --c-tint-text-toward: #ffffff;
    --c-tint-text-keep:   62%;
    --c-on-strong:        #ffffff;
    --c-on-bright:        #171717;

    /* Semantic colors */
    --c-success:        #27c97a;
    --c-success-dim:    rgba(39, 201, 122, 0.10);
    --c-success-bdr:    rgba(39, 201, 122, 0.25);

    --c-warning:        #f5a623;
    --c-warning-dim:    rgba(245, 166, 35, 0.10);
    --c-warning-bdr:    rgba(245, 166, 35, 0.25);

    --c-danger:         #f04055;
    --c-danger-dim:     rgba(240, 64, 85, 0.10);
    --c-danger-bdr:     rgba(240, 64, 85, 0.25);

    --c-info:           #38bdf8;
    --c-info-dim:       rgba(56, 189, 248, 0.10);

    --c-purple:         #a78bfa;
    --c-purple-dim:     rgba(167, 139, 250, 0.10);

    /* Typography */
    --c-font-ui:        system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --c-font-mono:      ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    /* Geometry */
    --sidebar-w:            220px;
    --sidebar-collapsed-w:  52px;
    --topbar-h:             52px;
    --radius:               6px;
    --radius-sm:            4px;

    /* Keyboard focus ring (04-components.css :focus-visible) */
    --c-focus-ring:         var(--c-accent);

    /* Color literals brought from components */
    --c-white:              #fff;
    --c-black:              #000;   /* a state colour pulled toward it makes a fill under white text */

    /* Sidebar-specific colors. The sidebar is dark in both themes (a data-bs-theme="dark"
       island), so its text and lines read these, never --c-text* / --c-border*, which take
       their light values in the light theme (links were 3.5:1 at rest, 1.2:1 hovered, #136).
       Text values are the dark theme's, so the sidebar looks the same in both themes. */
    --c-sidebar-text:        #e5e5e5;                   /* hovered link: 14.9:1 */
    --c-sidebar-text-muted:  #a3a3a3;                   /* link at rest, theme button: 7.9:1 */
    --c-sidebar-text-subtle: rgba(255, 255, 255, 0.5);  /* section titles, version: 5.3:1 */
    --c-sidebar-border-subtle: rgba(255, 255, 255, 0.042);  /* logo and footer separators */
    --c-sidebar-bg:         #070810;
    --c-sidebar-dropdown-bg: #0e1118;
    --c-sidebar-border:     rgba(255, 255, 255, 0.07);
    --c-sidebar-dropdown-border: rgba(255, 255, 255, 0.1);
    --c-sidebar-nav-hover:  rgba(255, 255, 255, 0.04);
    --c-sidebar-dropdown-text: rgba(255, 255, 255, 0.5);
    --c-sidebar-dropdown-hover-bg: rgba(255, 255, 255, 0.06);
    --c-sidebar-dropdown-hover-text: rgba(255, 255, 255, 0.85);

    /* Shadows */
    --c-shadow-dropdown:    rgba(0, 0, 0, 0.35);
    --c-shadow-dropdown-lg: rgba(0, 0, 0, 0.45);
    --c-shadow-tooltip:     rgba(0, 0, 0, 0.3);
    --c-shadow-toast:       rgba(0, 0, 0, 0.4);

    /* Button/element hover states */
    --c-hover-subtle:       rgba(255, 255, 255, 0.05);
    --c-hover-icon:         rgba(255, 255, 255, 0.06);

    /* Table striping, and the one background of a hovered row (links and muted text keep 4.5:1) */
    --c-table-stripe:       rgba(255, 255, 255, 0.022);
    --c-table-hover:        #333333;   /* a step above the striped rows (#1c1c1c, #262626) */

    /* Badge colors */
    --c-badge-bg:           rgba(255, 255, 255, 0.12);
    --c-badge-text:         rgba(255, 255, 255, 0.6);
    --c-badge-success-bg:   rgba(39, 201, 122, 0.18);
    --c-badge-danger-bg:    rgba(214, 57, 57, 0.18);
    --c-badge-warning-bg:   rgba(247, 183, 49, 0.18);
    --c-badge-info-bg:      rgba(61, 143, 248, 0.18);
    --c-badge-success-text: #27c97a;
    --c-badge-danger-text:  #f87171;   /* 6.4:1 on its tint over the sidebar (#d63939 was 3.8:1) */
    --c-badge-warning-text: #f7b731;

    /* Additional semantic color variants */
    --c-green-alt:          #4ade80;
    --c-green-alt-bg:       rgba(74, 222, 128, 0.1);
    --c-green-alt-border:   rgba(74, 222, 128, 0.28);
    --c-green-glow:         rgba(39, 201, 122, 0.55);

    --c-amber-alt:          #fbbf24;
    --c-amber-update:       #f59e0b;
    --c-amber-update-bg:    rgba(250, 176, 5, 0.12);
    --c-amber-update-border: rgba(250, 176, 5, 0.3);

    --c-teal:               #14b8a6;
    --c-teal-bg:            rgba(20, 184, 166, 0.08);
    --c-teal-border:        rgba(20, 184, 166, 0.22);
    --c-teal-alt:           #2dd4bf;

    --c-violet-alt:         #a78bfa;
    --c-violet-border-alt:  rgba(167, 139, 250, 0.28);

    --c-rose:               #f43f5e;
    --c-rose-bg:            rgba(244, 63, 94, 0.08);
    --c-rose-border:        rgba(244, 63, 94, 0.22);

    --c-red-alt:            #f87171;
    --c-red-fallback:       #d63939;

    /* Blue accent variants for specific components */
    --c-accent-blue-alt:    rgba(6, 111, 209, 0.08);
    --c-accent-blue-border: rgba(6, 111, 209, 0.25);
    --c-accent-blue-hover:  rgba(6, 111, 209, 0.35);

    /* Button shadows */
    --c-shadow-danger:      rgba(240, 64, 85, 0.35);
    --c-shadow-success:     rgba(39, 201, 122, 0.35);
    --c-shadow-warning:     rgba(245, 166, 35, 0.35);
    --c-info-border:        rgba(56, 189, 248, 0.28);

    /* Inset highlights on buttons */
    --c-btn-inset-light:    rgba(255, 255, 255, 0.12);
    --c-btn-inset-light-alt: rgba(255, 255, 255, 0.1);

    /* Mobile backdrop */
    --c-backdrop-mobile:    rgba(0, 0, 0, 0.5);

    /* JSON modal */
    --c-json-btn-bg:        rgba(0, 0, 0, 0.1);
    --c-json-btn-active:    rgba(0, 0, 0, 0.2);

    /* Bridge to Tabler (the primary and link colours are in 1b) */
    --tblr-font-sans-serif:  var(--c-font-ui);
    --tblr-font-monospace:   var(--c-font-mono);
}

/* -----------------------------------------------------------
   2. Light Mode Token Overrides
   ----------------------------------------------------------- */
[data-bs-theme="light"],
[data-theme="light"] {
    --c-tint-text-toward: #000000;
    --c-tint-text-keep:   60%;

    --c-bg:             #eef1f7;
    --c-surface:        #ffffff;
    --c-elevated:       #f5f7fb;
    --c-overlay:        #eaeff8;

    --c-border:         rgba(0, 0, 0, 0.08);
    --c-border-subtle:  rgba(0, 0, 0, 0.05);
    --c-border-str:     rgba(0, 0, 0, 0.16);

    --c-text:           #1a2535;
    --c-text-muted:     #586880;
    --c-text-subtle:    #6b7f94;

    --c-success:        #16a359;
    --c-success-dim:    rgba(22, 163, 89, 0.08);
    --c-success-bdr:    rgba(22, 163, 89, 0.22);

    --c-warning:        #d97706;
    --c-warning-dim:    rgba(217, 119, 6, 0.08);
    --c-warning-bdr:    rgba(217, 119, 6, 0.22);

    --c-danger:         #dc2626;
    --c-danger-dim:     rgba(220, 38, 38, 0.08);
    --c-danger-bdr:     rgba(220, 38, 38, 0.22);

    --c-info:           #0284c7;
    --c-info-dim:       rgba(2, 132, 199, 0.08);

    --c-purple:         #7c3aed;
    --c-purple-dim:     rgba(124, 58, 237, 0.08);

    /* Light mode table striping and hovered row */
    --c-table-stripe:   rgba(0, 0, 0, 0.025);
    --c-table-hover:    #eaeff8;
}

/* -----------------------------------------------------------
   1b. Accent — the one blue, the same tokens as the public site
   Neutral surfaces and one blue. Each role keeps >= 4.5:1 for text:
   - --c-accent: fills (primary button, active page, switch, focus ring, bars);
   - --c-on-accent: text on a fill (white on the light blue 4.5:1; dark text on
     the dark theme's brighter blue 5.9:1, where white is 3.2:1);
   - --c-accent-text: the blue as text on a surface (links, active labels);
   - --c-accent-hover: a hovered fill, one step further from the surface.
   Declared on [data-bs-theme="dark"] too: the sidebar is a dark island in the
   light theme and takes the dark values.
   ----------------------------------------------------------- */
:root,
[data-bs-theme="dark"] {
    --c-accent:          #3d8ff8;
    --c-accent-rgb:      61, 143, 248;
    --c-on-accent:       #04101f;
    --c-accent-text:     #6aabff;
    --c-accent-text-rgb: 106, 171, 255;
    --c-accent-hover:    #6aabff;
    --c-accent-light:    var(--c-accent-text);  /* the name plugins already use */
    --c-accent-dim:      rgba(61, 143, 248, 0.10);
    --c-accent-glow:     rgba(61, 143, 248, 0.10);
    --c-accent-bdr:      rgba(61, 143, 248, 0.28);
}

[data-bs-theme="light"],
[data-theme="light"] {
    --c-accent:          #2271ec;
    --c-accent-rgb:      34, 113, 236;
    --c-on-accent:       #ffffff;
    --c-accent-text:     #1a5fd0;
    --c-accent-text-rgb: 26, 95, 208;
    --c-accent-hover:    #1a5fd0;
    --c-accent-light:    var(--c-accent-text);
    --c-accent-dim:      rgba(34, 113, 236, 0.08);
    --c-accent-glow:     rgba(34, 113, 236, 0.08);
    --c-accent-bdr:      rgba(34, 113, 236, 0.22);
}

/* Tabler reads these for every primary button, link, badge, active page, switch and soft
   label; it ships its own blue (#066fd1), white button text and a see-through hover. */
:root,
[data-bs-theme] {
    --tblr-primary:              var(--c-accent);
    --tblr-primary-rgb:          var(--c-accent-rgb);
    --tblr-primary-fg:           var(--c-on-accent);
    --tblr-primary-darken:       var(--c-accent-hover);
    --tblr-primary-lt:           color-mix(in oklab, var(--c-accent) 10%, transparent);
    --tblr-link-color:           var(--c-accent-text);
    --tblr-link-color-rgb:       var(--c-accent-text-rgb);
    --tblr-link-hover-color:     var(--c-accent-text);
    --tblr-link-hover-color-rgb: var(--c-accent-text-rgb);
}

/* === 10-ui-kit.css === */

/* 10-ui-kit.css — The shared UI kit (docs/docs/features/ui-kit.md): the stat tile, the status
   badge and the tag, the alert banner, the notification. It reads only the tokens of
   01-tokens.css and Tabler's own variables, so ui-kit.css (01-tokens + this file, built by
   scripts/build-css.sh) gives the kit to a page with its own <head>. */

/* === Stat tiles (components/ui.html.j2 stat_tile) ===
   One tile, three tones. Colour says something or nothing:
   - neutral (default): no accent;
   - a category (blue, teal, violet): a thin bar on top, the value stays neutral;
   - a state (success, warning, danger): the value takes the colour, no bar.
   Only a tile that is a link reacts to the pointer. */
.fp-stat-tile {
    display: block;
    height: 100%;  /* tiles of one row line up, with or without a sub-line */
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    position: relative;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

a.fp-stat-tile { transition: border-color 0.15s ease; }
a.fp-stat-tile:hover { border-color: var(--c-border-str); color: inherit; }

.fp-stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--s-bar, transparent);
}

.fp-stat-tile--blue   { --s-bar: var(--c-accent); }
.fp-stat-tile--teal   { --s-bar: var(--c-teal); }
.fp-stat-tile--violet { --s-bar: var(--c-purple); }
.fp-stat-tile--success { --s-color: var(--c-success); }
.fp-stat-tile--warning { --s-color: var(--c-warning); }
.fp-stat-tile--danger  { --s-color: var(--c-danger); }

.fp-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--c-text-muted);
    margin-bottom: 0.375rem;
    padding-right: 3.25rem;  /* clear of the icon */
}

.fp-stat-value {
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--s-color, var(--c-text));
    line-height: 1.1;
}

.fp-stat-sub {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    margin-top: 0.375rem;
}

.fp-stat-icon {
    /* A large icon behind the value, on the right, centred on the tile's height */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    line-height: 1;
    font-size: 2.75rem;
    color: var(--s-bar, var(--s-color, var(--c-text)));
    opacity: 0.32;
    pointer-events: none;
}

/* === Notification (fp.notify) ===
   Soft like the alert banner, but opaque: it floats over the page, and a see-through tint
   would mix with whatever is under it. Icon and title in the level's colour, text neutral. */
.fp-toast {
    --t: var(--tblr-blue);
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
    width: 22rem;
    max-width: calc(100vw - 2rem);
    padding: 0.75rem 0.875rem;
    border-radius: var(--tblr-border-radius);
    background: color-mix(in srgb, var(--t) 14%, var(--c-surface));
    border: 1px solid color-mix(in srgb, var(--t) 25%, var(--c-surface));
    box-shadow: 0 8px 24px var(--c-shadow-toast);
    color: var(--c-text);
}
.fp-toast--success { --t: var(--tblr-green); }
.fp-toast--warning { --t: var(--tblr-yellow); }
.fp-toast--error   { --t: var(--tblr-red); }
.fp-toast-icon { font-size: 1.25rem; line-height: 1.25rem; }
.fp-toast-icon,
.fp-toast-title { color: color-mix(in srgb, var(--t) var(--c-tint-text-keep), var(--c-tint-text-toward)); }
.fp-toast-title { font-weight: 500; }
.fp-toast-text { color: var(--c-text-muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.fp-toast-text a { color: inherit; text-decoration: underline; }
.fp-toast .btn-close { width: 0.75rem; height: 0.75rem; flex: none; }

/* === Status badge and tag (render_status_badge / render_tag, fp.statusBadge / fp.tag) ===
   A status is a soft filled badge: its colour says the state. A tag (topic, kind, flag) is
   outlined and colourless, so the two never read alike. Sentence case, normal weight. */
.badge.fp-status,
.badge.fp-tag {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.badge.fp-tag {
    background: transparent;
    border: 1px solid var(--c-border-str);
    color: var(--c-text-muted);
}

/* An icon before the word, in the text colour. */
.badge.fp-status > .ti,
.badge.fp-tag > .ti {
    font-size: 1em;
    line-height: 1;
    vertical-align: -0.125em;
    margin-right: 0.3em;
}

/* Filled (soft=False): the selected or highlighted badge of a list, such as the filter in use.
   The tone is pulled toward black so white text keeps >= 4.5:1 in both themes; the light tones
   are pulled further. A filled tag is in ink, the text colour, so a category never reads as a
   status. A count badge inside turns into a pill in the badge's text colour (Tabler's bg-*-lt are
   !important). blue and primary need no class: the default. */
.badge.fp-filled {
    background: color-mix(in srgb, var(--fp-fill, var(--tblr-blue)) var(--fp-fill-keep, 74%), #000);
    border-color: transparent;
    color: #fff;
}
.badge.fp-tag.fp-filled {
    background: var(--c-text);
    color: var(--c-surface);
}
.badge.fp-filled .badge {
    background: color-mix(in srgb, currentcolor 24%, transparent) !important;
    color: inherit !important;
}
.fp-fill-azure,
.fp-fill-info      { --fp-fill: var(--tblr-azure); }
.fp-fill-indigo    { --fp-fill: var(--tblr-indigo); }
.fp-fill-purple    { --fp-fill: var(--tblr-purple); }
.fp-fill-pink      { --fp-fill: var(--tblr-pink); }
.fp-fill-red,
.fp-fill-danger    { --fp-fill: var(--tblr-red); }
.fp-fill-secondary { --fp-fill: var(--tblr-secondary); --fp-fill-keep: 66%; }
.fp-fill-orange    { --fp-fill: var(--tblr-orange); --fp-fill-keep: 58%; }
.fp-fill-yellow,
.fp-fill-warning   { --fp-fill: var(--tblr-yellow); --fp-fill-keep: 58%; }
.fp-fill-lime      { --fp-fill: var(--tblr-lime); --fp-fill-keep: 58%; }
.fp-fill-green,
.fp-fill-success   { --fp-fill: var(--tblr-green); --fp-fill-keep: 58%; }
.fp-fill-teal      { --fp-fill: var(--tblr-teal); --fp-fill-keep: 58%; }
.fp-fill-cyan      { --fp-fill: var(--tblr-cyan); --fp-fill-keep: 58%; }

/* === Alert banner (.alert, the alert() macro of components/ui.html.j2) ===
   A soft tint of the level's colour, opaque over the surface; icon and title in that
   colour pulled toward the theme's text end like the tinted labels, the text neutral.
   Tabler's own tint (5 %) hid the level; alert-important (solid, white text) shouted
   and was unreadable on yellow: every alert draws the same. */
.alert,
.alert-important {
    background-color: color-mix(in srgb, var(--tblr-alert-color) 12%, var(--tblr-bg-surface));
    border-color: color-mix(in srgb, var(--tblr-alert-color) 22%, var(--tblr-bg-surface));
    color: var(--c-text);
}
.alert :is(.alert-icon, .alert-title, .alert-heading) {
    color: color-mix(in srgb, var(--tblr-alert-color) var(--c-tint-text-keep), var(--c-tint-text-toward));
}
.alert :is(.alert-description, .alert-text) { color: var(--c-text-muted); }
.alert .alert-icon.ti { font-size: 1.25rem; line-height: 1.25rem; }
.alert .alert-link { color: inherit; text-decoration: underline; }  /* Tabler's yellow link is under 2:1 on the light tint */

