:root {
  --navy-950: #070d1c;
  --navy-900: #0a0f1f;
  --navy-800: #101a31;
  --navy-700: #1a2742;
  --navy-600: #26365a;
  --amber: #fbbf24;
  --amber-600: #f59e0b;
  --ink: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(255,255,255,.08);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; color: var(--ink);
  background: radial-gradient(1200px 600px at 70% -10%, #16223f 0%, var(--navy-900) 45%, var(--navy-950) 100%);
  min-height: 100vh;
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1,h2,h3 { margin: 0 0 .6rem; color: #fff; letter-spacing: -.01em; }
.muted { color: var(--muted); }
small { color: var(--muted); }
a { color: var(--amber); }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.5rem; border-bottom: 1px solid var(--line);
  background: rgba(7,13,28,.65); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; color: #fff; }
.brand strong { color: var(--amber); font-weight: 700; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
nav { display: flex; align-items: center; gap: .45rem; }
.navuser { color: var(--muted); font-size: .85rem; margin-right: .4rem; }

.container { max-width: 1120px; margin: 1.8rem auto; padding: 0 1.2rem; }

/* ---- Cards ---- */
.card {
  background: linear-gradient(180deg, rgba(26,39,66,.55), rgba(16,26,49,.55));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem;
}
.centered { text-align: center; max-width: 540px; margin: 5rem auto; }

.grid { display: grid; grid-template-columns: 1fr 1.45fr; gap: 1.2rem; }
.col { min-width: 0; }
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

/* ---- Forms ---- */
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .8rem; }
label.block { font-weight: 500; }
input, textarea, select {
  width: 100%; margin-top: .3rem; padding: .62rem .7rem; font: inherit; color: #fff;
  background: rgba(7,13,28,.55); border: 1px solid var(--navy-600); border-radius: 9px;
}
input::placeholder, textarea::placeholder { color: #64748b; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.15); }
textarea { resize: vertical; }
select option { color: #000; }

button { font: inherit; cursor: pointer; border-radius: 999px; padding: .6rem 1.15rem; border: 1px solid transparent; font-weight: 600; transition: .15s; }
button.primary { background: linear-gradient(180deg, var(--amber), var(--amber-600)); color: #241a02; box-shadow: 0 6px 18px rgba(245,158,11,.28); }
button.primary:hover { filter: brightness(1.05); }
button.ghost { background: transparent; border-color: var(--navy-600); color: var(--ink); font-weight: 500; }
button.ghost:hover { border-color: var(--amber); color: var(--amber); }
button:disabled { opacity: .55; cursor: default; }

.stack { display: flex; flex-direction: column; gap: .6rem; }
.row { display: flex; gap: .8rem; align-items: flex-end; }
.row.between { align-items: center; justify-content: space-between; }
.grow { flex: 1; }
.uploadrow { display: flex; gap: .6rem; align-items: center; }
.uploadrow input { flex: 1; }

/* ---- Auth (Chat-Login-Stil) ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.badge-icon {
  width: 58px; height: 58px; margin: 0 auto .9rem; display: grid; place-items: center;
  font-size: 1.5rem; color: #241a02; border-radius: 16px;
  background: linear-gradient(180deg, var(--amber), var(--amber-600)); box-shadow: 0 10px 30px rgba(245,158,11,.35);
}
.badge-icon.small { width: 46px; height: 46px; font-size: 1.2rem; border-radius: 13px; }
.auth-title { font-size: 1.7rem; margin-bottom: .4rem; }
.auth-sub { color: var(--muted); font-size: .92rem; margin: 0 0 1.4rem; }
.tabs { display: flex; gap: .4rem; background: rgba(7,13,28,.5); border: 1px solid var(--line); border-radius: 999px; padding: .25rem; margin-bottom: 1rem; }
.tab { flex: 1; background: transparent; color: var(--muted); border-radius: 999px; padding: .5rem; }
.tab.active { background: var(--navy-700); color: #fff; }
.auth-card .stack button.primary { margin-top: .3rem; }
.hint { color: var(--muted); font-size: .8rem; }
.msg { font-size: .85rem; padding: .55rem .75rem; border-radius: 9px; margin-top: .7rem; }
.msg.ok { background: rgba(52,211,153,.12); color: var(--ok); }
.msg.err { background: rgba(248,113,113,.12); color: var(--bad); }

/* ---- Files ---- */
.filelist, .historylist { list-style: none; padding: 0; margin: .9rem 0 0; }
.filelist li, .historylist li {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .55rem .1rem; border-bottom: 1px solid var(--line); font-size: .86rem;
}
.filelist li:last-child, .historylist li:last-child { border-bottom: none; }
.filelist button { padding: .25rem .6rem; font-size: .78rem; }
.historylist li { cursor: pointer; }
.historylist li:hover { color: var(--amber); }

/* ---- Stats + Chart ---- */
.statsrow { display: flex; gap: .9rem; margin: .4rem 0 1.2rem; }
.stat { flex: 1; text-align: center; background: rgba(7,13,28,.45); border: 1px solid var(--line); border-radius: 12px; padding: .85rem; }
.stat span { display: block; font-size: 1.7rem; font-weight: 800; color: var(--amber); }
.stat small { font-size: .74rem; }

.chart { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.3rem; }
.bar-row { display: flex; align-items: center; gap: .6rem; font-size: .82rem; }
.bar-label { width: 42%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bar-track { flex: 1; background: rgba(7,13,28,.6); border-radius: 6px; height: 22px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; border-radius: 6px; }
.bar-val { width: 38px; text-align: right; font-weight: 700; color: #fff; }

/* ---- Projects ---- */
.projectlist { display: flex; flex-direction: column; gap: .8rem; }
.project { background: rgba(7,13,28,.4); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px; padding: .85rem 1rem; }
.project .phead { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.project a { color: #fff; text-decoration: none; font-weight: 600; }
.project a:hover { color: var(--amber); }
.badge { font-size: .8rem; font-weight: 800; padding: .18rem .6rem; border-radius: 999px; color: #241a02; white-space: nowrap; }
.pmeta { color: var(--muted); font-size: .8rem; margin: .35rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.chip { font-size: .72rem; background: rgba(38,54,90,.5); color: #cbd5e1; padding: .12rem .55rem; border-radius: 999px; }
.chip.match { background: rgba(251,191,36,.15); color: var(--amber); }

/* ---- Admin ---- */
.createrow { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .3rem; }
.createrow input { flex: 1; min-width: 160px; margin-top: 0; }
.createrow button { white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.usertable { width: 100%; border-collapse: collapse; font-size: .87rem; }
.usertable th, .usertable td { text-align: left; padding: .6rem .55rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.usertable th { color: var(--muted); font-weight: 600; }
.usertable .actions { display: flex; gap: .35rem; }
.usertable button { padding: .3rem .65rem; font-size: .78rem; }
.pill { font-size: .74rem; padding: .13rem .55rem; border-radius: 999px; }
.pill.approved { background: rgba(52,211,153,.15); color: var(--ok); }
.pill.pending { background: rgba(251,191,36,.15); color: var(--warn); }
.pill.blocked { background: rgba(248,113,113,.15); color: var(--bad); }

.toast { position: fixed; bottom: 1.3rem; left: 50%; transform: translateX(-50%); background: var(--navy-700); color: #fff; padding: .65rem 1.1rem; border-radius: 10px; font-size: .85rem; box-shadow: var(--shadow); z-index: 20; border: 1px solid var(--line); }

/* ===== Dashboard: feste Höhe, nur rechts scrollt ===== */
.view.dash { max-width: 1180px; margin: 0 auto; padding: 1.2rem; height: calc(100vh - 61px); overflow: hidden; }
.dash-grid { display: grid; grid-template-columns: 380px 1fr; gap: 1.2rem; height: 100%; min-height: 0; }
.dash-left { overflow-y: auto; min-height: 0; padding-right: 4px; }
.dash-left .card:last-child { margin-bottom: .2rem; }
.dash-right { min-height: 0; height: 100%; }
.results-card { height: 100%; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; }
.results-head { flex: 0 0 auto; margin-bottom: .7rem; }
.results-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 8px; }
/* schlanke Scrollbar */
.dash-left::-webkit-scrollbar, .results-scroll::-webkit-scrollbar { width: 8px; }
.dash-left::-webkit-scrollbar-thumb, .results-scroll::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 8px; }
@media (max-width: 880px) {
  .view.dash { height: auto; overflow: visible; }
  .dash-grid { grid-template-columns: 1fr; height: auto; }
  .dash-left, .results-scroll { overflow: visible; }
  .results-card { height: auto; }
}

/* ===== Klickbare Projektkarte ===== */
.project.clickable { cursor: pointer; transition: .15s; }
.project.clickable:hover { border-left-color: var(--amber); background: rgba(251,191,36,.06); transform: translateX(2px); }
.ptitle { font-weight: 600; color: #fff; }
.pdetailhint { margin-top: .5rem; font-size: .76rem; color: var(--amber); opacity: .85; }

/* ===== Detailansicht ===== */
.back { margin-bottom: 1rem; }
.detail-head { display: flex; gap: 1.5rem; align-items: center; }
.detail-donut { flex: 0 0 auto; }
.donut-num { font-size: 26px; font-weight: 800; }
.donut-lbl { font-size: 11px; }
.detail-meta h2 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: 1.35rem; }
.detail-firma { color: var(--muted); margin: .1rem 0 .5rem; }
.detail-facts { display: flex; gap: 1.1rem; flex-wrap: wrap; color: var(--ink); font-size: .85rem; margin-bottom: .6rem; }
.klasse { font-size: .72rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; }
.klasse.k-B { background: rgba(52,211,153,.18); color: var(--ok); }
.klasse.k-C { background: rgba(251,191,36,.18); color: var(--amber); }
.klasse.k-D { background: rgba(248,113,113,.18); color: var(--bad); }
.crit-list { display: flex; flex-direction: column; gap: 1rem; }
.crit-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; font-size: .88rem; }
.crit-name { color: #fff; }
.crit-name small { color: var(--muted); font-weight: 400; }
.crit-val { font-weight: 800; color: var(--amber); }
.crit-why { color: var(--muted); font-size: .82rem; margin: .35rem 0 0; }
.jobdesc { color: var(--ink); line-height: 1.7; white-space: pre-wrap; }
.linkbtn { display: inline-block; margin-top: 1rem; text-decoration: none; padding: .55rem 1.1rem; }

/* ===== Radar / Spinnennetz ===== */
.radar-wrap { display: flex; justify-content: center; margin: .3rem 0 1.4rem; }
.radar { width: 100%; max-width: 460px; height: auto; }
.radar-lbl { fill: #e5e7eb; font-size: 12px; font-weight: 600; }
.radar-val { fill: var(--amber); font-size: 11px; font-weight: 700; }
