:root { --blau-dunkel: #233767; --blau: #0033cc; --gelb: #ffff00; --rand: #dde2ee; --hell: #f3f5fa; --rot: #c62828; --gruen: #2e7d32; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1c2333; background: var(--hell); font-size: 16px; line-height: 1.5; }
a { color: var(--blau); }
h1 { color: var(--blau-dunkel); margin-top: 0; }
h2 { color: var(--blau-dunkel); font-size: 1.15rem; margin-top: 0; }

.side { position: fixed; top: 0; left: 0; bottom: 0; width: 240px; background: var(--blau-dunkel); color: #fff; display: flex; flex-direction: column; border-right: 4px solid var(--gelb); }
.side-brand { padding: 22px 20px; font-weight: 700; color: var(--gelb); font-size: 1.05rem; }
.side-brand small { display: block; color: #cfd7ef; font-weight: 400; }
.side nav { flex: 1; }
.side a { display: block; color: #fff; text-decoration: none; padding: 11px 20px; }
.side nav a:hover { background: rgba(255,255,255,.08); }
.side nav a.active { background: var(--gelb); color: var(--blau-dunkel); font-weight: 600; }
.side-foot { padding: 10px 0 16px; border-top: 1px solid rgba(255,255,255,.15); font-size: .9rem; }
.side-foot a { padding: 6px 20px; color: #cfd7ef; }
.with-nav .admin-main { margin-left: 240px; padding: 32px 40px; max-width: 1200px; }
.plain .admin-main { padding: 40px 20px; }

.login-box { max-width: 400px; margin: 60px auto; background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.08); border-top: 6px solid var(--gelb); }
.login-box label, .form label { display: block; font-weight: 600; margin-bottom: 14px; }
input, select, textarea { display: block; width: 100%; padding: 10px 12px; border: 1px solid #c3cadb; border-radius: 6px; font: inherit; margin-top: 4px; background: #fff; }
input[type=checkbox] { display: inline; width: auto; margin-right: 6px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blau); border-color: transparent; }
textarea { resize: vertical; }
label.check, label.short { font-weight: 500; }
label.short input { max-width: 220px; }

.btn { display: inline-block; background: var(--blau-dunkel); color: #fff; border: 0; padding: 11px 20px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blau); }
.btn-link { background: none; border: 0; color: var(--blau); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.danger { color: var(--rot) !important; }
form.inline { display: inline; }
.buttons { margin-top: 20px; display: flex; gap: 16px; align-items: center; }

.form { background: #fff; padding: 24px; border-radius: 10px; border: 1px solid var(--rand); }
.form.narrow { max-width: 480px; }
.box { background: #fff; padding: 20px 24px; border-radius: 10px; border: 1px solid var(--rand); margin-bottom: 24px; flex: 1; }
.row { display: flex; gap: 20px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 220px; }
details { margin: 10px 0; }
summary { cursor: pointer; color: #5b6478; }

.toolbar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar-top h1 { margin: 0; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--rand); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rand); }
th { background: #e8ecf5; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: #5b6478; }
tr.muted td { color: #98a0b3; }
td.actions { white-space: nowrap; text-align: right; }
td.actions > * { margin-left: 12px; }
.indent { color: #98a0b3; margin-left: 10px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; background: #e5e7eb; font-size: .8rem; }
.tag.ok { background: #dcf5e0; color: var(--gruen); }
code { background: #eef1f7; padding: 2px 6px; border-radius: 4px; font-size: .85rem; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.flash.ok { background: #dcf5e0; color: var(--gruen); }
.flash.err { background: #fde2e2; color: var(--rot); }
.hint { color: #5b6478; font-size: .9rem; font-weight: 400; }

.editor { margin-top: 4px; font-weight: 400; }
.editor .toolbar { display: flex; gap: 4px; flex-wrap: wrap; background: #eef1f7; border: 1px solid #c3cadb; border-bottom: 0; border-radius: 6px 6px 0 0; padding: 6px; }
.editor .toolbar button { background: #fff; border: 1px solid #c3cadb; border-radius: 4px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: .9rem; }
.editor .toolbar button:hover { background: var(--gelb); }
.editor .toolbar .right { margin-left: auto; }
.editor textarea { margin-top: 0; border-radius: 0 0 6px 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; }
.editor .preview { border: 1px solid #c3cadb; border-radius: 0 0 6px 6px; padding: 10px 20px; min-height: 200px; background: #fff; }
.editor .preview img { max-width: 100%; }
.thumb { display: block; max-width: 220px; max-height: 140px; margin: 8px 0; border-radius: 6px; }
.contain { object-fit: contain; background: #fff; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 20px 0 30px; }
.quick a { background: #fff; border: 1px solid var(--rand); border-radius: 12px; padding: 22px; text-align: center; text-decoration: none; color: var(--blau-dunkel); font-weight: 600; transition: all .15s; }
.quick a:hover { border-color: var(--blau-dunkel); box-shadow: 0 4px 14px rgba(35,55,103,.15); }
.quick span { display: block; font-size: 2rem; margin-bottom: 6px; }

.admin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile { background: #fff; border: 1px solid var(--rand); border-radius: 10px; padding: 10px; }
.tile img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; }
.tile img.contain { object-fit: contain; }
.tile input { padding: 6px 8px; font-size: .9rem; margin-bottom: 4px; }
.tile .noimg { height: 140px; display: flex; align-items: center; justify-content: center; background: var(--hell); color: #98a0b3; border-radius: 6px; }

@media (max-width: 800px) {
  .side { position: static; width: auto; border-right: 0; border-bottom: 4px solid var(--gelb); }
  .side nav { display: flex; flex-wrap: wrap; }
  .side nav a { padding: 8px 12px; }
  .with-nav .admin-main { margin-left: 0; padding: 20px 14px; }
  td.actions { white-space: normal; }
}
pre { background:#0f172a; color:#e2e8f0; padding:12px; border-radius:8px; overflow:auto; font-size:.8rem; max-height:360px; }
