/* ============================================================================
   Page look (Alex Williams, "Page look guide", v2.0.47 review, 24 Nov 2026, p.3 "Exact styles").
   One layout for every list/setup page:
     breadcrumb -> header box -> tab bar (only if the page has sections) -> toolbar box -> content box(es)
   16 px between boxes. Components: PageHeaderBox, PageTabBar, PageToolbar, PageSearch (ScafTek.Platform.Wasm),
   PaginationControl (table footer), StatusPill (pills). Classes here are prefixed pl-.
   ============================================================================ */

:root {
    --pl-ink: #13233B;
    --pl-slate: #5A6B80;
    --pl-line: #EEF1F5;
    --pl-border: #CBD4DF;
    --pl-head-bg: #F6F8FB;
    --pl-orange: #C2510C;
    --pl-orange-hover: #A84508;
    --pl-blue: #1F4F8A;
    --pl-red: #9B1C1C;
    --pl-radius: 14px;
}

/* ── Page stack ───────────────────────────────────────────────────────── */
.pl-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pl-page > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.pl-box {
    background: #fff; border-radius: var(--pl-radius); box-shadow: 0 4px 20px rgba(13, 22, 38, .18);
    color: var(--pl-ink); min-width: 0;
}

/* ── Header box: icon tile 42 navy r10 · title 24/bold · summary 13 slate · actions right, 10 apart ── */
.pl-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: #fff; border-radius: var(--pl-radius); padding: 16px 22px;
    box-shadow: 0 4px 20px rgba(13, 22, 38, .18); color: var(--pl-ink); min-width: 0;
}
.pl-header-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pl-header-icon {
    flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; background: #13233B; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.pl-header-text { min-width: 0; }
.pl-header-title { font-size: 24px; font-weight: 700; line-height: 1.2; margin: 0; color: var(--pl-ink); }
.pl-header-summary { font-size: 13px; color: var(--pl-slate); margin-top: 2px; }
.pl-header-summary a { color: var(--pl-blue); text-decoration: underline; }
.pl-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }

