/* Centrio Scancenter — reduziertes, seriöses CSS. Mobile-first, kein Framework. */
:root {
  --c-bg: #f4f6f8;
  --c-surface: #ffffff;
  --c-ink: #1c2733;
  --c-muted: #5b6b7a;
  --c-line: #dde3e9;
  --c-brand: #14506b;
  --c-brand-dark: #0e3a4e;
  --c-accent: #2c7a9c;
  --c-error-bg: #fdecec;
  --c-error-ink: #9b2c2c;
  --c-error-line: #f3c2c2;
  --c-success-bg: #eaf6ec;
  --c-success-ink: #226b34;
  --c-info-bg: #eaf2f8;
  --c-info-ink: #1b5575;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 48, 0.06), 0 6px 20px rgba(16, 32, 48, 0.06);
  --maxw: 1040px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-ink);
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--c-brand);
}
.brand__mark { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em; }
.brand__sub { color: var(--c-muted); font-size: 0.85rem; }
.site-nav { display: flex; align-items: center; gap: 0.75rem; }
.site-nav__user { color: var(--c-muted); font-size: 0.85rem; }
.inline-form { display: inline; margin: 0; }

/* Main */
.site-main { flex: 1 0 auto; padding: 2rem 0; }

/* Footer */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  color: var(--c-muted);
  font-size: 0.8rem;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  gap: 1rem;
}
.site-footer__muted { color: var(--c-muted); }

/* Card */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Auth */
.auth { display: flex; justify-content: center; padding: 1rem 0; }
.auth__card { width: 100%; max-width: 380px; }
.auth__title { margin: 0 0 0.25rem; font-size: 1.4rem; }
.auth__lead { margin: 0 0 1.25rem; color: var(--c-muted); font-size: 0.9rem; }

/* Form */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field__label { font-size: 0.85rem; font-weight: 600; color: var(--c-muted); }
.field__input {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #fff;
  color: var(--c-ink);
}
.field__input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(44, 122, 156, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn--primary { background: var(--c-brand); color: #fff; }
.btn--primary:hover { background: var(--c-brand-dark); }
.btn--ghost { background: transparent; color: var(--c-brand); border-color: var(--c-line); }
.btn--ghost:hover { background: var(--c-bg); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

/* Flash */
.flash {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.flash--error { background: var(--c-error-bg); color: var(--c-error-ink); border-color: var(--c-error-line); }
.flash--success { background: var(--c-success-bg); color: var(--c-success-ink); }
.flash--info { background: var(--c-info-bg); color: var(--c-info-ink); }

/* Error pages */
.errorpage { display: flex; justify-content: center; padding: 1rem 0; }
.errorpage__card { max-width: 460px; text-align: center; }
.errorpage__code { font-size: 2.5rem; font-weight: 800; color: var(--c-brand); margin: 0; }
.errorpage__title { margin: 0.25rem 0 0.5rem; font-size: 1.3rem; }
.errorpage__text { color: var(--c-muted); margin: 0 0 1.25rem; }
.errorpage__detail {
  text-align: left;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 0.75rem;
  overflow: auto;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* === Admin / Upload (Phase 1) === */
.page-title { margin: 0 0 0.25rem; font-size: 1.5rem; }
.page-lead { margin: 0 0 1.5rem; color: var(--c-muted); font-size: 0.95rem; }

.admin__card { margin-bottom: 1rem; }
.admin__card-title { margin: 0 0 0.35rem; font-size: 1.15rem; }
.admin__card-text { margin: 0 0 1rem; color: var(--c-muted); font-size: 0.9rem; }

.upload__card { max-width: 640px; }

.field__hint { font-size: 0.78rem; color: var(--c-muted); }

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed var(--c-line);
  border-radius: var(--radius);
  background: var(--c-bg);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover,
.dropzone:focus { outline: none; border-color: var(--c-accent); }
.dropzone.is-dragover {
  border-color: var(--c-brand);
  background: var(--c-info-bg);
}
.dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.dropzone__inner { pointer-events: none; }
.dropzone__icon {
  display: block;
  font-size: 1.8rem;
  color: var(--c-accent);
  margin-bottom: 0.4rem;
}
.dropzone__text { margin: 0; color: var(--c-muted); font-size: 0.92rem; }
.dropzone__link { color: var(--c-brand); font-weight: 600; text-decoration: underline; }

/* File list */
.file-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.file-list__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
}
.file-list__info { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list__info.is-invalid { color: var(--c-error-ink); }
.file-list__status { font-size: 0.78rem; color: var(--c-muted); flex: 0 0 auto; }
.file-list__status.is-error { color: var(--c-error-ink); font-weight: 600; }
.file-list__remove {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--c-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}
.file-list__remove:hover { color: var(--c-error-ink); }

/* Progress */
.progress {
  height: 8px;
  background: var(--c-line);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.25rem 0 0.25rem;
}
.progress__fill {
  height: 100%;
  width: 0;
  background: var(--c-accent);
  transition: width 0.2s ease;
}

/* === Admin / CRM (Phase 2) === */

/* Sekundaer-Navigation im Admin-Header (Tabs) */
.admin-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.5rem; }
.admin-nav__link {
  text-decoration: none;
  color: var(--c-brand);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.admin-nav__link:hover { background: var(--c-bg); }
.admin-nav__link.is-active { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }

/* Toolbar (Suche + Aktion) */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 0 1.25rem;
}
.toolbar__search { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.toolbar__search .field { gap: 0.2rem; }
.toolbar__search .field__input { min-width: 220px; }

/* Stat-Kacheln */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}
.stat__value { font-size: 1.8rem; font-weight: 800; color: var(--c-brand); line-height: 1.1; }
.stat__label { font-size: 0.82rem; color: var(--c-muted); margin-top: 0.2rem; }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--c-muted); background: var(--c-bg); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--c-bg); }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }
.table a { color: var(--c-brand); text-decoration: none; font-weight: 600; }
.table a:hover { text-decoration: underline; }
.table__empty { padding: 1.5rem; text-align: center; color: var(--c-muted); }

