/* ==========================================================================
   Datei Manager – Frontend Styles
   DieSchule – Susanne Eimert & Christoph Rock
   ========================================================================== */

.dm-fe-wrap {
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

/* ---------- Header ---------- */
.dm-fe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 18px;
}
.dm-fe-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dm-fe-logo svg {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    color: #334155;
}
.dm-fe-logo-img {
    height: 44px;
    width: auto;
    max-width: 200px;
    display: block;
}
.dm-fe-title {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}
.dm-fe-sub {
    display: block;
    font-size: 13px;
    color: #64748b;
}

/* ---------- Buttons ---------- */
.dm-fe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background .15s, border-color .15s;
}
.dm-fe-btn-new,
.dm-fe-btn-action {
    background: #2563eb;
    color: #fff;
}
.dm-fe-btn-new:hover,
.dm-fe-btn-action:hover { background: #1d4ed8; }
.dm-fe-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}
.dm-fe-btn-cancel:hover { background: #e2e8f0; }
.dm-fe-btn-icon {
    background: #f1f5f9;
    color: #475569;
    padding: 7px 9px;
}
.dm-fe-btn-icon:hover { background: #e2e8f0; }
.dm-fe-btn-del:hover { background: #fee2e2; }

/* ---------- Upload-Panel ---------- */
.dm-fe-upload-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}
.dm-fe-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.dm-fe-ufield label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}
.dm-fe-ufield input,
.dm-fe-ufield select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
.dm-req { color: #dc2626; }
.dm-hint, .dm-hint-inline { color: #94a3b8; font-size: 12px; }

.dm-fe-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 22px;
    text-align: center;
    color: #64748b;
    background: #fff;
}
.dm-fe-drop-zone.dm-dragover { border-color: #2563eb; background: #eff6ff; }
.dm-fe-drop-zone svg { color: #94a3b8; margin-bottom: 6px; }
.dm-file-input { display: none; }
.dm-upload-label { color: #2563eb; cursor: pointer; text-decoration: underline; }
.dm-fe-file-selected { margin-top: 10px; font-size: 13px; color: #1e293b; }
.dm-fe-upload-msg { margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.dm-fe-upload-msg.dm-ok   { background: #dcfce7; color: #166534; }
.dm-fe-upload-msg.dm-err  { background: #fee2e2; color: #991b1b; }
.dm-fe-upload-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- Filterleiste ---------- */
.dm-fe-filterbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.dm-fe-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    max-width: 360px;
}
.dm-fe-search-wrap svg {
    position: absolute;
    left: 10px;
    color: #94a3b8;
}
.dm-fe-search-wrap input {
    width: 100%;
    padding: 9px 12px 9px 32px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
.dm-fe-kat-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.dm-fe-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}
.dm-fe-filter:hover { background: #f1f5f9; }
.dm-fe-filter-active { background: #1e293b; color: #fff; border-color: #1e293b; }
.dm-fe-filter-count {
    background: rgba(0,0,0,.12);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
}
.dm-fe-filter-active .dm-fe-filter-count { background: rgba(255,255,255,.25); }

/* ---------- Tabelle ---------- */
.dm-fe-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.dm-fe-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.dm-fe-table thead th {
    text-align: left;
    padding: 12px 14px;
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}
.dm-sort-icon { color: #cbd5e1; font-size: 11px; }
.dm-fe-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.dm-fe-row:hover { background: #f8fafc; }
.dm-fe-col-bezeichnung strong { display: block; }
.dm-fe-notiz { display: block; font-size: 12px; color: #94a3b8; margin-top: 2px; }

.dm-fe-datei-cell { display: flex; align-items: center; gap: 10px; }
.dm-fe-fname { display: block; font-size: 13px; }
.dm-fe-size  { display: block; font-size: 11px; color: #94a3b8; }
.dm-pdf-thumb { border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; }

.dm-fe-ext-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 30px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #94a3b8;
}
.dm-fe-icon-red    { background: #ef4444; }
.dm-fe-icon-blue   { background: #3b82f6; }
.dm-fe-icon-green  { background: #22c55e; }
.dm-fe-icon-orange { background: #f97316; }
.dm-fe-icon-purple { background: #a855f7; }
.dm-fe-icon-teal   { background: #14b8a6; }
.dm-fe-icon-grey   { background: #94a3b8; }

.dm-fe-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}
.dm-fe-badge-dm-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.dm-fe-badge-dm-badge-green  { background: #dcfce7; color: #15803d; }
.dm-fe-badge-dm-badge-purple { background: #f3e8ff; color: #7e22ce; }
.dm-fe-badge-dm-badge-grey   { background: #e2e8f0; color: #475569; }

.dm-fe-col-actions { white-space: nowrap; text-align: right; }
.dm-fe-col-actions .dm-fe-btn { margin-left: 4px; }
.dm-fe-missing { color: #dc2626; font-size: 13px; }

.dm-fe-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}
.dm-fe-empty svg { width: 48px; height: 48px; margin-bottom: 10px; }
.dm-fe-no-results { text-align: center; padding: 28px; color: #94a3b8; }

/* ---------- Modals ---------- */
.dm-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.5);
}
.dm-modal-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 24px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.dm-edit-box { max-width: 420px; text-align: left; }
.dm-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
}
.dm-modal-icon { font-size: 30px; margin-bottom: 6px; }
.dm-modal-box h3 { margin: 0 0 4px; font-size: 18px; }
.dm-modal-sub { color: #64748b; font-size: 13px; margin: 0 0 14px; }
.dm-modal-box input[type="password"],
.dm-modal-box input[type="text"],
.dm-modal-box select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
.dm-pw-error { color: #dc2626; font-size: 13px; margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .dm-fe-upload-grid { grid-template-columns: 1fr; }
    .dm-fe-table thead { display: none; }
    .dm-fe-table tbody td { display: block; border: none; padding: 6px 14px; }
    .dm-fe-row { display: block; border-bottom: 1px solid #e2e8f0; padding: 8px 0; }
    .dm-fe-col-actions { text-align: left; }
}
