/* ── VARIABLEN ── */
:root {
  --cream: #f5f0e6;
  --navy: #18213e;
  --navy-light: #2a3558;
  --red: #b5291d;
  --red-light: #fdf0ee;
  --slate: #3d4a5c;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #d8d0c2;
  --white: #ffffff;
  --success: #166534;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #92400e;
  --warning-bg: #fffbeb;
  --info: #1e40af;
  --info-bg: #eff6ff;
  --purple: #5b21b6;
  --purple-bg: #ede9fe;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  background: var(--cream);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── HEADER ── */
.site-header {
  background: var(--navy);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}
.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white; font-weight: 900;
}
.nav-links { display: flex; gap: 4px; list-style: none; flex: 1; }
.nav-links a {
  display: block;
  padding: 7px 14px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-links a:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-links a.active { background: rgba(255,255,255,0.15); color: white; }
.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-pill {
  font-size: 13px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}
.logout-link {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.logout-link:hover { color: white; background: rgba(255,255,255,0.1); }

/* ── LAYOUT ── */
.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* ── TYPOGRAPHIE ── */
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 32px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 16px;
}

/* ── CARDS ── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.card-header {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── FORMULARE ── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-label .opt { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 11px; }
.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Source Serif 4', serif;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(24,33,62,0.07);
}
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

.file-drop {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #faf8f3;
}
.file-drop:hover { border-color: var(--navy); background: #f0ecf0; }
.file-drop-icon { font-size: 30px; opacity: 0.4; margin-bottom: 8px; }
.file-drop p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.file-drop strong { color: var(--navy); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: white; color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--cream); }
.btn-danger    { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-outline   { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: white; }
.btn-sm  { padding: 6px 14px; font-size: 13px; }
.btn-xs  { padding: 4px 10px; font-size: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px;
  cursor: pointer; background: none; border: none;
  padding: 0; margin-bottom: 18px;
  font-family: 'Source Serif 4', serif;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--navy); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
  font-family: 'Source Serif 4', serif;
}
.badge-new      { background: var(--info-bg);    color: var(--info); }
.badge-review   { background: var(--warning-bg); color: var(--warning); }
.badge-done     { background: var(--success-bg); color: var(--success); }
.badge-narrativ { background: #fee2e2;            color: #991b1b; }
.badge-inhalt   { background: var(--warning-bg); color: var(--warning); }
.badge-didaktik { background: var(--purple-bg);  color: var(--purple); }

/* ── STATISTIK-KARTEN ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
}
.stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--muted); }

/* ── TABELLE ── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.filter-bar .form-control { flex: 1; }
.tbl-wrap { background: white; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #faf8f4;
  font-weight: 600;
  white-space: nowrap;
}
.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid #ede8df;
  font-size: 14px;
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #faf8f4; }
.tbl-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.tbl-title:hover { text-decoration: underline; }
.tbl-meta  { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tbl-count {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: var(--navy); color: white;
  border-radius: 50%; font-size: 11px; font-weight: 700;
}
.tbl-count.zero { background: var(--border); color: var(--muted); }

/* ── DETAIL-HEADER ── */
.detail-header {
  background: var(--navy);
  color: white;
  padding: 24px 28px;
  border-radius: 8px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.detail-header::before {
  content: '';
  position: absolute;
  right: -20px; top: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.detail-book-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  position: relative;
}
.detail-meta-grid {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 13px; opacity: 0.75; position: relative;
}
.detail-meta-item { display: flex; align-items: center; gap: 6px; }
.meta-dot { width: 3px; height: 3px; background: rgba(255,255,255,0.4); border-radius: 50%; }
.detail-actions { position: absolute; top: 20px; right: 24px; display: flex; gap: 8px; }

/* ── DETAIL-GRID ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* ── TABS ── */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 9px 18px;
  font-size: 14px;
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  color: var(--muted);
  background: none; border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover  { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--cream); border: 1px solid var(--border);
  border-radius: 20px; font-size: 11px; font-weight: 700; color: var(--slate);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── KRITIKEN ── */
.critique-item {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 22px; margin-bottom: 14px; background: white;
}
.critique-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.critique-text   { font-size: 14px; line-height: 1.7; color: var(--slate); }
.critique-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.critique-author { font-size: 12px; color: var(--muted); font-style: italic; }

/* ── KORRESPONDENZ ── */
.corr-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.corr-item:last-child { border-bottom: none; }
.corr-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  font-family: 'Source Serif 4', serif;
}
.corr-avatar.verlag { background: var(--slate); }
.corr-dir { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 3px; }
.corr-dir.out { color: var(--red); }
.corr-dir.in  { color: var(--success); }
.corr-parties { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.corr-body    { font-size: 14px; line-height: 1.6; color: var(--slate); }
.corr-date    { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ── SIDEBAR ── */
.info-list { list-style: none; }
.info-list li {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 10px;
}
.info-list li:last-child { border-bottom: none; }
.info-key { color: var(--muted); flex-shrink: 0; }
.info-val { font-weight: 600; color: var(--slate); text-align: right; }
.pages-display {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 4px;
}

/* ── INLINE-FORMULAR ── */
.inline-form {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px 22px; margin-top: 16px;
}
.inline-form-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 16px;
}

/* ── ERFOLGSMELDUNG ── */
.success-box {
  background: var(--success-bg); border: 1px solid var(--success-border);
  border-radius: 10px; padding: 36px 32px; text-align: center;
}
.success-icon  { font-size: 44px; margin-bottom: 14px; }
.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px; color: var(--success); margin-bottom: 10px;
}
.success-text { font-size: 15px; color: var(--muted); margin-bottom: 20px; }

/* ── FEHLERBOX ── */
.alert-error {
  background: var(--red-light); border: 1px solid #f5c6c2;
  border-radius: 8px; padding: 14px 18px;
  font-size: 14px; color: var(--red); margin-bottom: 20px;
}

/* ── STATUS-PUNKT ── */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.sd-new    { background: var(--info); }
.sd-review { background: #d97706; }
.sd-done   { background: #16a34a; }

/* ── LEERER ZUSTAND ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-style: italic; font-size: 14px; }
.empty-icon  { font-size: 32px; opacity: 0.4; margin-bottom: 10px; }

/* ── TRENNLINIE ── */
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--navy); color: white;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; font-family: 'Source Serif 4', serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s; z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── LOGIN-SEITE ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy); padding: 20px;
}
.login-card {
  background: white; border-radius: 12px;
  padding: 40px 44px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.login-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-title    { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; color: var(--navy); margin-bottom: 20px; }

/* ── QUOTE-BLOCK ── */
.quote-block {
  background: var(--cream); border-left: 3px solid var(--navy);
  padding: 12px 16px; border-radius: 0 6px 6px 0;
  font-style: italic; font-size: 14px; color: var(--slate);
  margin-top: 14px;
}

/* ── SCANS ── */
.scans-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-thumb {
  width: 60px; height: 60px; background: var(--cream);
  border: 1px solid var(--border); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-grid   { grid-template-columns: 1fr; }
  .stats-row     { grid-template-columns: 1fr 1fr; }
  .detail-actions { position: static; margin-top: 12px; }
  .detail-header  { position: relative; }
}
