/* =========================================================
   Plexxa primitive components — the only shared CSS layer.

   Class prefix is `plx-` — every shared visual primitive
   namespaces here so it stops colliding with Radzen / Bootstrap
   / page-local CSS. Pages compose these classes; pages do not
   override them.

   When you need a new primitive, add it here. Don't reach for
   another library. The point of this file is that the entire
   shared visual language fits in a few hundred lines.
   ========================================================= */

/* ----- Reset-ish baseline ----------------------------------- */

.plx, .plx * { box-sizing: border-box; }

body.plx-body {
    margin: 0;
    background: var(--surface);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: var(--t-base);
    line-height: var(--t-base-lh);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Skip-to-content link — visually hidden until focused. Renders
   inside MainLayout immediately after <body>. Single biggest
   keyboard a11y win. */
.plx-skip {
    position: absolute;
    top: -40px;
    left: 8px;
    background: var(--ink);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--r-md);
    font-size: var(--t-sm);
    text-decoration: none;
    z-index: 10000;
    transition: top var(--motion-quick);
}
.plx-skip:focus { top: 8px; }

/* ----- Material Symbols helper ----------------------------- */

.mi {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    vertical-align: middle;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    /* Zyndi's icon set is 1.8px-stroke line art at 16px. Material
       Symbols at weight 300 / opsz 20 is the closest match. */
    font-variation-settings: 'wght' 300, 'opsz' 20;
    user-select: none;
}

/* ----- Typography helpers ---------------------------------- */

.plx-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 var(--s-2);
}
.plx-page-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0;
}
.plx-page-sub {
    color: var(--muted);
    font-size: var(--t-sm);
    margin: var(--s-2) 0 0;
    max-width: 640px;
}
.plx-num {
    font-family: var(--serif);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

/* ----- Buttons (.plx-btn) ---------------------------------- */

.plx-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    padding: 9px 16px;
    border-radius: var(--r-pill);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background var(--motion-quick), border-color var(--motion-quick),
                color var(--motion-quick), box-shadow var(--motion-quick),
                transform var(--motion-quick);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.plx-btn .mi { font-size: 16px; }

.plx-btn-primary {
    background: var(--grad-cta);
    color: #fff;
    border: 0;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset,
                0 10px 24px -10px rgba(var(--brand-glow-rgb), .5);
}
.plx-btn-primary:hover:not(:disabled) {
    background: var(--grad-cta-hover);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset,
                0 16px 30px -10px rgba(var(--brand-glow-rgb), .6);
}

.plx-btn-secondary {
    background: var(--paper);
    color: var(--ink);
    border-color: rgba(var(--ink-rgb), .15);
}
.plx-btn-secondary:hover:not(:disabled) {
    border-color: rgba(var(--ink-rgb), .35);
}

.plx-btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border-color: transparent;
}
.plx-btn-ghost:hover:not(:disabled) { background: var(--line-2); }

.plx-btn-danger {
    background: var(--paper);
    color: var(--bad);
    border-color: #f1c5c0;
}
.plx-btn-danger:hover:not(:disabled) {
    background: var(--bad-soft);
    border-color: #ec9d96;
}

.plx-btn-sm { padding: 6px 12px; font-size: 12px; }
.plx-btn-lg { padding: 13px 22px; font-size: var(--t-base); }

.plx-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.plx-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--brand-soft);
}

/* Icon-only round button — used in top bar, table actions. */
.plx-icon-btn {
    appearance: none;
    width: 32px; height: 32px;
    border-radius: var(--r-md);
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: background var(--motion-quick), color var(--motion-quick);
}
.plx-icon-btn:hover { background: var(--line-2); color: var(--ink-2); }
.plx-icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--brand-soft);
}

/* ----- Inputs (.plx-input) --------------------------------- */

.plx-input {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    font: inherit;
    font-size: var(--t-sm);
    color: var(--ink-2);
    background: var(--paper);
    transition: border-color var(--motion-quick), box-shadow var(--motion-quick);
}
.plx-input::placeholder { color: var(--ink-400); }
.plx-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.plx-input:disabled {
    background: var(--line-2);
    color: var(--muted);
    cursor: not-allowed;
}
.plx-input.plx-input-error {
    border-color: var(--bad);
}
.plx-input.plx-input-error:focus {
    box-shadow: 0 0 0 3px var(--bad-soft);
}
.plx-help {
    font-size: var(--t-xs);
    color: var(--muted);
    margin-top: var(--s-1);
}
.plx-help.plx-help-error { color: var(--bad); }

/* Search input variant with leading icon */
.plx-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
}
.plx-search .mi {
    position: absolute;
    left: 10px;
    color: var(--muted);
    font-size: 16px;
    pointer-events: none;
}
.plx-search .plx-input { padding-left: 32px; }

/* ----- Cards (.plx-card) ----------------------------------- */

.plx-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    transition: box-shadow var(--motion-quick);
}
.plx-card.plx-card-elevated { box-shadow: var(--shadow-2); }

.plx-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
}
.plx-card-title {
    font-size: var(--t-md);
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}
.plx-card-sub {
    font-size: var(--t-sm);
    color: var(--muted);
    margin: var(--s-1) 0 0;
}
.plx-card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-2);
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--line-2);
}

/* ----- Tables (.plx-table) --------------------------------- */

/* X-07: wide tables scroll inside their own box so the page never scrolls
   sideways on a phone. Wrap any <table> that has more than ~4 columns. */
.plx-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.plx-table-scroll > table { min-width: 640px; }

.plx-table-wrap {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.plx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--t-sm);
}
.plx-table thead th {
    text-align: left;
    padding: 10px 16px;
    background: var(--line-2);
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.plx-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
    color: var(--ink-2);
}
.plx-table tbody tr:last-child td { border-bottom: 0; }
.plx-table tbody tr:hover td { background: rgba(var(--ink-rgb), .02); }
.plx-table .plx-table-name {
    color: var(--ink);
    font-weight: 500;
}
.plx-table .plx-table-meta {
    font-size: var(--t-xs);
    color: var(--muted);
    margin-top: 2px;
}
.plx-table .plx-table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

