/* =====================================================================
   JörgsMoba4N – Stylesheet (klassisch-nostalgischer Eisenbahn-Stil)
   Wird sowohl von den PHP-Seiten als auch von der HTML-Vorschau genutzt.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Warme, nostalgische Palette (oklch) */
  --bg:            oklch(0.95 0.014 78);   /* Pergament */
  --bg-deep:       oklch(0.92 0.018 76);   /* etwas tiefer */
  --surface:       oklch(0.985 0.009 82);  /* Kartenflächen */
  --surface-2:     oklch(0.965 0.012 80);
  --ink:           oklch(0.26 0.018 55);   /* Haupttext, warmes Schwarzbraun */
  --ink-soft:      oklch(0.44 0.02 58);    /* Sekundärtext */
  --ink-faint:     oklch(0.60 0.018 60);
  --line:          oklch(0.86 0.018 75);   /* Rahmen */
  --line-strong:   oklch(0.78 0.02 72);

  --primary:       oklch(0.505 0.176 28);  /* RAL 3000 Feuerrot */
  --primary-dark:  oklch(0.42 0.16 28);
  --primary-soft:  oklch(0.93 0.045 30);

  --brass:         oklch(0.66 0.10 72);    /* Messing / Ocker */
  --brass-dark:    oklch(0.55 0.10 68);
  --claret:        oklch(0.44 0.115 26);   /* Bahn-Bordeaux */
  --claret-soft:   oklch(0.93 0.035 30);

  --good:          oklch(0.52 0.09 150);
  --warn:          oklch(0.60 0.12 70);
  --danger:        oklch(0.50 0.15 27);
  --danger-soft:   oklch(0.94 0.04 27);

  --radius:    8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px oklch(0.3 0.02 60 / 0.10);
  --shadow:    0 2px 6px oklch(0.3 0.02 60 / 0.12), 0 8px 24px oklch(0.3 0.02 60 / 0.07);
  --shadow-lg: 0 6px 18px oklch(0.3 0.02 60 / 0.16), 0 18px 50px oklch(0.3 0.02 60 / 0.10);

  --serif: 'Bitter', Georgia, 'Times New Roman', serif;
  --sans:  'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', monospace;

  --maxw: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, oklch(0.3 0.02 60 / 0.012) 0 1px, transparent 1px 3px);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.15; margin: 0 0 .4em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.32rem; }
h4 { font-size: 1.08rem; }
p  { margin: 0 0 1rem; text-wrap: pretty; }
a  { color: var(--primary-dark); text-decoration-color: oklch(0.505 0.176 28 / 0.35); text-underline-offset: 2px; }
a:hover { color: var(--primary); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ---------- Rail-Motiv (Schienen-Trennlinie) ---------- */
.rail {
  height: 60px; width: 100%;
  background:
    linear-gradient(oklch(0.43 0.06 55), oklch(0.43 0.06 55)) 0 14px / 100% 5px no-repeat,
    linear-gradient(oklch(0.43 0.06 55), oklch(0.43 0.06 55)) 0 41px / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--line-strong) 0 5px, transparent 5px 24px) 0 14px / 100% 32px no-repeat;
  opacity: .9;
}

/* ===================== Kopfzeile / Navigation ===================== */
.topbar {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: oklch(0.97 0.01 80);
  border-bottom: 3px solid var(--brass-dark);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 40;
}
.topbar .wrap { display: flex; align-items: center; gap: 22px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-right: auto; }
.brand:hover { color: inherit; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass), var(--brass-dark));
  border: 2px solid oklch(0.97 0.01 80 / 0.65);
  display: grid; place-items: center; flex: none;
  box-shadow: inset 0 0 0 3px oklch(0.3 0.05 60 / 0.25);
  font-family: var(--serif); font-weight: 800; color: oklch(0.25 0.04 60); font-size: 1rem;
}
.brand .name { font-family: var(--serif); font-weight: 800; font-size: 1.32rem; letter-spacing: .2px; line-height: 1.05; display: block; }
.brand-logo { height: 46px; width: auto; max-width: 240px; object-fit: contain; display: block; }
@media (max-width: 860px) { .brand-logo { height: 40px; } }
.brand .sub  { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; opacity: .8; font-weight: 600; white-space: nowrap; display: block; margin-top: 3px; }
@media (max-width: 720px) { .brand .sub { display: none; } }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: oklch(0.96 0.012 80); text-decoration: none; font-weight: 600; font-size: .96rem;
  padding: 8px 13px; border-radius: 7px; transition: background .15s;
}
.nav a:hover { background: oklch(0.97 0.01 80 / 0.14); color: #fff; }
.nav a.active { background: oklch(0.97 0.01 80 / 0.2); }
.nav .sep { width: 1px; height: 22px; background: oklch(0.97 0.01 80 / 0.28); margin: 0 6px; }
.lang-switch { display: inline-flex; border: 1px solid oklch(0.97 0.01 80 / 0.4); border-radius: 6px; overflow: hidden; }
.lang-switch a { padding: 5px 9px; font-size: .8rem; border-radius: 0; }
.lang-switch a.active { background: var(--brass); color: oklch(0.25 0.04 60); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 600; }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brass);
  color: oklch(0.25 0.04 60); display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}

