/* KimbaCAD Startseite und Admin-Seite: Farben wie die Programmoberflaeche (src/style.css). */
:root {
  --bg: #212830;
  --panel: #2b333c;
  --line: #3d4652;
  --text: #d8dee6;
  --muted: #8a96a3;
  --accent: #6fb3ff;
  --error: #ff7b72;
  --ok: #7ee787;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); }
main { flex: 1; width: min(640px, calc(100vw - 32px)); margin: 0 auto; padding: 40px 0 24px; display: flex; flex-direction: column; gap: 20px; }
main.wide { width: min(900px, calc(100vw - 32px)); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; border-top: 1px solid var(--line); }

/* Logo wie das Startbild im Programm: weisse Karte, Versionszeile rechts unten */
.logo { position: relative; container-type: inline-size; background: #fefefe; border-radius: 10px; overflow: hidden; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45); }
.logo img { display: block; width: 100%; height: auto; }
.logo .version { position: absolute; right: 3.5cqw; bottom: 3.5cqw; font-size: 2.6cqw; color: #5b6168; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.panel h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--accent); }
form.grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
form.grid .actions { grid-column: 1 / 3; display: flex; justify-content: flex-end; gap: 8px; }
label { color: var(--muted); }
input[type="text"], input[type="password"], input[type="url"], input[type="email"] {
  font: inherit; width: 100%; padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px;
}
input:focus { outline: none; border-color: var(--accent); }
button { font: inherit; padding: 7px 16px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
button:hover { border-color: var(--accent); }
a.btn { display: inline-block; font: inherit; padding: 7px 16px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
a.btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #10161d; border-color: var(--accent); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.danger:hover { border-color: var(--error); color: var(--error); }
button:disabled { opacity: 0.5; cursor: default; }
.msg { margin: 10px 0 0; font-size: 13px; }
.msg:empty { display: none; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.bar { display: flex; align-items: center; gap: 10px; }
.bar .grow { flex: 1; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; }
td.over { color: var(--error); }
.tag { font-size: 12px; color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 0 5px; margin-left: 6px; }
@media (max-width: 560px) { form.grid { grid-template-columns: 1fr; } form.grid .actions { grid-column: 1; } }
#new-quota, #edit-quota-mb { width: 8em; flex: none; }
.bar .hint { margin: 0; white-space: nowrap; }
fieldset.grid { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
fieldset.grid .actions { grid-column: 1 / 3; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
fieldset:disabled input { opacity: 0.5; }
.hint-text { font-size: 13.5px; line-height: 1.5; max-height: 16em; overflow-y: auto; padding-right: 6px; }
.hint-text h2 { margin: 0 0 10px; }
.hint-text p { margin: 0 0 8px; }
.hint-actions { margin-top: 10px; }
.hint-actions .msg { margin: 0; }
@media (max-width: 560px) { fieldset.grid { grid-template-columns: 1fr; } fieldset.grid .actions { grid-column: 1; } }
.actions .grow { flex: 1; }
.log-scroll { max-height: 22em; overflow-y: auto; }
.forgot-link { margin: 10px 0 0; font-size: 13px; text-align: right; }
.panel > .hint + form { margin-top: 12px; }
textarea { font: inherit; width: 100%; padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); }
a.plain { color: inherit; text-decoration: none; }
.tag.new { color: var(--ok); border-color: var(--ok); }
table.topics td a { font-weight: 600; text-decoration: none; }
.post { border-bottom: 1px solid var(--line); padding: 12px 0; }
.post:last-child { border-bottom: 0; }
.post-head { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.post-head strong { color: var(--text); }
.post-tools { margin-left: auto; display: flex; gap: 6px; }
.post-tools button { padding: 3px 10px; font-size: 13px; }
.post-body p { margin: 0 0 8px; line-height: 1.5; overflow-wrap: anywhere; }
.post-body .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
#reply .actions { display: flex; justify-content: flex-end; }
#list-view, #topic-view { display: flex; flex-direction: column; gap: 20px; }
#users-head th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
#users-head th[data-sort]:hover { color: var(--text); }
#users-head th.sorted { color: var(--accent); }
#users-head th[data-sort]::after { content: attr(data-dir); font-size: 10px; margin-left: 4px; }
td .muted { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
/* Admin-Seite: breiter, Tabelle scrollt in sich statt über den Rand, Knöpfe klein und bündig */
main.admin { width: min(1240px, calc(100vw - 32px)); }
.table-scroll { overflow-x: auto; }
table.users td, table.users th { white-space: nowrap; }
table.users td { padding: 5px 8px; vertical-align: middle; }
td.actions-cell { width: 1%; text-align: left; }
td.actions-cell button { padding: 3px 10px; font-size: 13px; }
td.actions-cell button + button { margin-left: 4px; }
main.admin form.grid { max-width: 680px; }
/* Anleitung */
main.guide p, main.guide li { line-height: 1.55; }
main.guide h3 { margin: 18px 0 6px; font-size: 15px; }
main.guide ol, main.guide ul { margin: 0 0 6px; padding-left: 22px; }
main.guide code, main.guide kbd { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; color: var(--text); }
main.guide kbd { border-bottom-width: 2px; }
table.keys td { vertical-align: top; }
table.keys td:first-child { white-space: nowrap; width: 1%; padding-right: 18px; }
a.primary-link { background: var(--accent); color: #10161d; border-color: var(--accent); font-weight: 600; }
/* Forum: Bereiche, Brotkrumen, Bilder */
.view { display: flex; flex-direction: column; gap: 20px; }
.crumbs { font-size: 13px; color: var(--muted); margin-top: -8px; }
.crumbs a { color: var(--accent); text-decoration: none; }
table.cats td { padding: 10px 8px; vertical-align: middle; }
table.cats td:first-child { width: 60%; }
table.cats .cat-title { font-weight: 600; font-size: 15px; text-decoration: none; }
table.cats .cat-sub { margin: 3px 0 0; }
.img-bar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.img-bar .hint { margin: 0; }
.img-bar .grow { flex: 1; }
.img-bar button.img-pick { padding: 3px 10px; font-size: 13px; }
img.post-img { display: inline-block; max-width: 220px; max-height: 150px; margin: 4px 4px 4px 0; border: 1px solid var(--line); border-radius: 4px; cursor: zoom-in; object-fit: contain; background: var(--bg); vertical-align: middle; }
img.post-img:hover { border-color: var(--accent); }
#move-to { font: inherit; padding: 6px 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
table.cats td.actions-cell { white-space: nowrap; width: 1%; }
/* Forum: Eingabefeld mit Bildern an Ort und Stelle */
.editor { min-height: 8em; max-height: 60vh; overflow-y: auto; padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.editor:focus { outline: none; border-color: var(--accent); }
.editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.editor img.ed-img { display: inline-block; max-width: 220px; max-height: 150px; margin: 4px 4px 4px 0; vertical-align: middle; border: 1px solid var(--line); border-radius: 4px; object-fit: contain; user-select: none; }
.ed-upload { display: inline-block; padding: 2px 8px; margin: 2px; font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; }

/* Forum: Titel beim Bearbeiten (Admins) */
.edit-title { width: 100%; box-sizing: border-box; margin: 2px 0 8px; font-weight: 600; }