/* D-01 list-view extras — every one is opt-in from <PlxTable>/<PlxColumn>. */

/* MinWidth / MaxHeight: the wrap scrolls, the page never does (X-07). */
.plx-table-wrap-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
/* StickyHeader: pin the header while the wrap scrolls vertically. */
.plx-table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Column alignment (PlxColumn Align="right|center"). Right-aligned columns
   are numeric by convention, so they also get tabular numerals. */
.plx-table th.plx-col-right, .plx-table td.plx-col-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.plx-table th.plx-col-center, .plx-table td.plx-col-center { text-align: center; }

/* Trailing actions cell (PlxColumn IsActions). Shrinks to its buttons and
   sits flush right; the row hover doesn't imply the buttons are the row. */
.plx-table th.plx-col-actions, .plx-table td.plx-col-actions {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

/* Clickable rows (PlxTable OnRowClick). */
.plx-table tbody tr.plx-table-row-click { cursor: pointer; }
.plx-table tbody tr.plx-table-row-click:hover td { background: rgba(var(--ink-rgb), .035); }
.plx-table tbody tr.plx-table-row-click:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

/* Sortable headers (PlxColumn SortKey + PlxTable OnSort). The <th> keeps
   its padding on the button so the whole header is the hit target. */
.plx-table thead th.plx-th-sortable { padding: 0; }
.plx-th-sort {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 10px 16px;
    border: 0;
    background: transparent;
    font: inherit;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.plx-table th.plx-col-right .plx-th-sort { justify-content: flex-end; }
.plx-table th.plx-col-center .plx-th-sort { justify-content: center; }
.plx-th-sort:hover { background: var(--line); color: var(--ink-2); }
.plx-th-sort:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--brand-soft);
}
.plx-th-sort .mi { font-size: 14px; opacity: .45; }
.plx-table th.plx-th-sort-active .plx-th-sort { color: var(--ink); }
.plx-table th.plx-th-sort-active .plx-th-sort .mi { opacity: 1; color: var(--brand); }

/* Stack tables into card rows on narrow viewports. */
@media (max-width: 600px) {
    .plx-table-wrap { border: 0; background: transparent; }
    .plx-table-wrap-scroll { overflow: visible; max-height: none !important; }
    .plx-table { min-width: 0 !important; }
    .plx-table thead { display: none; }
    .plx-table, .plx-table tbody, .plx-table tr, .plx-table td { display: block; width: 100%; }
    .plx-table tr {
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        margin-bottom: var(--s-2);
        padding: var(--s-2) 0;
    }
    .plx-table td {
        border-bottom: 0;
        padding: 6px 14px;
    }
    .plx-table td.plx-col-right, .plx-table td.plx-col-center { text-align: left; }
    .plx-table td.plx-col-actions { text-align: left; white-space: normal; }
    .plx-table td::before {
        content: attr(data-label);
        font-family: var(--mono);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--muted);
        display: block;
        margin-bottom: 2px;
    }
    .plx-table td[data-label=""]::before { display: none; }
    .plx-table td.plx-table-empty::before { display: none; }
}

/* ----- Badges (.plx-badge) --------------------------------- */

.plx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: var(--r-sm);
    background: var(--line-2);
    color: var(--muted);
    white-space: nowrap;
}
.plx-badge-ok       { background: var(--ok-soft);    color: var(--ok); }
.plx-badge-warn     { background: var(--warn-soft);  color: var(--warn); }
.plx-badge-bad      { background: var(--bad-soft);   color: var(--bad); }
.plx-badge-brand    { background: var(--brand-soft); color: var(--brand); }
.plx-badge-muted    { background: var(--line-2);     color: var(--muted); }

/* Soft "pill" variants (rounded full) */
.plx-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--t-xs);
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: var(--line-2);
    color: var(--muted);
    white-space: nowrap;
}
.plx-pill-brand    { background: var(--brand-soft); color: var(--brand); }
.plx-pill-ok       { background: var(--ok-soft);    color: var(--ok); }
.plx-pill-warn     { background: var(--warn-soft);  color: var(--warn); }
.plx-pill-bad      { background: var(--bad-soft);   color: var(--bad); }

/* ----- Tabs (.plx-tabs) ------------------------------------ */

.plx-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.plx-tabs::-webkit-scrollbar { display: none; }
.plx-tab {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 12px 16px 10px;
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color var(--motion-quick), border-color var(--motion-quick);
    text-decoration: none;
}
.plx-tab:hover { color: var(--ink-2); }
.plx-tab[aria-selected="true"],
.plx-tab.active {
    color: var(--ink);
    border-bottom-color: var(--brand);
    font-weight: 600;
}
.plx-tab-count {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--r-sm);
    background: var(--line-2);
    color: var(--muted);
}
.plx-tab[aria-selected="true"] .plx-tab-count,
.plx-tab.active .plx-tab-count { background: var(--brand-soft); color: var(--brand); }

/* ----- Empty state (.plx-empty) ---------------------------- */

.plx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--s-12) var(--s-6);
    color: var(--muted);
}
.plx-empty .plx-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(var(--brand-glow-rgb), .14);
    color: var(--brand);
    display: grid;
    place-items: center;
    margin-bottom: var(--s-4);
}
.plx-empty .plx-empty-icon .mi { font-size: 26px; }
.plx-empty .plx-empty-title {
    font-family: var(--serif);
    color: var(--ink);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 var(--s-2);
}
.plx-empty .plx-empty-desc {
    font-size: var(--t-sm);
    color: var(--muted);
    margin: 0 0 var(--s-3);
    max-width: 360px;
}

/* ----- Usage bar (.plx-bar) -------------------------------- */

