/* ============ DATA MANAGER ============ */
.dm-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}

.dm-subtabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #4a5568;
}

.dm-subtab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.dm-subtab.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
}

.dm-subtab:hover { color: #cbd5e0; }

.dm-subpanel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.dm-subpanel.active { display: flex; }

.dm-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.dm-toolbar button {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #4a5568;
    background: #2d3748;
    color: #e2e8f0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.dm-toolbar button:hover { background: #4a5568; }

.dm-add-btn {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #000 !important;
}
.dm-add-btn:hover { background: #d97706 !important; }

.dm-export-btn {
    background: #10b981 !important;
    border-color: #059669 !important;
    color: #fff !important;
}

.dm-import-btn {
    background: #6366f1 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
}

.dm-search {
    width: 100%;
    padding: 6px 10px;
    background: #1a1d23;
    border: 1px solid #4a5568;
    color: #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

.dm-search::placeholder { color: #718096; }

.dm-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.dm-item:hover {
    border-color: #f59e0b;
    background: #374151;
}

.dm-item.dm-custom {
    border-left: 3px solid #f59e0b;
}

.dm-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-item-meta {
    font-size: 11px;
    color: #a0aec0;
    white-space: nowrap;
}

.dm-item-actions {
    display: flex;
    gap: 4px;
}

.dm-item-actions button {
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #4a5568;
    background: #1a1d23;
    color: #a0aec0;
    cursor: pointer;
    border-radius: 3px;
}

.dm-item-actions button:hover {
    background: #4a5568;
    color: #fff;
}

.dm-item-actions .dm-del-btn:hover {
    background: #ef4444;
    border-color: #dc2626;
}

/* ============ EDITOR MODAL ============ */
.dm-editor-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 6000;
    align-items: center;
    justify-content: center;
}

.dm-editor-modal.active { display: flex; }

.dm-editor-content {
    background: #2d3748;
    padding: 24px;
    border-radius: 8px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #4a5568;
}

.dm-editor-content h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #f59e0b;
}

.dm-field {
    margin-bottom: 14px;
}

.dm-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #a0aec0;
}

.dm-field input, .dm-field select {
    width: 100%;
    padding: 8px 12px;
    background: #1a1d23;
    border: 1px solid #4a5568;
    color: #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
}

.dm-field textarea {
    width: 100%;
    min-height: 200px;
    padding: 8px 12px;
    background: #1a1d23;
    border: 1px solid #4a5568;
    color: #e2e8f0;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 11px;
    line-height: 1.5;
    resize: vertical;
}

.dm-field input:focus, .dm-field select:focus, .dm-field textarea:focus {
    outline: none;
    border-color: #f59e0b;
}

.dm-editor-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.dm-editor-buttons button {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #4a5568;
    border-radius: 4px;
    cursor: pointer;
}

.dm-save-btn {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #000 !important;
}
.dm-save-btn:hover { background: #d97706 !important; }

.dm-cancel-btn {
    background: #4a5568 !important;
    color: #e2e8f0 !important;
}

.dm-delete-editor-btn {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}

/* ============ AI ASSISTANT ============ */
.ai-assist-section {
    margin-top: 12px;
    padding: 12px;
    background: #1e1b4b;
    border: 1px solid #4338ca;
    border-radius: 6px;
}

.ai-assist-section h4 {
    font-size: 12px;
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-assist-section h4::before {
    content: "✨";
}

.ai-assist-input {
    width: 100%;
    padding: 8px 10px;
    background: #0f0e2a;
    border: 1px solid #4338ca;
    color: #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

.ai-assist-input::placeholder { color: #6366f1; }

.ai-assist-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ai-assist-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    background: #4338ca;
    border: 1px solid #6366f1;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.ai-assist-btn:hover { background: #6366f1; }

.ai-assist-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-assist-output {
    margin-top: 8px;
    padding: 8px;
    background: #0f0e2a;
    border: 1px solid #4338ca;
    border-radius: 4px;
    font-size: 11px;
    color: #c4b5fd;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', monospace;
    display: none;
}

.ai-assist-output.active { display: block; }

.ai-assist-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #6366f1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ai-spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}
