/* ── Popup Menu (dark popup shell shared by board move-nav + header avatar menu) ── */

.popup-menu {
    background: var(--color-primary);
    border-radius: var(--border-radius-lg) 0 var(--border-radius-lg) var(--border-radius-lg);
    min-width: 190px;
    color: var(--color-white);
}

/* ── Custom Dropdown ───────────────────────────────────────── */

.dropdown {
    position: relative;
    width: 100%;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    background: var(--color-white);
    font-family: 'Inter', sans-serif;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: var(--font-weight-regular);
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    outline: none;
    transition:
        border-color var(--transition-fast),
        border-radius var(--transition-fast),
        box-shadow var(--transition-fast);
}

.dropdown-trigger:hover {
    box-shadow: var(--shadow-default);
}

.dropdown-trigger:focus-visible,
.dropdown-trigger:focus-within {
    border-color: var(--color-accent);
}

/* base.css's `* { font-size: 16px; }` matches this element directly, which
   beats inheriting .dropdown-trigger's clamped size - restore it explicitly. */
.dropdown-value {
    font-size: inherit;
}

.dropdown-placeholder {
    color: var(--color-text-muted);
}

.dropdown-arrow {
    flex-shrink: 0;
    box-sizing: content-box;
    padding: var(--space-2xs);
    border-radius: 50%;
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.dropdown-arrow:hover {
    background-color: var(--color-border);
}

.dropdown.is-open .dropdown-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    box-shadow: none;
}

.dropdown.is-open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    list-style: none;
    margin: 0;
    padding: var(--space-xs) 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: none;
    border-bottom-left-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
    box-shadow: var(--shadow-default);
    z-index: 3;
}

.dropdown.is-open .dropdown-panel {
    display: block;
}

.dropdown-option {
    padding: 10px 20px;
    cursor: pointer;
    font-size: clamp(16px, 4vw, 20px);
    transition: background var(--transition-fast);
}

.dropdown-option:hover {
    background: var(--color-bg);
}

/* Error state */
.input-wrapper.error .dropdown-trigger {
    border-color: var(--color-error);
}

/* ── Assigned Dropdown ─────────────────────────────────────── */

/* Caps the panel to ~5 rows (60px each: 40px avatar + 10px top/bottom
   padding from .dropdown-option) before scrolling, so a large contact
   list doesn't push the dropdown off-screen. */
#assignedList {
    max-height: 300px;
    overflow-y: auto;
}

/* #assignedTrigger's .dropdown-value is a real <input> (not the plain
   <span> other dropdowns use) so contacts can be searched by name -
   reset it to look like inert trigger text instead of a text field. */
#assignedTrigger .dropdown-value {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    font: inherit;
    line-height: 1.5;
    color: inherit;
    cursor: text;
}

#assignedTrigger .dropdown-value::placeholder {
    color: var(--color-text-muted);
}

.assigned-option.is-filtered {
    display: none;
}

.assigned-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.assigned-option.selected {
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--border-radius-md);
    margin: var(--space-xs) var(--space-2xs);
    padding: var(--space-2xs) 12px;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25);
}

.assigned-option.selected .contact-avatar {
    box-shadow: 0 0 0 2px var(--color-white);
}

.assigned-option.selected .contact-checkbox {
    filter: brightness(0) invert(1);
}

.assigned-option:active {
    background: var(--color-primary-dark);
    color: var(--color-white);
    border-radius: var(--border-radius-md);
}

.contact-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    user-select: none;
}

.contact-name {
    flex: 1;
}

.contact-checkbox {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    pointer-events: none;
}

.assigned-chips {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    flex-wrap: wrap;
    min-height: 40px;
    margin-top: var(--space-xs);
}

.assigned-chips .contact-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.contact-avatar-more {
    background: var(--color-primary);
}
