/* BelegPilot Dashboard – Theme: #0f3460 */
:root {
  --bg:         #0f1923;
  --surface:    #162032;
  --surface2:   #1c2d42;
  --primary:    #0f3460;
  --accent:     #1a7fc1;
  --text:       #e8edf2;
  --text-muted: #8fa3b8;
  --gruen:      #00b894;
  --gelb:       #fdcb6e;
  --rot:        #d63031;
  --border:     #243a52;
  --radius:     6px;
  --font:       'Segoe UI', system-ui, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.header {
  background: var(--primary);
  padding: 0 1.25rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.header__left { flex: 0 0 auto; }
.header__stats { display: flex; gap: 1rem; flex: 1; }
.header__right { display: flex; align-items: center; gap: 1rem; flex: 0 0 auto; }

.nav__brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.hstat { font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
.hstat b { color: var(--text); }
.hstat--gruen b { color: var(--gruen); }
.hstat--gelb  b { color: var(--gelb); }
.hstat--rot   b { color: var(--rot); }

.letzter-eingang { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.live-indicator { color: var(--gruen); font-size: .8rem; white-space: nowrap; }
.live-indicator.offline { color: var(--rot); }

/* MAIN */
.main { flex: 1; padding: 1.25rem; max-width: 1500px; margin: 0 auto; width: 100%; }

/* DETAIL SPLIT (2-spaltig) */
.detail-split {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
@media (max-width: 900px) { .detail-split { grid-template-columns: 1fr; } }

.detail-left { display: flex; flex-direction: column; gap: .75rem; }
.detail-right { display: flex; flex-direction: column; gap: .5rem; overflow-x: auto; }

.detail-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
}

#detail-title { font-size: 1rem; font-weight: 600; }
.detail-meta { font-size: .82rem; color: var(--text-muted); }

.preview-img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.no-preview {
  color: var(--text-muted);
  font-size: .85rem;
  font-style: italic;
}

/* AMPEL BADGE */
.ampel {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 3px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ampel--gruen { background: rgba(0,184,148,.15); color: var(--gruen); }
.ampel--gelb  { background: rgba(253,203,110,.15); color: var(--gelb); }
.ampel--rot   { background: rgba(214,48,49,.15);  color: var(--rot); }

.ampel-badge-large {
  font-size: 1.5rem;
  font-weight: 700;
  padding: .4rem 1rem;
  border-radius: var(--radius);
}

/* TABS */
.tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}
.tab-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: .35rem .85rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .85rem;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text); border-color: var(--border); }
.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* TABLE */
.table-wrap { overflow-x: auto; }
.beleg-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.beleg-table th {
  background: var(--surface2);
  padding: .55rem .75rem;
  text-align: left;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.beleg-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.beleg-table tr:last-child td { border-bottom: none; }

.beleg-row:hover td { background: var(--surface2); }
.beleg-row.selected td { background: rgba(26,127,193,.15); }

.cell-truncate { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--text-muted); padding: 2rem !important; }

/* BUTTONS */
.btn-back {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: .75rem;
  font-size: .9rem;
}
.btn-back:hover { color: var(--text); }

/* FOOTER */
.footer {
  background: var(--primary);
  padding: .55rem 1.25rem;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* DETAIL PAGE */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.detail-card h2 { font-size: 1rem; margin-bottom: .75rem; color: var(--text-muted); }
.detail-header { margin-bottom: 1.5rem; }
.detail-header h1 { font-size: 1.5rem; display: flex; align-items: center; gap: .75rem; margin: .3rem 0; }

.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .75rem; }
.meta-list dt { color: var(--text-muted); font-size: .85rem; }
.meta-list dd { font-size: .9rem; }
.error { color: var(--rot); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

/* KONFIDENZ BAR */
.konfidenz-bar {
  display: inline-block;
  position: relative;
  padding-left: calc(var(--k) + 6px);
  white-space: nowrap;
}
.konfidenz-bar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  width: var(--k);
  background: var(--accent);
  border-radius: 3px;
}
