/*
 * CrawlHub 사이드바 관리 편집기 스타일.
 * 드래그 손잡이, 항목 행 레이아웃, 표시/제외 스위치.
 */

.civ-admin-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
}

/* 그룹 카드 */
.civ-group.civ-dragging {
    opacity: 0.5;
    outline: 2px dashed #f47a20;
}

.civ-group-header {
    background: rgba(244, 122, 32, 0.06);
}

.civ-group-name {
    max-width: 260px;
    font-weight: 600;
}

.civ-group-disabled .civ-group-body {
    opacity: 0.45;
}

.civ-group-disabled .civ-group-header {
    background: rgba(0, 0, 0, 0.04);
}

/* 항목 행 */
.civ-item-list {
    min-height: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.civ-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--chart-border, #ecf3fa);
    border-radius: 8px;
    background: var(--white, #fff);
    transition: box-shadow 0.15s ease, opacity 0.15s ease;
}

.civ-item:hover {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.civ-item.civ-dragging {
    opacity: 0.4;
    border-style: dashed;
    border-color: #f47a20;
}

.civ-item.civ-disabled {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.02);
}

/* 드래그 손잡이 */
.civ-handle {
    cursor: grab;
    color: #9aa0a6;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    user-select: none;
    flex: 0 0 auto;
}

.civ-handle:active {
    cursor: grabbing;
}

.civ-group-handle {
    font-size: 20px;
}

/* 입력 필드 폭 배분 */
.civ-item .civ-label {
    flex: 1 1 30%;
    min-width: 120px;
}

.civ-item .civ-href {
    flex: 2 1 40%;
    min-width: 160px;
    font-family: monospace;
    font-size: 12px;
}

.civ-item .civ-icon {
    flex: 0 0 auto;
    width: 120px;
}

.civ-item .civ-del {
    flex: 0 0 auto;
}

/* 표시/제외 토글 스위치 */
.civ-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: 0 0 auto;
    margin: 0;
}

.civ-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.civ-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #c8ccd1;
    border-radius: 22px;
    transition: background 0.15s ease;
}

.civ-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.civ-switch input:checked + .civ-slider {
    background: #22c55e;
}

.civ-switch input:checked + .civ-slider::before {
    transform: translateX(18px);
}

@media (max-width: 768px) {
    .civ-item {
        flex-wrap: wrap;
    }
    .civ-item .civ-href,
    .civ-item .civ-label {
        flex: 1 1 100%;
    }
}
