:root {
  --bg: #0E1A28;
  --panel: #15263A;
  --panel-2: #1C324A;
  --line: #28405C;
  --text: #EAF0F6;
  --text-dim: #8CA1B8;
  --text-faint: #5C7188;
  --signal: #D2A94A;
  --green: #4CAF7D;
  --amber: #D2A94A;
  --red: #E0654C;
  --font: -apple-system, 'Segoe UI', Manrope, sans-serif;
  --mono: ui-monospace, 'SF Mono', monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login ─────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; text-align: center; letter-spacing: 0.3px; }
.login-box input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
}
.login-box button {
  background: var(--signal);
  color: #1A1508;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-weight: 700;
  cursor: pointer;
}
.flash-error { color: var(--red); font-size: 13.5px; text-align: center; }

/* ── Layout ────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 16px; letter-spacing: 0.2px; }
.topbar nav a { margin-left: 16px; font-size: 13.5px; color: var(--text-dim); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
.wrap.narrow { max-width: 760px; }

.pagehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.pagehead h1 { font-size: 20px; margin: 0; }
.btn {
  display: inline-block;
  background: var(--signal);
  color: #1A1508;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.btn.secondary { background: transparent; border: 1px solid var(--line); color: var(--text-dim); }
.btn.small { padding: 6px 11px; font-size: 12.5px; }

/* ── Table ─────────────────────────────────────────── */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left;
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
table.list th a { color: var(--text-faint); }
table.list td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
table.list tr:hover td { background: var(--panel); }
table.list tr.row-link { cursor: pointer; }
.company-cell { font-weight: 700; }
.sub-cell { font-size: 12.5px; color: var(--text-faint); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.gruen { background: var(--green); }
.dot.gelb { background: var(--amber); }
.dot.rot { background: var(--red); }
.dot.offen { background: var(--text-faint); }

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-dim);
  border: 1px solid var(--line);
}
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters a {
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.filters a.active { background: var(--signal); color: #1A1508; border-color: var(--signal); }

/* ── Detail form ───────────────────────────────────── */
.section { margin-bottom: 26px; }
.section-title { font-size: 12px; font-weight: 700; color: var(--text-faint); letter-spacing: 0.3px; margin-bottom: 10px; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid.g3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--text-faint); font-weight: 600; }
.field input, .field select, .field textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font-family: var(--font);
  font-size: 14px;
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 1.5px solid var(--signal); }

.savebar { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1px solid var(--line); margin-top: 20px; }

/* ── Timeline ──────────────────────────────────────── */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: none; }
.ti-icon { font-size: 15px; width: 22px; flex-shrink: 0; text-align: center; padding-top: 1px; }
.ti-subject { font-weight: 600; font-size: 14px; }
.ti-body { font-size: 13.5px; color: var(--text-dim); margin-top: 3px; white-space: pre-wrap; }
.ti-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; font-family: var(--mono); }

.addnote { display: flex; gap: 8px; margin-top: 14px; }
.addnote textarea { flex: 1; }

.empty { color: var(--text-faint); font-size: 13.5px; padding: 20px 0; }
.sync-note { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