.plx-bar {
    width: 100%;
    height: 8px;
    border-radius: var(--r-pill);
    background: var(--line-2);
    overflow: hidden;
    display: flex;
}
.plx-bar > .plx-bar-plan,
.plx-bar > .plx-bar-pack {
    display: block;
    height: 100%;
    transition: width var(--motion-base);
}
.plx-bar > .plx-bar-plan { background: var(--brand); }
.plx-bar > .plx-bar-pack { background: var(--brand-soft); border-left: 1px solid #fff; }

.plx-bar.is-warn > .plx-bar-plan { background: var(--warn); }
.plx-bar.is-warn > .plx-bar-pack { background: var(--warn-soft); }
.plx-bar.is-bad  > .plx-bar-plan { background: var(--bad); }
.plx-bar.is-bad  > .plx-bar-pack { background: var(--bad-soft); }

/* ----- Banners (.plx-banner) ------------------------------- */

.plx-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: var(--t-sm);
}
.plx-banner .mi { color: var(--brand); flex-shrink: 0; }
.plx-banner-warn { background: var(--warn-soft); color: #7c4a00; border-color: #f1eacc; }
.plx-banner-warn .mi { color: var(--warn); }
.plx-banner-bad  { background: var(--bad-soft);  color: #872929; border-color: #f5d8d4; }
.plx-banner-bad .mi { color: var(--bad); }

/* ----- Skeleton placeholder -------------------------------- */

.plx-skeleton {
    display: inline-block;
    background: linear-gradient(90deg, var(--line-2), #ebedf0, var(--line-2));
    background-size: 200% 100%;
    border-radius: var(--r-sm);
    animation: plx-skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes plx-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----- Blazor error UI ------------------------------------
   The <div id="blazor-error-ui"> is rendered into every page by
   MainLayout. It must be hidden by default; Blazor flips it to
   `display: block` when an unhandled circuit exception fires.
   The legacy site.css carried this rule but isn't loaded any
   more — moving it here so the rule survives the migration. */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ----- Focus visible (global) -----------------------------
   Replaces ad-hoc `outline: none !important` rules that exist
   across the codebase. Pages should not override this. */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--brand-soft);
    border-radius: var(--r-sm);
}
.plx-darksurface :focus-visible {
    /* Inset-style focus on dark backgrounds (e.g. sidebar items) */
    box-shadow: 0 0 0 2px var(--brand-darker), 0 0 0 4px rgba(var(--brand-glow-rgb), .55);
}

/* =========================================================
   App shell — the 232px sidebar + 56px topbar grid layout
   used by MainLayout.razor.

   These rules used to live in MainLayout.razor.css with
   `::deep` prefixes, but Blazor scoped CSS can't style a
   component's own root element via `::deep` (it compiles
   to `[scope] .selector` which requires the scope attribute
   on an ANCESTOR, but `.plx-shell` is itself a root of the
   layout component). Moved here so the rules actually
   apply.
   ========================================================= */

.plx-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    background: var(--surface);
}
.plx-shell-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ----- Sidebar -------------------------------------------- */

.plx-sidebar {
    background: var(--grad-rail);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.plx-sb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 12px;
}

.plx-sb-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.plx-sb-logo-img {
    height: 30px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    flex-shrink: 0;
}
.plx-sb-close-mobile { display: none; color: rgba(255, 255, 255, .65); }

.plx-sb-ws {
    appearance: none;
    margin: 4px 12px 12px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background var(--motion-quick);
    text-align: left;
}
.plx-sb-ws:hover { background: rgba(255, 255, 255, .08); }
.plx-sb-ws-init {
    width: 22px; height: 22px;
    border-radius: 5px;
    background: var(--grad-avatar);
    color: #fff;
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.plx-sb-ws-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plx-sb-ws .mi { color: rgba(255, 255, 255, .5); font-size: 14px; }

.plx-sb-search {
    margin: 0 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: 12px;
}
.plx-sb-search .mi { color: rgba(255, 255, 255, .5); font-size: 16px; }
.plx-sb-search input {
    flex: 1;
    appearance: none;
    background: transparent;
    border: 0;
    color: #fff;
    font: inherit;
    font-size: 12px;
    outline: none;
    min-width: 0;
}
.plx-sb-search input::placeholder { color: rgba(255, 255, 255, .5); }
.plx-sb-search .plx-kbd {
    font-family: var(--mono);
    font-size: 11px;
    color: rgba(255, 255, 255, .7);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 1px 5px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
}

.plx-sb-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    scrollbar-width: thin;
}
.plx-sb-nav::-webkit-scrollbar { width: 4px; }
.plx-sb-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 2px; }

.plx-sb-group {
    font-family: var(--mono);
    font-size: 11px;          /* A-02: 10px/.4 alpha was ~2.5:1 on the rail */
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, .7);
    padding: 14px 10px 6px;
    font-weight: 500;
}

.plx-sb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    position: relative;
    /* Spec (handoff §App-shell): items are 13px Inter / 500. The
       earlier `font: inherit` shorthand was clobbering size + weight
       to body defaults (14px / 400). Set explicitly so <button>
       (which doesn't inherit font in Chrome) and <a> render
       identically. */
    font-family: var(--sans);
    font-size: var(--t-sm);
    font-weight: 500;
    line-height: 1.2;
    color: rgba(255, 255, 255, .72);
    cursor: pointer;
    transition: background var(--motion-quick), color var(--motion-quick);
    margin-bottom: 2px;
    text-decoration: none;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}
.plx-sb-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
/* corporate-theme.css has a global `a:hover { text-decoration: underline }`
   that outranks the base rule above — pin shell links to no underline. */
