/* Fundament CMS – Backend */
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
  --bg: #f2f4f6; --panel: #fff; --ink: #14171b; --muted: #5f6873; --line: #dfe4ea;
  --brand: #0a7ea8; --brand-ink: #fff; --ok: #1f7a4d; --err: #b42318; --info: #1f5f8b;
  --r: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f1215; --panel: #171b20; --ink: #e8edf2; --muted: #98a3ae; --line: #2a3139; --brand: #2cc0ef; --brand-ink: #0d0f12; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.adm { margin: 0; font: 15px/1.55 "Manrope", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); }
code { background: rgba(0,0,0,.06); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
h1, h2 { line-height: 1.2; }

.adm-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.adm-brand { font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.adm-brand span { font-weight: 500; color: var(--muted); margin-left: 4px; }
.adm-top-r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.adm-top-r form { margin: 0; }
.adm-burger { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 18px; padding: 4px 10px; color: var(--ink); }
.adm-wrap { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 54px); }
.adm-nav { padding: 16px 10px; border-right: 1px solid var(--line); background: var(--panel); }
.adm-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.adm-nav a:hover { background: var(--bg); }
.adm-nav a.is-active { background: var(--brand); color: var(--brand-ink); }
.adm-nav .ico { width: 18px; text-align: center; opacity: .8; }
.adm-nav .pill { margin-left: auto; background: var(--brand); color: #fff; border-radius: 99px; padding: 0 8px; font-size: 12px; }
.adm-nav a.is-active .pill { background: #fff; color: var(--brand); }
.adm-who { color: var(--muted); font-size: 13px; padding: 16px 12px 0; }
.adm-main { padding: 28px clamp(16px, 3vw, 40px) 120px; max-width: 1180px; width: 100%; min-width: 0; }
.adm-h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: -.02em; }
.adm-h2 { font-size: 18px; margin: 28px 0 12px; }
.panel .adm-h2:first-child { margin-top: 0; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lead { color: var(--muted); max-width: 70ch; margin: 0 0 20px; }
.crumb { margin: 0; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); }
.empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center; }

@media (max-width: 860px) {
  .adm-burger { display: block; }
  .adm-wrap { grid-template-columns: 1fr; }
  .adm-nav { display: none; position: fixed; inset: 54px 0 auto 0; z-index: 30; border-bottom: 1px solid var(--line); max-height: calc(100vh - 54px); overflow: auto; box-shadow: var(--shadow); }
  .adm-nav.is-open { display: block; }
  .adm-top-r .btn-ghost:first-child { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--brand); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.btn-ghost { background: transparent; }
.btn-s { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.link { color: var(--brand); text-decoration: underline; cursor: pointer; }

/* Notes */
.note { padding: 12px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--muted); margin: 0 0 16px; }
.note-ok { border-left-color: var(--ok); }
.note-err { border-left-color: var(--err); }
.note-info { border-left-color: var(--info); }
.note ul { margin: 6px 0 0; }
.warn { color: var(--err); }
.ok-line { color: var(--ok); font-weight: 700; }

/* Forms */
.f { margin: 0 0 16px; min-width: 0; }
.f-label { display: block; font-weight: 700; font-size: 13px; margin: 0 0 6px; }
.f-help { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), textarea, select {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 1px; }
.f-heading { font-size: 17px; font-weight: 700; }
.f-check label, label.f-check { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.f-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 700px) { .grid2, .grid3, .f-row { grid-template-columns: 1fr; } }
.inline-form, .row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.inline-form input { flex: 1 1 260px; }
.row-form input, .row-form select { width: auto; flex: 1 1 160px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 16px; box-shadow: var(--shadow); }
.panel-pad { padding: 20px; }
.panel > summary { padding: 16px 20px; cursor: pointer; font-weight: 800; display: block; list-style: none; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::before { content: "▸"; display: inline-block; width: 18px; transition: transform .15s; }
.panel[open] > summary::before { transform: rotate(90deg); }
.panel[open] > summary { border-bottom: 1px solid var(--line); }
.panel > summary small { display: block; font-weight: 500; color: var(--muted); margin-left: 18px; }
.panel-body { padding: 20px; }
.savebar { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); display: flex; justify-content: flex-end; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 30%, var(--line)); margin-top: 32px; }

/* Richtext */
.rt-bar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.rt-bar button { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.rt-bar .rt-prev { margin-left: auto; }
.rt-preview { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 16px; background: var(--bg); }
.prose h3 { font-size: 17px; margin: 1em 0 .4em; }

/* Lists (Repeater) */
.list-rows, .ff-list { display: grid; gap: 10px; margin-bottom: 10px; }
.list-row, .ff { display: grid; grid-template-columns: 34px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--bg); }
.list-ctrl { display: flex; flex-direction: column; gap: 4px; }
.list-ctrl button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 2px 0; cursor: pointer; }
.list-ctrl button[data-del] { color: var(--err); }
.list-fields .f:last-child, .ff-body .f:last-child { margin-bottom: 0; }
.ff-checks { display: flex; gap: 18px; font-weight: 600; font-size: 14px; }
.ff-checks label { display: flex; gap: 6px; align-items: center; }