/* ── Buttons: 40 tall, r8, 14 semibold. One orange main action per page. ── */
.pl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
    border-radius: 8px; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
    border: 1px solid var(--pl-border); background: #fff; color: var(--pl-ink); text-decoration: none;
    transition: background-color .15s, border-color .15s;
}
.pl-btn:hover { background: #F6F8FB; color: var(--pl-ink); text-decoration: none; }
/* Outline header buttons that are links (Audit trail) stay ink: the WebAssembly layout paints links orange. */
.pl-header-actions a.pl-btn:not(.pl-btn--main), .pl-header-actions a.pl-btn:not(.pl-btn--main) i { color: var(--pl-ink) !important; }
.pl-btn:disabled, .pl-btn.disabled { opacity: .55; cursor: not-allowed; }
.pl-btn--main { background: var(--pl-orange); border-color: var(--pl-orange); color: #fff; }
.pl-btn--main:hover { background: var(--pl-orange-hover); border-color: var(--pl-orange-hover); color: #fff; }
.pl-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* ── Tab bar: own white box; 14 px tabs, 15 px icons; active = ink bold + 2 px orange underline ── */
.pl-tabbar {
    display: flex; gap: 4px; flex-wrap: wrap; background: #fff; border-radius: var(--pl-radius);
    padding: 0 14px; box-shadow: 0 4px 20px rgba(13, 22, 38, .18); min-width: 0;
}
.pl-tab {
    display: inline-flex; align-items: center; gap: 7px; padding: 13px 12px 11px; font-size: 14px; color: var(--pl-slate);
    background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.pl-tab i { font-size: 15px; }
.pl-tab:hover { color: var(--pl-ink); text-decoration: none; }
.pl-tab.active, .pl-tab[aria-selected="true"] { color: var(--pl-ink); font-weight: 700; border-bottom-color: var(--pl-orange); }
.pl-tab-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px;
    border-radius: 9px; background: #E3ECF7; color: var(--pl-blue); font-size: 11px; font-weight: 700;
}

/* ── Toolbar box: search 40 tall max 460; drop-downs 40; More filters + Columns outline; count right 13 slate ── */
.pl-toolbar {
    background: #fff; border-radius: var(--pl-radius); padding: 14px 16px; box-shadow: 0 4px 20px rgba(13, 22, 38, .18);
    display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.pl-toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.pl-toolbar-count { margin-left: auto; font-size: 13px; color: var(--pl-slate); white-space: nowrap; }
.pl-toolbar-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-toolbar-chips:not(:has(*)) { display: none; }
.pl-search { position: relative; flex: 1 1 260px; max-width: 460px; min-width: 200px; }
.pl-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pl-slate); font-size: 14px; pointer-events: none; }
.pl-search > input {
    width: 100%; height: 40px; border: 1px solid var(--pl-border); border-radius: 8px; padding: 0 12px 0 34px;
    font-size: 14px; color: var(--pl-ink); background: #fff;
}
.pl-search > input:focus, .pl-select:focus { outline: none; border-color: #1F5FA8; box-shadow: 0 0 0 3px rgba(31, 95, 168, .15); }
.pl-select {
    height: 40px; border: 1px solid var(--pl-border); border-radius: 8px; padding: 0 32px 0 12px; font-size: 14px;
    color: var(--pl-ink); background-color: #fff; min-width: 140px; max-width: 220px;
}
.pl-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--pl-ink); white-space: nowrap; margin: 0; }
/* Quick-view chips: 32 tall, fully round, active = navy fill */
.pl-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 16px;
    border: 1px solid var(--pl-border); background: #fff; color: var(--pl-ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.pl-chip.active, .pl-chip[aria-pressed="true"] { background: #13233B; border-color: #13233B; color: #fff; }

/* ── Table box: head #F6F8FB 12 caps bold slate; rows 56, 14 px; 1 px #EEF1F5; first text column bold ── */
.pl-table-box { background: #fff; border-radius: var(--pl-radius); box-shadow: 0 4px 20px rgba(13, 22, 38, .18); overflow: hidden; min-width: 0; }
.pl-table-scroll { overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 14px; color: var(--pl-ink); }
.pl-table > thead > tr > th {
    background: var(--pl-head-bg); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--pl-slate); padding: 10px 12px; border-bottom: 1px solid var(--pl-line); white-space: nowrap; vertical-align: middle;
}
.pl-table > tbody > tr > td { height: 56px; padding: 6px 12px; border-bottom: 1px solid var(--pl-line); vertical-align: middle; }
.pl-table > tbody > tr:last-child > td { border-bottom: 0; }
.pl-table > tbody > tr:hover > td { background: #FAFBFD; }
.pl-table .pl-strong { font-weight: 700; }
.pl-table .pl-check { width: 44px; padding-left: 16px; }
.pl-table .pl-num { text-align: right; font-variant-numeric: tabular-nums; }
.pl-table .pl-actions-col { text-align: right; white-space: nowrap; width: 1%; padding-right: 16px; }
.pl-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Row actions: 32 px outline icon buttons; extra (view, download, archive) first, then edit (blue), delete (red) last ── */
.pl-row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.pl-act {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--pl-border); background: #fff; color: var(--pl-slate); font-size: 14px; cursor: pointer; padding: 0;
}
.pl-act:hover { background: #F6F8FB; }
.pl-act--edit { color: #1F5FA8; border-color: #BFD3EA; }
.pl-act--delete { color: #B42318; border-color: #F1C4C0; }
.pl-act--lock { background: #13233B; border-color: #13233B; color: #fff; cursor: default; }
/* Row actions also carry btn-outline-primary / btn-outline-danger as plain markers for the E2E helpers. Without
   .btn those classes draw nothing, but WasmLayout's orange ".btn-outline-*:hover" (!important) would still catch
   them: keep the guide's quiet hover. */
.pl-act.pl-act--edit:is(:hover, :focus), .pl-act.pl-act--delete:is(:hover, :focus) {
    background-color: #F6F8FB !important; box-shadow: none !important;
}
.pl-act.pl-act--edit:is(:hover, :focus) { border-color: #BFD3EA !important; color: #1F5FA8 !important; }
.pl-act.pl-act--delete:is(:hover, :focus) { border-color: #F1C4C0 !important; color: #B42318 !important; }

/* ── Status pills: 24 tall, 12 bold, round, no icon ── */
.pl-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1; }
.pl-pill--green { background: #DCF2E3; color: #14532D; }
.pl-pill--red { background: #FDE2E1; color: #9B1C1C; }
.pl-pill--blue { background: #E3ECF7; color: #1F4F8A; }
.pl-pill--amber { background: #FEF0D9; color: #8A4B05; }
.pl-pill--grey { background: #EEF1F5; color: #4A5868; }

/* ── Collapsible stacked sections (project page) ── */
.pl-section { background: #fff; border-radius: var(--pl-radius); box-shadow: 0 4px 20px rgba(13, 22, 38, .18); min-width: 0; }
.pl-section-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; }
.pl-section-title { font-size: 14px; font-weight: 700; color: var(--pl-ink); display: inline-flex; align-items: center; gap: 8px; }
.pl-section-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 6px; background: #13233B; color: #fff; font-size: 11px; font-weight: 700; }
.pl-section-body { border-top: 1px solid var(--pl-line); padding: 12px 16px 16px; }
.pl-drag { color: #A9B4C2; cursor: grab; }

/* ── topbar.css normalises module toolbars, pagination bars and table heads with broad selectors
   ([class*="-toolbar"], [class*="pagination"], thead th). The kit's own parts must win over those: ── */
.page.stk-clean article.content :is(.pl-toolbar-row, .pl-toolbar-chips, .pl-toolbar-count) {
    border-bottom: 0 !important; background: transparent !important;
}
.page.stk-clean article.content .pl-toolbar-count,
.page.stk-clean article.content .pl-toolbar-count :is(span, small, strong) { color: var(--pl-slate) !important; }
.page.stk-clean article.content :is(.pagination-info, .pagination-controls, .pagination-rows, .pagination-nav, .pagination-ellipsis) {
    border-bottom: 0 !important; background: transparent !important;
}
.page.stk-clean article.content .pagination-container { border-bottom: 0 !important; border-top: 1px solid var(--pl-line); }
.page.stk-clean article.content :is(.pagination-info, .pagination-rows, .pagination-rows label) { color: var(--pl-slate) !important; }
.page.stk-clean article.content .pagination-btn { background: #fff !important; color: var(--pl-ink) !important; border-bottom: 1px solid var(--pl-border) !important; }
.page.stk-clean article.content .pagination-btn.active { background: #13233B !important; border-color: #13233B !important; color: #fff !important; }
.page.stk-clean article.content .pl-table > thead,
.page.stk-clean article.content .pl-table > thead > tr { background: var(--pl-head-bg) !important; }
.page.stk-clean article.content .pl-table > thead > tr > th { background: var(--pl-head-bg) !important; color: var(--pl-slate) !important; }

/* ============================================================================
   Screen sizes (guide, 25 Nov 2026, p.3): desktop 1280 px and up · tablet landscape 1024-1279 · tablet portrait 768-1023 ·
   mobile under 768. Each screen's tablet and mobile page in the guide shows what changes:
   - Tablet landscape: the desktop layout; low-priority columns drop (.pl-col-wide, added back with Columns).
   - Tablet portrait: the Menu button replaces the drop-downs (topbar.css); Audit trail and Import / export go under More (⋯);
     drop-downs and More filters open from Filters; fewer columns (.pl-col-desk hidden too).
   - Mobile: every list row becomes a card (.pl-cards inside the table box), "Load more" replaces page numbers
     (PaginationControl), tabs become a Section picker (PageTabBar), the main action is full width.
   ============================================================================ */

/* Header More (⋯) and toolbar Filters: checkbox toggles drawn by PageHeaderBox / PageToolbar; hidden on desktop. */
.pl-more-toggle, .pl-filters-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pl-more-btn, .pl-filters-btn { display: none !important; }
.pl-more-btn { width: 40px; padding: 0; }
.pl-more-toggle:focus-visible + .pl-more-btn, .pl-filters-toggle:focus-visible + .pl-filters-btn { box-shadow: 0 0 0 3px rgba(31, 95, 168, .25); }
.pl-section-picker { display: none; }

/* Column priority: .pl-col-wide shows from 1280 px; .pl-col-desk from 1024 px (both on th and td). */
@media (max-width: 1279.98px) {
    .pl-table .pl-col-wide { display: none; }
}

/* Mobile card list (inside .pl-table-box, before the footer): shown under 768 px instead of the table. */
.pl-cards { display: none; list-style: none; margin: 0; padding: 0; }
.pl-card-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 64px; border-bottom: 1px solid var(--pl-line);
    color: var(--pl-ink); text-decoration: none; cursor: pointer; background: #fff; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0;
}
.pl-card-row:hover { background: #FAFBFD; color: var(--pl-ink); text-decoration: none; }
.pl-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-card-title { font-size: 15px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-card-sub { font-size: 13px; color: var(--pl-slate); line-height: 1.3; }
.pl-card-sub a { color: var(--pl-blue); }
.pl-card-end { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pl-card-chevron { color: #A9B4C2; font-size: 14px; }
.pl-card-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; }
.pl-card-lead { flex: 0 0 auto; display: inline-flex; align-items: center; }
/* The line on the canvas above mobile list ("35 staff · A–Z"). */
.pl-list-caption { display: none; font-size: 13px; color: #9FB3CC; margin: -8px 2px -8px; }

@media (max-width: 1023.98px) {
    .pl-table .pl-col-desk { display: none; }

    /* Header: secondary actions under More (⋯). */
    .pl-header { position: relative; }
    .pl-header-actions:has(> :not(.pl-more-toggle):not(.pl-more-btn):not(.pl-btn--main):not(.pl-keep):not(style):not(script)) > .pl-more-btn { display: inline-flex !important; order: -1; }
    .pl-header-actions > :not(.pl-more-toggle):not(.pl-more-btn):not(.pl-btn--main):not(.pl-keep):not(style):not(script) { display: none !important; }
    .pl-header-actions > .pl-more-toggle:checked ~ :not(.pl-more-btn):not(.pl-btn--main) { display: inline-flex !important; }
    .pl-header-actions:has(> .pl-more-toggle:checked) { flex-wrap: wrap; }
    .pl-more-toggle:checked + .pl-more-btn { background: #EEF3FA; border-color: #B9C7D8; }

    /* Toolbar: search, Filters, Columns; the rest opens from Filters. The count goes (mobile shows a caption). */
    .pl-toolbar-row:has(> :is(.pl-select:not(.pl-keep), .pl-switch:not(.pl-keep), .pl-foldable, .pl-btn:not(.pl-filters-btn):not(.pl-columns-btn):not([title="Show or hide columns"]):not(.pl-keep))) > .pl-filters-btn { display: inline-flex !important; }
    .pl-toolbar-row > .pl-search { order: 0; }
    .pl-toolbar-row > .pl-filters-btn { order: 1; }
    .pl-toolbar-row > :is(.pl-columns-btn, [title="Show or hide columns"]) { order: 2; }
    .pl-toolbar-row > :is(.pl-select:not(.pl-keep), .pl-switch:not(.pl-keep), .pl-foldable, .pl-btn:not(.pl-filters-btn):not(.pl-columns-btn):not([title="Show or hide columns"]):not(.pl-keep)) { display: none !important; order: 3; }
    .pl-toolbar-row > .pl-filters-toggle:checked ~ :not(style):not(script):is(.pl-select:not(.pl-keep), .pl-switch:not(.pl-keep), .pl-foldable, .pl-btn:not(.pl-filters-btn):not(.pl-columns-btn):not([title="Show or hide columns"]):not(.pl-keep)) { display: inline-flex !important; }
    .pl-toolbar-row > .pl-filters-toggle:checked ~ .pl-select { display: block !important; }
    .pl-filters-toggle:checked + .pl-filters-btn { background: #EEF3FA; border-color: #B9C7D8; }
    .pl-toolbar-row > .pl-toolbar-count { display: none; }
    .pl-search { flex: 1 1 200px; }
}

@media (max-width: 767.98px) {
    .pl-page { gap: 12px; }
    .pl-header { padding: 14px 16px; align-items: flex-start; }
    .pl-header-id { padding-right: 48px; }
    .pl-header-actions { width: 100%; margin-left: 0; }
    .pl-header-actions > .pl-btn--main { flex: 1 1 100%; }
    .pl-header-actions:has(> :not(.pl-more-toggle):not(.pl-more-btn):not(.pl-btn--main):not(.pl-keep):not(style):not(script)) > .pl-more-btn { position: absolute; top: 14px; right: 16px; }
    .pl-header-actions > .pl-more-toggle:checked ~ :not(.pl-more-btn):not(.pl-btn--main) { flex: 1 1 auto; }
    .pl-header-title { font-size: 22px; }

    .pl-toolbar { padding: 10px 12px; }
    .pl-toolbar-row > :is(.pl-columns-btn, [title="Show or hide columns"]) { display: none !important; }
    .pl-search { min-width: 0; max-width: none; }
    .pl-btn, .pl-select, .pl-search > input { min-height: 44px; }

    /* Tabs become a Section picker. */
    .pl-tabbar { display: none; }
    .pl-section-picker {
        display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--pl-radius); padding: 10px 12px; margin: 0;
        box-shadow: 0 4px 20px rgba(13, 22, 38, .18); color: var(--pl-ink);
    }
    .pl-section-picker-label { font-size: 13px; color: var(--pl-slate); font-weight: 600; }
    .pl-section-picker .pl-select { flex: 1 1 auto; max-width: none; }

    /* Lists: cards instead of the table where the page provides them. */
    .pl-table-box:has(> .pl-cards) > :is(.pl-table-scroll, .table-responsive, table) { display: none !important; }
    .pl-table-box > .pl-cards { display: block; }
    .pl-list-caption { display: block; }
    .pl-page > .pl-list-caption { margin: -4px 2px !important; }
}