.plx-sb-item:hover, .plx-sb-item:focus,
.plx-sb-ws:hover, .plx-sb-logo-link:hover,
.plx-sb-foot a:hover, .plx-topbar a:hover,
.plx-btn:hover, .plx-icon-btn:hover { text-decoration: none; }
.plx-sb-item.active {
    background: rgba(var(--brand-glow-rgb), .12);
    color: var(--brand-bright);
    font-weight: 600;
}
/* Lime indicator bar in the sidebar gutter, as on Zyndi. */
.plx-sb-item.active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 2px;
    background: var(--brand-glow);
}
.plx-sb-item .mi { font-size: 18px; color: rgba(255, 255, 255, .6); flex-shrink: 0; }
.plx-sb-item:hover .mi { color: rgba(255, 255, 255, .85); }
.plx-sb-item.active .mi { color: var(--brand-bright); }
.plx-sb-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plx-sb-item-parent .plx-sb-item-chev { font-size: 16px; opacity: .5; }

/* Store teasers — modules the workspace could switch on. Dimmed with a
   trailing lock; hover restores full contrast to invite the click. */
.plx-sb-item-locked { opacity: .45; }
.plx-sb-item-locked:hover { opacity: 1; }
.plx-sb-item-locked .plx-sb-item-lock { font-size: 14px; opacity: .8; flex-shrink: 0; }

.plx-sb-children {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0 4px 22px;
}
.plx-sb-item-child {
    font-size: 12.5px;
    font-weight: 400;     /* Children quieter than parents per the mockup. */
    padding: 5px 10px;
    color: rgba(255, 255, 255, .7);
}
.plx-sb-item-child:hover { color: #fff; }
.plx-sb-item-child.active { font-weight: 600; }
.plx-sb-item-child.active::before { display: none; }

.plx-sb-foot {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.plx-sb-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--grad-avatar);
    color: #fff;
    display: grid; place-items: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.plx-sb-foot-name {
    flex: 1;
    font-weight: 500;
    color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plx-sb-foot .plx-icon-btn { color: rgba(255, 255, 255, .5); }
.plx-sb-foot .plx-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* ----- Main + topbar -------------------------------------- */

.plx-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.plx-topbar {
    height: var(--topbar-h);
    background: rgba(250, 250, 247, .92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(var(--ink-rgb), .06);
    display: flex;
    align-items: center;
    padding: 0 var(--content-x);
    gap: 12px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.plx-topbar-toggle-mobile { display: none; }

.plx-crumbs {
    font-size: var(--t-sm);
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.plx-crumbs-parent { color: var(--muted); }
.plx-crumbs-sep { color: var(--ink-300); }
.plx-crumbs-here { color: var(--ink); font-weight: 500; }

.plx-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Zyndi top-bar icon buttons: 36px white discs with a hairline border. */
.plx-topbar-right .plx-icon-btn {
    width: 36px; height: 36px;
    border-radius: var(--r-pill);
    background: var(--paper);
    border: 1px solid rgba(var(--ink-rgb), .08);
    color: var(--ink-600);
}
.plx-topbar-right .plx-icon-btn:hover {
    background: var(--paper);
    border-color: rgba(var(--ink-rgb), .2);
    color: var(--ink);
}
.plx-topbar-right .plx-icon-btn .mi { font-size: 17px; }

.plx-topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--grad-avatar);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: var(--t-xs);
    font-weight: 700;
    cursor: pointer;
    transition: opacity var(--motion-quick);
}
.plx-topbar-avatar:hover { opacity: .85; }

/* RadzenMenu surface theming for the avatar dropdown — kept for
   click-outside / keyboard mechanics; chrome themed via tokens. */
.plx-topbar-menu .rz-navigation-menu {
    background: var(--paper) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-md) !important;
    box-shadow: var(--shadow-2) !important;
    padding: 4px !important;
    min-width: 180px;
}
.plx-topbar-menu .rz-navigation-item-text { color: var(--ink-2) !important; font-family: var(--sans) !important; }
.plx-topbar-menu .rz-navigation-item-icon { color: var(--muted) !important; }
.plx-topbar-menu .rz-navigation-item-wrapper:hover { background: var(--line-2) !important; border-radius: var(--r-sm); }

/* ----- Content + footer ----------------------------------- */

.plx-content {
    flex: 1;
    padding: var(--content-y) var(--content-x) 40px;
    min-width: 0;
}

/* Pages that need to fill the content area edge-to-edge (Chat, future
   full-bleed surfaces) wrap their outer element in `.plx-content` and
   add `.plx-flush` — the helper negates the standard padding via
   negative margins so the page can paint into the bleed area while
   sibling pages keep the comfortable gutters. */
.plx-flush {
    margin: calc(var(--content-y) * -1) calc(var(--content-x) * -1) -40px;
    height: calc(100vh - var(--topbar-h));
    display: flex;
    min-height: 0;
}

.plx-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px var(--content-x);
    color: var(--muted);
    font-size: var(--t-xs);
    border-top: 1px solid var(--line);
    background: var(--paper);
    flex-wrap: wrap;
}
.plx-footer a { color: var(--muted); text-decoration: none; }
.plx-footer a:hover { color: var(--ink-2); }
.plx-footer-sep { opacity: .5; }

/* ----- Subhero (.plx-subhero) ----------------------------- */
/* Inner-page header — gradient panel that replaces the previous
   flat eyebrow + serif h1 + grey lede pattern. Lives at the top
   of every inner page (Library, People, Plan & billing, etc.).
   The dashboard uses the larger .plx-hero instead. */

.plx-subhero {
    background: var(--grad-hero);
    border-radius: 14px;
    padding: 24px 28px;
    color: #fff;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 36px -16px rgba(var(--ink-rgb), .35);
}
.plx-subhero::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(50% 80% at 100% 0%,
                  rgba(var(--brand-glow-rgb), .24), transparent 70%);
    pointer-events: none;
}
.plx-subhero-text { position: relative; min-width: 0; }
.plx-subhero-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-bright);
    margin-bottom: 6px;
}
.plx-subhero-eyebrow::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--brand-bright);
    box-shadow: 0 0 6px var(--brand-bright);
}
.plx-subhero h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    color: #fff;
}
.plx-subhero p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
}
.plx-subhero-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}
/* Secondary buttons inside the subhero need a dark-surface skin so
   they read on the gradient. Primary keeps its puffy gradient — it
   reads fine against the deep purple. */
