:root {
    --bg: #0b132b;
    --primary: #16a34a;
    --primary-dark: #15803d;
    --accent: #2563eb;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --surface: #ffffff;
    --danger: #dc2626;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; background: #f1f5f9; color: var(--text); line-height: 1.5; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem; height: 56px; background: var(--bg); color: #e2e8f0; }
.brand { font-weight: 700; font-size: 1.1rem; color: #fff; text-decoration: none; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 1.25rem; flex: 1; }
.nav a { color: #cbd5e1; text-decoration: none; font-size: .95rem; }
.nav a:hover { color: #fff; }
.nav-spacer { flex: 1; }

.status-pill { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(255,255,255,.1); }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #64748b; }
.status-pill.on .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.status-pill.off .dot { background: #ef4444; }

.content { max-width: 1150px; margin: 2rem auto; padding: 0 1.5rem; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.subtitle { color: var(--muted); margin: 0 0 1.5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 850px) { .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 460px; margin: 3rem auto; }

.stat { display: flex; flex-direction: column; gap: .25rem; }
.stat .value { font-size: 2rem; font-weight: 700; }
.stat .value.pos { color: var(--primary); }
.stat .value.accent { color: var(--accent); }
.stat .label { color: var(--muted); font-size: .9rem; }

.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
    width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; font-size: .95rem; font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.checkbox { display: flex; align-items: center; gap: .5rem; }
.checkbox input { width: auto; }
.checkbox label { margin: 0; font-weight: 400; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; align-items: center; flex-wrap: wrap; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

.btn { display: inline-block; padding: .55rem 1.1rem; border-radius: 8px; border: 1px solid transparent; font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.table th { background: #f8fafc; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-ban { background: #fee2e2; color: #991b1b; }
.badge-off { background: #f1f5f9; color: #64748b; }
.badge-wd { background: #fef3c7; color: #b45309; }
.badge-ff { background: #dbeafe; color: #1d4ed8; }
.kuerzel { display: inline-block; min-width: 2.2rem; text-align: center; font-weight: 700; background: #eef2ff; color: #4338ca; border-radius: 6px; padding: .1rem .4rem; }
.amount-pos { color: var(--primary); font-weight: 600; }
.amount-neg { color: var(--danger); font-weight: 600; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: .92rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }

.conn-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.conn-list li { padding: .3rem 0; border-bottom: 1px solid var(--border); }
.conn-list li:last-child { border-bottom: none; }

.log { list-style: none; padding: 0; margin: 0; font-family: "Cascadia Code", Consolas, monospace; font-size: .82rem; max-height: 360px; overflow-y: auto; }
.log li { padding: .2rem .4rem; border-radius: 4px; display: flex; gap: .6rem; }
.log .t { color: var(--muted); white-space: nowrap; }
.log .In { color: #15803d; }
.log .Out { color: #b45309; }
.log .Error { color: #b91c1c; }
.log .Ban { color: #be123c; font-weight: 600; }