/* ---------- Burger-Button (nur auf schmalen Bildschirmen) ---------- */
.nav-toggle {
  display: none; margin-left: auto; align-items: center; justify-content: center;
  width: 44px; height: 40px; border-radius: 8px; cursor: pointer;
  background: oklch(0.97 0.01 80 / 0.12); border: 1px solid oklch(0.97 0.01 80 / 0.4); color: #fff;
}
.nav-toggle:hover { background: oklch(0.97 0.01 80 / 0.2); }
.nav-toggle svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .topbar .wrap { flex-wrap: wrap; min-height: 60px; }
  .nav {
    width: 100%; display: none; flex-direction: column; align-items: stretch;
    gap: 2px; padding: 8px 0 12px;
  }
  .topbar.nav-open .nav { display: flex; }
  .nav a { padding: 12px 12px; border-radius: 8px; font-size: 1rem; }
  .nav .sep { width: auto; height: 1px; background: oklch(0.97 0.01 80 / 0.22); margin: 8px 4px; }
  .lang-switch { width: max-content; }
  .user-chip { padding: 8px 4px; }
  .nav .btn { width: max-content; margin: 2px 0; }
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: .98rem; line-height: 1;
  padding: 11px 18px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .06s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: oklch(0.97 0.01 80); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-brass { background: var(--brass); color: oklch(0.23 0.04 60); box-shadow: var(--shadow-sm); }
.btn-brass:hover { background: var(--brass-dark); color: oklch(0.2 0.04 60); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-faint); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: oklch(0.5 0.15 27 / 0.4); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .88rem; }
.btn-lg { padding: 14px 26px; font-size: 1.08rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ===================== Cards / Sektionen ===================== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px;
}
.card-pad-lg { padding: 30px; }
.section { padding: 52px 0; }
.eyebrow { font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--brass-dark); font-weight: 700; margin-bottom: 8px; }
.lede { font-size: 1.15rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }

/* ===================== Hero (Startseite) ===================== */
.hero { position: relative; overflow: hidden; background: var(--bg-deep); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; padding: 64px 0; }
.hero h1 { margin-bottom: .35em; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 30px; padding: 40px 0; } }

/* Foto-Platzhalter (gestreift, mit Monospace-Hinweis) */
.photo-placeholder {
  position: relative; border-radius: var(--radius-lg); border: 1px solid var(--line-strong);
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(45deg, oklch(0.3 0.02 60 / 0.05) 0 12px, transparent 12px 24px);
  display: grid; place-items: center; min-height: 240px; overflow: hidden; color: var(--ink-faint);
}
.photo-placeholder .pp-label {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px;
}
.photo-placeholder.tall { min-height: 320px; }
.photo-placeholder.thumb { min-height: 0; aspect-ratio: 4/3; }

/* Bildrahmen in den Übersichtskarten (Loks/Wagen/Gebäude) – Größe HIER zentral */
.ov-thumb {
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2);
  padding: 6px; height: 80px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ov-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; background: transparent; }

