/* ==========================================================================
   PixelEvolution CRM - application styles
   Layered on top of Bootstrap 5.3. Supports light and dark themes via
   Bootstrap's data-bs-theme attribute.
   ========================================================================== */

:root {
    --px-accent: #6366f1;
    --px-accent-2: #8b5cf6;
    --px-accent-soft: rgba(99, 102, 241, .12);
    --px-sidebar-w: 250px;
    --px-radius: 14px;
    --px-radius-sm: 9px;
    --px-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .16);
    --px-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --px-surface: #ffffff;
    --px-surface-2: #f7f8fa;
    --px-page: #f2f4f7;
    --px-line: #e6e8ee;
    --px-line-soft: #eef0f4;
    --px-text: #1b2030;
    --px-muted: #667085;
}

[data-bs-theme="dark"] {
    --px-accent: #818cf8;
    --px-accent-2: #a78bfa;
    --px-accent-soft: rgba(129, 140, 248, .16);
    --px-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --px-shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --px-surface: #171a21;
    --px-surface-2: #1e222b;
    --px-page: #10131a;
    --px-line: #2a2f3a;
    --px-line-soft: #23272f;
    --px-text: #e6e8ee;
    --px-muted: #98a2b3;
}

* { -webkit-tap-highlight-color: transparent; }

body {
    background: var(--px-page);
    color: var(--px-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .935rem;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

.px-icon { flex: 0 0 auto; vertical-align: -.15em; }

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.px-shell { display: flex; min-height: 100vh; }

.px-sidebar {
    width: var(--px-sidebar-w);
    flex: 0 0 var(--px-sidebar-w);
    background: var(--px-surface);
    border-right: 1px solid var(--px-line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1040;
}

.px-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Brand ------------------------------------------------------------------ */

.px-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.15rem 1.15rem 1rem;
    border-bottom: 1px solid var(--px-line-soft);
}

.px-brand-mark {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--px-accent), var(--px-accent-2));
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .02em;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .6);
}

.px-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.px-brand-text strong { font-size: .98rem; font-weight: 650; letter-spacing: -.01em; }
.px-brand-accent { color: var(--px-accent); }
.px-brand-text small { color: var(--px-muted); font-size: .715rem; letter-spacing: .04em; text-transform: uppercase; }

/* Nav -------------------------------------------------------------------- */

.px-nav { padding: .8rem .7rem; display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; overflow-y: auto; }

.px-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .58rem .7rem;
    border-radius: var(--px-radius-sm);
    color: var(--px-muted);
    font-weight: 500;
    font-size: .9rem;
    transition: background-color .13s ease, color .13s ease;
}

.px-nav-link:hover { background: var(--px-surface-2); color: var(--px-text); }

.px-nav-link.active {
    background: var(--px-accent-soft);
    color: var(--px-accent);
    font-weight: 600;
}

.px-nav-link .px-icon { opacity: .9; }

.px-nav-count {
    margin-left: auto;
    background: var(--px-surface-2);
    border: 1px solid var(--px-line);
    color: var(--px-muted);
    font-size: .7rem;
    font-weight: 600;
    padding: .05rem .42rem;
    border-radius: 99px;
}

.px-nav-link.active .px-nav-count { background: #fff; border-color: transparent; color: var(--px-accent); }
[data-bs-theme="dark"] .px-nav-link.active .px-nav-count { background: rgba(0, 0, 0, .25); }

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

.px-sidebar-foot { border-top: 1px solid var(--px-line-soft); padding: .85rem .9rem 1rem; }

.px-me { display: flex; align-items: center; gap: .6rem; margin-bottom: .65rem; min-width: 0; }

.px-avatar {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--px-accent), var(--px-accent-2));
    color: #fff; font-weight: 650; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    text-transform: uppercase;
}

