/* Album Tree Picker — grande modale centrée avec arbre scrollable */
.atp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.atp-overlay.open { display: flex; }

.atp-modal {
    background: var(--bg-card, var(--bg-secondary, #1f2937));
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.atp-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}
.atp-title {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.atp-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
}
.atp-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.atp-search {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}
.atp-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input, var(--bg-primary));
    color: var(--text-primary);
    font-size: 0.95rem;
}
.atp-search input:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
}

.atp-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 0;
}
.atp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary);
    font-size: 0.92rem;
    border-left: 3px solid transparent;
}
.atp-item:hover {
    background: var(--bg-hover);
    border-left-color: var(--accent, #3b82f6);
}
.atp-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.atp-item.disabled:hover {
    background: transparent;
    border-left-color: transparent;
}
.atp-item-icon { flex: 0 0 auto; opacity: 0.8; }
.atp-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atp-item-count {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}
.atp-item mark {
    background: rgba(255, 235, 59, 0.4);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.atp-root {
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.atp-empty {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.atp-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.atp-footer-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Champ de formulaire (via AlbumTreePicker.bindField) */
.atp-field {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
}
.atp-field-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-input, var(--bg-primary));
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.atp-field-btn:hover {
    border-color: var(--accent, #3b82f6);
}
.atp-field-btn::before {
    content: '📁';
    flex: 0 0 auto;
}
.atp-field-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.atp-field-label.atp-field-empty {
    color: var(--text-muted);
}
.atp-field-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    display: none;
}
.atp-field-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