/* ---------- Lok-Slideshow (Startseite) ---------- */
.lok-show {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  min-height: 320px; aspect-ratio: 4 / 3;
  background: transparent;
}
.lok-show-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .8s ease;
  mix-blend-mode: multiply;
  will-change: transform;
  animation: kenburns 18s ease-in-out infinite alternate;
}
/* Sanfter Ken-Burns-Effekt (langsames Zoomen/Wandern) */
@keyframes kenburns {
  0%   { transform: scale(1.015) translate3d(0, 0, 0); }
  100% { transform: scale(1.085) translate3d(0, -1.4%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .lok-show-img { animation: none; }
}
/* Lässt weißen/hellen Foto-Hintergrund in den Seitenhintergrund übergehen */
.blend-white { mix-blend-mode: multiply; }
.lok-show-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 34px 18px 14px; color: oklch(0.97 0.01 80);
  font-family: var(--serif); font-weight: 600; font-size: 1.08rem; letter-spacing: .01em;
  background: linear-gradient(transparent, oklch(0.20 0.03 60 / 0.78));
  transition: opacity .3s ease;
}
.lok-show-badge {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  background: var(--brass); color: oklch(0.23 0.04 60);
  font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px; box-shadow: var(--shadow-sm); white-space: nowrap;
}

/* ===================== Feature-/Info-Grid ===================== */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Gruppen-Abschnitte (z. B. Personen-/Güterwagen) */
.coll-section { margin-bottom: 38px; }
.coll-section:last-child { margin-bottom: 0; }
.coll-section-h {
  display: flex; align-items: center; gap: 11px; font-size: 1.35rem;
  padding-bottom: 10px; margin: 0 0 20px; border-bottom: 2px solid var(--line-strong);
}
.coll-section-n {
  font-family: var(--sans); font-size: .78rem; font-weight: 700; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; line-height: 1.5;
}

.feature .ic {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark); margin-bottom: 12px; border: 1px solid oklch(0.505 0.176 28 / 0.20);
}
a.card.feature { transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease; }
a.card.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brass); }
a.doc-card { transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease; }
a.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brass); }
.feature h3 { margin-bottom: .25em; }
.feature p { color: var(--ink-soft); margin: 0; font-size: .98rem; }

/* ===================== Auth-Karten (Login/Register) ===================== */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.auth-card .head { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); color: oklch(0.97 0.01 80); padding: 24px 28px; }
.auth-card .head h2 { color: #fff; margin: 0; }
.auth-card .head p { margin: 4px 0 0; opacity: .85; font-size: .95rem; }
.auth-card .body { padding: 28px; }
.auth-card .foot { padding: 16px 28px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .92rem; text-align: center; }

/* ===================== Formulare ===================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--ink-faint); margin-top: 4px; }
.field .req { color: var(--claret); }
.input, .select, .textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.textarea { resize: vertical; min-height: 96px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: .95rem; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--primary); }
.file-drop {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--surface-2); color: var(--ink-soft); cursor: pointer;
}
.file-drop:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ===================== Flash / Hinweise ===================== */
.flash { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; font-size: .96rem; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.flash-ok    { background: oklch(0.95 0.03 150); border-color: oklch(0.52 0.09 150 / 0.45); color: oklch(0.40 0.075 150); }
.flash-error { background: var(--danger-soft);  border-color: oklch(0.5 0.15 27 / 0.4); color: var(--danger); }
.flash-info  { background: var(--claret-soft);  border-color: oklch(0.44 0.115 26 / 0.3); color: var(--claret); }

/* ===================== Dashboard-Statistik ===================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px;
  position: relative; box-shadow: var(--shadow-sm); overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brass); }
.stat .label { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.stat .value { font-family: var(--serif); font-size: 2.3rem; font-weight: 800; color: var(--primary-dark); line-height: 1.1; margin-top: 6px; }
.stat .meta { font-size: .85rem; color: var(--ink-faint); margin-top: 2px; }
.stat.green::before  { background: var(--primary); }
.stat.claret::before { background: var(--claret); }

/* ===================== Filterleiste ===================== */
.toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.toolbar .search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0 10px; }
.toolbar .search input { border: none; background: transparent; padding: 10px 0; flex: 1; font-size: 1rem; color: var(--ink); }
.toolbar .search input:focus { outline: none; }
.toolbar .select { width: auto; min-width: 130px; }
.toolbar .spacer { flex: 1; }

/* Zusammenfassung unter der Filterleiste */
.filter-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -6px 2px 20px; font-size: .95rem; color: var(--ink-soft);
}
.filter-summary strong { color: var(--ink); font-weight: 700; }
.filter-summary .sep-dot { color: var(--line-strong); }
.filter-summary .filter-clear {
  margin-left: auto; font-size: .88rem; font-weight: 600; color: var(--claret);
  text-decoration: none; padding: 4px 12px; border: 1px solid oklch(0.44 0.115 26 / 0.3);
  border-radius: 999px; background: var(--claret-soft);
}
.filter-summary .filter-clear:hover { background: var(--claret); color: #fff; }

/* Rollen-Anzeige (Viewer / Admin) */
.role-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .9rem; font-weight: 600; color: var(--brass-dark);
  background: oklch(0.93 0.04 72); border: 1px solid oklch(0.55 0.1 68 / 0.35);
  padding: 8px 14px; border-radius: 999px;
}
.role-badge .svg-ic { width: 1.05em; height: 1.05em; }
.role-pill {
  font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--brass); color: oklch(0.23 0.04 60);
  padding: 2px 8px; border-radius: 999px; margin-left: 2px;
}