.px-me-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.px-me-text strong { font-size: .87rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-me-text small { color: var(--px-muted); font-size: .74rem; }

.px-sidebar-actions { display: flex; gap: .35rem; }
.px-sidebar-actions .btn { flex: 1 1 0; font-size: .775rem; padding: .3rem .4rem; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; }

/* Topbar ----------------------------------------------------------------- */

.px-topbar {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.4rem;
    background: var(--px-surface);
    border-bottom: 1px solid var(--px-line);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.px-topbar-title { flex: 1 1 auto; min-width: 0; }
.px-topbar-title h1 { font-size: 1.24rem; font-weight: 650; margin: 0; letter-spacing: -.015em; }
.px-topbar-title p { margin: .1rem 0 0; color: var(--px-muted); font-size: .83rem; }

.px-topbar-actions { display: flex; align-items: center; gap: .45rem; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

.px-sidebar-toggle { display: none !important; }

.px-theme-toggle .px-theme-dark { display: none; }
[data-bs-theme="dark"] .px-theme-toggle .px-theme-light { display: none; }
[data-bs-theme="dark"] .px-theme-toggle .px-theme-dark { display: inline; }

.px-content { padding: 1.4rem; flex: 1 1 auto; }

.px-footer {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.4rem 1.5rem;
    color: var(--px-muted);
    font-size: .78rem;
}

/* --------------------------------------------------------------------------
   Cards, surfaces
   -------------------------------------------------------------------------- */

.px-card {
    background: var(--px-surface);
    border: 1px solid var(--px-line);
    border-radius: var(--px-radius);
    box-shadow: var(--px-shadow-sm);
}

.px-card-pad { padding: 1.1rem 1.2rem; }

.px-card-head {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--px-line-soft);
}

.px-card-head h2 { font-size: .98rem; font-weight: 620; margin: 0; letter-spacing: -.01em; }
.px-card-head .px-card-sub { color: var(--px-muted); font-size: .8rem; margin: 0; }

/* Stat tiles ------------------------------------------------------------- */

.px-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: .85rem; margin-bottom: 1.15rem; }

.px-stat {
    background: var(--px-surface);
    border: 1px solid var(--px-line);
    border-radius: var(--px-radius);
    padding: .95rem 1.05rem;
    box-shadow: var(--px-shadow-sm);
    display: flex; flex-direction: column; gap: .15rem;
}

.px-stat-label { color: var(--px-muted); font-size: .765rem; font-weight: 550; text-transform: uppercase; letter-spacing: .045em; display: flex; align-items: center; gap: .35rem; }
.px-stat-value { font-size: 1.68rem; font-weight: 650; line-height: 1.1; letter-spacing: -.02em; }
.px-stat-foot { color: var(--px-muted); font-size: .785rem; }
.px-stat-accent { color: var(--px-accent); }

/* --------------------------------------------------------------------------
   Pills and badges
   -------------------------------------------------------------------------- */

.px-pill {
    --px-pill: #6c757d;
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .755rem; font-weight: 600; line-height: 1.35;
    padding: .16rem .52rem;
    border-radius: 99px;
    color: var(--px-pill);
    background: color-mix(in srgb, var(--px-pill) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--px-pill) 28%, transparent);
    white-space: nowrap;
}

/* Fallback for browsers without color-mix() support. */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .px-pill { background: transparent; border-color: currentColor; }
}

.px-pill-dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--px-pill); flex: 0 0 auto; }

.px-ref {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: .755rem;
    color: var(--px-muted);
    letter-spacing: -.01em;
}

.px-client-dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.px-table-wrap { overflow-x: auto; border-radius: var(--px-radius); }

.px-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }

