/* ═══════════════════════════════════════════
   Defense Configurator — Panel & Components
   ═══════════════════════════════════════════ */

#defense-configurator {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-card, rgba(22,27,34,0.95));
    border-left: 1px solid rgba(255,255,255,0.08);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
#defense-configurator.dc-visible {
    transform: translateX(0);
}

/* Header */
.dc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.dc-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #42A5F5;
}
.dc-close {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-dim);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dc-close:hover {
    border-color: #FF1744;
    color: #FF1744;
}

/* Sections */
.dc-section {
    padding: 10px 14px;
}
.dc-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.dc-sublabel {
    font-size: 8px;
    color: var(--text-dim);
    opacity: 0.6;
    margin-bottom: 8px;
}
.dc-divider {
    height: 1px;
    background: rgba(255,255,255,0.04);
    margin: 0 14px;
}
.dc-empty {
    font-size: 9px;
    color: var(--text-dim);
    opacity: 0.5;
    text-align: center;
    padding: 8px 0;
}

/* Buttons */
.dc-btn {
    padding: 6px 12px;
    font-size: 9px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.04em;
}
.dc-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.3);
}
.dc-btn-primary {
    border-color: rgba(66,165,245,0.4);
    color: #42A5F5;
}
.dc-btn-primary:hover {
    background: rgba(66,165,245,0.1);
}
.dc-btn-sm {
    padding: 4px 8px;
    font-size: 8px;
}
.dc-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

/* Object list */
.dc-object-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 120px;
    overflow-y: auto;
}
.dc-obj-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px;
    cursor: default;
}
.dc-obj-active {
    border-color: rgba(66,165,245,0.4);
    background: rgba(66,165,245,0.06);
}
.dc-obj-name {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.dc-obj-active .dc-obj-name {
    color: #42A5F5;
    font-weight: 600;
}
.dc-obj-actions {
    display: flex;
    gap: 4px;
}
.dc-obj-btn {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: none;
    color: var(--text-dim);
    border-radius: 3px;
    cursor: pointer;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dc-obj-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: var(--text-secondary);
}
.dc-obj-delete:hover {
    border-color: #FF1744;
    color: #FF1744;
}

/* System palette */
.dc-system-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}
.dc-ech-label {
    width: 100%;
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    text-align: center;
    padding: 3px 0 2px;
    border-bottom: 1px solid;
    margin: 2px 0;
}
.dc-sys-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
}
.dc-sys-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}
.dc-sys-btn.dc-sys-active {
    border-color: #00E5FF;
    background: rgba(0,229,255,0.08);
    box-shadow: 0 0 6px rgba(0,229,255,0.2);
}
.dc-sys-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dc-sys-code {
    font-size: 8px;
    font-weight: 600;
}
.dc-sys-range {
    font-size: 7px;
    color: var(--text-dim);
}

/* Position list */
.dc-position-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 200px;
    overflow-y: auto;
}
.dc-pos-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 3px;
}
.dc-pos-disabled {
    opacity: 0.4;
}
.dc-pos-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dc-pos-name {
    font-size: 9px;
    font-weight: 600;
    flex: 1;
}
.dc-pos-priority {
    font-size: 7px;
    color: var(--text-dim);
}
.dc-pos-actions {
    display: flex;
    gap: 3px;
}
.dc-pos-btn {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: none;
    color: var(--text-dim);
    border-radius: 3px;
    cursor: pointer;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dc-pos-btn:hover {
    border-color: rgba(255,255,255,0.2);
}

/* Preset list */
.dc-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.dc-preset-btn {
    padding: 4px 8px;
    font-size: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
}
.dc-preset-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.25);
}

/* Group list */
.dc-group-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}
.dc-grp-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
}
.dc-grp-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.dc-grp-name {
    font-size: 9px;
    flex: 1;
}
.dc-grp-btn {
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 8px;
}

/* Status bar */
.dc-status {
    padding: 8px 14px;
    font-size: 8px;
    color: var(--text-dim);
    border-top: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
    margin-top: auto;
}

/* ═══ Responsive ═══ */
@media (max-width: 767px) {
    #defense-configurator {
        width: 85vw;
    }
}
