/* Multi-select dropdown used by the table filter rows. */
.ms { position: relative; width: 100%; }

.ms-trigger {
    width: 100%; box-sizing: border-box;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    border: 1px solid #d9dde3; border-radius: 8px; background: #fff; cursor: pointer;
    padding: 7px 8px 7px 10px; font-size: .82rem; color: var(--ink); text-align: left;
}
.ms-trigger:hover { border-color: #c4c9d1; }
.ms-trigger.is-open, .ms-trigger:focus-visible {
    outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(122, 31, 43, .12);
}
.ms-trigger__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-trigger__caret { font-size: 18px; color: #6b7280; flex: none; }
.ms-trigger.is-open .ms-trigger__caret { transform: rotate(180deg); }

.ms-backdrop { position: fixed; inset: 0; z-index: 3400; background: transparent; }

.ms-panel {
    position: fixed; z-index: 3500;
    max-width: 340px; background: #fff;
    border: 1px solid #e3e6ea; border-radius: 10px;
    box-shadow: 0 12px 32px rgba(20, 20, 40, .18); padding: 8px 0;
}
.ms-search {
    display: flex; align-items: center; gap: 6px; margin: 0 8px 6px;
    border: 1px solid #d9dde3; border-radius: 8px; padding: 0 8px;
}
.ms-search .material-symbols-rounded { font-size: 18px; color: #8a8f99; }
.ms-search input { flex: 1; min-width: 0; border: none; outline: none; padding: 7px 0; font-size: .84rem; background: transparent; }
.ms-search:focus-within { border-color: var(--primary-color); }

.ms-list { max-height: 240px; overflow-y: auto; }
.ms-option {
    display: flex; align-items: center; gap: 9px; margin: 0; cursor: pointer;
    padding: 7px 14px; font-size: .86rem; color: var(--ink);
}
.ms-option:hover { background: #faf3f5; }
.ms-option span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-option input[type="checkbox"] { accent-color: var(--primary-color); width: 15px; height: 15px; flex: none; margin: 0; }
.ms-option--all { font-weight: 700; border-bottom: 1px solid #f0eaec; margin-bottom: 4px; }
.ms-empty { padding: 12px 14px; font-size: .84rem; color: #8a8f99; text-align: center; }

/* A frozen (sticky) table cell is its own stacking context, so an open panel inside it
   would be painted over by the sticky cells of the rows below. Lift that cell while open. */
:has(> .ms > .ms-panel) { z-index: 60 !important; }

/* Inputs inside the panel must ignore the table/filter input styles (.bud-fl input, .dp-field input). */
.ms-panel .ms-search input {
    width: auto; min-width: 0; box-sizing: border-box;
    border: none; border-radius: 0; box-shadow: none; background: transparent;
    padding: 7px 0; font-size: .84rem;
}
.ms-panel .ms-search input:focus { border: none; box-shadow: none; }
.ms-panel input[type="checkbox"] {
    width: 15px; height: 15px; min-width: 0; padding: 0; border: none; box-shadow: none;
    background: transparent; accent-color: var(--primary-color); flex: none; margin: 0;
}
