/* ==========================================================================
   Universal DCM Slide-Over Drawer (Documents, Notes & SAM Corporate Memory)
   ========================================================================== */

#dcm-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.18);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: auto;
}

#dcm-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

#dcm-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 100vw;
    background: #ffffff;
    z-index: 1050;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

#dcm-drawer-panel.open {
    transform: translateX(0);
}

/* Header */
.dcm-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #0f172a;
    color: #ffffff;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
}

.dcm-drawer-header .dcm-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.dcm-drawer-header .dcm-icon {
    font-size: 24px;
    color: #38bdf8;
    flex-shrink: 0;
}

.dcm-drawer-header .dcm-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f8fafc;
}

.dcm-drawer-header .dcm-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcm-drawer-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 22px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.dcm-drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Nav Tabs */
.dcm-drawer-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 12px;
    gap: 6px;
    flex-shrink: 0;
}

.dcm-tab-btn {
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 0.825rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.dcm-tab-btn .material-symbols-outlined {
    font-size: 18px;
}

.dcm-tab-btn:hover {
    color: #0f172a;
}

.dcm-tab-btn.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
    background: #ffffff;
}

.dcm-tab-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.dcm-tab-btn.active .dcm-tab-badge {
    background: #e0f2fe;
    color: #0369a1;
}

/* Body Content */
.dcm-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    background: #ffffff;
}

.dcm-tab-pane {
    display: none;
}

.dcm-tab-pane.active {
    display: block;
}

/* Dropzone & Upload */
.dcm-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.dcm-dropzone:hover, .dcm-dropzone.dragover {
    border-color: #0284c7;
    background: #f0f9ff;
}

.dcm-dropzone .dz-icon {
    font-size: 32px;
    color: #0284c7;
    margin-bottom: 6px;
}

.dcm-dropzone .dz-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.dcm-dropzone .dz-sub {
    font-size: 0.725rem;
    color: #64748b;
    margin-top: 2px;
}

/* Document Cards */
.dcm-doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dcm-doc-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.dcm-doc-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dcm-doc-card.locked {
    border-left: 3px solid #10b981;
}

.dcm-doc-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.dcm-doc-icon.pdf { background: #fee2e2; color: #dc2626; }
.dcm-doc-icon.img { background: #e0e7ff; color: #4338ca; }
.dcm-doc-icon.sheet { background: #dcfce7; color: #15803d; }
.dcm-doc-icon.doc { background: #e0f2fe; color: #0284c7; }
.dcm-doc-icon.note { background: #fef3c7; color: #b45309; }
.dcm-doc-icon.other { background: #f1f5f9; color: #475569; }

.dcm-doc-info {
    flex: 1;
    min-width: 0;
}

.dcm-doc-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcm-doc-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dcm-gobd-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.dcm-gobd-badge.locked {
    background: #dcfce7;
    color: #15803d;
}

.dcm-gobd-badge.draft {
    background: #fef3c7;
    color: #b45309;
}

.dcm-doc-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dcm-action-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 16px;
    transition: all 0.15s ease;
}

.dcm-action-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.dcm-action-btn.btn-lock:hover {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.dcm-action-btn.btn-delete:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Notes & Knowledge Chips */
.dcm-notes-editor-wrap {
    margin-bottom: 20px;
}

.dcm-notes-textarea {
    width: 100%;
    min-height: 110px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
}

.dcm-notes-textarea:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.dcm-facts-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.dcm-facts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dcm-facts-header h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dcm-facts-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dcm-fact-chip {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.dcm-fact-chip .chip-label {
    color: #64748b;
}

.dcm-fact-chip .chip-val {
    font-weight: 700;
    color: #0f172a;
}

.dcm-fact-chip .chip-delete {
    background: none;
    border: none;
    padding: 0;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.dcm-fact-chip .chip-delete:hover {
    color: #dc2626;
}

/* SAM Insights Tab */
.dcm-insight-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
    margin-bottom: 12px;
}

.dcm-insight-card.success { border-left: 4px solid #10b981; }
.dcm-insight-card.warning { border-left: 4px solid #f59e0b; }
.dcm-insight-card.info    { border-left: 4px solid #0284c7; }

.dcm-insight-card .card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    color: #0f172a;
    margin-bottom: 6px;
}

.dcm-insight-card .card-body {
    font-size: 0.825rem;
    color: #475569;
    line-height: 1.45;
}

/* Dezentraler Beleg-Trigger-Button für Tabellen */
.btn-dcm-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 6px;
    font-size: 0.775rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-dcm-trigger:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-dcm-trigger.has-docs {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0284c7;
}

.btn-dcm-trigger .material-symbols-outlined {
    font-size: 16px;
}

.btn-dcm-trigger .badge-count {
    background: #0284c7;
    color: #ffffff;
    border-radius: 10px;
    padding: 0 5px;
    font-size: 0.675rem;
    font-weight: 700;
}
