:root {
  --bg:           #f4f5f7;
  --surface:      #ffffff;
  --surface2:     #f8f9fb;
  --border:       #dde1e8;
  --border-subtle:#eaedf2;
  --primary:      #1a3a6b;
  --primary-hover:#142e57;
  --primary-dim:  rgba(26,58,107,.07);
  --text:         #1a1f2e;
  --text-muted:   #6b7485;
  --success:      #1a7a4a;
  --warning:      #8a5e00;
  --danger:       #b52626;
  --accent:       #1a3a6b;
}

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

html { font-size: 15px; }

body {
  font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Topbar ─── */
.topbar {
  height: 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-brand { display: flex; align-items: center; gap: 16px; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--primary); letter-spacing: -.01em; }
.brand-divider { width: 1px; height: 18px; background: var(--border); }
.brand-tag { font-size: 12px; color: var(--text-muted); font-weight: 500; letter-spacing: .01em; }

/* ─── Hero (Landing) ─── */
.hero { display:flex; align-items:center; justify-content:center; min-height:calc(100vh - 54px); padding:40px 24px; }
.hero-inner { text-align:center; max-width:480px; }
.hero-inner h1 { font-size:28px; font-weight:700; color:var(--text); margin-bottom:14px; letter-spacing:-.02em; }
.hero-sub { color:var(--text-muted); font-size:15px; margin-bottom:28px; line-height:1.65; }
.contact-box { background:var(--surface); border:1px solid var(--border); border-radius:6px; padding:14px 20px; font-size:13px; color:var(--text-muted); }
.contact-box a { color:var(--primary); text-decoration:none; font-weight:500; }

/* ─── Login ─── */
.login-wrap { display:flex; align-items:center; justify-content:center; min-height:calc(100vh - 54px); padding:40px 24px; }
.login-card { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:40px 36px; width:100%; max-width:400px; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.login-card h2 { font-size:18px; font-weight:700; margin-bottom:6px; color:var(--text); }
.login-card .subtitle { font-size:13px; color:var(--text-muted); margin-bottom:28px; }

/* ─── Form Wizard ─── */
.form-wrap { display:flex; min-height:calc(100vh - 54px); }
.sidebar {
  width:240px; min-width:210px; background:var(--surface); border-right:1px solid var(--border);
  padding:28px 16px; position:sticky; top:54px; height:calc(100vh - 54px); overflow-y:auto;
}
.sidebar-title { font-size:10px; font-weight:700; letter-spacing:.1em; color:var(--text-muted); text-transform:uppercase; margin-bottom:16px; padding:0 8px; }
.step-list { list-style:none; padding:0; margin:0; }
.step-list li {
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:5px;
  cursor:pointer; margin-bottom:2px; font-size:13px; color:var(--text-muted); transition:all .12s;
}
.step-list li.active { background:var(--primary-dim); color:var(--primary); font-weight:600; }
.step-list li.done { color:var(--success); }
.step-list li .step-num {
  width:20px; height:20px; border-radius:3px; border:1.5px solid currentColor;
  display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; flex-shrink:0;
}
.step-list li.done .step-num { background:var(--success); border-color:var(--success); color:#fff; font-size:9px; }
.step-list li.done .step-num::after { content:'ok'; font-size:8px; font-weight:800; letter-spacing:-.02em; }
.step-list li.done .step-num span { display:none; }

.form-main { flex:1; padding:36px 48px; max-width:820px; }
.module-header { margin-bottom:28px; }
.module-badge {
  display:inline-block; background:var(--primary-dim); color:var(--primary);
  font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  padding:3px 9px; border-radius:3px; margin-bottom:10px; border:1px solid rgba(26,58,107,.15);
}
.module-title { font-size:21px; font-weight:700; color:var(--text); margin:0 0 7px 0; letter-spacing:-.01em; }
.module-desc { color:var(--text-muted); font-size:13.5px; line-height:1.65; }

.form-group { margin-bottom:20px; }
.form-group label { display:block; font-size:12.5px; font-weight:600; color:var(--text); margin-bottom:6px; letter-spacing:.01em; }
.form-group label .req { color:var(--danger); margin-left:2px; }
.form-group label .hint { font-weight:400; color:var(--text-muted); font-size:12px; margin-left:6px; }

input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], select, textarea {
  width:100%; background:var(--surface); border:1px solid var(--border); color:var(--text);
  border-radius:5px; padding:10px 13px; font-size:13.5px; font-family:inherit; transition:border .12s;
  box-sizing:border-box;
}
input:focus, select:focus, textarea:focus {
  outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(26,58,107,.08);
}
select {
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7485' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:34px;
}
textarea { resize:vertical; min-height:88px; }

.ync-group { display:flex; gap:8px; flex-wrap:wrap; }
.ync-btn {
  flex:1; min-width:80px; padding:9px 12px; background:var(--surface); border:1px solid var(--border);
  border-radius:5px; color:var(--text-muted); font-size:13px; font-weight:500;
  cursor:pointer; text-align:center; transition:all .12s; user-select:none; font-family:inherit;
}
.ync-btn:hover { border-color:var(--primary); color:var(--text); }
.ync-btn.selected-ja { background:rgba(26,122,74,.07); border-color:var(--success); color:var(--success); font-weight:600; }
.ync-btn.selected-nein { background:var(--surface2); border-color:#adb5c2; color:var(--text-muted); font-weight:600; }
.ync-btn.selected-unklar { background:rgba(138,94,0,.07); border-color:var(--warning); color:var(--warning); font-weight:600; }

.checkbox-group { display:flex; flex-direction:column; gap:8px; }
.checkbox-item {
  display:flex; align-items:flex-start; gap:12px; padding:11px 14px;
  background:var(--surface); border:1px solid var(--border); border-radius:5px; cursor:pointer; transition:all .12s;
}
.checkbox-item:hover { border-color:var(--primary); }
.checkbox-item.checked { background:var(--primary-dim); border-color:rgba(26,58,107,.3); }
.checkbox-item input[type=checkbox] { width:16px; height:16px; margin-top:2px; accent-color:var(--primary); flex-shrink:0; }
.checkbox-item .cb-label { font-size:13.5px; color:var(--text); line-height:1.5; }
.checkbox-item .cb-tag {
  display:inline-block; background:var(--surface2); border:1px solid var(--border);
  color:var(--text-muted); font-size:10.5px; padding:1px 7px; border-radius:3px; margin-left:7px;
}

.tool-table { width:100%; border-collapse:collapse; font-size:13px; }
.tool-table th {
  text-align:left; padding:8px 10px; color:var(--text-muted);
  font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  border-bottom:2px solid var(--border);
}
.tool-table td { padding:5px 6px; border-bottom:1px solid var(--border-subtle); }
.tool-table td input { padding:7px 10px; font-size:13px; }
.tool-table .del-btn {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  font-size:15px; padding:4px 8px; border-radius:3px;
}
.tool-table .del-btn:hover { color:var(--danger); }
.add-row-btn {
  margin-top:10px; background:none; border:1px dashed var(--border); color:var(--text-muted);
  padding:8px 16px; border-radius:5px; cursor:pointer; font-size:13px; width:100%;
  transition:all .12s; font-family:inherit;
}
.add-row-btn:hover { border-color:var(--primary); color:var(--primary); }

.trigger-row {
  display:grid; grid-template-columns:1fr auto; gap:16px; align-items:center;
  padding:14px 16px; background:var(--surface); border:1px solid var(--border);
  border-radius:5px; margin-bottom:8px;
}
.trigger-label { font-size:13.5px; color:var(--text); font-weight:500; }
.trigger-label small { display:block; color:var(--text-muted); font-size:12px; font-weight:400; margin-top:2px; }

.row2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.section-divider { margin:24px 0; border:none; border-top:1px solid var(--border); }

.info-box {
  background:var(--primary-dim); border:1px solid rgba(26,58,107,.18);
  border-radius:5px; padding:13px 16px; margin-bottom:22px; font-size:13px;
  color:var(--primary); line-height:1.6;
}

.progress-bar { height:3px; background:var(--border); border-radius:2px; margin-bottom:28px; }
.progress-fill { height:100%; background:var(--primary); border-radius:2px; transition:width .3s; }

.form-nav {
  display:flex; justify-content:space-between; align-items:center;
  margin-top:36px; padding-top:22px; border-top:1px solid var(--border);
}

.btn {
  display:inline-flex; align-items:center; gap:6px; padding:9px 18px;
  border-radius:5px; font-size:13.5px; font-weight:600; cursor:pointer;
  border:none; transition:all .12s; font-family:inherit; text-decoration:none;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-hover); }
.btn-ghost { background:var(--surface); color:var(--text-muted); border:1px solid var(--border); }
.btn-ghost:hover { color:var(--text); border-color:#9aa0af; }
.btn-success { background:var(--success); color:#fff; }
.btn-danger { background:rgba(181,38,38,.08); color:var(--danger); border:1px solid rgba(181,38,38,.2); }
.btn-danger:hover { background:rgba(181,38,38,.14); }
.btn-sm { padding:6px 12px; font-size:12px; }

/* ─── Admin ─── */
.admin-wrap { max-width:1200px; margin:0 auto; padding:32px 32px; }
.admin-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.admin-header h1 { font-size:20px; font-weight:700; color:var(--text); }

.stats-row { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:24px; }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:6px; padding:18px 20px; }
.stat-card .stat-num { font-size:28px; font-weight:700; color:var(--text); line-height:1; margin-bottom:5px; }
.stat-card .stat-label { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.07em; font-weight:600; }

.table-card { background:var(--surface); border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.data-table { width:100%; border-collapse:collapse; font-size:13px; }
.data-table th {
  text-align:left; padding:11px 14px; font-size:10.5px; font-weight:700;
  letter-spacing:.07em; text-transform:uppercase; color:var(--text-muted);
  background:var(--surface2); border-bottom:1px solid var(--border);
}
.data-table td { padding:12px 14px; border-bottom:1px solid var(--border-subtle); color:var(--text); vertical-align:middle; }
.data-table tr:last-child td { border-bottom:none; }
.data-table tr:hover td { background:var(--surface2); }
.data-table a { color:var(--primary); text-decoration:none; font-weight:500; }

.status-badge { display:inline-block; padding:2px 9px; border-radius:3px; font-size:11px; font-weight:600; letter-spacing:.03em; }
.status-pending    { background:var(--surface2); color:var(--text-muted); border:1px solid var(--border); }
.status-in_progress { background:rgba(138,94,0,.08); color:var(--warning); border:1px solid rgba(138,94,0,.2); }
.status-submitted  { background:rgba(26,122,74,.08); color:var(--success); border:1px solid rgba(26,122,74,.2); }

.progress-cell { display:flex; align-items:center; gap:8px; }
.mini-bar { flex:1; height:4px; background:var(--border); border-radius:2px; max-width:72px; }
.mini-fill { height:100%; background:var(--primary); border-radius:2px; }

/* ─── Admin Detail ─── */
.detail-grid { display:grid; grid-template-columns:1fr 300px; gap:20px; margin-top:20px; }
.detail-card { background:var(--surface); border:1px solid var(--border); border-radius:6px; padding:20px; margin-bottom:16px; }
.detail-card h3 {
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
  color:var(--text-muted); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--border);
}
.detail-row { display:flex; gap:12px; margin-bottom:7px; font-size:13px; }
.detail-row .dk { color:var(--text-muted); min-width:180px; flex-shrink:0; }
.detail-row .dv { color:var(--text); }
.copy-link { background:var(--surface2); border:1px solid var(--border); border-radius:5px; padding:9px 12px; font-size:11.5px; font-family:monospace; color:var(--primary); word-break:break-all; margin-bottom:10px; }

.admin-notes { width:100%; background:var(--surface2); border:1px solid var(--border); color:var(--text); border-radius:5px; padding:10px 12px; font-size:13px; font-family:inherit; resize:vertical; min-height:90px; }

/* ─── Success / Error ─── */
.success-wrap { display:flex; align-items:center; justify-content:center; min-height:calc(100vh - 54px); padding:40px 24px; }
.success-card { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:48px 40px; max-width:480px; text-align:center; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.success-card h2 { font-size:20px; font-weight:700; margin-bottom:12px; color:var(--text); }
.success-card p { color:var(--text-muted); font-size:14px; line-height:1.7; }

.error-box { background:rgba(181,38,38,.06); border:1px solid rgba(181,38,38,.2); color:var(--danger); border-radius:5px; padding:10px 14px; font-size:13px; margin-bottom:16px; }

/* ─── Utilities ─── */
.hidden { display:none !important; }

@media (max-width:900px) {
  .form-wrap { flex-direction:column; }
  .sidebar { width:100%; height:auto; position:static; padding:16px; overflow-x:auto; }
  .step-list { flex-direction:row; display:flex; gap:4px; }
  .step-list li { white-space:nowrap; }
  .form-main { padding:24px 20px; }
  .row2 { grid-template-columns:1fr; }
  .stats-row { grid-template-columns:1fr 1fr; }
  .detail-grid { grid-template-columns:1fr; }
  .trigger-row { grid-template-columns:1fr; }
}
@media (max-width:480px) {
  .stats-row { grid-template-columns:1fr; }
  .admin-wrap { padding:20px 16px; }
  .form-main { padding:20px 16px; }
}