.plx-subhero .plx-btn-secondary {
    background: rgba(255, 255, 255, .03);
    color: #fff;
    border-color: rgba(255, 255, 255, .18);
}
.plx-subhero .plx-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, .14);
}
.plx-subhero .plx-btn-ghost {
    color: rgba(255, 255, 255, .85);
}
.plx-subhero .plx-btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

@media (max-width: 720px) {
    .plx-subhero { flex-direction: column; align-items: flex-start; padding: 20px 22px; }
    .plx-subhero-actions { width: 100%; flex-wrap: wrap; }
    .plx-subhero h1 { font-size: 24px; }
}

/* ----- Hero (.plx-hero) — dashboard only ------------------ */
/* The big gradient panel that opens the workspace overview.
   Inner pages use the smaller .plx-subhero instead. */

.plx-hero {
    position: relative;
    background: var(--grad-hero);
    border-radius: var(--r-xl);
    padding: 36px 40px;
    color: #fff;
    overflow: hidden;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: center;
    box-shadow: 0 24px 48px -12px rgba(var(--ink-rgb), .35);
}
/* Lime glow blob in the top-right corner, as on the Zyndi dashboard hero. */
.plx-hero::before {
    content: "";
    position: absolute;
    top: -80px; right: -80px;
    width: 360px; height: 360px;
    border-radius: 50%;
    background: radial-gradient(closest-side,
                  rgba(var(--brand-glow-rgb), .32), transparent 70%);
    pointer-events: none;
}
.plx-hero-text { position: relative; min-width: 0; }
.plx-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    letter-spacing: 0.12em;
    color: var(--brand-bright);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    padding: 6px 12px;
    border-radius: var(--r-pill);
    margin-bottom: 16px;
}
.plx-hero-eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand-glow);
    box-shadow: 0 0 8px var(--brand-glow);
}
.plx-hero h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(28px, 4.5vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin: 0 0 14px;
    color: #fff;
    max-width: 18ch;
}
.plx-hero-sub {
    margin: 0 0 26px;
    font-size: 15px;
    color: rgba(255, 255, 255, .6);
    max-width: 42ch;
    line-height: 1.55;
}
.plx-hero-cta {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--grad-lime);
    color: var(--brand-darker);
    border: 0;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 28px -8px rgba(var(--brand-glow-rgb), .5);
    transition: background var(--motion-quick), transform var(--motion-quick);
}
.plx-hero-cta:hover {
    background: var(--grad-lime-hover);
    color: var(--brand-darker);
    text-decoration: none;
    transform: translateY(-1px);
}
.plx-hero-cta .mi { font-variation-settings: 'wght' 500, 'opsz' 20; }

.plx-hero-aside {
    position: relative;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.plx-hero-aside-title {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-bright);
    margin: 0 0 4px;
}
.plx-hero-way {
    display: flex; align-items: flex-start; gap: 12px;
    color: #fff;
    text-decoration: none;
    padding: 6px 0;
}
.plx-hero-way:hover { color: #fff; text-decoration: none; }
.plx-hero-way:hover .plx-hero-way-name { color: var(--brand-bright); }
.plx-hero-way-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: rgba(var(--brand-glow-rgb), .14);
    border: 1px solid rgba(var(--brand-glow-rgb), .22);
    color: var(--brand-bright);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.plx-hero-way-icon .mi { font-size: 18px; }
.plx-hero-way-text { min-width: 0; }
.plx-hero-way-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    transition: color var(--motion-quick);
}
.plx-hero-way-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, .6);
    line-height: 1.45;
    margin-top: 2px;
}

@media (max-width: 900px) {
    .plx-hero { grid-template-columns: 1fr; padding: 28px 24px; gap: 20px; }
    .plx-hero h1 { font-size: 32px; max-width: none; }
}

/* ----- Onboarding checklist (.plx-checklist) — dashboard ---- */

.plx-checklist {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px 22px;
    margin-bottom: 22px;
}
.plx-checklist-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.plx-checklist-head h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
    margin: 0;
    color: var(--ink);
}
.plx-checklist-head .plx-checklist-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.plx-checklist-progress {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    flex-shrink: 0;
}
.plx-checklist-progress strong { color: var(--ink); font-weight: 600; }

.plx-ck-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--line-2);
}
.plx-ck-row:first-of-type { border-top: 0; }
.plx-ck-tick {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--paper);
    flex-shrink: 0;
    display: grid; place-items: center;
    color: transparent;
}
.plx-ck-row.done .plx-ck-tick {
    background: var(--grad-lime);
    border-color: transparent;
    color: var(--brand-darker);
}
.plx-ck-row.done .plx-ck-tick .mi { font-variation-settings: 'wght' 600, 'opsz' 20; }
.plx-ck-row.done .plx-ck-tick .mi { font-size: 14px; }
.plx-ck-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.plx-ck-icon .mi { font-size: 18px; }
.plx-ck-text { flex: 1; min-width: 0; }
.plx-ck-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.plx-ck-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
    line-height: 1.45;
}
.plx-ck-row.done .plx-ck-name { color: var(--muted); text-decoration: line-through; }
.plx-ck-action {
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}
.plx-ck-action:hover { background: var(--brand-soft); text-decoration: none; }

/* ----- Loading splash ------------------------------------- */

.plx-app-loading {
    position: fixed;
    inset: 0;
    background: var(--surface);
    display: grid;
    place-items: center;
    z-index: 10000;
}
.plx-app-loading-spinner {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    animation: plx-spin 0.8s linear infinite;
}
@keyframes plx-spin { to { transform: rotate(360deg); } }

/* ----- Mobile + tablet ------------------------------------ */

