:root {
  --bg: #f4f5f7; --card: #fff; --line: #e6e9ee; --border: #dde1e8; --text: #12151c; --muted: #6b7280;
  --accent: #7c3aed; --accent-soft: rgba(124,58,237,.12); --good: #16a34a; --bad: #dc2626; --warn: #d97706;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e1016; --card:#171a23; --line:#262b38; --border:#262b38; --text:#e8eaf0; --muted:#8b93a5; --accent:#a78bfa; --accent-soft: rgba(167,139,250,.14); }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin:0; font-family:"Inter",-apple-system,"Segoe UI",Helvetica,Arial,sans-serif; background:var(--bg); color:var(--text); }
a { color: var(--accent); }
i[data-lucide] { width:1em; height:1em; display:inline-block; vertical-align:-0.15em; flex:none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.wrap.center { max-width: 420px; padding-top: 10vh; }
.auth-mark { width:52px; height:52px; margin:0 auto 18px; border-radius:15px; background:linear-gradient(155deg,#8b5cf6,#6d28d9); color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:inset 0 1px 0 rgba(255,255,255,.25), 0 8px 20px -6px rgba(109,40,217,.55); }
.auth-mark i { width:26px; height:26px; }

.topbar { position: sticky; top:0; z-index:20; background:var(--card); border-bottom:1px solid var(--line); box-shadow:0 1px 0 rgba(15,23,42,.03); }
.topbar-inner { max-width:1080px; margin:0 auto; padding:0 20px; height:60px; display:flex; align-items:center; gap:22px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); font-weight:800; font-size:16px; }
.brand-mark { width:34px; height:34px; border-radius:10px; background:linear-gradient(155deg,#8b5cf6,#6d28d9); color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px -1px rgba(109,40,217,.5); }
.brand-mark i { width:18px; height:18px; }
.topnav { display:flex; gap:4px; flex:1; }
.topnav a { display:inline-flex; align-items:center; gap:7px; color:var(--muted); text-decoration:none; font-size:14px; font-weight:600; padding:8px 13px; border-radius:8px; transition:background .12s ease,color .12s ease; }
.topnav a i { width:15px; height:15px; }
.topnav a:hover { background:var(--line); color:var(--text); }
.topnav a.active { background:var(--accent-soft); color:var(--accent); }
.logout-form { margin:0; }
.logout-form .btn-ghost i { width:14px; height:14px; }

.flash { display:flex; align-items:center; gap:10px; padding:11px 16px; border-radius:10px; margin-bottom:18px; font-size:14px; font-weight:500; background:var(--accent-soft); color:var(--accent); border:1px solid var(--accent); }
.flash i { width:17px; height:17px; }
.flash.error { background:rgba(220,38,38,.1); color:var(--bad); border-color:var(--bad); }

h1 { font-size:23px; font-weight:800; margin:0 0 4px; letter-spacing:-.01em; }
h2 { font-size:16px; font-weight:700; margin:0 0 10px; display:flex; align-items:center; gap:8px; }
h2 i { width:17px; height:17px; color:var(--accent); }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:22px; }
.page-head h1 { display:flex; align-items:center; gap:11px; }
.page-head h1 i { width:22px; height:22px; color:var(--accent); }
.subtitle { color:var(--muted); font-size:13.5px; margin:0; }

.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:20px 22px; margin-bottom:16px; box-shadow:0 1px 2px rgba(15,23,42,.03), 0 10px 28px -20px rgba(15,23,42,.18); }
.card-pad-sm { padding: 14px 16px; }

.btn, button, input[type=submit] { font: inherit; }
.btn-primary { display:inline-flex; align-items:center; gap:8px; background:var(--accent); color:#fff; border:none; padding:10px 18px; border-radius:10px; font-weight:600; font-size:14px; cursor:pointer; text-decoration:none; box-shadow:0 4px 12px -4px rgba(124,58,237,.55); transition:transform .1s ease, box-shadow .1s ease; }
.btn-primary:hover { opacity:.95; transform:translateY(-1px); box-shadow:0 6px 16px -4px rgba(124,58,237,.6); }
.btn-primary:active { transform:translateY(0); }
.btn-ghost { display:inline-flex; align-items:center; gap:6px; background:var(--card); border:1px solid var(--border); color:var(--text); padding:9px 15px; border-radius:10px; font-weight:600; font-size:13.5px; cursor:pointer; text-decoration:none; transition:background .12s ease; }
.btn-ghost:hover { background:var(--line); }
.btn-danger { color:var(--bad); border-color:rgba(220,38,38,.35); }
.btn-sm { padding:6px 11px; font-size:12.5px; border-radius:8px; }
.btn-primary i, .btn-ghost i { width:15px; height:15px; }
.btn-sm i { width:13px; height:13px; }

label { display:block; font-size:13px; font-weight:600; color:var(--muted); margin-bottom:6px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], select, textarea {
  width:100%; padding:10px 13px; border:1px solid var(--border); border-radius:9px; background:var(--bg); color:var(--text); font-size:14.5px; outline:none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom:16px; }
.field-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field-sub { font-size:12px; color:var(--muted); margin-top:5px; }
.check-row { display:flex; align-items:center; gap:8px; font-weight:500; color:var(--text); font-size:14px; }
.check-row input { width:auto; }

table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--line); }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.03em; font-weight:700; }
tr:last-child td { border-bottom:none; }

.badge { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:20px; }
.badge i { width:12px; height:12px; }
.badge.ok { background:rgba(22,163,74,.12); color:var(--good); }
.badge.error { background:rgba(220,38,38,.12); color:var(--bad); }
.badge.pending { background:rgba(107,114,128,.14); color:var(--muted); }
.badge.admin { background:var(--accent-soft); color:var(--accent); }
.badge.member { background:rgba(107,114,128,.14); color:var(--muted); }
.badge.inactive { background:rgba(217,119,6,.12); color:var(--warn); }

/* Farbige Icon-Kreise für Statuskacheln, Watch-Zeilen etc. */
.icon-badge { width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; flex:none; }
.icon-badge i { width:19px; height:19px; }
.icon-badge.accent { background:var(--accent-soft); color:var(--accent); }
.icon-badge.good { background:rgba(22,163,74,.12); color:var(--good); }
.icon-badge.bad { background:rgba(220,38,38,.12); color:var(--bad); }
.icon-badge.warn { background:rgba(217,119,6,.12); color:var(--warn); }
.icon-badge.muted { background:rgba(107,114,128,.14); color:var(--muted); }
.icon-badge.sm { width:30px; height:30px; border-radius:9px; }
.icon-badge.sm i { width:15px; height:15px; }

.watch-row { display:flex; align-items:center; gap:14px; padding:14px 4px; border-bottom:1px solid var(--line); border-radius:10px; transition:background .12s ease; }
.watch-row:hover { background:var(--bg); }
.watch-row:last-child { border-bottom:none; }
.watch-main { min-width:0; flex:1; }
.watch-label { font-weight:700; font-size:15px; display:block; text-decoration:none; color:var(--text); }
.watch-url { color:var(--muted); font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:520px; }
.watch-meta { display:flex; align-items:center; gap:10px; font-size:12px; color:var(--muted); flex:none; }
.watch-meta .sep { color:var(--border); }
.watch-actions { display:flex; gap:6px; flex:none; }

.empty { display:flex; flex-direction:column; align-items:center; gap:10px; color:var(--muted); font-size:14px; padding:40px 0; text-align:center; }
.empty i { width:30px; height:30px; color:var(--border); }

.diff ins { background:rgba(22,163,74,.18); text-decoration:none; color:inherit; border-radius:2px; }
.diff del { background:rgba(220,38,38,.16); text-decoration:line-through; color:inherit; opacity:.85; border-radius:2px; }
.diff { white-space:pre-wrap; word-break:break-word; font-size:13.5px; line-height:1.55; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:16px; max-height:520px; overflow:auto; }

.event-item { border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:12px; }
.event-item .when { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); margin-bottom:8px; font-weight:600; }
.event-item .when i { width:13px; height:13px; }

.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:22px; }
.stat { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; display:flex; align-items:center; gap:13px; box-shadow:0 1px 2px rgba(15,23,42,.03), 0 10px 28px -20px rgba(15,23,42,.18); }
.stat .n { font-size:21px; font-weight:800; line-height:1.15; }
.stat .l { font-size:11.5px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.03em; }

@media (max-width:640px) {
  .field-row { grid-template-columns:1fr; }
  .watch-row { flex-direction:column; align-items:flex-start; }
  .watch-url { max-width:100%; }
  .topnav { gap:0; }
  .topnav a span.lbl { display:none; }
}

.ww-picker-modal { position:fixed; inset:0; background:rgba(15,23,42,.55); z-index:50; display:flex; align-items:center; justify-content:center; padding:24px; }
.ww-picker-modal[hidden] { display:none; }
.ww-picker-box { background:var(--card); border-radius:14px; box-shadow:0 20px 60px -20px rgba(15,23,42,.45); width:min(1000px,100%); height:min(80vh,780px); display:flex; flex-direction:column; overflow:hidden; }
.ww-picker-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:1px solid var(--line); }
.ww-picker-frame { flex:1; border:0; width:100%; background:#fff; }