/* ===================== Foto-Galerie (Anlagen-Doku) ===================== */
.doc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0 0 8px; }
.doc-gallery .g-thumb {
  display: block; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); aspect-ratio: 4 / 3; box-shadow: var(--shadow-sm); position: relative;
}
.doc-gallery .g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.doc-gallery .g-thumb:hover img { transform: scale(1.05); }
.doc-gallery .g-thumb .g-more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: oklch(0.2 0.02 60 / 0.55); color: #fff; font-family: var(--serif); font-weight: 800; font-size: 1.5rem;
}
.photo-count-badge {
  position: absolute; bottom: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px;
  background: oklch(0.2 0.02 60 / 0.78); color: #fff; font-size: .76rem; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; backdrop-filter: blur(2px);
}

/* Foto-Verwaltung im Bearbeiten-Formular */
.doc-photo-manage { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.doc-photo-manage .dpm-item { width: 120px; }
.doc-photo-manage .dpm-item img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); display: block; }
.doc-photo-manage .dpm-del { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--ink-soft); margin-top: 5px; cursor: pointer; }
.doc-photo-manage .dpm-del input { accent-color: var(--danger); }

/* ===================== Lightbox / Bildshow ===================== */
.lb-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  background: oklch(0.16 0.015 60 / 0.92); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.lb-overlay.is-open { display: flex; }
.lb-stage { margin: 0; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-img {
  max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 6px;
  box-shadow: 0 10px 40px oklch(0 0 0 / 0.5); background: oklch(0.22 0.01 60);
  opacity: 0; transform: scale(.98); transition: opacity .25s, transform .25s;
}
.lb-img.is-in { opacity: 1; transform: scale(1); }
.lb-cap { color: oklch(0.92 0.01 80); font-size: .95rem; text-align: center; max-width: 80ch; }
.lb-overlay .lb-close, .lb-overlay .lb-nav, .lb-overlay .lb-play {
  position: absolute; border: none; cursor: pointer; color: #fff;
  background: oklch(0.97 0.01 80 / 0.12); border: 1px solid oklch(0.97 0.01 80 / 0.25);
  border-radius: 50%; display: grid; place-items: center; transition: background .15s;
}
.lb-overlay .lb-close:hover, .lb-overlay .lb-nav:hover, .lb-overlay .lb-play:hover { background: oklch(0.97 0.01 80 / 0.25); }
.lb-close { top: 18px; right: 18px; width: 46px; height: 46px; font-size: 1.8rem; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 2rem; line-height: 1; }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-play { bottom: 22px; left: 50%; transform: translateX(-50%); width: 50px; height: 50px; font-size: 1rem; }
.lb-play.is-playing { background: var(--brass); color: oklch(0.22 0.04 60); border-color: var(--brass); }
.lb-count { position: absolute; bottom: 30px; right: 24px; color: oklch(0.9 0.01 80); font-family: var(--mono); font-size: .9rem; letter-spacing: .04em; }
@media (max-width: 600px) {
  .lb-nav { width: 44px; height: 44px; font-size: 1.6rem; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-count { bottom: 76px; right: 14px; }
}

/* ===================== Tabelle (Sammlung) ===================== */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: .96rem; }
table.data thead th {
  text-align: left; font-family: var(--sans); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700; padding: 13px 16px; background: var(--surface-2); border-bottom: 2px solid var(--line-strong); white-space: nowrap;
}
table.data tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--bg-deep); }
table.data .thumb-cell { width: 64px; }
.mini-thumb {
  width: 56px; height: 42px; border-radius: 6px; border: 1px solid var(--line-strong); object-fit: cover; display: block; flex: none;
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(45deg, oklch(0.3 0.02 60 / 0.06) 0 6px, transparent 6px 12px);
}
table.data .row-title { font-weight: 600; color: var(--ink); }
table.data .row-sub { font-size: .84rem; color: var(--ink-faint); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary-dark); border-color: var(--primary); }
.icon-btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ===================== Badges ===================== */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid; letter-spacing: .02em; white-space: nowrap; }
.badge-cat-lok      { background: var(--primary-soft); color: var(--primary-dark); border-color: oklch(0.505 0.176 28 / 0.3); }
.badge-cat-wagen    { background: var(--claret-soft); color: var(--claret); border-color: oklch(0.44 0.115 26 / 0.3); }
.badge-cat-zugset   { background: var(--primary-soft); color: var(--primary-dark); border-color: oklch(0.4 0.058 158 / 0.3); }
.badge-cat-gebaeude { background: oklch(0.93 0.04 72); color: var(--brass-dark); border-color: oklch(0.55 0.1 68 / 0.35); }
.badge-cat-zubehoer { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line-strong); }
.badge-era { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line-strong); font-family: var(--mono); }
.cond-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.cond-neu { background: var(--good); }
.cond-gebraucht { background: var(--brass); }
.cond-bastler { background: var(--claret); }