@media (max-width: 1100px) {
    .plx-shell {
        grid-template-columns: var(--sidebar-w-collapsed) 1fr;
    }
    .plx-shell .plx-sb-logo-img,
    .plx-shell .plx-sb-ws-name,
    .plx-shell .plx-sb-ws .mi:last-child,
    .plx-shell .plx-sb-search input,
    .plx-shell .plx-sb-search .plx-kbd,
    .plx-shell .plx-sb-group,
    .plx-shell .plx-sb-item-label,
    .plx-shell .plx-sb-item-chev,
    .plx-shell .plx-sb-foot-name {
        display: none;
    }
    .plx-shell .plx-sb-children { padding-left: 0; }
    .plx-shell .plx-sb-item { justify-content: center; }
    .plx-shell-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
}

@media (max-width: 768px) {
    .plx-shell {
        grid-template-columns: 1fr;
    }
    .plx-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform var(--motion-base);
        z-index: 200;
        box-shadow: var(--shadow-3);
    }
    .plx-shell-mobile-open .plx-sidebar { transform: translateX(0); }
    .plx-shell-mobile-open .plx-sb-logo-img,
    .plx-shell-mobile-open .plx-sb-ws-name,
    .plx-shell-mobile-open .plx-sb-ws .mi:last-child,
    .plx-shell-mobile-open .plx-sb-search input,
    .plx-shell-mobile-open .plx-sb-search .plx-kbd,
    .plx-shell-mobile-open .plx-sb-group,
    .plx-shell-mobile-open .plx-sb-item-label,
    .plx-shell-mobile-open .plx-sb-item-chev,
    .plx-shell-mobile-open .plx-sb-foot-name {
        display: revert;
    }
    .plx-shell-mobile-open .plx-sb-children { padding-left: 22px; }
    .plx-shell-mobile-open .plx-sb-item { justify-content: flex-start; }

    .plx-sb-close-mobile { display: inline-grid; }
    .plx-topbar-toggle-mobile { display: inline-grid; }
    .plx-topbar-toggle { display: none; }

    .plx-shell-scrim {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 150;
    }
}

/* ----- Table empty cell (.plx-table-empty) ------------------ */

.plx-table .plx-table-empty {
    text-align: center;
    color: var(--muted);
    padding: var(--s-8) var(--s-4);
    font-size: var(--t-sm);
}

/* ----- Dialog shell (.plx-dialog) --------------------------- */
/* Sits inside Radzen DialogService's overlay; replaces its chrome. */

.plx-dialog {
    background: var(--paper);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    min-width: 320px;
    overflow: hidden;
}
.plx-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-6) var(--s-3);
    border-bottom: 1px solid var(--line-2);
}
.plx-dialog-titlewrap { min-width: 0; }
.plx-dialog-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.plx-dialog-sub {
    margin: var(--s-1) 0 0;
    font-size: var(--t-sm);
    color: var(--muted);
}
.plx-dialog-close {
    appearance: none;
    background: transparent;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    color: var(--muted);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: background var(--motion-quick), color var(--motion-quick);
}
.plx-dialog-close:hover {
    background: var(--line-2);
    color: var(--ink-2);
}
.plx-dialog-body {
    padding: var(--s-6);
    color: var(--ink-2);
    font-size: var(--t-base);
    line-height: 1.55;
}
.plx-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-6) var(--s-4);
    border-top: 1px solid var(--line-2);
    background: var(--surface);
}

/* ----- Role badges (.plx-role-badge) ------------------------ */
/* Used wherever a workspace role is rendered. Replaces the legacy
   pink capsule. Palette per Phase 2 handoff Screen 05. */

.plx-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: var(--t-xs);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}
.plx-role-icon { flex-shrink: 0; }

.plx-role-owner   { background: #FEF3C7; color: #92400E; }
.plx-role-admin   { background: var(--brand-soft); color: var(--brand-deep); }
.plx-role-member  { background: var(--line-2); color: var(--ink-2); }
.plx-role-pending { background: var(--line-2); color: var(--muted); }

/* ----- Drawer (.plx-drawer) --------------------------------- */
/* Right- (or left-) anchored slide-in panel. Renders always; the
   .plx-drawer-open class on the scrim + drawer toggles visibility +
   transform. transform-only animation keeps the GPU happy. */

.plx-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base);
    z-index: 300;
}
.plx-drawer-scrim.plx-drawer-open {
    opacity: 1;
    pointer-events: auto;
}

.plx-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    background: var(--paper);
    box-shadow: var(--shadow-3, 0 18px 40px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.08));
    display: flex;
    flex-direction: column;
    transition: transform var(--motion-base);
    z-index: 301;
    outline: none;
    max-width: 100vw;
}
.plx-drawer-right {
    right: 0;
    transform: translateX(100%);
}
.plx-drawer-left {
    left: 0;
    transform: translateX(-100%);
}
.plx-drawer.plx-drawer-open { transform: translateX(0); }

.plx-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-6) var(--s-3);
    border-bottom: 1px solid var(--line-2);
}
.plx-drawer-titlewrap { min-width: 0; }
.plx-drawer-title {
    margin: var(--s-1) 0 0;
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.plx-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--s-6);
}
.plx-drawer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-6) var(--s-4);
    border-top: 1px solid var(--line-2);
    background: var(--surface);
}

/* ----- Chip input (.plx-chip-input) ------------------------- */
/* Multi-chip text field. Wraps on small widths; each chip is a pill
   with an X button. Invalid chips get a red border + the title-attr
   tooltip carries the validation message. */

.plx-chip-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--paper);
    cursor: text;
    transition: border-color var(--motion-quick), box-shadow var(--motion-quick);
}
.plx-chip-input:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.plx-chip-input-disabled {
    background: var(--line-2);
    cursor: not-allowed;
}

