/* =========================================================
   Datei Manager – Frontend CSS – v1.1.0
   Autor: Christoph Rock
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

.dm-fe-wrap {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #0f172a;
}

/* ── Header ── */
.dm-fe-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    padding: 1rem 1.25rem; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 12px;
    margin-bottom: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.dm-fe-logo { display: flex; align-items: center; gap: 10px; }
.dm-fe-logo svg { width: 28px; height: 28px; color: #1a56a0; flex-shrink: 0; }
.dm-fe-title { display: block; font-size: 15px; font-weight: 700; color: #0f172a; }
.dm-fe-sub   { display: block; font-size: 11px; color: #94a3b8; }

/* ── Buttons ── */
.dm-fe-wrap .dm-fe-btn {
    display: inline-flex !important; align-items: center !important; gap: 5px !important;
    padding: 7px 13px !important; border-radius: 7px !important;
    font-size: 12px !important; font-weight: 500 !important; line-height: 1.4 !important;
    cursor: pointer !important; text-decoration: none !important;
    transition: all 0.15s !important; white-space: nowrap !important;
    text-transform: none !important; letter-spacing: normal !important;
    box-shadow: none !important; width: auto !important; height: auto !important;
    min-width: 0 !important;
}
.dm-fe-wrap .dm-fe-btn-action {
    background: #dbeafe !important; color: #1e40af !important;
    border: 1.5px solid #bfdbfe !important;
}
.dm-fe-wrap .dm-fe-btn-action:hover { background: #bfdbfe !important; border-color: #93c5fd !important; color: #1e3a8a !important; }
.dm-fe-wrap .dm-fe-btn-new {
    background: #dbeafe !important; color: #1e40af !important;
    border: 1.5px solid #bfdbfe !important; font-weight: 600 !important;
    padding: 8px 14px !important;
}
.dm-fe-wrap .dm-fe-btn-new:hover { background: #bfdbfe !important; border-color: #93c5fd !important; color: #1e3a8a !important; }
.dm-fe-wrap .dm-fe-btn-cancel {
    background: #fff !important; color: #64748b !important;
    border: 1.5px solid #e2e8f0 !important;
}
.dm-fe-wrap .dm-fe-btn-cancel:hover { background: #f8fafc !important; }
.dm-fe-wrap .dm-fe-btn-icon {
    background: transparent !important; color: #94a3b8 !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: 5px 8px !important; font-size: 13px !important;
}
.dm-fe-wrap .dm-fe-btn-icon:hover { background: #f8fafc !important; color: #475569 !important; border-color: #cbd5e1 !important; }
.dm-fe-wrap .dm-fe-btn-del:hover { background: #fff1f2 !important; border-color: #fca5a5 !important; color: #dc2626 !important; }

/* ── Upload-Panel ── */
.dm-fe-upload-panel {
    background: #fff; border: 1.5px solid #bfdbfe;
    border-radius: 10px; padding: 1.1rem;
    margin-bottom: 10px; box-shadow: 0 2px 10px rgba(26,86,160,0.07);
}
.dm-fe-upload-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 10px;
}
.dm-fe-ufield label {
    display: block; font-size: 12px; font-weight: 600;
    color: #374151; margin-bottom: 4px;
}
.dm-fe-ufield input, .dm-fe-ufield select {
    width: 100%; padding: 8px 10px;
    border: 1.5px solid #e2e8f0; border-radius: 7px;
    font-size: 13px; box-sizing: border-box; transition: border-color 0.2s;
}
.dm-fe-ufield input:focus, .dm-fe-ufield select:focus {
    border-color: #93c5fd; outline: none;
}
.dm-hint-inline { font-size: 11px; color: #94a3b8; font-weight: 400; }
.dm-req { color: #dc2626; }
.dm-fe-drop-zone {
    border: 2px dashed #bfdbfe; border-radius: 8px;
    padding: 1rem; text-align: center; background: #f8fafc;
    cursor: pointer; transition: all 0.2s; margin-bottom: 8px;
}
.dm-fe-drop-zone:hover, .dm-fe-drop-zone.drag-over { border-color: #1a56a0; background: #eff6ff; }
.dm-fe-drop-zone svg { color: #94a3b8; display: block; margin: 0 auto 6px; }
.dm-fe-drop-zone p { margin: 2px 0; font-size: 12px; color: #64748b; }
.dm-upload-label { color: #1a56a0; cursor: pointer; text-decoration: underline; font-weight: 500; }
.dm-file-input { display: none; }
.dm-fe-file-selected {
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 7px; padding: 7px 10px;
    font-size: 12px; color: #166534; margin-bottom: 8px;
}
.dm-fe-upload-msg {
    padding: 7px 10px; border-radius: 7px; font-size: 12px; margin-bottom: 8px;
}
.dm-fe-upload-msg.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.dm-fe-upload-msg.error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.dm-fe-upload-actions { display: flex; gap: 8px; }

/* ── Filterleiste ── */
.dm-fe-filterbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 10px 14px; margin-bottom: 10px;
}
.dm-fe-search-wrap {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px;
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 7px;
    padding: 6px 10px;
}
.dm-fe-search-wrap svg { color: #94a3b8; flex-shrink: 0; }
.dm-fe-search-wrap input {
    border: none; background: transparent; font-size: 13px; color: #0f172a;
    width: 100%; outline: none;
}
.dm-fe-search-wrap input::placeholder { color: #94a3b8; }
.dm-fe-kat-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.dm-fe-wrap .dm-fe-filter {
    display: inline-flex !important; align-items: center !important; gap: 5px !important;
    padding: 5px 14px !important; border-radius: 20px !important;
    font-size: 13px !important; font-weight: 500 !important; line-height: 1.4 !important;
    border: 1.5px solid #e2e8f0 !important; background: #fff !important; color: #475569 !important;
    cursor: pointer !important; transition: all 0.15s !important;
    text-transform: none !important; letter-spacing: normal !important;
    box-shadow: none !important; margin: 0 !important; width: auto !important;
    min-width: 0 !important; height: auto !important;
}
.dm-fe-wrap .dm-fe-filter:hover { border-color: #bfdbfe !important; color: #1a56a0 !important; background: #eff6ff !important; }
.dm-fe-wrap .dm-fe-filter-active { background: #dbeafe !important; color: #1e40af !important; border-color: #bfdbfe !important; font-weight: 600 !important; }
.dm-fe-filter-count {
    background: rgba(0,0,0,0.07); padding: 1px 6px;
    border-radius: 10px; font-size: 11px; display: inline-block;
}
.dm-fe-wrap .dm-fe-filter-active .dm-fe-filter-count { background: rgba(30,64,175,0.12); }

/* ── Tabelle ── */
.dm-fe-table-wrap {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 10px; overflow: hidden;
}
.dm-fe-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.dm-fe-table thead tr {
    background: #f8fafc; border-bottom: 2px solid #e2e8f0;
}
.dm-fe-table th {
    padding: 10px 14px; text-align: left; font-weight: 600;
    color: #374151; font-size: 12px; white-space: nowrap; cursor: pointer;
    user-select: none;
}
.dm-fe-table th:hover { background: #f1f5f9; }
.dm-sort-icon { color: #cbd5e1; font-size: 10px; }
.dm-fe-table td {
    padding: 10px 14px; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.dm-fe-row:last-child td { border-bottom: none; }
.dm-fe-row:hover td { background: #fafbff; }
.dm-fe-row.dm-hidden { display: none; }

.dm-fe-col-bezeichnung strong { display: block; color: #0f172a; font-weight: 600; }
.dm-fe-notiz { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }
.dm-fe-col-datei { color: #475569; white-space: nowrap; }
.dm-fe-col-datum { color: #64748b; white-space: nowrap; font-size: 12px; }
.dm-fe-col-actions { white-space: nowrap; }
.dm-fe-col-actions .dm-fe-btn { margin-right: 4px; }
.dm-fe-size { font-size: 11px; color: #94a3b8; }
.dm-fe-missing { font-size: 12px; color: #ef4444; }

/* ── Dateityp-Pill ── */
.dm-fe-ext-pill {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em; margin-right: 4px;
}
.dm-fe-icon-red    { background: #fee2e2; color: #b91c1c; }
.dm-fe-icon-blue   { background: #dbeafe; color: #1e40af; }
.dm-fe-icon-green  { background: #dcfce7; color: #166534; }
.dm-fe-icon-orange { background: #ffedd5; color: #c2410c; }
.dm-fe-icon-purple { background: #ede9fe; color: #5b21b6; }
.dm-fe-icon-teal   { background: #ccfbf1; color: #0f766e; }
.dm-fe-icon-grey   { background: #f1f5f9; color: #475569; }

/* ── Badges ── */
.dm-fe-badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.dm-fe-badge-dm-badge-blue   { background: #dbeafe; color: #1e40af; }
.dm-fe-badge-dm-badge-green  { background: #dcfce7; color: #166534; }
.dm-fe-badge-dm-badge-purple { background: #ede9fe; color: #5b21b6; }
.dm-fe-badge-dm-badge-grey   { background: #f1f5f9; color: #475569; }

/* ── Leer / keine Ergebnisse ── */
.dm-fe-empty, .dm-fe-no-results {
    text-align: center; padding: 2.5rem 1rem; color: #94a3b8;
}
.dm-fe-empty svg { width: 40px; height: 40px; margin: 0 auto 10px; display: block; color: #cbd5e1; }
.dm-fe-empty p, .dm-fe-no-results { font-size: 14px; }

/* ── Modals ── */
.dm-modal-wrap {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.dm-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(2px);
}
.dm-modal-box {
    position: relative; z-index: 1;
    background: #fff; border-radius: 14px; padding: 1.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18); text-align: center;
    width: 100%; max-width: 360px;
}
.dm-modal-close {
    position: absolute; top: 12px; right: 12px;
    background: none; border: none; cursor: pointer;
    font-size: 15px; color: #94a3b8; padding: 4px; line-height: 1;
}
.dm-modal-close:hover { color: #0f172a; }
.dm-modal-icon { font-size: 32px; margin-bottom: 8px; }
.dm-modal-box h3 { margin: 0 0 5px; font-size: 17px; font-weight: 700; color: #0f172a; }
.dm-modal-sub { font-size: 12px; color: #64748b; margin-bottom: 1rem; }
.dm-modal-box input[type=password] {
    width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 7px; font-size: 14px; box-sizing: border-box;
    margin-bottom: 8px; text-align: center;
}
.dm-modal-box input[type=password]:focus { border-color: #93c5fd; outline: none; }
.dm-pw-error {
    background: #fee2e2; color: #991b1b; border-radius: 6px;
    padding: 7px; font-size: 12px; margin-bottom: 8px;
}
.dm-edit-box { text-align: left; }
.dm-edit-box h3, .dm-edit-box .dm-modal-icon { text-align: center; }

/* ── PDF Thumbnail ── */
.dm-fe-datei-cell {
    display: flex; align-items: center; gap: 10px;
}
.dm-fe-thumb {
    width: 36px; height: 48px; object-fit: cover;
    border-radius: 4px; border: 1px solid #e2e8f0;
    flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dm-fe-datei-cell > div {
    display: flex; flex-direction: column; gap: 2px;
}
.dm-fe-fname { font-size: 12px; color: #374151; }

/* ── PDF Canvas Thumbnail ── */
canvas.dm-pdf-thumb {
    width: 36px; height: 48px;
    border-radius: 4px; border: 1px solid #e2e8f0;
    flex-shrink: 0; display: block;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    background: #f8fafc;
}
