:root {
  --ink: #1f2430;
  --ink-soft: #5b6270;
  --ink-faint: #8991a0;
  --line: #e2e5ea;
  --line-strong: #cdd2da;
  --page: #f6f7f9;
  --card: #ffffff;
  --accent: #2f5d8a;
  --accent-dark: #274d73;
  --danger: #a3312c;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }
.topbar-actions { display: flex; gap: 10px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.count { font-size: 13px; color: var(--ink-faint); }

select, input, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 8px 10px; background: #fff; width: 100%;
}
.filters select { width: auto; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; }

button {
  font-family: inherit; font-size: 13.5px; cursor: pointer;
  border-radius: 6px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); padding: 8px 14px;
}
button:hover { background: #f1f2f4; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-dark); }
button.danger { color: var(--danger); border-color: #e3b6b3; }
button.danger:hover { background: #fdefee; }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: #eceef1; }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.app-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; display: grid;
  grid-template-columns: 1fr auto; gap: 4px 16px; cursor: pointer;
}
.app-card:hover { border-color: var(--line-strong); box-shadow: 0 1px 4px rgba(20,24,32,0.06); }
.app-card .firma { font-weight: 600; font-size: 15px; }
.app-card .jobtitel { color: var(--ink-soft); font-size: 13px; }
.app-card .meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--ink-faint); }
.app-card .meta-row span { display: inline-flex; align-items: center; gap: 4px; }
.app-card .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; white-space: nowrap;
}
.st-neutral { background: #eef0f2; color: #5b6270; }
.st-progress { background: #e6f1fb; color: #185fa5; }
.st-interview { background: #faeeda; color: #854f0b; }
.st-success { background: #eaf3de; color: #3b6d11; }
.st-fail { background: #fcebeb; color: #a32d2d; }
.remote-tag { font-size: 11.5px; color: var(--ink-soft); background: #f1f2f4; border-radius: 4px; padding: 2px 8px; }

.empty { text-align: center; color: var(--ink-faint); padding: 60px 16px; }

.overlay {
  position: fixed; inset: 0; background: rgba(20,24,32,0.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 660px;
  padding: 24px; max-height: 92vh; overflow-y: auto;
}
.modal.small { max-width: 480px; }
.modal.wide { max-width: 860px; }
.modal h2 { font-size: 17px; margin: 0 0 12px; }
.hint { font-size: 12.5px; color: var(--ink-faint); margin: 0 0 12px; line-height: 1.5; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.modal-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px;
}
.modal-actions .right { display: flex; gap: 8px; }

.extract-status { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.extract-status.error { color: var(--danger); }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.detail-head h2 { margin: 0 0 2px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-info dl { margin: 0 0 12px; font-size: 13.5px; }
.detail-info dt { color: var(--ink-faint); font-size: 12px; font-weight: 600; margin-top: 8px; }
.detail-info dd { margin: 1px 0 0; }
.detail-links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.detail-links a { font-size: 13px; color: var(--accent); text-decoration: none; }
.detail-links a:hover { text-decoration: underline; }
.detail-links a.disabled { color: var(--ink-faint); pointer-events: none; }
.notes { font-size: 13.5px; margin: 0; white-space: pre-wrap; }
.map { height: 300px; border-radius: 10px; border: 1px solid var(--line); }
.desc-details { margin-top: 16px; }
.desc-details summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.desc-details pre {
  white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.55;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; max-height: 400px; overflow-y: auto;
}

/* ---------- Login ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; background: var(--page);
}
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 32px; width: 100%; max-width: 380px;
}
.login-logo { font-size: 18px; margin: 0 0 6px; }
.error {
  font-size: 13px; color: var(--danger); background: #fdefee;
  border: 1px solid #e3b6b3; border-radius: 6px; padding: 8px 10px; margin: 0 0 12px;
}
button.block { width: 100%; padding: 10px; }

/* ---------- Einstellungen ---------- */
.sep { border: none; border-top: 1px solid var(--line); margin: 22px 0 16px; }
.sub-head { font-size: 14px; margin: 0 0 10px; }
.ok-msg {
  font-size: 13px; color: #3b6d11; background: #eaf3de;
  border: 1px solid #c0dd97; border-radius: 6px; padding: 8px 10px; margin: 0 0 12px;
}
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .topbar-actions button { flex: 1 1 auto; }
}

/* ---------- Suche, Sortierung, Ansichtsumschalter ---------- */
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.search { flex: 1; font-size: 14px; padding: 10px 12px; }
.view-switch { display: flex; align-items: center; gap: 8px; }
button.seg { border-radius: 6px; padding: 7px 14px; }
button.seg.active { background: var(--accent); border-color: var(--accent); color: #fff; }
button.seg.active:hover { background: var(--accent-dark); }

/* Treffer in der Suche hervorheben */
mark { background: #fdf0c8; color: inherit; border-radius: 2px; padding: 0 1px; }
.snippet {
  font-size: 12.5px; color: var(--ink-soft); margin-top: 6px;
  border-left: 2px solid var(--line-strong); padding-left: 8px; line-height: 1.5;
}

/* ---------- Kartenansicht ---------- */
.overview-map-wrap { position: relative; }
.overview-map {
  height: 560px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.map-hover {
  position: absolute; top: 12px; right: 12px; z-index: 500;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 14px; max-width: 260px; pointer-events: none;
  box-shadow: 0 2px 10px rgba(20,24,32,0.12);
}
.map-hover .mh-firma { font-weight: 600; font-size: 14px; }
.map-hover .mh-job { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.map-hover .mh-meta { font-size: 12px; color: var(--ink-faint); margin-top: 6px; line-height: 1.6; }
.map-hover .badge { margin-top: 8px; }
.map-legend {
  font-size: 12px; color: var(--ink-faint); margin-top: 10px;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.resolved {
  font-size: 12px; color: var(--ink-faint); margin-top: 2px; line-height: 1.45;
}
