:root {
  --bg: #0e0e13;
  --panel: #141419;
  --card: #18181e;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.07);
  --text: #f4f4f7;
  --text-soft: rgba(244, 244, 247, 0.62);
  --text-faint: rgba(244, 244, 247, 0.36);
  --accent: #7c5cff;
  --accent-hover: #8d71ff;
  --green: #3ddc84;
  --yellow: #ffc23d;
  --red: #ff5470;
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  background:
    radial-gradient(50% 60% at 85% 10%, rgba(124, 92, 255, .12), transparent 70%),
    var(--bg);
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hidden { display: none !important; }

/* ============ Formulare ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }
.input {
  width: 100%;
  height: 42px; padding: 0 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, background .15s;
}
textarea.input { height: auto; min-height: 160px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: rgba(124, 92, 255, .6); background: rgba(124, 92, 255, .05); }
.input::placeholder { color: var(--text-faint); }
input[type="date"].input { color-scheme: dark; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  transition: background .15s, transform .15s, opacity .15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); box-shadow: 0 6px 20px rgba(124, 92, 255, .3); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger { background: rgba(255, 84, 112, .12); color: var(--red); border: 1px solid rgba(255, 84, 112, .25); }
.btn-danger:hover { background: rgba(255, 84, 112, .2); }

.error { font-size: 13px; color: var(--red); min-height: 18px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-soft); cursor: pointer; }
.toggle input { display: none; }
.toggle span {
  width: 36px; height: 20px; border-radius: 20px; background: var(--surface-hover); position: relative; transition: background .2s;
}
.toggle span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .2s;
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); }

/* ============ Login ============ */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; padding: 36px 32px 30px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.login-logo { display: block; width: 220px; max-width: 100%; margin: 0 auto 8px; }
.login-sub { text-align: center; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 28px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-card .btn { width: 100%; height: 44px; margin-top: 4px; }

/* ============ Panel-Layout ============ */
.layout { display: grid; grid-template-columns: 72px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 18px 0;
}
.sidebar .logo { width: 34px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.nav { display: flex; flex-direction: column; gap: 8px; margin: auto 0; }
.nav-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: var(--text-faint); transition: color .15s, background .15s;
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:hover { color: var(--text); background: var(--surface); }
.nav-btn.active { color: var(--accent); background: rgba(124, 92, 255, .12); }
.nav-btn.logout:hover { color: var(--red); }

.content { padding: 28px 40px 40px; max-width: 980px; width: 100%; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.topbar h1 { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.topbar p { font-size: 13px; color: var(--text-faint); margin-top: 4px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase;
}

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-head h2 { font-size: 15px; font-weight: 700; }
.muted { color: var(--text-faint); font-size: 13px; }

/* ============ News-Liste ============ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.stat { padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.stat span { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }
.stat b { display: block; font-size: 26px; font-weight: 800; margin-top: 6px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px;
  padding: 14px 16px 14px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s;
}
.row:hover { border-color: rgba(255, 255, 255, .14); }
.row-main { min-width: 0; }
.row-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 12px; color: var(--text-faint); text-align: right; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; margin-bottom: 4px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { color: var(--green); background: rgba(61, 220, 132, .1); }
.badge.draft { color: var(--yellow); background: rgba(255, 194, 61, .1); }

.row-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--text-faint); transition: background .15s, color .15s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); background: rgba(255, 84, 112, .12); }

.empty {
  padding: 48px 20px; text-align: center; color: var(--text-faint); font-size: 13px;
  border: 1px dashed var(--border); border-radius: 12px;
}

/* ============ Benutzer ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.card { padding: 22px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.card form { display: flex; flex-direction: column; gap: 14px; }
.card .btn { align-self: flex-start; }
.ok { font-size: 13px; color: var(--green); min-height: 18px; }

/* ============ Modal ============ */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(8, 8, 12, .7); backdrop-filter: blur(4px);
  animation: fade .2s ease;
}
.modal-card {
  width: 100%; max-width: 560px; padding: 26px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.modal-card h3 { font-size: 18px; margin-bottom: 20px; }
.modal-card form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.confirm-text { font-size: 14px; color: var(--text-soft); line-height: 1.55; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  padding: 11px 18px; border-radius: 10px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  animation: fade .2s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 720px) {
  .content { padding: 22px 18px 32px; }
  .stats, .grid-2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr auto; }
  .row-meta { display: none; }
  .user-chip span:last-child { display: none; }
}
