/* =============================================================================
   AddColumnDropdown — add-column-dropdown.css
   Slack-list-style "Add Column" picker
   ============================================================================= */

/* Panel container */
.acd-panel {
    position: fixed !important;
    z-index: 99999 !important;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 10px 24px -4px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* width is set inline by JS (256px) */
    max-height: 520px;
    font-family: inherit;
    font-size: 0.78rem;
    color: #111827;
    /* Animate open */
    animation: acd-pop 0.13s ease both;
}

@keyframes acd-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ---------- Header row ---------- */
.acd-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.6rem 0.55rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.acd-title {
    flex: 1;
    font-size: 0.73rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acd-back,
.acd-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 5px;
    cursor: pointer;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
}

.acd-back:hover,
.acd-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ---------- Search row ---------- */
.acd-search-wrap {
    position: relative;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.acd-search-icon {
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.acd-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.3rem 0.5rem 0.3rem 1.7rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.74rem;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.acd-search:focus {
    border-color: #818cf8;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.22);
}

.acd-search::placeholder {
    color: #9ca3af;
}

/* ---------- Scrollable list ---------- */
.acd-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.3rem 0;
}

/* Custom scrollbar */
.acd-list::-webkit-scrollbar      { width: 4px; }
.acd-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* Group label */
.acd-group-label {
    padding: 0.45rem 0.75rem 0.2rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
    user-select: none;
}

/* Type item button */
.acd-type-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: left;
    padding: 0.37rem 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.1s ease;
    color: #374151;
    font-size: 0.76rem;
    font-family: inherit;
}

.acd-type-item:hover {
    background: #f3f4f6;
}

.acd-type-item:focus-visible {
    background: #ede9fe;
    outline: none;
}

.acd-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: #f3f4f6;
    font-size: 0.7rem;
    flex-shrink: 0;
    color: #6b7280;
    line-height: 1;
}

.acd-type-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acd-no-results {
    padding: 1rem 0.75rem;
    font-size: 0.73rem;
    color: #9ca3af;
    text-align: center;
}

/* ---------- Config panel ---------- */
.acd-config-body {
    padding: 0.65rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    flex: 1;
}

.acd-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.acd-field-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.acd-field-row > div {
    flex: 1;
}

/* Select option builder */
.acd-opt-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 6px;
}
.acd-opt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 4px;
    border-radius: 5px;
    background: transparent;
    transition: background 0.1s;
}
.acd-opt-row:hover { background: #f3f4f6; }
.acd-opt-chip {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.10);
    cursor: pointer;
    flex-shrink: 0;
    outline: 2px solid transparent;
    outline-offset: 1px;
    transition: outline 0.12s, border-color 0.12s;
}
.acd-opt-chip:hover { outline: 2px solid #4f46e5; border-color: transparent; }
.acd-opt-label {
    flex: 1;
    font-size: 0.82rem;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.acd-opt-del {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}
.acd-opt-del:hover { color: #ef4444; }
.acd-opt-add-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.acd-opt-new-input {
    flex: 1;
}

/* Toggle row */
.acd-toggle-row {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 2px 0;
}
.acd-toggle-label {
    flex: 1;
}
.acd-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}
.acd-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.acd-toggle-track {
    display: inline-flex;
    align-items: center;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.18s;
    padding: 2px;
    position: relative;
}
.acd-toggle input:checked + .acd-toggle-track {
    background: #4f46e5;
}
.acd-toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.18s;
    display: block;
}
.acd-toggle input:checked + .acd-toggle-track .acd-toggle-thumb {
    transform: translateX(14px);
}

.acd-label {
    font-size: 0.67rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acd-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #9ca3af;
    font-size: 0.65rem;
}

.acd-input,
.acd-textarea {
    padding: 0.38rem 0.55rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.76rem;
    font-family: inherit;
    color: #111827;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
    resize: none;
}

.acd-input:focus,
.acd-textarea:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.22);
}

.acd-input::placeholder,
.acd-textarea::placeholder {
    color: #9ca3af;
}

/* ---------- Config footer ---------- */
.acd-config-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.acd-cancel {
    padding: 0.3rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    font-size: 0.73rem;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s ease;
}

.acd-cancel:hover {
    background: #f3f4f6;
}

.acd-confirm {
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: #4f46e5;
    font-size: 0.73rem;
    font-family: inherit;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, opacity 0.12s ease;
}

.acd-confirm:hover:not(:disabled) {
    background: #4338ca;
}

.acd-confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ---------- Error state ---------- */
.acd-error {
    margin: 0;
    padding: 0.3rem 0.45rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
    font-size: 0.68rem;
    color: #b91c1c;
}

/* ---------- Table header "+" add button ---------- */
.fleet-add-col-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1.5px dashed #d1d5db;
    border-radius: 5px;
    background: transparent;
    color: #9ca3af;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
    vertical-align: middle;
    padding: 0;
    font-family: inherit;
}

.fleet-add-col-btn:hover {
    border-color: #818cf8;
    color: #4f46e5;
    background: #ede9fe;
}

/* Custom column header cell */
.fleet-th-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.fleet-th-custom-badge {
    display: none;
}