/* Image picker */
.img-pick { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.img-thumb { width: 160px; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 8px, var(--line) 8px, var(--line) 9px); display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); padding: 0; }
.img-thumb span { padding: 8px; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-logo img { object-fit: contain; background: #fff; }
.img-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Cards / tables */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0 0 24px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.card:hover { border-color: var(--brand); }
.card strong { font-size: 30px; letter-spacing: -.02em; }
.card .card-t { font-size: 20px; }
.card-k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.card span:last-child { color: var(--muted); font-size: 13px; }
.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tbl tr.unread td { font-weight: 800; }
.tbl .row-form { margin: 0; flex-wrap: nowrap; }
@media (max-width: 700px) { .tbl { display: block; overflow-x: auto; } }
.msg { display: grid; grid-template-columns: 200px 1fr; gap: 8px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.msg dt { font-weight: 700; color: var(--muted); }
.msg dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .msg { grid-template-columns: 1fr; } .msg dd { margin-bottom: 8px; } }

/* Galleries */
.gal-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.gal-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.gal-cover { width: 84px; height: 60px; border-radius: 6px; overflow: hidden; background: var(--bg); flex: none; }
.gal-cover img { width: 100%; height: 100%; object-fit: cover; }
.gal-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gal-meta a { color: var(--ink); text-decoration: none; }
.gal-meta span { color: var(--muted); font-size: 13px; }
.drag { cursor: grab; color: var(--muted); user-select: none; }
.is-dragging { opacity: .4; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.thumb { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.thumbs[data-sortable] .thumb { cursor: grab; }
.thumb-img { position: relative; aspect-ratio: 4/3; background: var(--bg); }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; left: 8px; top: 8px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.badge-dim { background: rgba(0,0,0,.6); }
.thumb details { padding: 8px 10px; font-size: 13px; }
.thumb summary { cursor: pointer; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb form { margin: 8px 0; }
.thumb .f { margin-bottom: 8px; }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 28px; text-align: center; transition: .15s; }
.drop.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.drop p { margin: 4px 0; }
.drop-progress { display: grid; gap: 4px; margin-top: 10px; text-align: left; font-size: 13px; }
.drop-progress .ok { color: var(--ok); }
.drop-progress .bad { color: var(--err); }
.import-list { font-size: 14px; }
.import-list em { color: var(--muted); }
.import-list b.ok { color: var(--ok); }
.import-list b.bad { color: var(--err); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--panel); border-radius: 12px; width: min(960px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-grid { padding: 16px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.modal-grid button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 4/3; background: var(--bg); }
.modal-grid button:hover, .modal-grid button:focus { border-color: var(--brand); }
.modal-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Auth */
.adm-auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--brand) 14%, var(--bg)), var(--bg) 60%); }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.08); }
.auth-wide { width: min(560px, 100%); }
.auth-card h1 { margin: 0 0 18px; font-size: 26px; letter-spacing: -.02em; }
.qr { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: 8px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-size: 15px; letter-spacing: .05em; }
.steps { padding-left: 20px; }