.plx-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px 8px;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: var(--t-sm);
    line-height: 1.4;
}
.plx-chip-label { font-weight: 500; }
.plx-chip-remove {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--motion-quick), background var(--motion-quick);
}
.plx-chip-remove:hover {
    opacity: 1;
    background: rgba(91, 33, 182, .12);
}
.plx-chip-invalid {
    background: var(--bad-soft);
    color: var(--bad);
    box-shadow: inset 0 0 0 1px var(--bad);
}
.plx-chip-invalid .plx-chip-remove:hover { background: rgba(220, 38, 38, .12); }

.plx-chip-input-field {
    flex: 1 1 120px;
    min-width: 120px;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: var(--t-sm);
    color: var(--ink-2);
    padding: 4px 0;
}
.plx-chip-input-field::placeholder { color: #94a3b8; }

/* ----- Stat strip (.plx-stat-strip / .plx-stat) ------------- */
/* Headline-numbers row at the top of admin pages. Auto-collapses
   to 2 columns < 1100px and 1 column < 600px, matching the rest
   of the admin grid behaviour. Each .plx-stat is a flex column
   with label (12 muted), serif value, optional mono trend. */

.plx-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 1100px) { .plx-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .plx-stat-strip { grid-template-columns: 1fr; } }

.plx-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    min-width: 0;
}
.plx-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
}
.plx-stat-label .mi { font-size: 14px; color: var(--brand); }
.plx-stat-value {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 30px;
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.plx-stat-trend {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}
.plx-stat-trend.up   { color: var(--ok); }
.plx-stat-trend.down { color: var(--bad); }

/* ----- Upgrade banner (.plx-upgrade-banner) ---------------- */
/* Informational, non-blocking — gated content renders underneath. */

.plx-upgrade-banner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--brand-soft), #FAF5FF);
    border: 1px solid #E0D4F7;
    border-radius: var(--r-lg);
    margin-bottom: var(--s-4);
}
@media (max-width: 760px) {
    .plx-upgrade-banner {
        grid-template-columns: auto 1fr;
    }
    .plx-upgrade-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

.plx-upgrade-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: var(--brand);
    color: white;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.plx-upgrade-icon .mi { font-size: 22px; }

.plx-upgrade-title {
    margin: 0 0 2px;
    font-size: var(--t-md);
    font-weight: 600;
    color: var(--ink);
}
.plx-upgrade-desc {
    margin: 0;
    font-size: var(--t-sm);
    color: var(--ink-2);
    line-height: 1.5;
}

.plx-upgrade-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ----- Burn-rate forecast line (.plx-burnrate) ------------- */
/* Threshold-coloured one-liner under the usage bar on the
   billing hero. Caller supplies pre-computed Used / Limit /
   ForecastDaysRemaining; this is purely presentational. */

.plx-burnrate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: var(--t-xs);
    line-height: 1.5;
}
.plx-burnrate-headroom { color: var(--muted); }
.plx-burnrate-warn     { color: var(--warn); }
.plx-burnrate-bad      { color: var(--bad); }
.plx-burnrate-exceeded { color: var(--bad); font-weight: 600; }

.plx-burnrate-pack {
    appearance: none;
    background: var(--bad);
    color: white;
    border: 0;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font: inherit;
    font-family: var(--sans);
    font-size: var(--t-xs);
    font-weight: 500;
    transition: opacity var(--motion-quick);
}
.plx-burnrate-pack:hover { opacity: 0.88; }

/* ----- Pulse-glow keyframe (.plx-pulse) -------------------- */
/* Used by /workspace/billing when arriving via ?highlight=pro
   from the modules page "Upgrade to unlock" CTA. Caller adds
   the class on first render and removes it on animationend. */

@keyframes plx-pulse-glow {
    0%   { box-shadow: 0 0 0 0   rgba(107, 72, 209, 0.6); }
    100% { box-shadow: 0 0 0 12px rgba(107, 72, 209, 0); }
}
.plx-pulse {
    animation: plx-pulse-glow 0.6s ease-out 2;
}

/* ----- Category header (.plx-category-header) -------------- */
/* Per-category banner on /workspace/agent-training. The icon
   palette is set inline (see PlxCategoryHeader) so new categories
   don't need a CSS change. */

.plx-category-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--s-3);
}
.plx-category-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--r-md);
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.plx-category-icon .mi { font-size: 18px; }
.plx-category-titles { flex: 1 1 auto; min-width: 0; }
.plx-category-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.2;
}
.plx-category-desc {
    margin: 2px 0 0;
    font-size: var(--t-xs);
    color: var(--muted);
}
.plx-category-actions { flex-shrink: 0; }

/* ----- Rule card (.plx-rule-card) -------------------------- */

.plx-rule-card {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 12px;
    align-items: flex-start;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color var(--motion-quick);
}
.plx-rule-card:hover { border-color: var(--brand); }

.plx-rule-card-draft {
    border-left: 3px solid var(--warn);
    background: var(--warn-soft);
    padding-left: 13px; /* compensate the thicker left border */
}
.plx-rule-card-disabled { opacity: 0.55; }
.plx-rule-card-add {
    grid-template-columns: 1fr;
    border: 1px dashed var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    padding: 12px;
}
.plx-rule-card-add:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.plx-rule-card-add .plx-rule-body {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.plx-rule-handle {
    color: var(--muted);
    opacity: 0.4;
    user-select: none;
    cursor: grab;
    line-height: 1.2;
    font-size: 12px;
    letter-spacing: 1px;
    padding-top: 2px;
}
.plx-rule-card .plx-rule-body { min-width: 0; }
.plx-rule-titlerow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.plx-rule-name {
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--ink);
}
.plx-rule-name.muted { color: var(--muted); font-weight: 500; }
.plx-rule-name-deleted { text-decoration: line-through; color: var(--muted); }
.plx-rule-meta {
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--muted);
    margin-top: 4px;
}
.plx-rule-actions { flex-shrink: 0; }

/* ----- Lint row (.plx-lint) -------------------------------- */