/* ===================== Detailansicht ===================== */
.detail-grid { display: grid; grid-template-columns: 1.1fr 1.4fr; gap: 30px; align-items: start; }
@media (max-width: 820px) { .detail-grid { grid-template-columns: 1fr; } }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-list .spec { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.spec-list .spec:nth-child(odd) { border-right: 1px solid var(--line); }
.spec .k { font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.spec .v { font-size: 1.02rem; color: var(--ink); font-weight: 500; }
@media (max-width: 520px) { .spec-list { grid-template-columns: 1fr; } .spec-list .spec:nth-child(odd) { border-right: none; } }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery .photo-placeholder { min-height: 150px; }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* ===================== Doku-Liste ===================== */
.doc-card { display: flex; gap: 16px; align-items: flex-start; }
.doc-card .photo-placeholder { width: 130px; flex: none; min-height: 96px; }
.doc-card .meta-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--ink-faint); margin-top: 6px; }

/* ===================== Footer ===================== */
.footer { background: var(--primary-dark); color: oklch(0.9 0.01 80); margin-top: 60px; border-top: 3px solid var(--brass-dark); }
.footer .wrap { padding: 36px 24px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer a { color: oklch(0.92 0.02 80); }
.footer .brand .name, .footer .brand .sub { color: oklch(0.95 0.01 80); }
.footer-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.social { display: flex; align-items: center; gap: 10px; }
.social-link {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid oklch(0.95 0.01 80 / 0.3); color: oklch(0.95 0.01 80);
  transition: background .15s, border-color .15s, transform .06s;
}
.social-link:hover { background: var(--brass); border-color: var(--brass); color: oklch(0.23 0.04 60); }
.social-link:active { transform: translateY(1px); }
.social-link svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* ===================== Rechtsseiten (Impressum/Datenschutz) ===================== */
.legal h2 { margin-top: 1.6em; font-size: 1.4rem; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.legal h3 { margin-top: 1.3em; font-size: 1.1rem; color: var(--primary-dark); }
.legal p { color: var(--ink-soft); font-size: .98rem; }
.legal a { word-break: break-word; }

/* ===================== Hilfsklassen ===================== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .ic { width: 60px; height: 60px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-faint); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 18px; } .mt-3 { margin-top: 28px; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--line); border: none; margin: 22px 0; }
.pill-link { font-size: .9rem; font-weight: 600; }
.svg-ic { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media print {
  .topbar, .footer, .toolbar, .row-actions, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .table-card, .card, .stat { box-shadow: none; border-color: #ccc; }
}
