/* =====================================================================
   ERP Premium Design System  —  soft glass / pastel-gradient SaaS look
   Plain CSS (no build step). Loaded AFTER the compiled Tailwind bundle,
   so it restyles the app's semantic classes (.card, .btn-primary,
   .form-input, .table, .badge, .alert …) everywhere at once.
   ===================================================================== */

/* ---------- 1. Design tokens ---------------------------------------- */
:root {
    color-scheme: light;

    /* type */
    --px-font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* legacy variables used all over the existing views (kept + re-themed) */
    --bg: #f4f6fb;
    --bg-elevated: #ffffff;
    --bg-muted: #eef0fa;
    --border: rgba(108, 118, 168, 0.20);
    --text: #1c2142;
    --text-muted: #6a7192;
    --primary: #5a55e0;
    --primary-hover: #4a45cc;
    --accent: #e56aa6;
    --danger: #d4344c;
    --success: #0d8f6a;
    --warning: #b86e0e;
    --sidebar: #ffffff;
    --sidebar-text: #1c2142;
    --sidebar-active: #eeeafd;

    /* surfaces */
    --px-glass: rgba(255, 255, 255, 0.80);
    --px-glass-strong: rgba(255, 255, 255, 0.92);
    --px-glass-soft: rgba(255, 255, 255, 0.55);
    --px-line: rgba(108, 118, 168, 0.16);
    --px-line-strong: rgba(108, 118, 168, 0.28);
    --px-field: #f3f4fb;
    --px-hover: rgba(122, 108, 240, 0.07);

    /* gradients */
    --px-grad-primary: linear-gradient(115deg, #de4a85 0%, #8760e6 52%, #3b78ee 100%);
    --px-grad-primary-hover: linear-gradient(115deg, #d23f7a 0%, #7b55dd 52%, #316ee6 100%);
    --px-grad-hero: linear-gradient(135deg, #ffdcd3 0%, #f9d0e6 28%, #d9c9f8 58%, #bdd3fb 100%);
    --px-tone-blue: linear-gradient(135deg, #e4eafe, #c2d3fb);
    --px-tone-violet: linear-gradient(135deg, #eee6fc, #cfc0f4);
    --px-tone-mint: linear-gradient(135deg, #dff6ef, #b8ece4);
    --px-tone-pink: linear-gradient(135deg, #fde6ee, #f9c8db);
    --px-tone-peach: linear-gradient(135deg, #ffeadf, #ffd2c7);
    --px-ink-blue: #3b62d9;
    --px-ink-violet: #6a4fd6;
    --px-ink-mint: #0e8c7c;
    --px-ink-pink: #c73c78;
    --px-ink-peach: #c4552f;

    /* shape, depth, motion */
    --px-r-sm: 12px;
    --px-r-md: 16px;
    --px-r-lg: 22px;
    --px-r-xl: 28px;
    --shadow: 0 1px 2px rgba(31, 38, 90, 0.04), 0 14px 34px -14px rgba(58, 68, 140, 0.18);
    --px-shadow-lift: 0 2px 4px rgba(31, 38, 90, 0.05), 0 22px 44px -16px rgba(72, 82, 170, 0.28);
    --px-shadow-pop: 0 24px 60px -18px rgba(40, 48, 120, 0.35);
    --px-glow: 0 10px 26px -8px rgba(126, 104, 240, 0.55);
    --px-ease: cubic-bezier(0.22, 0.8, 0.28, 1);
    --px-fast: 180ms;
    --px-med: 260ms;

    /* layout */
    --px-sb-w: 268px;
    --px-gap: 16px;
}

.dark {
    color-scheme: dark;
    --bg: #0c0f1f;
    --bg-elevated: #151a31;
    --bg-muted: #1b2140;
    --border: rgba(150, 160, 220, 0.18);
    --text: #eceffc;
    --text-muted: #a3abd0;
    --primary: #9a95ff;
    --primary-hover: #b3afff;
    --accent: #f08bbb;
    --danger: #ff7b8d;
    --success: #4fd6ac;
    --warning: #f4b35e;
    --sidebar: #131830;
    --sidebar-text: #eceffc;
    --sidebar-active: #232a52;
    --px-glass: rgba(24, 29, 56, 0.72);
    --px-glass-strong: rgba(28, 34, 66, 0.9);
    --px-glass-soft: rgba(24, 29, 56, 0.5);
    --px-line: rgba(150, 160, 220, 0.14);
    --px-line-strong: rgba(150, 160, 220, 0.28);
    --px-field: rgba(255, 255, 255, 0.05);
    --px-hover: rgba(154, 149, 255, 0.10);
    --px-tone-blue: linear-gradient(135deg, #232f63, #2b3d80);
    --px-tone-violet: linear-gradient(135deg, #2f2766, #40338a);
    --px-tone-mint: linear-gradient(135deg, #17423f, #1d5a55);
    --px-tone-pink: linear-gradient(135deg, #4a2340, #62305a);
    --px-tone-peach: linear-gradient(135deg, #4a2f2a, #63403a);
    --px-ink-blue: #a8bcff;
    --px-ink-violet: #c4b6ff;
    --px-ink-mint: #7fe6d6;
    --px-ink-pink: #ffb0d1;
    --px-ink-peach: #ffbfa8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 36px -14px rgba(0, 0, 0, 0.55);
    --px-shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 24px 46px -16px rgba(0, 0, 0, 0.7);
    --px-shadow-pop: 0 28px 70px -18px rgba(0, 0, 0, 0.75);
    --px-grad-hero: linear-gradient(135deg, #3a2a52 0%, #3c2f6e 45%, #26386f 100%);
}

/* ---------- 2. Base -------------------------------------------------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body.px-body {
    font-family: var(--px-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(60% 46% at 6% -4%, rgba(206, 240, 233, 0.85) 0%, transparent 62%),
        radial-gradient(52% 44% at 100% 4%, rgba(232, 222, 250, 0.9) 0%, transparent 60%),
        radial-gradient(60% 50% at 72% 104%, rgba(212, 226, 252, 0.9) 0%, transparent 62%),
        radial-gradient(40% 34% at 0% 100%, rgba(253, 226, 236, 0.7) 0%, transparent 65%),
        #f6f7fc;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
.dark body.px-body {
    background:
        radial-gradient(60% 46% at 6% -4%, rgba(48, 92, 110, 0.5) 0%, transparent 62%),
        radial-gradient(52% 44% at 100% 4%, rgba(84, 62, 150, 0.45) 0%, transparent 60%),
        radial-gradient(60% 50% at 72% 104%, rgba(46, 70, 150, 0.4) 0%, transparent 62%),
        #0b0e1d;
    background-attachment: fixed;
}

::selection { background: rgba(140, 118, 245, 0.28); }

h1, h2, h3, h4 { color: var(--text); letter-spacing: -0.015em; }
a { transition: color var(--px-fast) ease; }
img, svg, video { max-width: 100%; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid rgba(122, 108, 240, 0.45);
    outline-offset: 2px;
    border-radius: 10px;
}

.px-skip {
    position: fixed; left: 16px; top: -60px; z-index: 100;
    background: var(--text); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600;
    transition: top var(--px-fast) ease;
}
.px-skip:focus { top: 12px; }

/* thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(120, 128, 180, 0.35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(120, 128, 180, 0.32); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }

.px-icon { flex: none; vertical-align: middle; }
.px-relative { position: relative; }

/* ---------- 3. Application shell ------------------------------------ */
.px-sidebar {
    position: fixed; z-index: 40;
    top: var(--px-gap); bottom: var(--px-gap); left: var(--px-gap);
    width: var(--px-sb-w);
    display: flex; flex-direction: column;
    background: var(--px-glass);
    -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
    border: 1px solid var(--px-line);
    border-radius: var(--px-r-xl);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: translate var(--px-med) var(--px-ease), width var(--px-med) var(--px-ease);
    overflow: hidden;
}
.px-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 10px 18px; }
.px-brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: var(--text); }
.px-brand-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; border-radius: 14px; color: #fff;
    background: var(--px-grad-primary); box-shadow: var(--px-glow);
}
.px-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.px-brand-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-brand-sub { font-size: 11.5px; color: var(--text-muted); }

.px-nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.px-navtop {
    display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer;
    padding: 10px 12px; border-radius: 14px; color: var(--text); text-decoration: none;
    font-size: 14px; font-weight: 600;
    transition: background var(--px-fast) ease, color var(--px-fast) ease;
}
.px-navtop::-webkit-details-marker { display: none; }
.px-navtop .px-icon { color: var(--text-muted); transition: color var(--px-fast) ease; }
.px-navtop:hover { background: var(--px-hover); }
.px-navtop:hover .px-icon { color: var(--primary); }
.px-navtop.is-active, .px-navgroup.has-active > .px-navtop {
    background: linear-gradient(120deg, rgba(244, 114, 168, 0.13), rgba(122, 108, 240, 0.14) 55%, rgba(74, 140, 245, 0.14));
    color: var(--text);
}
.px-navtop.is-active .px-icon, .px-navgroup.has-active > .px-navtop .px-icon { color: var(--primary); }
.px-nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-nav-chevron { transition: transform var(--px-fast) ease; opacity: 0.6; }
.px-navgroup[open] > .px-navtop .px-nav-chevron { transform: rotate(180deg); }

.px-navlinks { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 8px 22px; margin-left: 12px; border-left: 1px solid var(--px-line); animation: px-fade-down var(--px-med) var(--px-ease) both; }
.px-navlink {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px;
    font-size: 13.5px; font-weight: 500; color: var(--text-muted); text-decoration: none;
    transition: background var(--px-fast) ease, color var(--px-fast) ease;
}
.px-navlink:hover { background: var(--px-hover); color: var(--text); }
.px-navlink.is-active { background: var(--px-glass-strong); color: var(--primary); font-weight: 700; box-shadow: 0 4px 14px -8px rgba(90, 85, 224, 0.5); }
.px-navdot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: 0.35; flex: none; }
.px-navlink.is-active .px-navdot { background: var(--px-grad-primary); opacity: 1; }

.px-sidebar-foot { padding: 12px; border-top: 1px solid var(--px-line); }
.px-user { display: flex; align-items: center; gap: 12px; padding: 6px; min-width: 0; }
.px-user-text, .px-userbtn-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; text-align: left; }
.px-user-name { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-user-role { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-avatar {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff;
    background: var(--px-grad-primary); box-shadow: 0 6px 16px -6px rgba(126, 104, 240, 0.6);
}

/* main column */
.px-main { min-height: 100vh; padding: var(--px-gap); }
@media (min-width: 1024px) {
    .px-main { padding-left: calc(var(--px-sb-w) + var(--px-gap) * 2); padding-right: 24px; }
    /* Tailwind v4 hides the drawer with the `translate` property; force it visible on desktop */
    .px-sidebar, .px-sidebar.-translate-x-full { translate: none !important; transform: none !important; }
}

.px-topbar {
    position: sticky; top: var(--px-gap); z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 18px;
    background: var(--px-glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid var(--px-line); border-radius: var(--px-r-lg);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.px-topbar-left { display: flex; align-items: center; gap: 8px; }
.px-topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.px-search { position: relative; flex: 1; max-width: 560px; }
.px-search .form-input { padding-left: 42px; padding-right: 46px; background: var(--px-field); }
.px-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.px-search-submit {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 12px; color: #fff; background: var(--px-grad-primary); cursor: pointer;
    box-shadow: var(--px-glow); transition: transform var(--px-fast) ease;
}
.px-search-submit:hover { transform: translateY(-50%) scale(1.06); }

.px-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; border-radius: 14px; cursor: pointer; text-decoration: none;
    color: var(--text); background: var(--px-glass-strong); border: 1px solid var(--px-line);
    transition: transform var(--px-fast) ease, box-shadow var(--px-fast) ease, background var(--px-fast) ease;
}
.px-iconbtn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(58, 68, 140, 0.4); }
.px-desktop-only { display: none; }
@media (min-width: 1024px) { .px-desktop-only { display: inline-flex; } }
.px-dot-badge {
    position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 99px; font-size: 11px; font-weight: 700; color: #fff; background: #ef4f7e;
    border: 2px solid var(--bg-elevated);
}
.px-theme-sun { display: none; }
.dark .px-theme-moon { display: none; }
.dark .px-theme-sun { display: inline-block; }

.px-userbtn {
    display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text);
    min-height: 44px; padding: 3px 12px 3px 4px; border-radius: 999px;
    background: var(--px-glass-strong); border: 1px solid var(--px-line);
}
.px-userbtn:hover { box-shadow: 0 8px 18px -10px rgba(58, 68, 140, 0.4); }
.px-userbtn .px-avatar { width: 36px; height: 36px; }
.px-userbtn-text { max-width: 150px; }

/* big rounded floating "canvas" that holds each page (like the reference) */
.px-canvas {
    background: var(--px-glass-soft);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--px-line);
    border-radius: var(--px-r-xl);
    padding: 28px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    max-width: 1560px; margin-inline: auto;
    min-height: calc(100vh - 140px);
}
.px-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.px-pagehead-title { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.px-pagehead-sub { margin-top: 6px; font-size: 14.5px; color: var(--text-muted); }
.px-pagehead-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.px-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #a070d8; }
.dark .px-eyebrow { color: #c4a8ff; }

/* collapsed (icon-only) desktop sidebar */
@media (min-width: 1024px) {
    html.px-collapsed { --px-sb-w: 88px; }
    html.px-collapsed .px-brand-text,
    html.px-collapsed .px-nav-label,
    html.px-collapsed .px-nav-chevron,
    html.px-collapsed .px-navlinks,
    html.px-collapsed .px-user-text { display: none; }
    html.px-collapsed .px-sidebar-head { justify-content: center; padding-inline: 8px; }
    html.px-collapsed .px-navtop { justify-content: center; padding-inline: 0; }
    html.px-collapsed .px-user { justify-content: center; }
    html.px-collapsed .px-nav { padding-inline: 10px; }
}

/* mobile drawer */
@media (max-width: 1023.98px) {
    .px-sidebar { width: min(86vw, 320px); top: 0; bottom: 0; left: 0; border-radius: 0 var(--px-r-xl) var(--px-r-xl) 0; background: var(--px-glass-strong); }
    .px-sidebar.-translate-x-full { translate: -104% 0; box-shadow: none; }
    .px-sidebar:not(.-translate-x-full) { translate: 0 0; box-shadow: var(--px-shadow-pop); }
    .px-main { padding: 10px; }
    .px-topbar { top: 10px; margin-bottom: 12px; padding: 8px; border-radius: 20px; }
    .px-canvas { padding: 18px 14px; border-radius: 24px; }
    .px-userbtn-text, .px-userbtn > .px-icon { display: none; }
    .px-userbtn { padding: 3px; }
}
.px-overlay { background: rgba(22, 26, 58, 0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

@media (max-width: 640px) {
    .px-topbar { flex-wrap: wrap; }
    .px-search { order: 3; flex: 1 1 100%; max-width: none; }
    .px-topbar-actions { margin-left: auto; }
    .px-pagehead { margin-bottom: 18px; }
    .px-pagehead-actions { width: 100%; }
    .px-pagehead-actions > * { flex: 1 1 auto; }
}

/* ---------- 4. Cards -------------------------------------------------- */
.card {
    background: var(--px-glass-strong);
    -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid var(--px-line);
    border-radius: var(--px-r-lg);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    color: var(--text);
    transition: transform var(--px-med) var(--px-ease), box-shadow var(--px-med) var(--px-ease), border-color var(--px-fast) ease;
}
.dark .card { box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
a.card:hover, .px-lift:hover, .card.px-lift:hover {
    transform: translateY(-3px) scale(1.005);
    box-shadow: var(--px-shadow-lift), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
a.card, a.px-lift { text-decoration: none; color: inherit; }
.card h2, .card h3 { color: var(--text); }
.card.overflow-hidden { overflow: hidden; }

.px-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.px-card-head--pad { padding: 20px 22px 4px; margin-bottom: 8px; }
.px-card-title { font-size: 17px; font-weight: 700; }
.px-card-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.px-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* KPI / metric cards.  Explicit component + auto-detected legacy pattern
   ( <div class="card p-5"><div class="text-sm text-muted-app">…</div><div class="text-2xl font-bold">…</div></div> ) */
.card:has(> .text-muted-app + :is(.text-xl, .text-2xl, .text-3xl)) {
    position: relative; overflow: hidden; isolation: isolate;
    transition: transform var(--px-med) var(--px-ease), box-shadow var(--px-med) var(--px-ease);
}
.card:has(> .text-muted-app + :is(.text-xl, .text-2xl, .text-3xl))::before {
    content: ''; position: absolute; z-index: -1; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%;
    background: var(--px-tone-blue); opacity: 0.75;
}
.card:has(> .text-muted-app + :is(.text-xl, .text-2xl, .text-3xl)):nth-child(4n+2)::before { background: var(--px-tone-violet); }
.card:has(> .text-muted-app + :is(.text-xl, .text-2xl, .text-3xl)):nth-child(4n+3)::before { background: var(--px-tone-mint); }
.card:has(> .text-muted-app + :is(.text-xl, .text-2xl, .text-3xl)):nth-child(4n+4)::before { background: var(--px-tone-pink); }
.card:has(> .text-muted-app + :is(.text-xl, .text-2xl, .text-3xl)):hover { transform: translateY(-3px); box-shadow: var(--px-shadow-lift); }
.card > .text-muted-app + :is(.text-xl, .text-2xl, .text-3xl) { font-weight: 800; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.card > .text-sm.text-muted-app:first-child { font-weight: 600; }
.stat-card::after { display: none; }

/* explicit <x-stat-card> */
.px-stat {
    position: relative; display: flex; align-items: center; gap: 14px; overflow: hidden; isolation: isolate;
    padding: 18px; border-radius: var(--px-r-lg); text-decoration: none; color: var(--text);
    background: var(--px-glass-strong); border: 1px solid var(--px-line);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: transform var(--px-med) var(--px-ease), box-shadow var(--px-med) var(--px-ease);
}
.px-stat::before {
    content: ''; position: absolute; z-index: -1; right: -40px; top: -40px; width: 100px; height: 100px; border-radius: 50%;
    background: var(--tone, var(--px-tone-blue)); opacity: 0.7;
}
.px-stat--blue { --tone: var(--px-tone-blue); --ink: var(--px-ink-blue); }
.px-stat--violet { --tone: var(--px-tone-violet); --ink: var(--px-ink-violet); }
.px-stat--mint { --tone: var(--px-tone-mint); --ink: var(--px-ink-mint); }
.px-stat--pink { --tone: var(--px-tone-pink); --ink: var(--px-ink-pink); }
.px-stat--peach { --tone: var(--px-tone-peach); --ink: var(--px-ink-peach); }
.px-stat-icon {
    flex: none; width: 44px; height: 44px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tone); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 6px 14px -8px rgba(60, 70, 150, 0.4);
}
.px-stat-body { display: flex; flex-direction: column; min-width: 0; }
.px-stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.px-stat-label { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-top: 3px; }
.px-stat-hint { font-size: 12px; color: var(--text-muted); opacity: 0.85; }
.px-trend { margin-left: auto; align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--bg-muted); color: var(--text-muted); }
.px-trend.is-up { background: rgba(15, 157, 118, 0.14); color: var(--success); }
.px-trend.is-down { background: rgba(212, 52, 76, 0.13); color: var(--danger); }

.px-grid { display: grid; gap: 16px; }
.px-grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.px-section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; font-size: 19px; font-weight: 700; }
.px-section-title small { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.px-section-title:first-child { margin-top: 0; }

/* dashboard hero (pastel gradient art, like the reference) */
.px-hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
    padding: 30px 32px; border-radius: var(--px-r-xl); margin-bottom: 24px;
    background: var(--px-grad-hero); border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}
.px-hero::before {
    content: ''; position: absolute; z-index: -1; inset: -40% -10% auto auto; width: 520px; height: 520px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 65%);
}
.px-hero::after {
    content: ''; position: absolute; z-index: -1; right: 6%; bottom: -80px; width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0%, rgba(214, 200, 250, 0.9) 35%, rgba(150, 170, 250, 0.4) 70%, transparent 72%);
    opacity: 0.85;
}
.px-hero h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.03em; }
.px-hero p { margin-top: 6px; color: #4d5478; max-width: 52ch; }
.dark .px-hero p { color: #c5cbea; }
.px-hero-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.px-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px; font-size: 13px; font-weight: 700;
    background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(255, 255, 255, 0.85); color: #1c2142; text-decoration: none;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transition: transform var(--px-fast) ease, background var(--px-fast) ease;
}
.px-chip:hover { transform: translateY(-2px); background: #fff; }
.dark .px-chip { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.16); color: #eceffc; }

/* in-page header component */
.px-pageheader { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.px-pageheader-title { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; letter-spacing: -0.025em; }
.px-pageheader-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.px-pageheader-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 5. Buttons ------------------------------------------------ */
.btn-primary, .px-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap;
    transition: transform var(--px-fast) ease, box-shadow var(--px-fast) ease, background-position var(--px-med) ease, filter var(--px-fast) ease;
}
.btn-primary {
    color: #fff;
    background: var(--px-grad-primary); background-size: 140% 100%; background-position: 0 0;
    box-shadow: var(--px-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    text-shadow: 0 1px 1px rgba(60, 30, 120, 0.25);
}
.btn-primary:hover { background: var(--px-grad-primary); background-size: 140% 100%; background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(126, 104, 240, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35); color: #fff; }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary:disabled, .btn-primary[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.py-1, .btn-primary.text-xs, .px-btn--sm { min-height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: 12px; }
.btn-primary.w-full { width: 100%; }

/* secondary: any legacy  "rounded-xl border border-app px-3 py-2"  button/link */
:is(a, button, label).border-app:not(.form-input):not(.card):not(.px-iconbtn),
.px-btn--secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border-radius: 14px; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap;
    background: var(--px-glass-strong); border: 1px solid var(--px-line-strong);
    box-shadow: 0 2px 6px -3px rgba(58, 68, 140, 0.25);
    transition: transform var(--px-fast) ease, box-shadow var(--px-fast) ease, background var(--px-fast) ease;
}
:is(a, button).border-app:not(.form-input):not(.card):not(.px-iconbtn):hover, .px-btn--secondary:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(58, 68, 140, 0.4); }
.dark :is(a, button).border-app:not(.form-input):not(.card):not(.px-iconbtn):hover, .dark .px-btn--secondary:hover { background: rgba(255, 255, 255, 0.1); }
:is(a, button).border-app.text-xs, :is(a, button).border-app.py-1 { min-height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 12px; }

.px-btn--ghost { background: transparent; color: var(--text); border: 0; }
.px-btn--ghost:hover { background: var(--px-hover); }
.px-btn--danger { color: #fff; background: linear-gradient(120deg, #e5566d, #d4344c); box-shadow: 0 10px 22px -10px rgba(212, 52, 76, 0.6); }
.px-btn--danger:hover { transform: translateY(-1px); filter: brightness(1.05); }
/* legacy inline-red action buttons keep their meaning, get a refined pill */
button[style*='--danger'], a[style*='--danger'] { font-weight: 700; border-radius: 10px; padding: 4px 8px; transition: background var(--px-fast) ease; }
button[style*='--danger']:hover, a[style*='--danger']:hover { background: rgba(212, 52, 76, 0.1); }
.px-btn.is-busy, .btn-primary.is-busy { pointer-events: none; opacity: 0.75; }
.btn-primary.is-busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: px-spin 0.7s linear infinite; }

/* ---------- 6. Forms -------------------------------------------------- */
.form-input,
:where(.px-canvas, .px-auth-card) :is(select, textarea, input:not([type='checkbox'], [type='radio'], [type='file'], [type='range'], [type='color'], [type='hidden'], [type='submit'], [type='button'], [type='image'])) {
    font-family: inherit; font-size: 15px; color: var(--text);
    background: var(--px-field); border: 1px solid var(--px-line-strong); border-radius: 14px;
    transition: border-color var(--px-fast) ease, box-shadow var(--px-fast) ease, background var(--px-fast) ease;
}
.form-input { width: 100%; min-height: 46px; padding: 10px 14px; box-shadow: inset 0 1px 2px rgba(31, 38, 90, 0.04); }
textarea.form-input { min-height: 96px; line-height: 1.5; resize: vertical; }
select.form-input {
    appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a7192' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.form-input::placeholder, :where(.px-canvas) input::placeholder, :where(.px-canvas) textarea::placeholder { color: #98a0bf; }
.form-input:hover { border-color: rgba(122, 108, 240, 0.4); }
.form-input:focus, :where(.px-canvas, .px-auth-card) :is(select, textarea, input):focus {
    outline: none; background: #fff; border-color: #8b7cf6;
    box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.2);
}
.dark .form-input:focus, .dark :where(.px-canvas, .px-auth-card) :is(select, textarea, input):focus { background: rgba(255, 255, 255, 0.08); }
.form-input.is-invalid, .form-input[aria-invalid='true'] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(212, 52, 76, 0.12); }
.form-input:disabled, .form-input[readonly] { opacity: 0.65; cursor: not-allowed; }
input[type='checkbox'], input[type='radio'] { accent-color: #7c6cf0; width: 18px; height: 18px; cursor: pointer; }
input[type='checkbox'] { border-radius: 6px; }
input[type='file'] { font-size: 14px; }
input[type='file']::file-selector-button {
    margin-right: 12px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--px-line-strong);
    background: var(--px-glass-strong); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
:where(.px-canvas) label.block, .px-label { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: 0.005em; }
.px-field { display: flex; flex-direction: column; gap: 6px; }
.px-req { color: var(--danger); margin-left: 3px; }
.px-hint { font-size: 12.5px; color: var(--text-muted); }
.px-error { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.px-canvas form.space-y-4 > div, .px-canvas form.space-y-3 > div { min-width: 0; }
.px-canvas form label.mb-1 { margin-bottom: 6px; }
.px-canvas fieldset { border: 1px solid var(--px-line); border-radius: var(--px-r-lg); padding: 18px; }
.px-canvas legend { font-weight: 700; padding: 0 8px; }

/* ---------- 7. Badges & alerts --------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; line-height: 1.3;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-success { background: rgba(15, 157, 118, 0.13); color: var(--success); }
.badge-danger { background: rgba(212, 52, 76, 0.12); color: var(--danger); }
.badge-warning { background: rgba(232, 150, 30, 0.16); color: var(--warning); }
.badge-muted { background: var(--bg-muted); color: var(--text-muted); }
.badge-info, .badge-primary { background: rgba(90, 85, 224, 0.12); color: var(--primary); }

.alert, .px-alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; margin-bottom: 18px; border-radius: 16px; font-size: 14px; line-height: 1.5;
    border: 1px solid var(--px-line); background: var(--px-glass-strong);
}
.alert-success, .px-alert--success { background: rgba(15, 157, 118, 0.10); border-color: rgba(15, 157, 118, 0.28); color: var(--success); }
.alert-error, .px-alert--error, .px-alert--danger { background: rgba(212, 52, 76, 0.09); border-color: rgba(212, 52, 76, 0.28); color: var(--danger); }
.alert-warning, .px-alert--warning { background: rgba(232, 150, 30, 0.12); border-color: rgba(232, 150, 30, 0.32); color: var(--warning); }

.px-timeline { position: relative; padding-left: 4px; }
.px-timeline-item { position: relative; padding: 0 0 18px 22px; }
.px-timeline-item:last-child { padding-bottom: 0; }
.px-timeline-item::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: -4px; width: 2px; background: var(--px-grad-primary, linear-gradient(180deg, #de4a85, #8760e6)); opacity: .18; }
.px-timeline-item:last-child::before { display: none; }
.px-timeline-dot { position: absolute; left: 0; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary, #8760e6); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #8760e6) 18%, transparent); }
.px-timeline-content { padding-top: 0; }
.px-alert--info { background: rgba(90, 85, 224, 0.08); border-color: rgba(90, 85, 224, 0.24); color: var(--primary); }
.alert ul { margin: 0; }
/* legacy hard-coded flash banners in individual views */
.px-canvas .bg-green-50, .px-canvas .bg-red-50 { border-radius: 16px; }

/* ---------- 8. Tables -------------------------------------------------- */
.card:has(> .table-wrap), .px-tablecard { overflow: hidden; }
/* tables inside padded cards run edge-to-edge under the card title */
.card.p-5 > .table-wrap { margin-inline: -20px; margin-bottom: -20px; }
.card.p-4 > .table-wrap { margin-inline: -16px; margin-bottom: -16px; }
.card.p-6 > .table-wrap { margin-inline: -24px; margin-bottom: -24px; }
.table tr[hidden] { display: none !important; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table :is(th, td) { padding: 15px 20px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--px-line); }
.table th {
    font-size: 11.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted);
    background: rgba(238, 240, 250, 0.7); white-space: nowrap; user-select: none;
    border-bottom: 1px solid var(--px-line-strong);
}
.dark .table th { background: rgba(255, 255, 255, 0.04); }
.table tbody tr { transition: background var(--px-fast) ease; }
.table tbody tr:hover { background: var(--px-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td a[style*='--primary'], .table td > a:first-child { font-weight: 700; text-decoration: none; }
.table td a[style*='--primary']:hover { text-decoration: underline; text-underline-offset: 3px; }
.table td.text-muted-app[colspan] { text-align: center; padding: 42px 20px; }
.table th.is-sortable { cursor: pointer; }
.table th.is-sortable::after { content: '↕'; margin-left: 6px; opacity: 0.35; font-size: 11px; }
.table th[aria-sort='ascending']::after { content: '↑'; opacity: 1; color: var(--primary); }
.table th[aria-sort='descending']::after { content: '↓'; opacity: 1; color: var(--primary); }
.table th.is-sortable:hover { color: var(--text); }
.table :is(th, td).text-right { text-align: right; }
.px-table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--px-line); }
.px-table-tools .px-search { max-width: 340px; flex: 1 1 220px; }
.px-table-tools .form-input { min-height: 40px; }
.px-table-count { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.px-nomatch { padding: 34px 20px; text-align: center; color: var(--text-muted); }

/* responsive tables -> stacked cards on phones */
@media (max-width: 720px) {
    .table.is-stacked, .table.is-stacked tbody, .table.is-stacked tr, .table.is-stacked td { display: block; width: 100%; }
    .table.is-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table.is-stacked tbody tr { padding: 10px 6px; border-bottom: 1px solid var(--px-line-strong); }
    .table.is-stacked tbody tr:last-child { border-bottom: 0; }
    .table.is-stacked td { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 8px 14px; border: 0; text-align: right; }
    .table.is-stacked td::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
    .table.is-stacked td:not([data-label])::before, .table.is-stacked td[data-label='']::before { display: none; }
    .table.is-stacked td[colspan] { display: block; text-align: center; }
    .table.is-stacked td[colspan]::before { display: none; }
}

/* pagination */
.px-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; }
.px-pagination-info { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.px-pages { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.px-page {
    min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    border-radius: 12px; font-size: 13.5px; font-weight: 700; text-decoration: none; color: var(--text);
    background: var(--px-glass-strong); border: 1px solid var(--px-line);
    transition: transform var(--px-fast) ease, box-shadow var(--px-fast) ease;
}
a.px-page:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(58, 68, 140, 0.45); }
.px-page.is-current { color: #fff; border-color: transparent; background: var(--px-grad-primary); box-shadow: var(--px-glow); }
.px-page.is-disabled { opacity: 0.45; cursor: not-allowed; }
.px-page.is-gap { background: transparent; border-color: transparent; min-width: 24px; padding: 0; }

/* ---------- 9. Dropdowns, modals, tabs, toasts ------------------------ */
.px-dropdown { position: relative; }
.px-menu {
    position: absolute; z-index: 60; top: calc(100% + 10px); min-width: 230px; padding: 8px;
    background: var(--px-glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid var(--px-line-strong); border-radius: 18px; box-shadow: var(--px-shadow-pop);
    transform-origin: top right; animation: px-pop var(--px-fast) var(--px-ease) both;
}
.dark .px-menu { background: rgba(26, 31, 60, 0.96); }
.px-menu[hidden] { display: none; }
.px-menu--right { right: 0; }
.px-menu--left { left: 0; transform-origin: top left; }
.px-menu-head { padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--px-line); }
.px-menuitem {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 12px;
    background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; text-decoration: none;
    transition: background var(--px-fast) ease;
}
.px-menuitem:hover { background: var(--px-hover); }
.px-menuitem--danger { color: var(--danger); }
.px-menuitem--danger:hover { background: rgba(212, 52, 76, 0.1); }

.px-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px; }
.px-modal[hidden] { display: none; }
.px-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 24, 56, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: px-fade var(--px-fast) ease both; }
.px-modal-panel {
    position: relative; display: flex; flex-direction: column; width: 100%; max-height: min(88vh, 900px);
    background: var(--px-glass-strong); border: 1px solid var(--px-line-strong); border-radius: 24px;
    box-shadow: var(--px-shadow-pop); animation: px-pop var(--px-med) var(--px-ease) both; outline: none;
}
.dark .px-modal-panel { background: #171c38; }
.px-modal--sm { max-width: 400px; } .px-modal--md { max-width: 560px; } .px-modal--lg { max-width: 780px; }
.px-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.px-modal-head h3 { font-size: 19px; font-weight: 800; }
.px-modal-body { padding: 8px 22px 22px; overflow-y: auto; }
.px-modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--px-line); background: inherit; border-radius: 0 0 24px 24px; }
/* legacy modal overlays written with Tailwind utilities (e.g. pipeline "lost reason") */
.fixed.inset-0.z-50 { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: rgba(20, 24, 56, 0.42) !important; }
.fixed.inset-0.z-50 > .card { border-radius: 24px; box-shadow: var(--px-shadow-pop); animation: px-pop var(--px-med) var(--px-ease) both; }

.px-tablist { display: inline-flex; gap: 4px; padding: 5px; border-radius: 16px; background: var(--bg-muted); border: 1px solid var(--px-line); max-width: 100%; overflow-x: auto; }
.px-tab { min-height: 38px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: var(--text-muted); white-space: nowrap; transition: all var(--px-fast) ease; }
.px-tab:hover { color: var(--text); }
.px-tab.is-active { color: var(--text); background: var(--px-glass-strong); box-shadow: 0 6px 14px -8px rgba(58, 68, 140, 0.45); }
.px-tabpanels { margin-top: 16px; }
[data-tab-panel][hidden] { display: none; }

.px-toasts { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 36px)); pointer-events: none; }
.px-toast {
    pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 18px;
    background: var(--px-glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid var(--px-line-strong); box-shadow: var(--px-shadow-pop);
    animation: px-toast-in 320ms var(--px-ease) both; font-size: 14px; font-weight: 600;
}
.dark .px-toast { background: rgba(26, 31, 60, 0.96); }
.px-toast.is-leaving { animation: px-toast-out 220ms ease both; }
.px-toast-icon { flex: none; width: 28px; height: 28px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--px-grad-primary); }
.px-toast--success .px-toast-icon { background: linear-gradient(135deg, #2ccf9f, #0d9f78); }
.px-toast--error .px-toast-icon { background: linear-gradient(135deg, #f27089, #d4344c); }
.px-toast-close { margin-left: auto; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 2px; border-radius: 8px; }

/* top progress bar + skeletons */
.px-progress { position: fixed; z-index: 150; top: 0; left: 0; height: 3px; width: 0; background: var(--px-grad-primary); box-shadow: 0 0 12px rgba(160, 122, 240, 0.7); opacity: 0; transition: width 500ms var(--px-ease), opacity 250ms ease; }
.px-progress.is-active { opacity: 1; width: 78%; }
.skeleton, .px-skeleton {
    position: relative; overflow: hidden; border-radius: 12px; min-height: 14px; background: var(--bg-muted);
}
.skeleton::after, .px-skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent); animation: px-shimmer 1.4s infinite; }

/* empty state */
.px-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 20px; }
.px-empty-art { width: 76px; height: 76px; border-radius: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--px-ink-violet); background: var(--px-tone-violet); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 14px 30px -14px rgba(106, 79, 214, 0.5); }
.px-empty h3 { font-size: 17px; font-weight: 800; margin-top: 8px; }
.px-empty p { color: var(--text-muted); max-width: 46ch; }
.px-empty-actions { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* charts */
.px-chart { position: relative; width: 100%; }
.px-chart svg { width: 100%; height: 100%; overflow: visible; display: block; }
.px-chart-tip {
    position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -110%); padding: 7px 11px; border-radius: 12px;
    font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap;
    background: var(--px-glass-strong); border: 1px solid var(--px-line-strong); box-shadow: var(--px-shadow-lift); opacity: 0; transition: opacity 120ms ease;
}
.px-chart-tip small { display: block; color: var(--text-muted); font-weight: 600; }
.px-chart text { font-family: var(--px-font); fill: var(--text-muted); font-size: 11.5px; font-weight: 600; }

/* progress bars (used in dashboards) */
.px-progressbar { height: 8px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; }
.px-progressbar > span { display: block; height: 100%; border-radius: inherit; background: var(--px-grad-primary); }

/* ---------- 10. Kanban / misc legacy surfaces -------------------------- */
.kanban-column { background: var(--px-glass-soft) !important; border-color: var(--px-line) !important; border-radius: var(--px-r-lg) !important; }
.kanban-column .card { border-radius: 16px; }
.bg-muted\/40, .bg-muted { background-color: var(--bg-muted); }
.px-canvas hr { border: 0; border-top: 1px solid var(--px-line); }
.px-canvas details:not(.px-navgroup) { border: 1px solid var(--px-line); border-radius: var(--px-r-md); padding: 12px 16px; background: var(--px-glass-strong); }
.px-canvas details:not(.px-navgroup) > summary { cursor: pointer; font-weight: 700; }
.px-canvas code { padding: 2px 7px; border-radius: 8px; background: var(--bg-muted); font-size: 0.9em; }
.px-canvas a:not([class]) { color: var(--primary); font-weight: 600; text-decoration: none; }
.px-canvas a:not([class]):hover { text-decoration: underline; text-underline-offset: 3px; }
.px-canvas h2.text-base, .px-canvas h2.font-semibold { font-size: 17px; font-weight: 700; }

/* impersonation banner */
.px-body .bg-amber-500 {
    position: relative; z-index: 45; margin: 10px var(--px-gap) 0; border-radius: 18px; padding: 10px 16px;
    background: linear-gradient(120deg, #ffe6b8, #ffd3c2); color: #5a3411; border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: var(--shadow);
}
@media (min-width: 1024px) { .px-body .bg-amber-500 { margin-left: calc(var(--px-sb-w) + var(--px-gap) * 2); margin-right: 24px; } }

/* ---------- 11. Auth pages --------------------------------------------- */
.px-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.px-auth-hero { display: none; }
.px-auth-panel { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.px-auth-card { width: 100%; max-width: 440px; padding: 34px 30px; border-radius: var(--px-r-xl); }
.px-auth-head { margin-bottom: 24px; }
.px-auth-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 14px; }
.px-auth-head p { color: var(--text-muted); margin-top: 4px; }
.px-auth-card form label.mb-1 { font-size: 13px; font-weight: 700; }
@media (min-width: 960px) {
    .px-auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding: 16px; gap: 16px; }
    .px-auth-hero {
        position: relative; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate;
        border-radius: 34px; padding: 48px; background: var(--px-grad-hero); border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: var(--shadow);
    }
    .px-auth-hero::before { content: ''; position: absolute; z-index: -1; inset: -30% -20% auto auto; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 65%); }
    .px-auth-hero::after { content: ''; position: absolute; z-index: -1; left: -10%; top: 10%; width: 120%; height: 60%; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.06), 0 0 0 90px rgba(255, 255, 255, 0.05); transform: rotate(-14deg); }
    .px-auth-hero-inner { max-width: 470px; display: flex; flex-direction: column; gap: 14px; }
    .px-auth-hero h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; font-weight: 800; letter-spacing: -0.035em; }
    .px-auth-hero p { color: #4d5478; }
    .px-auth-points { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
    .px-auth-points li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; font-weight: 700; font-size: 14px; background: rgba(255, 255, 255, 0.62); border: 1px solid rgba(255, 255, 255, 0.8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
    .px-auth-points .px-icon { color: #7a5fe0; }
    .px-orb { position: absolute; z-index: -1; right: 12%; top: 16%; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff, #d8c9f8 45%, #a9b6f8 100%); box-shadow: 0 30px 50px -20px rgba(110, 96, 220, 0.55); animation: px-float 7s ease-in-out infinite; }
    .px-auth-mobile-mark { display: none; }
}
@media (min-width: 960px) { .dark .px-auth-hero p { color: #c5cbea; } .dark .px-auth-points li { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); } }

/* ---------- 12. Motion -------------------------------------------------- */
@keyframes px-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes px-fade-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes px-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes px-toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes px-toast-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes px-spin { to { transform: rotate(360deg); } }
@keyframes px-shimmer { to { transform: translateX(100%); } }
@keyframes px-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.animate-fade-up { animation: px-fade-up 0.4s var(--px-ease) both; }
@keyframes px-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 13. Utilities & print -------------------------------------- */
.px-stack { display: flex; flex-direction: column; gap: 16px; }
.px-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
@media print {
    .px-sidebar, .px-topbar, .px-toasts, .px-progress, .px-overlay, .px-skip { display: none !important; }
    .px-main { padding: 0 !important; }
    body.px-body { background: #fff !important; }
    .px-canvas, .card { box-shadow: none !important; border: 0 !important; background: #fff !important; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }
}

/* ---------- 14. Layout helpers used by redesigned pages ---------------- */
.px-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.px-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.px-grid--split { grid-template-columns: 1fr; }
@media (min-width: 1100px) { .px-grid--split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.px-grid + .px-grid, .px-grid + .px-section-title, .px-hero + .px-grid { margin-top: 16px; }
@media (max-width: 480px) { .px-grid--stats { grid-template-columns: 1fr 1fr; gap: 12px; } .px-stat { padding: 14px; gap: 10px; } .px-stat-icon { width: 38px; height: 38px; } .px-stat-value { font-size: 22px; } .px-hero { padding: 22px 20px; } }

/* ---------- 15. Compatibility with Tailwind v4 utilities ---------------
   My component rules set `display` (unlayered) which would otherwise beat
   the layered `hidden` / `lg:hidden` utilities, so restore them here.      */
.px-iconbtn.hidden, .btn-primary.hidden, .px-btn.hidden, .badge.hidden, .alert.hidden, .px-alert.hidden, .px-chip.hidden { display: none; }
@media (min-width: 1024px) { .lg\:hidden.px-iconbtn { display: none; } }

/* inputs living in flex filter bars keep a sensible width instead of 100% */
.flex > .form-input, .flex-wrap > .form-input, form.flex .form-input { width: auto; flex: 1 1 180px; min-width: 0; max-width: 100%; }
.form-input.w-24 { width: 6rem; flex: none; } .form-input.w-28 { width: 7rem; flex: none; } .form-input.w-32 { width: 8rem; flex: none; }
.form-input.w-36 { width: 9rem; flex: none; } .form-input.w-40 { width: 10rem; flex: none; } .form-input.w-44 { width: 11rem; flex: none; }
.form-input.w-48 { width: 12rem; flex: none; } .form-input.w-52 { width: 13rem; flex: none; } .form-input.w-56 { width: 14rem; flex: none; }
.form-input.w-60 { width: 15rem; flex: none; } .form-input.w-64 { width: 16rem; flex: none; } .form-input.w-72 { width: 18rem; flex: none; }
@media (max-width: 480px) { .form-input[class*='w-']:not(.w-full) { max-width: 100%; flex: 1 1 100%; width: 100%; } }

/* ---------- 16. Bar-list (compact horizontal chart used on the dashboard) ---------- */
.px-barlist { display: flex; flex-direction: column; gap: 12px; }
.px-barrow { display: grid; grid-template-columns: minmax(0, 148px) 1fr 34px; align-items: center; gap: 12px; }
.px-barrow-label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-barrow-track { height: 10px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; }
.px-barrow-fill { display: block; height: 100%; border-radius: inherit; transition: width 500ms var(--px-ease); }
.px-barrow-fill--blue { background: linear-gradient(90deg, #8fb3ff, #4a8cf5); }
.px-barrow-fill--violet { background: linear-gradient(90deg, #c0a8f9, #8760e6); }
.px-barrow-fill--mint { background: linear-gradient(90deg, #8fe6d1, #1fb59c); }
.px-barrow-fill--pink { background: linear-gradient(90deg, #f7aecd, #e8568f); }
.px-barrow-fill--peach { background: linear-gradient(90deg, #ffc7ab, #f2895a); }
.px-barrow-value { text-align: right; font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
@media (max-width: 480px) {
    .px-barrow { grid-template-columns: minmax(0, 100px) 1fr 28px; gap: 8px; }
    .px-barrow-label { font-size: 12px; }
    .px-barrow-value { font-size: 12.5px; }
}

/* Filter bars on phones: a <select> is as wide as its longest option by default, which
   pushed several index-page toolbars past the screen edge. Let fields and the forms that
   hold them shrink to the available width instead. */
@media (max-width: 640px) {
    .form-input { max-width: 100%; min-width: 0; }
    main form.flex, main form.flex > * { min-width: 0; max-width: 100%; }
}