.px-table > thead > tr > th {
    background: var(--px-surface-2);
    border-bottom: 1px solid var(--px-line);
    color: var(--px-muted);
    font-size: .735rem;
    font-weight: 620;
    text-transform: uppercase;
    letter-spacing: .045em;
    padding: .62rem .8rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.px-table > tbody > tr > td {
    border-bottom: 1px solid var(--px-line-soft);
    padding: .68rem .8rem;
    vertical-align: middle;
}

.px-table > tbody > tr:last-child > td { border-bottom: 0; }
.px-table > tbody > tr:hover > td { background: var(--px-surface-2); }
.px-table > tbody > tr.px-row-done > td { opacity: .62; }
.px-table > tbody > tr.px-row-selected > td { background: var(--px-accent-soft); }

.px-task-title { font-weight: 550; color: var(--px-text); display: block; line-height: 1.35; }
a.px-task-title:hover { color: var(--px-accent); }
.px-task-meta { color: var(--px-muted); font-size: .775rem; margin-top: .12rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.px-col-tight { width: 1%; white-space: nowrap; }

.px-overdue { color: #d92d20; font-weight: 600; }
[data-bs-theme="dark"] .px-overdue { color: #fda29b; }
.px-duesoon { color: #b54708; font-weight: 600; }
[data-bs-theme="dark"] .px-duesoon { color: #fec84b; }

/* Progress --------------------------------------------------------------- */

.px-progress {
    height: 6px;
    background: var(--px-line-soft);
    border-radius: 99px;
    overflow: hidden;
    min-width: 68px;
}

.px-progress > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--px-accent), var(--px-accent-2));
    border-radius: 99px;
    transition: width .25s ease;
}

.px-progress-done > span { background: #12b76a; }

.px-progress-wrap { display: flex; align-items: center; gap: .5rem; }
.px-progress-num { font-size: .74rem; color: var(--px-muted); font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right; }

/* Inline status select --------------------------------------------------- */

.px-status-select {
    border: 1px solid var(--px-line);
    background: var(--px-surface);
    color: var(--px-text);
    border-radius: 99px;
    font-size: .765rem;
    font-weight: 600;
    padding: .18rem 1.6rem .18rem .6rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9.5 12,15.5 18,9.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .42rem center;
    cursor: pointer;
    max-width: 11rem;
}

.px-status-select:focus { outline: 2px solid var(--px-accent-soft); outline-offset: 1px; border-color: var(--px-accent); }
.px-status-select.px-saving { opacity: .55; }
.px-status-select.px-saved { border-color: #12b76a; }

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */

.px-filters {
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
    padding: .8rem .9rem;
    background: var(--px-surface);
    border: 1px solid var(--px-line);
    border-radius: var(--px-radius);
    box-shadow: var(--px-shadow-sm);
    margin-bottom: 1rem;
}

.px-filters .form-select, .px-filters .form-control { width: auto; min-width: 8.5rem; font-size: .85rem; }
.px-filters .px-search { min-width: 15rem; flex: 1 1 15rem; }
.px-filter-count { color: var(--px-muted); font-size: .8rem; margin-left: auto; white-space: nowrap; }

/* Bulk action bar -------------------------------------------------------- */

.px-bulk {
    position: sticky; bottom: 1rem; z-index: 1030;
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    margin-top: 1rem;
    padding: .7rem .9rem;
    background: var(--px-surface);
    border: 1px solid var(--px-accent);
    border-radius: var(--px-radius);
    box-shadow: var(--px-shadow);
}

.px-bulk-count { font-weight: 620; font-size: .87rem; }
.px-bulk .form-select, .px-bulk .form-control { width: auto; font-size: .83rem; }

/* --------------------------------------------------------------------------
   Settings rows (statuses / work types / priorities)
   -------------------------------------------------------------------------- */

.px-setting-head,
.px-setting-main {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) 4.4rem 5.5rem 4.6rem 5.6rem 4.2rem 5.2rem;
    gap: .6rem;
    align-items: center;
}

.px-setting-head:not(.px-has-flags),
.px-setting-main:not(.px-has-flags) { grid-template-columns: minmax(9rem, 1fr) 4.4rem 5.5rem 4.6rem 4.2rem 5.2rem; }

.px-setting-head {
    padding: .6rem 1.15rem;
    background: var(--px-surface-2);
    border-bottom: 1px solid var(--px-line);
    color: var(--px-muted);
    font-size: .715rem;
    font-weight: 620;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.px-setting-row { border-bottom: 1px solid var(--px-line-soft); }
.px-setting-row:last-of-type { border-bottom: 0; }

.px-setting-main { padding: .7rem 1.15rem .35rem; }
.px-setting-c-name { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.px-setting-c-colour,
.px-setting-c-order,
.px-setting-c-flag,
.px-setting-c-use,
.px-setting-c-act { display: flex; align-items: center; justify-content: center; text-align: center; }
.px-setting-head .px-setting-c-name { justify-content: flex-start; }
.px-setting-c-order .form-control { text-align: center; }
.px-setting-c-use { font-variant-numeric: tabular-nums; font-size: .82rem; }
.px-setting-save-label { display: none; }

.px-setting-extra {
    display: flex; gap: .8rem; align-items: center; flex-wrap: wrap;
    padding: 0 1.15rem .6rem;
    font-size: .8rem;
}

@media (max-width: 767.98px) {
    .px-setting-head { display: none; }
    .px-setting-main,
    .px-setting-main:not(.px-has-flags) {
        grid-template-columns: 1fr auto;
        padding: .85rem 1rem .4rem;
    }
    .px-setting-c-name { grid-column: 1 / -1; }
    .px-setting-save-label { display: inline; }
}

/* --------------------------------------------------------------------------
   Client cards (dashboard)
   -------------------------------------------------------------------------- */

.px-client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; }

.px-client-card {
    background: var(--px-surface);
    border: 1px solid var(--px-line);
    border-radius: var(--px-radius);
    box-shadow: var(--px-shadow-sm);
    padding: 1rem 1.05rem;
    display: flex; flex-direction: column; gap: .7rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow .16s ease, transform .16s ease;
}

.px-client-card:hover { box-shadow: var(--px-shadow); transform: translateY(-1px); }

.px-client-card::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
    background: var(--px-client-colour, var(--px-accent));
}

.px-client-card-head { display: flex; align-items: flex-start; gap: .6rem; }
.px-client-card-head h3 { font-size: .96rem; font-weight: 620; margin: 0; letter-spacing: -.01em; }
.px-client-card-head h3 a { color: inherit; }
.px-client-card-head h3 a:hover { color: var(--px-accent); }
.px-client-card-head .px-ref { font-size: .72rem; }

.px-client-nums { display: flex; gap: 1.1rem; }
.px-client-num { display: flex; flex-direction: column; line-height: 1.2; }
.px-client-num strong { font-size: 1.12rem; font-weight: 650; }
.px-client-num small { color: var(--px-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }

.px-status-bar { display: flex; height: 7px; border-radius: 99px; overflow: hidden; background: var(--px-line-soft); }
.px-status-bar > span { display: block; }

.px-status-legend { display: flex; flex-wrap: wrap; gap: .35rem .7rem; }
.px-status-legend span { display: inline-flex; align-items: center; gap: .3rem; font-size: .755rem; color: var(--px-muted); }
.px-status-legend i { width: .5rem; height: .5rem; border-radius: 50%; display: inline-block; }

/* --------------------------------------------------------------------------
   Task detail
   -------------------------------------------------------------------------- */

.px-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.1rem; align-items: start; }

@media (max-width: 991.98px) {
    .px-detail-grid { grid-template-columns: minmax(0, 1fr); }
}

.px-meta-list { display: flex; flex-direction: column; gap: .05rem; }
.px-meta-row { display: flex; justify-content: space-between; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--px-line-soft); }
.px-meta-row:last-child { border-bottom: 0; }
.px-meta-row dt { color: var(--px-muted); font-size: .8rem; font-weight: 500; margin: 0; flex: 0 0 auto; }
.px-meta-row dd { margin: 0; font-size: .855rem; text-align: right; min-width: 0; }

.px-notes { display: flex; flex-direction: column; gap: .8rem; }

.px-note {
    display: flex; gap: .7rem;
    padding: .85rem .95rem;
    background: var(--px-surface-2);
    border: 1px solid var(--px-line-soft);
    border-radius: var(--px-radius-sm);
}

.px-note-body { min-width: 0; flex: 1 1 auto; }
.px-note-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .2rem; }
.px-note-head strong { font-size: .85rem; font-weight: 620; }
.px-note-head time { color: var(--px-muted); font-size: .755rem; }
.px-note-text { font-size: .885rem; line-height: 1.55; word-break: break-word; }

.px-timeline { display: flex; flex-direction: column; gap: .1rem; }
.px-timeline-item { display: flex; gap: .6rem; padding: .42rem 0; font-size: .8rem; color: var(--px-muted); }
.px-timeline-item .px-icon { margin-top: .12rem; opacity: .7; }
.px-timeline-item strong { color: var(--px-text); font-weight: 600; }

.px-desc { font-size: .9rem; line-height: 1.62; word-break: break-word; }

/* --------------------------------------------------------------------------
   Attachments
   -------------------------------------------------------------------------- */

.px-file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .6rem; }

.px-file {
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem .6rem;
    background: var(--px-surface);
    border: 1px solid var(--px-line);
    border-radius: var(--px-radius-sm);
    min-width: 0;
    transition: border-color .14s ease, box-shadow .14s ease;
}

.px-file:hover { border-color: var(--px-accent); box-shadow: var(--px-shadow-sm); }

.px-file-preview {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 7px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--px-surface-2);
    border: 1px solid var(--px-line-soft);
}

