/* Admin-Bereich */
body.admin { display: block; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 36px; box-shadow: var(--shadow); }
.login-box img { height: 70px; width: auto; margin: 0 auto 8px; }
.login-box h2 { text-align: center; font-size: 1.3rem; }
.login-box .back-link { text-align: center; margin: 4px 0 0; }

.admin-top {
  position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.admin-top .logo { height: 36px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions .btn { padding: 0 16px; height: 38px; font-size: .9rem; white-space: nowrap; }
.save-state { font-size: .85rem; color: var(--muted); }
.save-state.dirty { color: var(--copper); font-weight: 600; }
@media (max-width: 760px) {
  .top-actions .btn-ghost { display: none; }
  .save-state { display: none; }
}

.admin-body { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 64px); }
.admin-nav { border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.admin-nav a { color: var(--text); text-decoration: none; padding: 10px 14px; border-radius: 8px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.admin-nav a:hover { background: var(--surface-2); }
.admin-nav a.active { background: var(--surface-2); color: var(--accent); }
.badge-inline { background: var(--copper); color: #fff; border-radius: 10px; font-size: .72rem; padding: 1px 7px; }
.badge-inline:empty { display: none; }
@media (max-width: 760px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .admin-nav a { white-space: nowrap; }
}
.admin-main { padding: 28px 16px 80px; max-width: 980px; width: 100%; }
@media (min-width: 760px) { .admin-main { padding: 32px 36px 80px; } }
.admin-main h1 { font-size: 1.7rem; }
.hint { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.box-head strong { font-family: Outfit, sans-serif; font-size: 1.05rem; }
.box-tools { display: flex; gap: 4px; }
.tool { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: .85rem; }
.tool:hover { border-color: var(--accent); color: var(--accent); }
.tool.danger:hover { border-color: #c0453b; color: #c0453b; }
.btn-small { padding: 8px 14px; font-size: .88rem; }

.fields { display: grid; gap: 14px; }
.fields .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.form label { align-content: start; }
@media (max-width: 600px) { .fields .two { grid-template-columns: 1fr; } }
.form label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.form label.check input { width: 18px; height: 18px; accent-color: var(--copper); }
.form textarea.small { min-height: 80px; }

.sub-items { display: grid; gap: 10px; }
.sub-item { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; }

.img-field { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.img-field .thumb { width: 120px; height: 80px; border-radius: 6px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.thumbs figure { margin: 0; position: relative; }
.thumbs img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.thumbs figcaption { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.thumbs .cover-tag { position: absolute; top: 6px; left: 6px; background: var(--copper); color: #fff; font-size: .7rem; padding: 2px 7px; border-radius: 4px; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; }
.list-row:hover { border-color: var(--accent); }
.list-row img { width: 72px; height: 52px; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex-shrink: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; }
.list-row .meta { color: var(--muted); font-size: .85rem; }
.pill { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.pill.on { color: var(--accent); }

.menu-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.menu-row.hidden-entry { opacity: .6; }
@media (max-width: 640px) { .menu-row { grid-template-columns: 1fr 1fr; } }

.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.msg.unread { border-left: 4px solid var(--copper); }
.msg-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; }
.msg-head .meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.msg.unread .msg-head .who { font-weight: 700; }
.msg-body { padding: 0 18px 16px; display: none; }
.msg.open .msg-body { display: block; }
.msg-body pre { white-space: pre-wrap; font: inherit; background: var(--bg); border-radius: 8px; padding: 14px; margin: 10px 0 14px; }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--charcoal); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 100; font-size: .92rem; }
.page-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.page-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 20px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: .9rem; }
.page-tabs button.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.add-block { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.add-block select { width: auto; }