.plx-lint {
    display: grid;
    grid-template-columns: 8px 36px 1fr auto;
    column-gap: 8px;
    align-items: baseline;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: var(--t-sm);
    line-height: 1.45;
}
.plx-lint + .plx-lint { margin-top: 4px; }
.plx-lint-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    transform: translateY(2px);
}
.plx-lint-line {
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--muted);
    text-align: right;
}
.plx-lint-msg { color: var(--ink-2); }
.plx-lint-action {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0 4px;
    font: inherit;
    font-size: var(--t-xs);
    color: var(--brand);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.plx-lint-action:hover { color: var(--brand-deep); }

.plx-lint-ok   { background: rgba(0, 0, 0, 0); }
.plx-lint-ok   .plx-lint-dot { background: var(--good, #047857); }
.plx-lint-warn { background: var(--warn-soft); border-color: #f1eacc; }
.plx-lint-warn .plx-lint-dot { background: var(--warn); }
.plx-lint-bad  { background: var(--bad-soft);  border-color: #f5d8d4; }
.plx-lint-bad  .plx-lint-dot { background: var(--bad); }
.plx-lint-bad  .plx-lint-msg { color: #872929; }


/* ----- Sidebar sections (collapsible) ----------------------------------
   Section headers ("Work", "Travel", "Tools", "Manage") are buttons so a
   user with every module switched on can fold away the parts of the rail
   they aren't using. State persists per browser (localStorage). The
   header keeps the .plx-sb-group class so the icon-rail media rules that
   hide it still apply unchanged. */
.plx-sb-group-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-radius: var(--r-sm);
    transition: color var(--motion-quick);
}
.plx-sb-group-btn:hover,
.plx-sb-group-btn:focus-visible { color: rgba(255, 255, 255, .75); text-decoration: none; }
.plx-sb-group-btn:focus-visible { outline: 2px solid var(--brand-glow); outline-offset: -2px; }
.plx-sb-group-chev { font-size: 14px; opacity: .45; transition: transform var(--motion-quick), opacity var(--motion-quick); }
.plx-sb-group-btn:hover .plx-sb-group-chev { opacity: .9; }
.plx-sb-group-btn.is-collapsed .plx-sb-group-chev { transform: rotate(-90deg); }
/* A collapsed section still renders the item the user is currently on
   (filtered in MainLayout.RenderGroup) so they never lose their place. */
.plx-sb-section { display: flex; flex-direction: column; }
/* Parent whose child is the current page: lit like an active row while
   folded, so the accordion never hides where you are. */
.plx-sb-item-parent.is-active-parent:not(.is-expanded) { color: var(--brand-bright); }
.plx-sb-item-parent.is-active-parent:not(.is-expanded) .mi { color: var(--brand-bright); }

/* A-03: every control that removes the default outline gets a visible focus ring back. */
.plx-sb-search:focus-within { outline: 2px solid var(--brand-glow); outline-offset: 2px; border-radius: 8px; }
.plx-chip-input-field:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.plx-drawer:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Command palette (X-08) -------------------------------------- */
.plx-sb-search-btn { cursor: pointer; text-align: left; font: inherit; }
.plx-sb-search-btn .plx-sb-search-placeholder { flex: 1; color: rgba(255, 255, 255, .55); font-size: var(--t-sm); }
.plx-palette-overlay { position: fixed; inset: 0; background: rgba(15, 12, 30, .45); z-index: 1000; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.plx-palette { width: min(680px, calc(100vw - 32px)); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-3, 0 24px 60px rgba(0,0,0,.35)); overflow: hidden; }
.plx-palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.plx-palette-input .mi { color: var(--muted); }
.plx-palette-input input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; min-width: 0; color: inherit; }
.plx-palette-input .plx-kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.plx-palette-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.plx-palette-group { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.plx-palette-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.plx-palette-row:hover, .plx-palette-row.is-selected { background: var(--brand-soft, rgba(124,58,237,.10)); text-decoration: none; }
.plx-palette-row .mi { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.plx-palette-row.is-selected .mi { color: var(--brand); }
.plx-palette-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plx-palette-sub { color: var(--muted); font-size: 12.5px; flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plx-palette-hint { color: var(--muted); font-size: 13px; padding: 12px 10px; }

/* ---- D-01: one spinner (replaces Bootstrap .spinner-border) ---------------- */
.plx-spinner {
    display: inline-block;
    width: 1.75rem;
    height: 1.75rem;
    vertical-align: -0.2em;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: var(--plx-brand, #6d3df5);
    animation: plx-spin 0.75s linear infinite;
    flex: none;
}
.plx-spinner-sm { width: 1rem; height: 1rem; border-width: 0.15em; }
.plx-spinner.text-primary { color: var(--plx-brand, #6d3df5); }
.plx-spinner.text-light, .plx-spinner.text-white { color: #fff; }
@keyframes plx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .plx-spinner { animation-duration: 1.5s; }
}

/* ----- Pager (.plx-pager) — P-01 server paging ------------------- */
/* Sits under a .plx-table-wrap (or a card grid). Summary on the left,
   rows-per-page + prev/next on the right; stacks on narrow screens. */
.plx-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    flex-wrap: wrap;
    padding: 10px 4px;
    margin-top: var(--s-2);
    font-size: var(--t-sm);
    color: var(--muted);
}
.plx-table-wrap + .plx-pager { margin-top: var(--s-3); }
.plx-pager-summary { font-variant-numeric: tabular-nums; }
.plx-pager-controls { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.plx-pager-size { display: inline-flex; align-items: center; gap: 6px; }
.plx-pager-select.plx-input {
    display: inline-block;
    width: auto;
    min-width: 0;
    padding: 4px 28px 4px 10px;
    font-size: var(--t-sm);
}
.plx-pager-page { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plx-pager-nav { display: inline-flex; gap: 4px; }
.plx-pager-btn.plx-btn { padding: 4px 8px; }
.plx-pager-btn .mi { font-size: 18px; }
@media (max-width: 600px) {
    .plx-pager { flex-direction: column; align-items: stretch; }
    .plx-pager-controls { justify-content: space-between; }
}
