/* ═══════════════════════════════════════════════════════════════
   관리자 공용 커스텀 드롭다운 (<select> 대체)
   ---------------------------------------------------------------
   OS 기본 select 는 폰트·높이·옵션 스타일을 브라우저가 정해버려서
   관리자 폼과 어긋난다. 마크업/스타일을 우리가 쥐는 대체 컴포넌트.
   dropdown.js 의 $.fn.ddSelect 가 이 마크업을 만든다.
   ═══════════════════════════════════════════════════════════════ */
.dd {
    position: relative;
    width: 100%;
    user-select: none;
    font-family: 'Paperlogy', sans-serif;
}

.dd-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dd-toggle:hover {
    border-color: #c7d2fe;
}

.dd-toggle:focus-visible {
    outline: none;
    border-color: #5d66ff;
}

.dd.is-open .dd-toggle {
    border-color: #5d66ff;
}

.dd-toggle.is-placeholder .dd-label {
    color: #9ca3af;
}

.dd-toggle:disabled {
    cursor: not-allowed;
    background: #f9fafb;
    color: #9ca3af;
}

.dd-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dd-label small {
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}

.dd-caret {
    flex-shrink: 0;
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.25s ease;
}

.dd.is-open .dd-caret {
    transform: rotate(180deg);
    color: #5d66ff;
}

.dd-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    z-index: 1200;
    display: none;
}

/* 아래 공간이 부족하면 위로 펼친다 */
.dd.is-up .dd-menu {
    top: auto;
    bottom: calc(100% + 6px);
}

.dd.is-open .dd-menu {
    display: block;
}

.dd-option {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dd-option small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}

.dd-option:hover,
.dd-option.is-active {
    background: #f5f6ff;
    color: #5d66ff;
}

.dd-option:hover small,
.dd-option.is-active small {
    color: #8b93ff;
}

.dd-option.is-selected {
    background: rgba(93, 102, 255, 0.1);
    color: #5d66ff;
    font-weight: 600;
}

.dd-empty {
    padding: 12px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

/* 폼 밀도가 높은 화면(DQGS 리포트 작성 등)에서 쓰는 축소형 */
.dd.dd-compact .dd-toggle {
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 14px;
}

.dd.dd-compact .dd-menu {
    border-radius: 9px;
}