.px-file-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.px-file-ext {
    --px-file: #6b7280;
    font-size: .57rem; font-weight: 700; letter-spacing: .01em;
    color: #fff;
    background: var(--px-file);
    border-radius: 5px;
    padding: .15rem .25rem;
    line-height: 1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
}

.px-file-body { flex: 1 1 auto; min-width: 0; }

.px-file-name {
    display: block;
    font-size: .845rem; font-weight: 550;
    color: var(--px-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.px-file-name:hover { color: var(--px-accent); }

.px-file-meta {
    color: var(--px-muted);
    font-size: .735rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.px-file-actions { display: flex; gap: .25rem; flex: 0 0 auto; }
.px-file-actions .btn { padding: .2rem .4rem; }

.px-file-list-compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .45rem; }
.px-file-list-compact .px-file { background: var(--px-surface); padding: .4rem .5rem; }
.px-file-list-compact .px-file-preview { width: 36px; height: 36px; flex-basis: 36px; }

/* Drop zone -------------------------------------------------------------- */

.px-dropzone { position: relative; }

.px-dropzone-inner {
    display: flex; align-items: center; gap: .8rem;
    width: 100%;
    padding: .95rem 1.05rem;
    border: 1.5px dashed var(--px-line);
    border-radius: var(--px-radius-sm);
    background: var(--px-surface-2);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    margin: 0;
}

.px-dropzone-inner:hover { border-color: var(--px-accent); }
.px-dropzone-inner .px-icon { color: var(--px-muted); flex: 0 0 auto; }

.px-dropzone.px-dragging .px-dropzone-inner {
    border-color: var(--px-accent);
    border-style: solid;
    background: var(--px-accent-soft);
}
.px-dropzone.px-dragging .px-dropzone-inner .px-icon { color: var(--px-accent); }

.px-dropzone-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.px-dropzone-text strong { font-size: .87rem; font-weight: 600; }
.px-dropzone-text small { color: var(--px-muted); font-size: .755rem; word-break: break-word; }

/* Visually hidden but still keyboard reachable through its label. */
.px-dropzone-input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.px-dropzone-actions { display: flex; gap: .4rem; margin-top: .6rem; }

.px-dropzone-chosen, .px-note-chosen { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }

.px-chosen-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .765rem;
    padding: .2rem .5rem;
    border-radius: 99px;
    background: var(--px-accent-soft);
    color: var(--px-accent);
    border: 1px solid color-mix(in srgb, var(--px-accent) 26%, transparent);
    max-width: 100%;
}
.px-chosen-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.px-chosen-chip.px-chosen-bad {
    background: rgba(217, 45, 32, .1);
    color: #d92d20;
    border-color: rgba(217, 45, 32, .35);
}
[data-bs-theme="dark"] .px-chosen-chip.px-chosen-bad { color: #fda29b; }

.px-clip-count {
    display: inline-flex; align-items: center; gap: .18rem;
}

/* --------------------------------------------------------------------------
   "Email the team?" dialog
   -------------------------------------------------------------------------- */

.px-notify-summary {
    background: var(--px-surface-2);
    border: 1px solid var(--px-line-soft);
    border-left: 3px solid var(--px-accent);
    border-radius: var(--px-radius-sm);
    padding: .8rem .95rem;
    margin-bottom: .9rem;
}

.px-notify-headline { font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--px-accent); margin-bottom: .3rem; }
.px-notify-task { font-size: .92rem; font-weight: 580; line-height: 1.4; display: flex; gap: .45rem; flex-wrap: wrap; align-items: baseline; }
.px-notify-detail { font-size: .85rem; color: var(--px-muted); margin-top: .35rem; line-height: 1.5; word-break: break-word; }
.px-notify-to { font-size: .84rem; color: var(--px-muted); display: flex; align-items: center; gap: .4rem; }

/* --------------------------------------------------------------------------
   Email settings
   -------------------------------------------------------------------------- */

.px-mail-log { font-size: .82rem; }
.px-mail-log td { vertical-align: top; }
.px-smtp-log {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .74rem;
    line-height: 1.6;
    background: #10131a;
    color: #cbd5e1;
    border-radius: var(--px-radius-sm);
    padding: .8rem .9rem;
    max-height: 17rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}
.px-smtp-log .px-out { color: #86efac; }
.px-smtp-log .px-in { color: #93c5fd; }
.px-smtp-log .px-note { color: #fcd34d; }

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */

.px-empty { text-align: center; padding: 2.8rem 1.5rem; color: var(--px-muted); }
.px-empty .px-icon { opacity: .35; margin-bottom: .7rem; }
.px-empty h3 { font-size: 1rem; font-weight: 620; color: var(--px-text); margin: 0 0 .3rem; }
.px-empty p { font-size: .875rem; margin: 0 auto .95rem; max-width: 26rem; }

/* --------------------------------------------------------------------------
   Auth pages (login, installer)
   -------------------------------------------------------------------------- */

.px-auth {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(900px 480px at 15% -10%, rgba(99, 102, 241, .16), transparent 60%),
        radial-gradient(760px 440px at 105% 15%, rgba(139, 92, 246, .14), transparent 60%),
        var(--px-page);
}

.px-auth-card {
    width: 100%;
    max-width: 27rem;
    background: var(--px-surface);
    border: 1px solid var(--px-line);
    border-radius: 18px;
    box-shadow: var(--px-shadow);
    padding: 1.9rem;
}

.px-auth-wide { max-width: 44rem; }

.px-auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem; }
.px-auth-brand .px-brand-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; font-size: .9rem; }
.px-auth-brand strong { font-size: 1.12rem; font-weight: 650; display: block; line-height: 1.2; letter-spacing: -.015em; }
.px-auth-brand small { color: var(--px-muted); font-size: .775rem; }

.px-auth-card h1 { font-size: 1.16rem; font-weight: 640; margin-bottom: .25rem; letter-spacing: -.015em; }
.px-auth-card .px-auth-lead { color: var(--px-muted); font-size: .875rem; margin-bottom: 1.3rem; }

/* Installer steps -------------------------------------------------------- */

.px-steps { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.px-step { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--px-muted); }
.px-step i {
    width: 1.35rem; height: 1.35rem; border-radius: 50%;
    background: var(--px-surface-2); border: 1px solid var(--px-line);
    display: inline-flex; align-items: center; justify-content: center;
    font-style: normal; font-size: .72rem; font-weight: 650;
}
.px-step.done i { background: #12b76a; border-color: #12b76a; color: #fff; }
.px-step.active { color: var(--px-text); font-weight: 600; }
.px-step.active i { background: var(--px-accent); border-color: var(--px-accent); color: #fff; }
.px-step-sep { color: var(--px-line); }

.px-check-list { list-style: none; padding: 0; margin: 0; }
.px-check-list li {
    display: flex; align-items: flex-start; gap: .55rem;
    padding: .5rem 0; border-bottom: 1px solid var(--px-line-soft);
    font-size: .865rem;
}
.px-check-list li:last-child { border-bottom: 0; }
.px-check-list .px-ok { color: #12b76a; }
.px-check-list .px-bad { color: #d92d20; }
.px-check-list .px-warn { color: #b54708; }
.px-check-list small { display: block; color: var(--px-muted); font-size: .785rem; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-label { font-size: .82rem; font-weight: 560; margin-bottom: .28rem; }
.form-text { font-size: .785rem; }
.form-control, .form-select { font-size: .89rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--px-accent);
    box-shadow: 0 0 0 3px var(--px-accent-soft);
}

.btn { font-size: .875rem; font-weight: 550; display: inline-flex; align-items: center; gap: .35rem; justify-content: center; }
.btn-sm { font-size: .8rem; }
.btn-primary {
    background: var(--px-accent);
    border-color: var(--px-accent);
}
.btn-primary:hover, .btn-primary:focus {
    background: color-mix(in srgb, var(--px-accent) 86%, #000);
    border-color: color-mix(in srgb, var(--px-accent) 86%, #000);
}
.btn-check:focus + .btn, .btn:focus-visible { box-shadow: 0 0 0 3px var(--px-accent-soft); }

.px-colour-input { width: 3rem; padding: .18rem; height: 2.15rem; }

.px-inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.modal-content { border-radius: var(--px-radius); border-color: var(--px-line); }
.modal-header, .modal-footer { border-color: var(--px-line-soft); }
.modal-title { font-size: 1.02rem; font-weight: 630; }

.px-required::after { content: " *"; color: #d92d20; }

.px-help-card {
    background: var(--px-accent-soft);
    border: 1px solid color-mix(in srgb, var(--px-accent) 26%, transparent);
    border-radius: var(--px-radius-sm);
    padding: .8rem .95rem;
    font-size: .85rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .px-sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--px-shadow);
    }
    .px-sidebar.px-open { transform: translateX(0); }
    .px-sidebar-toggle { display: inline-flex !important; }
    .px-sidebar-backdrop {
        position: fixed; inset: 0;
        background: rgba(16, 24, 40, .45);
        z-index: 1035;
    }
    .px-content { padding: 1.1rem; }
    .px-topbar { padding: .85rem 1.1rem; }
}

@media (max-width: 575.98px) {
    .px-topbar { flex-wrap: wrap; }
    .px-topbar-title h1 { font-size: 1.1rem; }
    .px-topbar-actions { width: 100%; justify-content: flex-start; }
    .px-content { padding: .9rem; }
    .px-filters .px-search { min-width: 100%; }
    .px-filters .form-select, .px-filters .form-control { flex: 1 1 8rem; min-width: 0; }
}

@media print {
    .px-sidebar, .px-topbar-actions, .px-filters, .px-bulk, .px-footer, .px-sidebar-toggle { display: none !important; }
    .px-shell { display: block; }
    body { background: #fff; }
}
