* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--brand-primary-dark); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 34px; width: 100%; max-width: 400px; }
.login-card img { height: 50px; margin-bottom: 18px; }
.login-card h1 { font-size: 19px; margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; }
.field textarea { resize: vertical; min-height: 70px; font-family: var(--font-mono); font-size: 12.5px; }
.err { color: var(--risk); font-size: 13px; min-height: 18px; margin-top: 6px; }

/* Shell */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; }
.side .logo { height: 40px; margin: 4px 6px 18px; }
.logoHome { cursor: pointer; }
.side nav a, .mmenu nav a { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; cursor: pointer; margin-bottom: 3px; }
.side nav a:hover, .mmenu nav a:hover { background: var(--brand-primary-light); }
.side nav a.active, .mmenu nav a.active { background: var(--brand-primary); color: #fff; }

/* Mobile Kopfleiste + Menü (auf Desktop ausgeblendet) */
.mtopbar { display: none; }
.mmenu { display: none; }
.side .who { margin-top: 18px; padding: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.side .who b { color: var(--ink); display: block; }
.main { padding: 26px 30px; overflow: auto; }
.main h1 { font-size: 22px; margin: 0 0 4px; }
.main .sub { color: var(--ink-soft); margin: 0 0 20px; font-size: 14px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f1f6f8; }
.btn.primary { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.btn.primary:hover { background: var(--brand-primary-dark); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.danger { color: var(--risk); border-color: #e7c3c3; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #f7fafb; color: var(--ink-soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
tr:last-child td { border-bottom: none; }
.pill { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: #eef3f5; color: var(--ink-soft); font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.info { background: var(--brand-primary-light); color: var(--brand-primary-dark); }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--brand-primary-light); color: var(--brand-primary-dark); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--brand-primary); }
.chip.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.chip .cnt { opacity: .7; font-weight: 700; margin-left: 2px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.stat[data-go] { cursor: pointer; transition: all .12s; }
.stat[data-go]:hover { border-color: var(--brand-primary); transform: translateY(-1px); }
.stat .n { font-size: 30px; font-weight: 700; color: var(--brand-primary-dark); line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-bg { position: fixed; inset: 0; background: rgba(20,40,55,.4); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.linkbox { font-family: var(--font-mono); font-size: 12.5px; background: #f1f6f8; padding: 10px 12px; border-radius: 9px; word-break: break-all; }
.scene-edit { border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 12px; }
.scene-edit .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 11px; font-size: 14px; opacity: 0; transition: all .25s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.audit-log { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.audit-log div { padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.legal-doc h2 { font-size: 17px; margin: 0 0 10px; }
.legal-doc ol { padding-left: 20px; margin: 12px 0; }
.legal-doc li { margin-bottom: 9px; line-height: 1.5; }
.legal-doc .disc { font-size: 13.5px; color: var(--ink-soft); }
.post { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.post .meta { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.post .body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .main table { font-size: 13px; }
  th, td { padding: 9px 10px; }
  .bar { gap: 8px; }
  /* Mobile Kopfleiste sichtbar */
  .mtopbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .mtopbar .logo { height: 34px; }
  .mmenu.open { display: block; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px 16px; position: sticky; top: 55px; z-index: 29; box-shadow: var(--shadow); }
  .mmenu .who { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
  .mmenu .who b { color: var(--ink); display: block; }
}
