/* ─── DWL Preloader Admin ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.dwl-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    background: #f0f2f5;
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Header */
.dwl-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -8px -20px 30px;
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
}
.dwl-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}
.dwl-logo .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    opacity: 0.9;
    animation: dwl-spin 3s linear infinite;
}
@keyframes dwl-spin { to { transform: rotate(360deg); } }
.dwl-logo h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.dwl-logo p {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.85;
    color: #fff;
}

/* Notice */
.dwl-notice {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* Layout */
.dwl-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 0 10px;
}
@media (max-width: 960px) {
    .dwl-content { grid-template-columns: 1fr; }
}

/* Card */
.dwl-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    margin-bottom: 20px;
}
.dwl-card h3 {
    margin: 0 0 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dwl-card h3 .dashicons { color: #667eea; }

/* Fields */
.dwl-field { margin-bottom: 20px; }
.dwl-field label { display: block; font-size: 13px; font-weight: 600; color: #4b5563; margin-bottom: 8px; }

/* Toggle switch */
.dwl-toggle-label {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}
.dwl-toggle { position: relative; display: inline-block; width: 48px; height: 26px; }
.dwl-toggle input { opacity: 0; width: 0; height: 0; }
.dwl-slider {
    position: absolute; inset: 0;
    background: #d1d5db; border-radius: 26px; cursor: pointer;
    transition: .3s;
}
.dwl-slider::before {
    content: "";
    position: absolute;
    height: 20px; width: 20px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.dwl-toggle input:checked + .dwl-slider { background: #667eea; }
.dwl-toggle input:checked + .dwl-slider::before { transform: translateX(22px); }

/* Color input */
.dwl-color-row { display: flex; align-items: center; gap: 12px; }
.dwl-color-input {
    width: 48px; height: 40px;
    border: 2px solid #e5e7eb; border-radius: 8px;
    padding: 2px; cursor: pointer; background: none;
}
.dwl-color-hex {
    font-family: monospace; font-size: 14px;
    color: #374151; font-weight: 600;
}

/* Selected badge */
.dwl-selected-badge {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* Save button */
.dwl-save-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(102,126,234,.4);
}
.dwl-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,.5);
}
.dwl-save-btn:active { transform: translateY(0); }

/* Live preview */
.dwl-preview-card .dwl-live-preview {
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.dwl-live-preview .dwl-svg { width: 90px; height: 90px; }

/* Section title */
.dwl-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

/* Preloader grid */
.dwl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.dwl-item {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    position: relative;
}
.dwl-item:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102,126,234,.2);
}
.dwl-item.dwl-active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.2), 0 8px 24px rgba(102,126,234,.2);
}

.dwl-item-preview {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 16px;
}
.dwl-item-preview .dwl-svg { width: 80px; height: 80px; }

.dwl-item-footer {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid #f3f4f6;
}
.dwl-item-num {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: monospace;
}
.dwl-item-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dwl-check {
    color: #667eea;
    font-size: 18px;
    opacity: 0;
    transition: opacity .2s;
}
.dwl-item.dwl-active .dwl-check { opacity: 1; }
.dwl-item.dwl-active .dwl-item-num {
    background: #667eea;
    color: #fff;
}
