/* ===== Reset & base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0e1116; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #e7ecf2;
}
button, input, select, textarea { font-family: 'IBM Plex Sans', sans-serif; }
.mono { font-family: 'IBM Plex Mono', monospace; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0e1116; }
::-webkit-scrollbar-thumb { background: #2a3340; border-radius: 6px; border: 2px solid #0e1116; }
::-webkit-scrollbar-thumb:hover { background: #36424f; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 4px; background: #2a3340; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%; background: #16c0a8;
  cursor: pointer; border: 2px solid #0e1116; box-shadow: 0 0 0 1px #16c0a8;
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #16c0a8;
  cursor: pointer; border: 2px solid #0e1116; box-shadow: 0 0 0 1px #16c0a8;
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0e1116;
  color: #e7ecf2;
  overflow: hidden;
}

/* ===== Topbar ===== */
.topbar {
  height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
  background: #11161d;
  border-bottom: 1px solid #232c37;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.topbar-logo { height: 18px; width: auto; display: block; }
.topbar-divider { width: 1px; height: 22px; background: #2a3340; }
.topbar-title { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: #cdd6e0; }

.topbar-nav { display: flex; gap: 4px; }
.nav-btn {
  height: 32px; padding: 0 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: #9aa7b5;
}
.nav-btn.active { border-color: #16c0a8; background: rgba(22,192,168,0.12); color: #16c0a8; }

.topbar-search { flex: 1; max-width: 420px; position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #6b7886; font-size: 13px; }
.search-input {
  width: 100%; height: 34px; padding: 0 12px 0 30px;
  background: #0e1116; border: 1px solid #2a3340; border-radius: 8px;
  color: #e7ecf2; font-size: 13px; outline: none;
}
.search-input:focus { border-color: #16c0a8; }

.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.crawl-info { text-align: right; line-height: 1.25; }
.crawl-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7886; }
.crawl-value { font-size: 12px; font-family: 'IBM Plex Mono', monospace; color: #9aa7b5; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 6px;
  background: #0e1116; border: 1px solid #2a3340; border-radius: 20px;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #16c0a8; color: #04201c; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.user-text { line-height: 1.2; }
.user-name { font-size: 12px; font-weight: 600; }
.user-role { font-size: 10px; color: #6b7886; }

/* ===== Views ===== */
.view { flex: 1; display: none; min-height: 0; flex-direction: column; }
.view.active { display: flex; }
.view--config { overflow-y: auto; padding: 22px 28px 40px; }
.view--config.active { display: block; }
.config-inner { max-width: 1180px; margin: 0 auto; }
.config-h2 { font-size: 18px; font-weight: 600; margin: 0 0 3px; }
.config-h2:not(:first-child) { margin-top: 0; }
.config-p { font-size: 13px; color: #6b7886; margin: 0 0 16px; }

/* ===== KPI header ===== */
.kpi-grid {
  flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
  padding: 16px 20px;
}
.kpi-card {
  background: #151a21; border: 1px solid #232c37; border-radius: 12px;
  padding: 15px 17px; position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.kpi-card--teal::before { background: #16c0a8; }
.kpi-card--blue::before { background: #38bdf8; }
.kpi-card--red::before { background: #f87171; }
.kpi-card--green::before { background: #34d399; }
.kpi-label { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: #9aa7b5; }
.kpi-value {
  font-family: 'IBM Plex Mono', monospace; font-size: 34px; font-weight: 600;
  line-height: 1.1; margin-top: 6px;
}
.kpi-value--blue { color: #38bdf8; }
.kpi-value--red { color: #f87171; }
.kpi-value--green { color: #34d399; }
.kpi-sub { font-size: 11px; color: #6b7886; margin-top: 2px; }

/* ===== Filter + list row ===== */
.content-row { flex: 1; display: flex; min-height: 0; padding: 0 20px 20px; }

.filter-sidebar {
  flex: 0 0 248px; background: #151a21; border: 1px solid #232c37; border-radius: 12px;
  margin-right: 14px; display: flex; flex-direction: column; overflow: hidden;
}
.filter-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.filter-title { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #cdd6e0; }
.filter-reset { background: none; border: none; color: #16c0a8; font-size: 11px; font-weight: 600; cursor: pointer; padding: 2px; }
.filter-body { flex: 1; overflow-y: auto; padding: 0 16px 18px; }
.filter-group-label { font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: #6b7886; margin: 16px 0 8px; }
.filter-body .filter-group-label:first-child { margin-top: 6px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 7px;
  cursor: pointer; transition: all .12s;
  border: 1px solid #2a3340; color: #9aa7b5; background: transparent;
}
.chip.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }

.select-field {
  width: 100%; height: 32px; padding: 0 8px; margin-top: 6px;
  background: #0e1116; border: 1px solid #2a3340; border-radius: 7px;
  color: #e7ecf2; font-size: 12px;
}

.range-row { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; }
.range-row-label { font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: #6b7886; }
.range-row-value { font-size: 11px; font-family: 'IBM Plex Mono', monospace; color: #16c0a8; }
.range-input { width: 100%; }
.range-scale {
  display: flex; justify-content: space-between; margin-top: 4px;
  font-size: 9px; color: #4f5a67; font-family: 'IBM Plex Mono', monospace;
}

/* ===== List panel ===== */
.list-panel {
  flex: 1; background: #151a21; border: 1px solid #232c37; border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.list-toolbar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #232c37;
}
.list-count { font-size: 13px; color: #9aa7b5; }
.list-count strong { font-family: 'IBM Plex Mono', monospace; color: #e7ecf2; font-weight: 600; }
.export-buttons { display: flex; gap: 8px; }
.btn-export {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  background: #0e1116; border: 1px solid #2a3340; border-radius: 7px;
  color: #cdd6e0; font-size: 12px; font-weight: 500; cursor: pointer;
}
.btn-export:hover { border-color: #16c0a8; }

.list-header, .list-row {
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) 168px 132px 110px 92px 128px;
  gap: 12px; align-items: center;
}
.list-header {
  flex: 0 0 auto; padding: 9px 16px; border-bottom: 1px solid #232c37;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7886;
}
.lh-elig { text-align: center; }
.lh-cell.sortable { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.lh-cell.sortable:hover { color: #cdd6e0; }
.sort-arrow { color: #16c0a8; }

.list-body { flex: 1; overflow-y: auto; }
.list-row { padding: 11px 16px; border-bottom: 1px solid #1a2027; cursor: pointer; }
.list-row:hover { background: #1a2129; }

.cell-elig { display: flex; justify-content: center; }
.elig-badge {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600;
}
.cell-title { min-width: 0; }
.title-row { display: flex; align-items: center; gap: 8px; }
.badge-new {
  flex: 0 0 auto; font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  color: #38bdf8; background: rgba(56,189,248,0.14); padding: 1px 5px; border-radius: 4px;
}
.row-title {
  font-size: 13px; font-weight: 600; color: #e7ecf2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub {
  font-size: 11px; color: #6b7886; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deadline-date { font-size: 12px; font-family: 'IBM Plex Mono', monospace; color: #cdd6e0; }
.frist-pill { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; }
.frist-dot { width: 7px; height: 7px; border-radius: 50%; }
.frist-text { font-size: 10px; }
.cell-value { font-size: 13px; font-family: 'IBM Plex Mono', monospace; color: #cdd6e0; }
.score-track { height: 5px; border-radius: 3px; background: #232c37; overflow: hidden; }
.score-fill { height: 100%; }
.cell-source { font-size: 11px; color: #9aa7b5; }
.status-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }

.empty-state { padding: 60px 20px; text-align: center; color: #6b7886; }
.empty-state-icon { font-size: 32px; margin-bottom: 8px; }
.empty-state-title { font-size: 14px; }
.empty-state-sub { font-size: 12px; margin-top: 4px; }

/* ===== Config view ===== */
.profiles-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 34px; }
.profile-card { background: #151a21; border: 1px solid #232c37; border-radius: 12px; padding: 16px 18px; }
.profile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.profile-name-row { display: flex; align-items: center; gap: 9px; }
.profile-dot { width: 9px; height: 9px; border-radius: 50%; }
.profile-name { font-size: 14px; font-weight: 600; }
.profile-toggle {
  font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 14px;
  cursor: pointer; border: 1px solid; background: transparent;
}
.profile-block-label {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7886; margin-bottom: 6px;
}
.chip-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.kw-chip { font-size: 11px; padding: 2px 8px; background: #0e1116; border: 1px solid #2a3340; border-radius: 5px; color: #cdd6e0; }
.cpv-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.cpv-chip {
  font-size: 11px; font-family: 'IBM Plex Mono', monospace; padding: 2px 8px;
  background: rgba(22,192,168,0.1); border: 1px solid rgba(22,192,168,0.3); border-radius: 5px; color: #16c0a8;
}
.region-chip { font-size: 11px; padding: 2px 8px; background: #0e1116; border: 1px solid #2a3340; border-radius: 5px; color: #9aa7b5; }
.profile-min-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.profile-min-label { font-size: 11px; color: #6b7886; }
.profile-min-value { font-size: 12px; font-family: 'IBM Plex Mono', monospace; color: #cdd6e0; }

.sources-table { background: #151a21; border: 1px solid #232c37; border-radius: 12px; overflow: hidden; }
.sources-head, .source-row {
  display: grid; grid-template-columns: 48px minmax(0,1.6fr) 1fr 150px 110px 90px; gap: 14px;
}
.sources-head {
  padding: 11px 18px; border-bottom: 1px solid #232c37;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7886;
}
.source-row { align-items: center; padding: 13px 18px; border-bottom: 1px solid #1a2027; }
.source-row:last-child { border-bottom: none; }
.align-right { text-align: right; }
.source-toggle-btn {
  width: 34px; height: 19px; border-radius: 11px; border: none; cursor: pointer;
  position: relative; transition: background .15s;
}
.source-toggle-knob {
  position: absolute; top: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; transition: left .15s;
}
.source-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-url { font-size: 11px; color: #6b7886; font-family: 'IBM Plex Mono', monospace; }
.source-method, .source-freq, .source-last { font-size: 12px; color: #9aa7b5; }
.source-freq, .source-last { font-family: 'IBM Plex Mono', monospace; }
.source-items { text-align: right; font-size: 13px; font-family: 'IBM Plex Mono', monospace; color: #cdd6e0; }

/* ===== Detail drawer ===== */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(6,9,13,0.6); z-index: 90;
  transition: opacity .22s; opacity: 0; pointer-events: none;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 760px; max-width: 94vw;
  background: #151a21; border-left: 1px solid #232c37; z-index: 91;
  box-shadow: -20px 0 50px rgba(0,0,0,0.5);
  transition: transform .26s cubic-bezier(.22,.61,.36,1);
  transform: translateX(102%);
}
.drawer.open { transform: translateX(0); }
.drawer-inner { height: 100%; display: flex; flex-direction: column; }

.drawer-head { flex: 0 0 auto; padding: 18px 22px 16px; border-bottom: 1px solid #232c37; }
.drawer-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-head-left { display: flex; align-items: center; gap: 10px; }
.drawer-score-badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600;
}
.drawer-vnr { font-size: 11px; font-family: 'IBM Plex Mono', monospace; color: #6b7886; }
.drawer-elig-label { font-size: 11px; font-weight: 600; }
.drawer-close {
  background: #0e1116; border: 1px solid #2a3340; border-radius: 8px;
  width: 32px; height: 32px; color: #9aa7b5; font-size: 16px; cursor: pointer;
}
.drawer-close:hover { border-color: #36424f; color: #e7ecf2; }
.drawer-title { font-size: 18px; font-weight: 600; margin: 14px 0 4px; line-height: 1.3; }
.drawer-auth { font-size: 13px; color: #9aa7b5; }

.drawer-body { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.drawer-left { padding: 18px 20px; border-right: 1px solid #232c37; }
.drawer-right { padding: 18px 20px; background: #12171e; }

.section-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7886; margin-bottom: 12px; }
.eckdaten-list { display: flex; flex-direction: column; gap: 11px; margin-bottom: 20px; }
.meta-label { font-size: 10px; color: #6b7886; text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { font-size: 13px; font-family: 'IBM Plex Mono', monospace; color: #e7ecf2; margin-top: 2px; }
.meta-value--plain { font-family: 'IBM Plex Sans', sans-serif; color: #cdd6e0; }
.meta-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.desc-text { font-size: 13px; line-height: 1.6; color: #b6c0cc; margin: 0 0 18px; }

.breakdown-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.breakdown-head { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 3px; }
.breakdown-head span:first-child { color: #cdd6e0; }
.breakdown-head span:last-child { font-family: 'IBM Plex Mono', monospace; color: #9aa7b5; }
.breakdown-track { height: 5px; border-radius: 3px; background: #232c37; overflow: hidden; }
.breakdown-fill { height: 100%; }

.action-row { display: flex; gap: 8px; }
.action-link {
  flex: 1; text-align: center; text-decoration: none; font-size: 12px; font-weight: 600;
  padding: 9px; border-radius: 8px;
}
.action-link--primary { background: #16c0a8; color: #04201c; }
.action-link--secondary { background: #0e1116; border: 1px solid #2a3340; color: #cdd6e0; }

.work-field { margin-bottom: 14px; }
.work-label { font-size: 11px; color: #9aa7b5; display: block; margin-bottom: 5px; }
.status-select {
  width: 100%; height: 36px; padding: 0 10px; background: #0e1116; border: 1px solid #2a3340;
  border-radius: 8px; font-size: 13px; font-weight: 600;
}
.assign-select {
  width: 100%; height: 36px; padding: 0 10px; background: #0e1116; border: 1px solid #2a3340;
  border-radius: 8px; color: #e7ecf2; font-size: 13px;
}
.reminder-box {
  padding: 11px 13px; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 8px; margin-bottom: 16px;
}
.reminder-label { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #fbbf24; margin-bottom: 3px; }
.reminder-text { font-size: 12px; color: #e7ecf2; }
.notes-textarea {
  width: 100%; min-height: 88px; resize: vertical; padding: 10px 12px;
  background: #0e1116; border: 1px solid #2a3340; border-radius: 8px;
  color: #e7ecf2; font-size: 13px; line-height: 1.5; outline: none; margin-bottom: 18px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.notes-textarea:focus { border-color: #16c0a8; }
.notes-textarea::placeholder { color: #4f5a67; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 11px; padding-bottom: 14px; position: relative; }
.activity-dot-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 3px; z-index: 1; }
.activity-line { flex: 1; width: 1px; background: #232c37; }
.activity-body { padding-bottom: 2px; }
.activity-text { font-size: 12px; color: #e7ecf2; }
.activity-meta { font-size: 10px; color: #6b7886; font-family: 'IBM Plex Mono', monospace; margin-top: 2px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1b222b; border: 1px solid #36424f; color: #e7ecf2;
  font-size: 13px; padding: 11px 18px; border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.toast.show { opacity: 1; }
