:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --border: #e2e4e9;
    --text: #22262f;
    --text-muted: #6b7280;
    --primary: #2f5fdb;
    --primary-dark: #2447ab;
    --danger: #d1453b;
    --ok-bg: #e8f7ee;
    --ok-text: #1c7a3e;
    --err-bg: #fdeaea;
    --err-text: #b3271b;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: #1b2130;
    color: #fff;
}
.topbar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.brand {
    color: #fff;
    font-weight: 600;
    padding: 14px 0;
    font-size: 1.05rem;
}
.topbar nav {
    display: flex;
    align-items: center;
    gap: 18px;
}
.topbar nav a {
    color: #cfd6e6;
    font-size: 0.92rem;
}
.topbar nav a:hover { color: #fff; }
.topbar .user {
    color: #8891a5;
    font-size: 0.85rem;
}
.topbar .logout {
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 6px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

h1 { font-size: 1.5rem; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 14px; }
.subtitle { color: var(--text-muted); margin-bottom: 22px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: center;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f0f1f4; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #ad2e26; }
.btn-sm { padding: 5px 10px; font-size: 0.82rem; }

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.94rem;
}
th { color: var(--text-muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
.actions { white-space: nowrap; text-align: right; }
.actions a, .actions button { margin-left: 8px; }

label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 5px; }
input[type=text], input[type=password], textarea, input[type=search] {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.92rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok-text); }
.flash.fehler { background: var(--err-bg); color: var(--err-text); }

.checkbox-list { list-style: none; margin: 0; padding: 0; }
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.checkbox-item:last-child { border-bottom: none; }
.checkbox-item input[type=checkbox] { margin-top: 4px; width: 17px; height: 17px; flex-shrink: 0; }
.checkbox-item .cb-title { font-weight: 600; margin-bottom: 3px; }
.checkbox-item .cb-preview { color: var(--text-muted); font-size: 0.87rem; white-space: pre-line; }
.checkbox-item .cb-edit { margin-left: auto; flex-shrink: 0; font-size: 0.82rem; }

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 26px 0 10px;
}

.login-wrap {
    max-width: 380px;
    margin: 90px auto 0;
}
.login-wrap h1 { text-align: center; margin-bottom: 4px; }
.login-wrap .subtitle { text-align: center; }

.empty { color: var(--text-muted); font-style: italic; padding: 10px 0; }
.help { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
