/* ═══════════════════════════════════════════════════════════════
   DITWAH — shared filter command deck
   Reusable visual layer for table filter panels. Behaviour stays in
   each page; this file only supplies the professional shell, quick
   chips, search capsule, labelled fields and active-filter trail.
   ═══════════════════════════════════════════════════════════════ */

.fd-shell {
    --fd-accent: #059669;
    --fd-accent-dark: #047857;
    --fd-accent-soft: #ecfdf5;
    --fd-accent-rgb: 5, 150, 105;
    position: relative;
    padding: 1rem 1.2rem 1.05rem;
    border-bottom: 1px solid #e4edf3;
    background:
        radial-gradient(760px 260px at 0% 0%, rgba(var(--fd-accent-rgb), .10), transparent 68%),
        radial-gradient(560px 230px at 100% 0%, rgba(14, 165, 233, .07), transparent 72%),
        linear-gradient(180deg, #ffffff 0%, #fbfefd 55%, #f6fbf9 100%);
    overflow: hidden;
}
.fd-shell::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--fd-accent) 0%, var(--fd-accent-dark) 52%, #0ea5e9 100%);
}
/* Allow custom dropdown panels (e.g. the contractor combo) to escape the deck. */
.fd-shell--dropdown { overflow: visible; }
[data-table-scope][aria-busy="true"] > .fd-shell::after,
.fd-shell[aria-busy="true"]::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(var(--fd-accent-rgb), .9), transparent);
    animation: fdScan 1s linear infinite;
}
@keyframes fdScan {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ── Header: identity + quick chips ── */
.fd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
    margin-bottom: .8rem;
}
.fd-title-wrap {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}
.fd-badge {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: .68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fd-accent-dark);
    font-size: .84rem;
    background: linear-gradient(135deg, #fff, var(--fd-accent-soft));
    border: 1px solid rgba(var(--fd-accent-rgb), .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 6px 14px -12px rgba(var(--fd-accent-rgb), .9);
}
.fd-eyebrow {
    margin: 0;
    font-size: .58rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--fd-accent);
}
.fd-status {
    margin: .24rem 0 0;
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.2;
    color: #64748b;
}
.fd-status strong {
    color: #0f172a;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.fd-active-pill {
    display: inline-flex;
    align-items: center;
    gap: .34rem;
    height: 1.24rem;
    padding: 0 .5rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--fd-accent-rgb), .28);
    background: var(--fd-accent-soft);
    color: var(--fd-accent-dark);
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}
.fd-active-pill .dot {
    width: .34rem;
    height: .34rem;
    border-radius: 50%;
    background: var(--fd-accent);
    box-shadow: 0 0 0 3px rgba(var(--fd-accent-rgb), .14);
}

.fd-quick-filters {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .28rem;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    background: rgba(255, 255, 255, .76);
    box-shadow: inset 0 1px 0 #fff, 0 8px 18px -17px rgba(15, 23, 42, .55);
}
.fd-quick-filters::-webkit-scrollbar { display: none; }
.fd-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .43rem .68rem;
    border: 1px solid transparent;
    border-radius: .62rem;
    color: #64748b;
    font-size: .71rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
    transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.fd-quick-chip::before {
    content: "";
    width: .35rem;
    height: .35rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background .18s ease;
}
.fd-quick-chip--progress::before { background: #38bdf8; }
.fd-quick-chip--delay::before { background: #f59e0b; }
.fd-quick-chip--done::before { background: #10b981; }
.fd-quick-chip:hover {
    color: #0f172a;
    background: #f1f5f9;
    text-decoration: none;
}
.fd-quick-chip .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.28rem;
    height: 1.28rem;
    padding: 0 .34rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    color: #64748b;
    font-size: .61rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.fd-quick-chip.is-active {
    color: #fff;
    border-color: var(--fd-accent-dark);
    background: linear-gradient(135deg, var(--fd-accent-dark), var(--fd-accent));
    box-shadow: 0 7px 16px -9px rgba(var(--fd-accent-rgb), .9);
}
.fd-quick-chip.is-active::before { background: rgba(255, 255, 255, .92); }
.fd-quick-chip.is-active .count {
    color: #fff;
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .25);
}
.fd-quick-chip--progress.is-active {
    border-color: #0284c7;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    box-shadow: 0 7px 16px -9px rgba(2, 132, 199, .9);
}
.fd-quick-chip--delay.is-active {
    border-color: #d97706;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 7px 16px -9px rgba(217, 119, 6, .9);
}
.fd-quick-chip--done.is-active {
    border-color: #0f766e;
    background: linear-gradient(135deg, #0f766e, #10b981);
}
.fd-quick-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--fd-accent-rgb), .25);
}

