:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #17202a;
    --muted: #687382;
    --line: #dde3e9;
    --brand: #1aa1ad;
    --brand-dark: #850916;
    --good: #18794e;
    --warn: #9a6700;
    --bad: #b42318;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--brand); }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { background: #101820; color: #fff; padding: 22px 16px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; margin: 0 8px 28px; }
.brand-mark { display: inline-flex; background: var(--brand); border-radius: 6px; padding: 6px 8px; letter-spacing: .03em; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { color: #dce3e9; text-decoration: none; border-radius: 8px; padding: 11px 12px; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-label { color: #84919e; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; margin: 20px 12px 5px; }
.sidebar-footer { color: #84919e; margin-top: auto; padding: 18px 12px 0; font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 68px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.topbar-user { color: var(--muted); font-size: 14px; }
.content { padding: 30px; width: 100%; max-width: 1500px; }
.footer { margin-top: auto; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); padding: 18px 30px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.grid > * { min-width: 0; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: 0 4px 18px rgba(16,24,32,.035); }
.card h2, .card h3 { margin-top: 0; }
.metric { font-size: 31px; font-weight: 800; margin: 8px 0 2px; }
.muted { color: var(--muted); }
.notice { border-radius: 9px; padding: 13px 15px; margin-bottom: 18px; border: 1px solid; }
.notice.success { color: var(--good); background: #ecfdf3; border-color: #abefc6; }
.notice.error { color: var(--bad); background: #fef3f2; border-color: #fecdca; }
.notice.warning { color: var(--warn); background: #fffaeb; border-color: #fedf89; }
label { display: block; font-weight: 650; margin-bottom: 7px; }
input, select, textarea { width: 100%; border: 1px solid #cdd5df; border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(181,13,30,.12); border-color: var(--brand); }
.form-row { margin-bottom: 17px; }
.form-help { color: var(--muted); font-size: 13px; margin-top: 6px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--brand); color: #fff; padding: 10px 15px; border-radius: 8px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button.secondary { background: #eef1f4; color: #24313e; }
.button.danger { background: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--good); } .status.bad { color: var(--bad); } .status.warn { color: var(--warn); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f2f4f7; border-radius: 6px; padding: 2px 6px; font-size: 13px; }
.login-page, .install-page { min-height: 100vh; padding: 35px 20px; display: grid; place-items: center; background: linear-gradient(135deg, #101820, #273746); }
.login-box, .install-box { width: min(100%, 470px); background: #fff; border-radius: 14px; padding: 30px; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.install-box { width: min(100%, 900px); }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-weight: 800; font-size: 20px; }
.requirements { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 18px; margin: 18px 0 26px; }
.requirement { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.requirement.ok { color: var(--good); } .requirement.bad { color: var(--bad); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #101820; color: #e8eef3; padding: 16px; border-radius: 8px; overflow: auto; }
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { min-height: auto; }
    .sidebar nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .nav-label { grid-column: 1 / -1; }
    .sidebar-footer { display: none; }
    .topbar { padding: 0 18px; }
    .content { padding: 18px; }
    .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { grid-column: span 12; }
}
@media (max-width: 600px) {
    .requirements { grid-template-columns: 1fr; }
    .footer, .topbar { align-items: flex-start; height: auto; flex-direction: column; padding: 16px 18px; }
    .sidebar nav { grid-template-columns: 1fr; }
}

/* Benutzer- und Rechteverwaltung */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.page-heading h1 { margin: 0 0 6px; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; }
.page-heading p { margin: 0; }
.topbar-user { display: flex; align-items: center; gap: 7px; }
.role-chip, .role-badge, .self-label { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.role-chip { background: #eef1f4; color: #455462; padding: 4px 8px; font-size: 11px; }
.role-badge { padding: 5px 9px; font-size: 12px; background: #eef1f4; color: #344250; }
.role-administrator { background: #fef3f2; color: var(--brand); }
.role-editor { background: #eff8ff; color: #175cd3; }
.role-viewer { background: #f2f4f7; color: #475467; }
.self-label { margin-left: 7px; padding: 2px 7px; font-size: 10px; background: #ecfdf3; color: var(--good); }
.button.small { padding: 7px 10px; font-size: 13px; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.checkbox-row { padding-top: 29px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; }
.checkbox-label input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role-grid > div { border: 1px solid var(--line); background: #f8fafb; border-radius: 10px; padding: 16px; }
.role-grid strong, .role-grid span { display: block; }
.role-grid span { color: var(--muted); margin-top: 7px; font-size: 14px; line-height: 1.45; }
.clean-list { margin: 0; padding-left: 20px; }
.clean-list li + li { margin-top: 12px; }

@media (max-width: 760px) {
    .page-heading { flex-direction: column; }
    .form-grid, .role-grid { grid-template-columns: 1fr; }
    .checkbox-row { padding-top: 0; }
    .topbar-user { flex-wrap: wrap; }
}

/* Medienverwaltung */
.button:disabled, .button[disabled] { opacity: .48; cursor: not-allowed; pointer-events: none; }
.media-stats { margin-bottom: 18px; }
.media-size-metric { font-size: clamp(22px, 2.5vw, 31px); }
.media-filter { margin-bottom: 18px; }
.media-filter-grid { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(160px, .8fr) minmax(190px, 1fr) auto; gap: 16px; align-items: end; }
.media-filter-grid .form-row { margin-bottom: 0; }
.media-filter-actions { padding-bottom: 1px; }
.media-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 22px 0 14px; color: var(--muted); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 18px; }
.media-card { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 18px rgba(16,24,32,.035); }
.media-preview { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; background: #e9edf1; text-decoration: none; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.media-card:hover .media-preview img { transform: scale(1.025); }
.media-type-chip { position: absolute; left: 10px; top: 10px; background: rgba(16,24,32,.82); color: #fff; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 750; backdrop-filter: blur(5px); }
.document-preview { width: 100%; height: 100%; display: grid; place-content: center; text-align: center; color: #fff; background: linear-gradient(145deg, #b50d1e, #7d0914); }
.document-preview strong { font-size: 38px; letter-spacing: .04em; }
.document-preview small { margin-top: 6px; opacity: .82; }
.document-preview.large { min-height: 360px; border-radius: 10px; margin-bottom: 18px; }
.document-preview.large strong { font-size: 68px; }
.media-card-body { padding: 16px; }
.media-card-body h2 { margin: 0 0 7px; font-size: 17px; line-height: 1.25; }
.media-card-body h2 a { color: var(--ink); text-decoration: none; }
.media-card-body h2 a:hover { color: var(--brand); }
.media-card-file { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; color: var(--muted); font-size: 12px; }
.media-card-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card-status { min-height: 22px; margin-top: 11px; font-size: 12px; }
.metadata-warning, .metadata-good { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-weight: 700; }
.metadata-warning { color: var(--warn); background: #fffaeb; }
.metadata-good { color: var(--good); background: #ecfdf3; }
.empty-state { text-align: center; padding: 54px 24px; }
.empty-state-icon { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 14px; background: #eef1f4; font-size: 28px; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.pagination a { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.pagination a.active, .pagination a:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.upload-zone { position: relative; min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px; border: 2px dashed #b8c2cc; border-radius: 12px; background: #f8fafb; text-align: center; cursor: pointer; }
.upload-zone:hover { border-color: var(--brand); background: #fff7f7; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #fef3f2; color: var(--brand); font-size: 29px; font-weight: 800; }
.upload-zone span:last-of-type { color: var(--muted); font-weight: 400; }
.media-detail-preview > img { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #eef1f4; border-radius: 10px; }
.media-technical-data { margin: 22px 0 0; }
.media-technical-data > div { display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.media-technical-data dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.media-technical-data dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.folder-list { display: grid; gap: 10px; }
.folder-row { display: grid; grid-template-columns: minmax(260px,1fr) auto auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.folder-rename { display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: 10px; }
.folder-count { color: var(--muted); font-size: 13px; white-space: nowrap; }

@media (max-width: 1050px) {
    .media-filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .media-filter-actions { align-self: end; }
}
@media (max-width: 700px) {
    .media-filter-grid { grid-template-columns: 1fr; }
    .media-result-heading { align-items: flex-start; flex-direction: column; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); }
    .folder-row { grid-template-columns: 1fr; }
    .folder-rename { grid-template-columns: 1fr; }
    .media-technical-data > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Seiten- und Navigationsverwaltung */
.pages-table td:first-child small{display:block;margin-top:5px;color:var(--muted)}.page-status{display:inline-flex;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:750}.status-draft{background:#f2f4f7;color:#475467}.status-scheduled{background:#fffaeb;color:#9a6700}.status-published{background:#ecfdf3;color:#18794e}.status-hidden{background:#eff8ff;color:#175cd3}.status-archived{background:#fef3f2;color:#b42318}.checkbox-grid{display:flex;flex-wrap:wrap;gap:18px;margin-top:18px}.checkbox-grid label{display:flex;align-items:center;gap:8px}.checkbox-grid input{width:19px;height:19px;accent-color:var(--brand)}.block-list{display:grid;gap:10px}.block-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px;border:1px solid var(--line);border-radius:10px;background:#f8fafb}.block-row>div:first-child{display:grid;gap:5px}.block-row span{color:var(--muted);font-size:13px}.block-row form{display:flex;gap:6px}.button.danger{background:var(--bad);border-color:var(--bad);color:#fff}.form-actions{margin-top:20px}@media(max-width:800px){.block-row{align-items:flex-start;flex-direction:column}.block-row .actions{width:100%;flex-wrap:wrap}.checkbox-grid{flex-direction:column}}