.thumb-hero { padding: 8px 10px 0; }
.thumb-hero .btn { width: 100%; justify-content: center; }
.badge-off { left: auto; right: 8px; background: #6b7378; }
.thumb-off .thumb-img img { opacity: .4; filter: grayscale(1); }
.thumb-off .thumb-hero .btn { border-style: dashed; color: var(--muted); }
.auth-wrap { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-wrap .auth-card { width: 100%; }
.auth-logo { display: block; width: min(260px, 70%); }
.auth-logo img { width: 100%; height: auto; display: block; }
.auth-links { display: flex; gap: 18px; font-size: 13px; }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--ink); text-decoration: underline; }
.bk-actions { display: flex; gap: 8px; align-items: flex-start; justify-content: flex-end; flex-wrap: wrap; }
.bk-actions details summary { list-style: none; cursor: pointer; }
.bk-actions details summary::-webkit-details-marker { display: none; }
.bk-restore { margin-top: 8px; display: grid; gap: 6px; min-width: 220px; }
.pill-dim { background: var(--line); color: var(--muted); }
.muted { color: var(--muted); }
.tbl .pill { display: inline-block; border-radius: 99px; padding: 0 8px; font-size: 12px; }
/* Statistik */
.st-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.st-range { display: flex; gap: 6px; flex-wrap: wrap; }
.st-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.st-kpi { padding: 16px 18px; }
.st-kpi span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.st-kpi strong { display: block; font-size: 28px; letter-spacing: -.02em; margin-top: 4px; }
.st-chart { width: 100%; height: auto; display: block; }
.st-grid { stroke: var(--line); stroke-width: 1; }
.st-ax { fill: var(--muted); font-size: 12px; }
.st-axx { text-anchor: middle; }
.st-col { fill: var(--brand); }
.st-col:hover { opacity: .8; }
.st-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; opacity: .55; }
.st-legend { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.st-k { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.st-k1 { background: var(--brand); } .st-k2 { background: var(--ink); opacity: .55; height: 3px; margin-left: 12px; }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.st-grid2 .panel { margin: 0; }
.st-tbl td { padding-top: 7px; padding-bottom: 7px; }
.st-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.st-pc { width: 40%; white-space: nowrap; font-size: 13px; color: var(--muted); }
.st-pc progress { width: calc(100% - 52px); height: 8px; vertical-align: middle; accent-color: var(--brand); }
.st-cc { display: inline-block; min-width: 30px; padding: 1px 0; margin-right: 6px; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
@media (max-width: 900px) { .st-kpis { grid-template-columns: 1fr 1fr; } .st-grid2 { grid-template-columns: 1fr; } }

/* Preisliste ----------------------------------------------------------- */
.price-ico { display: grid; place-items: center; color: var(--brand); }
.price-ico .ico { width: 30px; height: 30px; }
.pr-grid { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr; gap: 0 12px; }
.pr-prices { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.pr-p { flex: 0 1 130px; }
.pr-p[hidden] { display: none; }
.pr-badge { flex: 0 1 150px; }
.pr-eur { position: relative; }
.pr-eur input { padding-right: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.pr-eur span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pr-eur input::placeholder { text-align: left; font-size: 12px; }
.pr-checks { display: flex; gap: 14px; margin: 0 0 16px; font-weight: 600; font-size: 14px; padding-bottom: 10px; }
.pr-checks label { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.pr-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pr-confirm { margin-right: auto; background: var(--panel); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.price-row .f { margin-bottom: 10px; }
@media (max-width: 760px) { .pr-grid, .pr-cols { grid-template-columns: 1fr; } .pr-p { flex: 1 1 40%; } }

.f-color { display: flex; gap: 8px; align-items: center; }
.f-color input[type=color] { width: 46px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; flex: none; }
.f-color input[type=text] { max-width: 140px; font-family: ui-monospace, monospace; text-transform: uppercase; }