/* ── Search + clear ── */
.fd-form { margin: 0; }
.fd-search-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .8rem;
}
.fd-search {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.fd-search > i {
    position: absolute;
    left: .92rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fd-accent);
    font-size: .88rem;
    pointer-events: none;
}
.fd-search-input {
    width: 100%;
    height: 2.85rem;
    padding: 0 5.6rem 0 2.55rem;
    border: 1px solid #dbe5ee;
    border-radius: .9rem;
    background: linear-gradient(180deg, #fff, #fbfdfc);
    color: #0f172a;
    font-size: .82rem;
    font-weight: 500;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .035), 0 1px 0 #fff;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.fd-search-input::placeholder { color: #94a3b8; font-weight: 400; }
.fd-search-input:hover { border-color: #cbd5e1; }
.fd-search-input:focus {
    outline: none;
    border-color: var(--fd-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--fd-accent-rgb), .11), inset 0 1px 2px rgba(15, 23, 42, .02);
}
.fd-search-hint {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    height: 1.55rem;
    padding: 0 .52rem;
    border: 1px solid #e2e8f0;
    border-radius: .45rem;
    background: #f8fafc;
    color: #94a3b8;
    font-size: .59rem;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
    pointer-events: none;
}
.fd-search-clear {
    position: absolute;
    right: .58rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.62rem;
    height: 1.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #f8fafc;
    color: #94a3b8;
    text-decoration: none;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.fd-search-clear:hover {
    color: #be123c;
    background: #fff1f2;
    border-color: #fecdd3;
}
.fd-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 2.85rem;
    padding: 0 .9rem;
    flex-shrink: 0;
    border: 1px solid #fecdd3;
    border-radius: .9rem;
    background: #fff;
    color: #be123c;
    text-decoration: none;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1px 0 #fff;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.fd-clear-btn:hover {
    background: #fff1f2;
    border-color: #fda4af;
    color: #9f1239;
    box-shadow: 0 8px 16px -14px rgba(190, 18, 60, .7);
}
.fd-clear-btn .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .32rem;
    border-radius: 999px;
    background: #ffe4e6;
    color: #be123c;
    font-size: .61rem;
    font-weight: 800;
}
.fd-clear-btn.hidden,
.fd-active-pill.hidden,
.fd-active-trail.hidden,
.fd-search-hint.hidden { display: none !important; }
.fd-clear-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, .25);
}