/* Status-Badges */
.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge--active { background: var(--c-success-bg); color: var(--c-success-ink); }
.badge--inactive { background: var(--c-error-bg); color: var(--c-error-ink); }
.badge--muted { background: var(--c-bg); color: var(--c-muted); border: 1px solid var(--c-line); }
.badge--info { background: var(--c-info-bg); color: var(--c-info-ink); }

/* Detailseite */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 760px) { .detail-grid { grid-template-columns: 1fr 1fr; } }
.dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; }
.dl dt { color: var(--c-muted); font-weight: 600; }
.dl dd { margin: 0; }

.card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 1rem; }
.card__title { margin: 0; font-size: 1.1rem; }
.card + .card { margin-top: 1.25rem; }

/* Aktions-Reihe (mehrere Buttons/Formulare nebeneinander) */
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.btn--danger { background: var(--c-error-ink); color: #fff; }
.btn--danger:hover { background: #7f2222; }

/* Initial-Passwort-Box (einmalige Anzeige) */
.secret-box {
  background: var(--c-info-bg);
  border: 1px solid var(--c-info-ink);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
}
.secret-box__label { font-size: 0.8rem; color: var(--c-info-ink); font-weight: 700; margin: 0 0 0.3rem; }
.secret-box__value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; font-weight: 700; word-break: break-all; }
.secret-box__hint { font-size: 0.78rem; color: var(--c-muted); margin: 0.35rem 0 0; }

/* Checkbox-Feld */
.field--check { flex-direction: row; align-items: center; gap: 0.5rem; }
.field--check input { width: 1.05rem; height: 1.05rem; }
.field--check .field__label { font-weight: 500; color: var(--c-ink); }

/* Zweispaltiges Formular */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 620px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.form-section-title { font-size: 0.95rem; font-weight: 700; color: var(--c-muted); margin: 0.5rem 0 0; border-top: 1px solid var(--c-line); padding-top: 1rem; }

/* Autocomplete */
.ac { position: relative; }
.ac__list {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  position: absolute;
  left: 0; right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
}
.ac__item { padding: 0.5rem 0.7rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.1rem; }
.ac__item:hover, .ac__item.is-active { background: var(--c-info-bg); }
.ac__name { font-weight: 600; font-size: 0.9rem; }
.ac__meta { font-size: 0.78rem; color: var(--c-muted); }

/* Pagination */
.pager { display: flex; gap: 0.5rem; align-items: center; justify-content: center; margin: 1.25rem 0 0; font-size: 0.88rem; }
.pager__info { color: var(--c-muted); }

/* Activity-Log */
.log-action { font-weight: 600; }
.log-details { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: var(--c-muted); white-space: pre-wrap; word-break: break-word; max-width: 320px; }
.log-time { white-space: nowrap; color: var(--c-muted); font-size: 0.82rem; }