/* ── Labelled field cards ── */
.fd-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: .55rem;
    margin-bottom: .72rem;
}
.fd-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
    padding: .5rem .62rem .56rem;
    border: 1px solid #e3ebf3;
    border-radius: .75rem;
    background: linear-gradient(180deg, #fff, #fbfdfe);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .95);
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}
.fd-field:hover {
    border-color: rgba(var(--fd-accent-rgb), .35);
    background: #fff;
    box-shadow: 0 8px 18px -16px rgba(var(--fd-accent-rgb), .65);
}
.fd-field:focus-within {
    border-color: var(--fd-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--fd-accent-rgb), .11);
}
.fd-field-label {
    display: flex;
    align-items: center;
    gap: .3rem;
    color: #7c8ba1;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
    line-height: 1;
}
.fd-field-label i { color: var(--fd-accent); font-size: .62rem; }
.fd-field-control {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}
.fd-select {
    width: 100%;
    min-width: 0;
    padding: 0 1.2rem 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e293b;
    font-size: .76rem;
    font-weight: 600;
    text-overflow: ellipsis;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.fd-field-control::after {
    content: "";
    position: absolute;
    right: .08rem;
    top: 50%;
    width: .4rem;
    height: .4rem;
    pointer-events: none;
    border-right: 1.5px solid #94a3b8;
    border-bottom: 1.5px solid #94a3b8;
    transform: translateY(-68%) rotate(45deg);
    transition: border-color .15s ease;
}
.fd-field:hover .fd-field-control::after { border-color: var(--fd-accent); }
.fd-select:focus-visible { outline: none; }
/* Long native dropdown lists (e.g. contractors) render their popup text flush
   against the left edge. Chrome passes the select's own left padding through
   to the popup, so reserve a little inset while keeping the closed value
   aligned with the field label. */
.fd-field--popup-inset { padding-left: .25rem; }
.fd-field--popup-inset .fd-field-label { padding-left: .37rem; }
.fd-field--popup-inset .fd-select { padding-left: .37rem; }
.fd-field-control input[type="text"] {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e293b;
    font-size: .76rem;
    font-weight: 600;
}
/* Button-based select (custom combo). Suppress the decorative chevron so the
   control's own interactive chevron remains the only one. */
.fd-field-control--combo::after { display: none; }
.fd-combo-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e293b;
    font-size: .76rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.fd-combo-btn:focus-visible { outline: none; }
.fd-combo-btn > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Performance controls + result summary ── */
.fd-lower {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.fd-progress-block {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}
.fd-progress-inputs {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .26rem .38rem .26rem .42rem;
    border: 1px solid #e3ebf3;
    border-radius: .62rem;
    background: linear-gradient(180deg, #fff, #fbfdfe);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.fd-progress-inputs:focus-within {
    border-color: var(--fd-accent);
    box-shadow: 0 0 0 3px rgba(var(--fd-accent-rgb), .11);
}
.fd-progress-input {
    width: 2.55rem;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e293b;
    font-size: .74rem;
    font-weight: 700;
    text-align: center;
}
.fd-progress-input::placeholder { color: #b6c2d1; font-weight: 600; }
.fd-progress-dash { color: #cbd5e1; font-size: .68rem; }
.fd-progress-pct { padding-right: .12rem; color: #94a3b8; font-size: .65rem; font-weight: 700; }
.fd-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .24rem .52rem .24rem .28rem;
    border: 1px solid #e3ebf3;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.fd-switch:hover {
    border-color: #fcd34d;
    background: #fffdf5;
    box-shadow: 0 8px 18px -17px rgba(217, 119, 6, .8);
}
.fd-switch-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}
.fd-switch-track {
    position: relative;
    width: 2.02rem;
    height: 1.13rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .09);
    transition: background .18s ease;
}
.fd-switch-knob {
    position: absolute;
    top: .145rem;
    left: .145rem;
    width: .84rem;
    height: .84rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
    transition: transform .18s cubic-bezier(.4, 0, .2, 1);
}
.fd-switch-input:checked + .fd-switch-track {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.fd-switch-input:checked + .fd-switch-track .fd-switch-knob { transform: translateX(.89rem); }
.fd-switch-input:focus-visible + .fd-switch-track { box-shadow: 0 0 0 3px rgba(245, 158, 11, .24); }
.fd-switch-text {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #475569;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
}
.fd-switch-text i { color: #d97706; font-size: .7rem; }
.fd-result-hint {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    margin-left: auto;
    color: #94a3b8;
    font-size: .66rem;
    font-weight: 600;
    white-space: nowrap;
}
.fd-result-hint strong {
    color: #475569;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.fd-result-hint .dot {
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}
.fd-result-hint .dot.is-live {
    background: var(--fd-accent);
    box-shadow: 0 0 0 3px rgba(var(--fd-accent-rgb), .14);
}

/* ── Active filter trail ── */
.fd-active-trail {
    display: flex;
    align-items: center;
    gap: .42rem;
    flex-wrap: wrap;
    margin-top: .78rem;
    padding-top: .72rem;
    border-top: 1px dashed #dbe7e2;
    animation: fdTrailIn .24s ease both;
}
@keyframes fdTrailIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.fd-active-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-right: .12rem;
    color: #94a3b8;
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.fd-active-label i { color: var(--fd-accent); }
.fd-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .36rem;
    height: 1.68rem;
    max-width: 100%;
    padding: 0 .28rem 0 .58rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: .65rem;
    font-weight: 600;
    box-shadow: 0 2px 7px -6px rgba(15, 23, 42, .45);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.fd-filter-chip:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 14px -11px rgba(15, 23, 42, .55);
}
.fd-filter-chip .chip-icon { font-size: .63rem; flex-shrink: 0; }
.fd-filter-chip .chip-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fd-filter-chip strong { font-weight: 800; }
.fd-filter-chip .chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .75);
    color: #94a3b8;
    text-decoration: none;
    transition: color .15s ease, background .15s ease;
}
.fd-filter-chip .chip-x:hover { color: #be123c; background: #ffe4e6; }
.fd-filter-chip--search { border-color: #dbe3ff; background: #f5f7ff; color: #3f4c86; }
.fd-filter-chip--search .chip-icon { color: #6366f1; }
.fd-filter-chip--place { border-color: #d8eefb; background: #f0f9ff; color: #245b7a; }
.fd-filter-chip--place .chip-icon { color: #0ea5e9; }
.fd-filter-chip--people { border-color: #ecdcfb; background: #faf5ff; color: #6b3f86; }
.fd-filter-chip--people .chip-icon { color: #8b5cf6; }
.fd-filter-chip--perf { border-color: #fde9bd; background: #fffbeb; color: #8a5a12; }
.fd-filter-chip--perf .chip-icon { color: #d97706; }
.fd-filter-chip--progress { border-color: #c7f5e3; background: #ecfdf5; color: #0b6b54; }
.fd-filter-chip--progress .chip-icon { color: #059669; }
.fd-filter-chip--kpi { border-color: #dbe3ff; background: #eef2ff; color: #4338ca; }
.fd-filter-chip--kpi .chip-icon { color: #6366f1; }

/* ── Responsive ── */
@media (max-width: 767.98px) {
    .fd-shell { padding: .9rem 1rem .95rem; }
    .fd-head { align-items: flex-start; }
    .fd-quick-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
    }
    .fd-quick-chip { justify-content: space-between; }
    .fd-result-hint { margin-left: 0; }
}
@media (max-width: 479.98px) {
    .fd-search-hint { display: none; }
    .fd-search-input { padding-right: 2.6rem; }
    .fd-search-input:placeholder-shown { padding-right: 1rem; }
    .fd-lower { gap: .55rem; }
    .fd-clear-btn { padding: 0 .72rem; gap: .32rem; }
}
@media (prefers-reduced-motion: reduce) {
    .fd-shell,
    .fd-quick-chip,
    .fd-field,
    .fd-active-trail,
    .fd-switch-knob { animation: none !important; transition: none !important; }
}

/* ── Dark mode ── */
html.dark .fd-shell {
    border-color: #1e293b;
    background:
        radial-gradient(760px 260px at 0% 0%, rgba(var(--fd-accent-rgb), .13), transparent 68%),
        radial-gradient(560px 230px at 100% 0%, rgba(14, 165, 233, .09), transparent 72%),
        linear-gradient(180deg, #111c2e 0%, #0f172a 100%);
}
html.dark .fd-eyebrow { color: var(--fd-accent); }
html.dark .fd-badge {
    color: #a7f3d0;
    background: rgba(var(--fd-accent-rgb), .12);
    border-color: rgba(var(--fd-accent-rgb), .28);
}
html.dark .fd-status { color: #94a3b8; }
html.dark .fd-status strong { color: #e2e8f0; }
html.dark .fd-active-pill {
    color: #6ee7b7;
    background: rgba(var(--fd-accent-rgb), .12);
    border-color: rgba(var(--fd-accent-rgb), .28);
}
html.dark .fd-quick-filters {
    background: rgba(15, 23, 42, .55);
    border-color: #334155;
}
html.dark .fd-quick-chip { color: #94a3b8; }
html.dark .fd-quick-chip:not(.is-active):hover { color: #f1f5f9; background: #1e293b; }
html.dark .fd-quick-chip .count {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
html.dark .fd-quick-chip.is-active,
html.dark .fd-quick-chip.is-active:hover { color: #fff; }
html.dark .fd-quick-chip--all.is-active,
html.dark .fd-quick-chip--all.is-active:hover {
    border-color: var(--fd-accent-dark);
    background: linear-gradient(135deg, var(--fd-accent-dark), var(--fd-accent));
}
html.dark .fd-quick-chip.is-active .count,
html.dark .fd-quick-chip.is-active:hover .count {
    color: #fff;
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .25);
}
html.dark .fd-search-input {
    background: #111c2e;
    border-color: #334155;
    color: #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
}
html.dark .fd-search-input:hover { border-color: #475569; }
html.dark .fd-search-hint,
html.dark .fd-search-clear {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}
html.dark .fd-clear-btn {
    background: rgba(190, 18, 60, .08);
    border-color: rgba(251, 113, 133, .32);
    color: #fda4af;
}
html.dark .fd-clear-btn .count { background: rgba(190, 18, 60, .22); color: #fecdd3; }
html.dark .fd-field { background: #111c2e; border-color: #334155; }
html.dark .fd-field:hover,
html.dark .fd-field:focus-within { background: #16243a; border-color: var(--fd-accent-dark); }
html.dark .fd-field-label { color: #94a3b8; }
html.dark .fd-select,
html.dark .fd-field-control input[type="text"] { color: #e2e8f0; }
html.dark .fd-select option { background: #0f172a; color: #e2e8f0; }
html.dark .fd-progress-inputs { background: #111c2e; border-color: #334155; }
html.dark .fd-progress-input { color: #e2e8f0; }
html.dark .fd-switch { background: #111c2e; border-color: #334155; }
html.dark .fd-switch:hover { background: #16243a; border-color: #92400e; }
html.dark .fd-switch-track { background: #334155; }
html.dark .fd-switch-text { color: #cbd5e1; }
html.dark .fd-result-hint { color: #64748b; }
html.dark .fd-result-hint strong { color: #cbd5e1; }
html.dark .fd-active-trail { border-color: #1e293b; }
html.dark .fd-active-label { color: #64748b; }
html.dark .fd-filter-chip { border-color: #334155; background: #1e293b; color: #cbd5e1; }
html.dark .fd-filter-chip .chip-x { background: rgba(15, 23, 42, .7); color: #94a3b8; }
html.dark .fd-filter-chip .chip-x:hover { background: rgba(190, 18, 60, .22); color: #fecdd3; }

/* ═══════════════════════════════════════════════════════════════
   Multi-select checkbox dropdowns
   Shared by every filter deck. Behaviour lives in filter-multi.js;
   the visible styling intentionally mirrors the Awarded card.
   ═══════════════════════════════════════════════════════════════ */
.fd-field--multi {
    z-index: 6;
    cursor: default;
}
.fd-field--multi.fd-multi-open-field {
    z-index: 45;
}
.fd-field--multi .fd-field-label { cursor: default; }
.fd-multi { position: relative; min-width: 0; }
.fd-multi-toggle {
    display: flex;
    align-items: center;
    gap: .3rem;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e293b;
    font: inherit;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}
.fd-multi-toggle:focus-visible { outline: none; }
.fd-multi-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fd-multi-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.02rem;
    height: 1.02rem;
    padding: 0 .26rem;
    border: 1px solid rgba(var(--fd-accent-rgb, 5, 150, 105), .4);
    border-radius: 999px;
    background: rgba(var(--fd-accent-rgb, 5, 150, 105), .13);
    color: var(--fd-accent-dark, #047857);
    font-size: .55rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.fd-multi-badge[hidden] { display: none; }
.fd-multi-chevron {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: .56rem;
    transition: transform .18s ease, color .18s ease;
}
.fd-multi.is-open .fd-multi-chevron {
    color: var(--fd-accent, #059669);
    transform: rotate(180deg);
}
.fd-multi.is-open .fd-multi-toggle { color: var(--fd-accent-dark, #047857); }
.fd-multi-menu {
    position: absolute;
    z-index: 120;
    top: calc(100% + .42rem);
    left: 0;
    width: max-content;
    min-width: 14rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: .32rem;
    border: 1px solid #d7e5ef;
    border-radius: .72rem;
    background: #fff;
    box-shadow: 0 24px 48px -20px rgba(15, 23, 42, .48), 0 2px 6px -3px rgba(15, 23, 42, .12);
    text-align: left;
}
.fd-multi-menu[hidden] { display: none; }
.fd-multi-list {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    max-height: 15rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: .08rem;
}
.fd-multi-option {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    margin: 0;
    padding: .4rem .45rem;
    border-radius: .45rem;
    color: #334155;
    font-size: .73rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
}
.fd-multi-option[hidden] { display: none; }
.fd-multi-option:hover {
    background: rgba(var(--fd-accent-rgb, 5, 150, 105), .09);
    color: var(--fd-accent-dark, #047857);
}
.fd-multi-option input {
    flex: 0 0 auto;
    margin: .11rem 0 0;
    accent-color: var(--fd-accent, #059669);
    cursor: pointer;
}
.fd-multi-option span { min-width: 0; overflow-wrap: anywhere; }
.fd-multi-empty {
    padding: .55rem .45rem;
    color: #94a3b8;
    font-size: .7rem;
    font-style: italic;
}
.fd-multi-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    margin-top: .3rem;
    padding: .34rem .16rem .08rem;
    border-top: 1px solid #eef3f7;
}
.fd-multi-clear,
.fd-multi-apply {
    border: 0;
    border-radius: .48rem;
    padding: .36rem .62rem;
    font-size: .66rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}
.fd-multi-clear { background: transparent; color: #64748b; }
.fd-multi-clear:hover { background: #f1f5f9; color: #334155; }
.fd-multi-apply {
    background: var(--fd-accent, #059669);
    color: #fff;
    box-shadow: 0 8px 16px -10px rgba(var(--fd-accent-rgb, 5, 150, 105), .9);
}
.fd-multi-apply:hover { background: var(--fd-accent-dark, #047857); }
.fd-shell.fd-multi-open {
    z-index: 25;
    overflow: visible;
}
.fd-multi-host-open { overflow: visible !important; }

html.dark .fd-multi-toggle { color: #e2e8f0; }
html.dark .fd-multi.is-open .fd-multi-toggle { color: #6ee7b7; }
html.dark .fd-multi-badge {
    background: rgba(var(--fd-accent-rgb, 5, 150, 105), .22);
    border-color: rgba(var(--fd-accent-rgb, 5, 150, 105), .45);
    color: #6ee7b7;
}
html.dark .fd-multi-chevron { color: #64748b; }
html.dark .fd-multi.is-open .fd-multi-chevron { color: #34d399; }
html.dark .fd-multi-menu {
    background: #0f172a;
    border-color: #1e3a5f;
    box-shadow: 0 26px 52px -20px rgba(0, 0, 0, .9), 0 2px 6px -3px rgba(0, 0, 0, .7);
}
html.dark .fd-multi-option { color: #cbd5e1; }
html.dark .fd-multi-option:hover { background: #132a3f; color: #6ee7b7; }
html.dark .fd-multi-empty { color: #64748b; }
html.dark .fd-multi-actions { border-top-color: #1e3a5f; }
html.dark .fd-multi-clear { color: #94a3b8; }
html.dark .fd-multi-clear:hover { background: #1e293b; color: #e2e8f0; }
html.dark .fd-multi-apply { background: var(--fd-accent-dark, #047857); color: #fff; }

@media (max-width: 640px) {
    .fd-multi-menu {
        min-width: 12rem;
        max-width: calc(100vw - 1.6rem);
    }
}
@media (prefers-reduced-motion: reduce) {
    .fd-multi-chevron { transition: none !important; }
}
