/* ================================================================
   LULUPEDIA — Das Schlaraffische Wiki
   Stylesheet v1.0
   ================================================================ */

:root {
  --bg-deep: #0c0a14;
  --bg-card: #16131f;
  --bg-card-hover: #1e1a2a;
  --bg-sidebar: #110e1a;
  --bg-input: rgba(255,255,255,0.06);
  --gold: #c9a84c;
  --gold-light: #e8cc6e;
  --gold-dim: #8a7234;
  --gold-bg: rgba(201,168,76,0.1);
  --text: #d4cfc6;
  --text-dim: #8a8578;
  --text-bright: #f0ece4;
  --accent: #6b4fa0;
  --accent-light: #9b7ad8;
  --border: #2a2438;
  --border-light: #3a3248;
  --danger: #c0392b;
  --success: #27ae60;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

.mono { font-family: 'JetBrains Mono', monospace; }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }

/* ================================================================
   HEADER
   ================================================================ */

.site-header {
  background: linear-gradient(135deg, #0f0c18, #1a1528, #12101c);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-area {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
}

.logo-uhu { font-size: 30px; line-height: 1; }

.site-title {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 20px; color: var(--gold);
  letter-spacing: 1.5px; text-transform: uppercase;
}

.site-subtitle {
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase;
}

.main-nav {
  display: flex; gap: 4px;
}

.nav-link {
  padding: 6px 14px; border-radius: 6px;
  font-size: 14px; color: var(--text);
  transition: all 0.2s;
}

.nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text-bright); }
.nav-link.active { background: var(--gold-bg); color: var(--gold); }

.search-area {
  flex: 1; max-width: 400px; position: relative;
}

.search-input {
  width: 100%; padding: 9px 14px 9px 36px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-bright);
  font-family: 'Crimson Pro', serif; font-size: 15px;
  outline: none; transition: all 0.3s;
}

.search-input:focus {
  border-color: var(--gold-dim);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 20px rgba(201,168,76,0.08);
}

.search-input::placeholder { color: var(--text-dim); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 14px; }

.search-results {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 8px; margin-top: 4px; max-height: 400px;
  overflow-y: auto; box-shadow: var(--shadow); z-index: 150;
}

.search-results.open { display: block; }

.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text); transition: background 0.15s;
}

.search-result-item:hover { background: var(--bg-card-hover); }

.search-result-item img {
  width: 36px; height: 36px; object-fit: cover; border-radius: 4px;
}

.search-result-name { font-weight: 500; color: var(--text-bright); }
.search-result-meta { font-size: 12px; color: var(--text-dim); }

.header-actions { flex-shrink: 0; }

.btn-admin {
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; color: var(--gold);
  border: 1px solid var(--gold-dim);
  transition: all 0.2s;
}

.btn-admin:hover { background: var(--gold-bg); }

.sidebar-toggle {
  display: none; padding: 6px 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); cursor: pointer; font-size: 18px;
}

/* ================================================================
   LAYOUT
   ================================================================ */

.app-layout {
  display: flex; max-width: 1440px; margin: 0 auto; width: 100%;
  min-height: calc(100vh - 140px); flex: 1;
}

/* ================================================================
   SIDEBAR
   ================================================================ */

.sidebar {
  width: 260px; flex-shrink: 0; background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px; overflow-y: auto;
  height: calc(100vh - 60px); position: sticky; top: 60px;
}

.sidebar h3 {
  font-family: 'Cinzel', serif; font-size: 11px; font-weight: 600;
  color: var(--gold-dim); letter-spacing: 2px; text-transform: uppercase;
  margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}

.sidebar h3:first-child { margin-top: 0; }

.filter-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 6px 10px; background: transparent;
  border: none; border-radius: 5px; color: var(--text);
  font-family: 'Crimson Pro', serif; font-size: 14px;
  cursor: pointer; transition: all 0.2s; text-align: left;
  text-decoration: none;
}

.filter-btn:hover { background: rgba(255,255,255,0.04); }
.filter-btn.active { background: var(--gold-bg); color: var(--gold); }

.filter-count {
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim); background: rgba(255,255,255,0.04);
  padding: 1px 6px; border-radius: 8px;
}

.lv-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

.lv-dot[data-lv="Austria"] { background: #c0392b; }
.lv-dot[data-lv="Deutschland"] { background: #34495e; }
.lv-dot[data-lv="Helvetica"] { background: #e74c3c; }
.lv-dot[data-lv="Lateinamerika"] { background: #16a085; }
.lv-dot[data-lv="Nordamerika"] { background: #2980b9; }
.lv-dot[data-lv=""] { background: #555; }

.sort-controls { display: flex; gap: 3px; }

.sort-btn {
  flex: 1; padding: 5px 6px; text-align: center;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-dim); font-size: 12px;
  text-decoration: none; transition: all 0.2s;
}

.sort-btn.active { background: var(--gold-bg); border-color: var(--gold-dim); color: var(--gold); }

.alpha-index { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; }

.alpha-btn {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-dim); font-family: 'Cinzel', serif; font-size: 10px;
  text-decoration: none; transition: all 0.2s;
}

.alpha-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.alpha-btn.active { background: var(--gold); color: var(--bg-deep); border-color: var(--gold); }
.alpha-btn.disabled { opacity: 0.2; pointer-events: none; }

.sidebar-stats {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
}

.stat-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 3px 0; color: var(--text-dim);
}

.stat-val { color: var(--gold-dim); font-family: 'JetBrains Mono', monospace; }

/* ================================================================
   MAIN CONTENT
   ================================================================ */

.main-content { flex: 1; padding: 20px 24px; }

.results-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.results-info { display: flex; align-items: center; gap: 8px; }
.results-count { font-size: 14px; color: var(--text-dim); }
.results-filter { font-size: 13px; color: var(--gold-dim); background: var(--gold-bg); padding: 2px 8px; border-radius: 4px; }
.clear-search { color: var(--danger); font-size: 12px; margin-left: 4px; }

.view-toggle { display: flex; gap: 3px; }

.view-btn {
  padding: 5px 9px; background: transparent; border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-dim); cursor: pointer;
  font-size: 14px; transition: all 0.2s;
}

.view-btn.active { background: var(--gold-bg); border-color: var(--gold-dim); color: var(--gold); }

/* ================================================================
   GRID VIEW
   ================================================================ */

.entries-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.entry-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.3s; text-decoration: none; color: var(--text);
  display: block;
}

.entry-card:hover {
  background: var(--bg-card-hover); border-color: var(--gold-dim);
  transform: translateY(-2px); box-shadow: var(--shadow);
  color: var(--text);
}

.card-images {
  padding: 10px 10px 0; display: flex; justify-content: center;
  min-height: 60px;
}

.card-images img {
  max-height: 140px; max-width: 100%; object-fit: contain;
  border-radius: 4px; background: rgba(255,255,255,0.02);
}

.card-no-img {
  height: 70px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; opacity: 0.2;
}

.card-body { padding: 10px 14px 14px; }

.card-number {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--gold-dim); margin-bottom: 2px;
}

.card-name {
  font-family: 'Cinzel', serif; font-size: 16px; font-weight: 600;
  color: var(--text-bright); line-height: 1.3; margin-bottom: 4px;
}

.card-lv {
  font-size: 12px; color: var(--text-dim);
  display: flex; align-items: center; gap: 5px;
}

.card-img-count {
  font-size: 11px; color: var(--text-dim); float: right;
}

/* ================================================================
   LIST VIEW
   ================================================================ */

.entries-list { display: flex; flex-direction: column; gap: 3px; }

.list-row {
  display: grid; grid-template-columns: 55px 1fr 130px 150px 50px;
  align-items: center; padding: 9px 14px; gap: 10px;
  background: var(--bg-card); border: 1px solid transparent;
  border-radius: 5px; text-decoration: none; color: var(--text);
  transition: all 0.15s;
}

.list-row:hover { background: var(--bg-card-hover); border-color: var(--border-light); }

.list-nr { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--gold-dim); }
.list-name { font-family: 'Cinzel', serif; font-weight: 600; color: var(--text-bright); font-size: 15px; }
.list-lv { font-size: 13px; color: var(--text-dim); }
.list-cat { font-size: 12px; color: var(--text-dim); }
.list-imgs { font-size: 12px; color: var(--text-dim); text-align: right; }

/* ================================================================
   PAGINATION
   ================================================================ */

.pagination {
  display: flex; gap: 4px; justify-content: center;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
}

.page-btn {
  padding: 6px 12px; border-radius: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; text-decoration: none;
  transition: all 0.2s;
}

.page-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.page-btn.active { background: var(--gold); color: var(--bg-deep); border-color: var(--gold); }
.page-dots { padding: 6px 4px; color: var(--text-dim); }

/* ================================================================
   DETAIL PAGE
   ================================================================ */

.detail-page { padding: 20px 24px; max-width: 1000px; margin: 0 auto; width: 100%; }
.detail-container { }

.breadcrumbs {
  font-size: 13px; color: var(--text-dim); margin-bottom: 16px;
}

.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--gold); }
.bc-sep { margin: 0 6px; }
.bc-current { color: var(--text); }

.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}

.detail-number {
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
  color: var(--gold); margin-bottom: 4px;
}

.detail-name {
  font-family: 'Cinzel', serif; font-size: 32px; font-weight: 700;
  color: var(--gold-light); line-height: 1.2;
}

.detail-meta {
  margin-top: 8px; font-size: 14px; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}

.meta-sep { color: var(--border-light); }
.meta-lv { display: flex; align-items: center; gap: 5px; }

.detail-gallery {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px;
}

.gallery-item { position: relative; }

.gallery-item img {
  max-height: 280px; max-width: 100%; object-fit: contain;
  border-radius: 8px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); cursor: zoom-in;
  transition: transform 0.3s;
}

.gallery-item img:hover { transform: scale(1.02); }
.gallery-caption { font-size: 12px; color: var(--text-dim); margin-top: 4px; text-align: center; }

.detail-section { margin-bottom: 24px; }

.detail-section h2 {
  font-family: 'Cinzel', serif; font-size: 14px; font-weight: 600;
  color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 10px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}

.orden-list, .turniere-list { list-style: none; }

.orden-list li, .turniere-list li {
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 15px;
}

.orden-list li::before { content: '◆ '; color: var(--gold-dim); font-size: 8px; }
.turniere-list li::before { content: '⚔ '; font-size: 12px; }

.detail-text {
  font-size: 15px; line-height: 1.7; white-space: pre-wrap;
  padding: 14px 18px; background: rgba(0,0,0,0.2);
  border-radius: 8px; border: 1px solid var(--border);
  max-height: 500px; overflow-y: auto;
}

.cross-refs { display: flex; flex-wrap: wrap; gap: 8px; }

.ref-link {
  padding: 6px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; color: var(--text); transition: all 0.2s;
}

.ref-link:hover { border-color: var(--gold-dim); color: var(--gold); }
.ref-label { font-size: 11px; color: var(--text-dim); margin-left: 4px; }

.related-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }

.related-section h2 {
  font-family: 'Cinzel', serif; font-size: 14px; font-weight: 600;
  color: var(--gold-dim); letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 12px;
}

.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
}

.related-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; text-decoration: none;
  transition: all 0.2s;
}

.related-card:hover { border-color: var(--gold-dim); transform: translateY(-1px); }

.related-card img {
  width: 100%; height: 80px; object-fit: contain;
  background: rgba(255,255,255,0.02);
}

.related-info { padding: 6px 8px; }
.related-nr { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--gold-dim); }
.related-name { display: block; font-size: 13px; color: var(--text-bright); font-weight: 500; }

/* ================================================================
   EMPTY STATE
   ================================================================ */

.empty-state { text-align: center; padding: 60px 20px; grid-column: 1 / -1; }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-text { color: var(--text-dim); font-size: 16px; margin-bottom: 16px; }

/* ================================================================
   ERROR PAGE
   ================================================================ */

.error-page {
  text-align: center; padding: 80px 20px; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.error-page .error-icon { font-size: 64px; margin-bottom: 16px; }
.error-page h1 { font-family: 'Cinzel', serif; font-size: 72px; color: var(--gold); }
.error-page p { color: var(--text-dim); margin: 8px 0 24px; }

/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
  background: var(--bg-sidebar); border-top: 1px solid var(--border);
  padding: 20px 24px; margin-top: auto;
}

.footer-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}

.footer-brand {
  display: flex; align-items: center; gap: 8px;
}

.footer-title {
  font-family: 'Cinzel', serif; font-weight: 600;
  color: var(--gold-dim); font-size: 14px;
}

.footer-dash { color: var(--border-light); }
.footer-tagline { color: var(--text-dim); font-size: 13px; }

.footer-copy {
  font-size: 13px; color: var(--text-dim); text-align: center;
}

.footer-links {
  font-size: 13px; color: var(--text-dim);
}

.footer-links a { color: var(--gold-dim); }
.footer-links a:hover { color: var(--gold); }
.footer-sep { margin: 0 6px; color: var(--border-light); }
.footer-org { font-size: 12px; }

/* ================================================================
   LIGHTBOX
   ================================================================ */

.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.92); z-index: 300;
  align-items: center; justify-content: center; cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 8px;
}

.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  color: white; font-size: 20px; cursor: pointer;
}

/* ================================================================
   FLASH MESSAGES
   ================================================================ */

.flash-container {
  max-width: 1440px; margin: 0 auto; padding: 8px 24px;
}

.flash {
  padding: 10px 16px; border-radius: 6px; margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; animation: flashIn 0.3s ease-out;
}

@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

.flash-success { background: rgba(39,174,96,0.15); color: #2ecc71; border: 1px solid rgba(39,174,96,0.3); }
.flash-error { background: rgba(192,57,43,0.15); color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }
.flash-info { background: rgba(201,168,76,0.1); color: var(--gold); border: 1px solid var(--gold-dim); }

.flash-close {
  background: none; border: none; color: inherit; cursor: pointer;
  opacity: 0.6; font-size: 14px;
}

/* ================================================================
   BUTTONS
   ================================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 6px;
  font-family: 'Crimson Pro', serif; font-size: 15px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; transition: all 0.2s;
  text-decoration: none; white-space: nowrap;
}

.btn:hover { border-color: var(--border-light); background: var(--bg-card-hover); color: var(--text-bright); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8952f);
  border-color: var(--gold); color: var(--bg-deep); font-weight: 600;
}

.btn-gold:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--bg-deep); }

.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(192,57,43,0.15); }

.btn-outline { background: transparent; }

.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 17px; }
.btn-block { width: 100%; justify-content: center; }

/* ================================================================
   FORMS
   ================================================================ */

.form-group { margin-bottom: 14px; }

.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-dim); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.form-input {
  width: 100%; padding: 9px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-bright);
  font-family: 'Crimson Pro', serif; font-size: 16px;
  outline: none; transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--gold-dim); }
.form-input.mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

.form-input-file {
  padding: 8px; background: var(--bg-input); border: 1px dashed var(--border);
  border-radius: 6px; color: var(--text); width: 100%;
}

.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; display: block; }

.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 15px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.form-actions {
  display: flex; align-items: center; gap: 12px;
  padding-top: 16px; border-top: 1px solid var(--border); margin-top: 20px;
}

/* ================================================================
   ADMIN
   ================================================================ */

.login-page { display: flex; flex-direction: column; }

.login-container {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}

.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
}

.login-header {
  text-align: center; margin-bottom: 24px;
}

.login-header h1 {
  font-family: 'Cinzel', serif; font-size: 28px; color: var(--gold);
}

.login-header p { color: var(--text-dim); font-size: 14px; }

.login-form .btn { margin-top: 8px; }

.login-footer {
  text-align: center; margin-top: 16px; font-size: 13px;
}

.login-footer a { color: var(--text-dim); }

/* Admin layout */
.admin-layout { display: flex; max-width: 1440px; margin: 0 auto; width: 100%; flex: 1; }

.admin-sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg-sidebar);
  border-right: 1px solid var(--border); padding: 16px;
  height: calc(100vh - 60px); position: sticky; top: 60px;
}

.admin-user {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
}

.admin-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold-bg); border: 1px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-family: 'Cinzel', serif; font-weight: 700;
}

.admin-username { font-size: 14px; color: var(--text-bright); }

.admin-nav { display: flex; flex-direction: column; gap: 2px; }

.admin-nav-link {
  padding: 8px 10px; border-radius: 6px; font-size: 14px;
  color: var(--text); transition: all 0.15s;
}

.admin-nav-link:hover { background: rgba(255,255,255,0.04); }
.admin-nav-link.active { background: var(--gold-bg); color: var(--gold); }

.admin-nav-sep {
  border: none; border-top: 1px solid var(--border); margin: 6px 0;
}

.admin-main { flex: 1; padding: 20px 28px; }

.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

.admin-header h1 {
  font-family: 'Cinzel', serif; font-size: 22px; color: var(--text-bright);
}

/* Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; text-align: center;
}

.stat-icon { font-size: 24px; margin-bottom: 4px; }

.stat-card .stat-value {
  font-family: 'Cinzel', serif; font-size: 28px; font-weight: 700;
  color: var(--gold);
}

.stat-card .stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* LV Bars */
.lv-bars { display: flex; flex-direction: column; gap: 6px; }

.lv-bar-row { display: flex; align-items: center; gap: 8px; }
.lv-bar-label { width: 130px; font-size: 14px; display: flex; align-items: center; gap: 6px; }

.lv-bar-track {
  flex: 1; height: 20px; background: rgba(255,255,255,0.04);
  border-radius: 4px; overflow: hidden;
}

.lv-bar-fill {
  height: 100%; border-radius: 4px; min-width: 4px;
  transition: width 0.5s ease-out;
}

.lv-bar-fill[data-lv="Austria"] { background: #c0392b; }
.lv-bar-fill[data-lv="Deutschland"] { background: #34495e; }
.lv-bar-fill[data-lv="Helvetica"] { background: #e74c3c; }
.lv-bar-fill[data-lv="Lateinamerika"] { background: #16a085; }
.lv-bar-fill[data-lv="Nordamerika"] { background: #2980b9; }

.lv-bar-count {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--text-dim); width: 30px; text-align: right;
}

/* Admin panels */
.admin-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 18px; margin-bottom: 16px;
}

.admin-panel h2 {
  font-family: 'Cinzel', serif; font-size: 14px; font-weight: 600;
  color: var(--gold); margin-bottom: 12px;
}

.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; padding: 8px 10px; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); }

.table-link { color: var(--text-bright); font-weight: 500; }
.table-link:hover { color: var(--gold); }

/* Admin toolbar */
.admin-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

.admin-search-form { display: flex; gap: 6px; }
.admin-search-form .form-input { width: 250px; padding: 7px 12px; font-size: 14px; }
.admin-search-form .btn { padding: 7px 12px; }

.admin-filter-pills { display: flex; gap: 4px; }

.pill {
  padding: 5px 12px; border-radius: 14px; font-size: 13px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); text-decoration: none; transition: all 0.2s;
}

.pill:hover { border-color: var(--gold-dim); color: var(--gold); }
.pill.active { background: var(--gold-bg); border-color: var(--gold-dim); color: var(--gold); }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
  background: rgba(255,255,255,0.06); color: var(--text-dim);
}

.badge-ok { background: rgba(39,174,96,0.15); color: var(--success); }
.badge-off { background: rgba(255,255,255,0.04); color: var(--text-dim); }
.badge-login { background: rgba(41,128,185,0.15); color: #3498db; }
.badge-create { background: rgba(39,174,96,0.15); color: var(--success); }
.badge-update { background: rgba(201,168,76,0.15); color: var(--gold); }
.badge-delete { background: rgba(192,57,43,0.15); color: var(--danger); }
.badge-backup { background: rgba(155,122,216,0.15); color: var(--accent-light); }

/* Category rows */
.cat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}

.sub-row { padding-left: 20px; }

/* Image admin grid */
.image-grid-admin { display: flex; flex-wrap: wrap; gap: 8px; }

.img-thumb-admin {
  position: relative; width: 100px; height: 80px;
}

.img-thumb-admin img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border);
}

.img-delete-btn {
  position: absolute; top: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); border: none;
  color: white; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr; }
  .admin-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar, .admin-sidebar { display: none; }
  .sidebar-toggle { display: block; }
  .main-nav { display: none; }
  .search-area { max-width: 100%; }

  .sidebar.mobile-open, .admin-sidebar.mobile-open {
    display: block; position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 150; width: 260px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
  }

  .entries-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .list-row { grid-template-columns: 45px 1fr 80px; }
  .list-cat, .list-imgs { display: none; }
  .header-inner { flex-wrap: wrap; }
  .footer-inner { flex-direction: column; text-align: center; }
  .detail-name { font-size: 24px; }
  .detail-gallery img { max-height: 200px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* Auto-references (↑ links) */
.auto-ref { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold-dim); transition: all .2s; }
.auto-ref:hover { color: var(--gold-bright, #e0c05c); border-bottom-color: var(--gold); }

/* Fulltext section */
.detail-fulltext { line-height: 1.8; font-size: 16px; max-width: 800px; }
.detail-fulltext p, .detail-fulltext br { margin-bottom: 0.4em; }
.detail-source { margin-top: 12px; padding: 8px 14px; background: rgba(201,168,76,.06); border-left: 3px solid var(--gold-dim); font-size: 13px; color: var(--text-dim); border-radius: 0 6px 6px 0; }

/* Cross-references section */
.auto-links { margin-top: 16px; }
.auto-links h3 { font-family: var(--font-heading, 'Cinzel', serif); font-size: 15px; color: var(--gold-dim); margin-bottom: 8px; }
.auto-links-list { display: flex; flex-wrap: wrap; gap: 6px; }
.auto-links-list a { display: inline-block; padding: 4px 10px; background: rgba(201,168,76,.08); border: 1px solid var(--border-light, #2a2438); border-radius: 4px; color: var(--gold); font-size: 13px; text-decoration: none; transition: all .2s; }
.auto-links-list a:hover { background: rgba(201,168,76,.15); border-color: var(--gold-dim); }

/* ═══ HERO LANDING (Wikipedia-style) ═══ */
.hero-landing { background: linear-gradient(180deg, #0e0b18 0%, #16131f 100%); border-bottom: 1px solid var(--border-light, #2a2438); padding: 50px 20px 40px; text-align: center; }
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-uhu { font-size: 72px; margin-bottom: 4px; filter: drop-shadow(0 4px 24px rgba(201,168,76,.15)); }
.hero-title { font-family: 'Cinzel', serif; font-size: 48px; font-weight: 700; color: var(--gold, #c9a84c); letter-spacing: 2px; margin-bottom: 4px; }
.hero-subtitle { color: var(--text-dim, #8a8578); font-family: 'Crimson Pro', serif; font-size: 17px; margin-bottom: 28px; }

.hero-search-wrap { max-width: 600px; margin: 0 auto 24px; }
.hero-search { position: relative; }
.hero-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--gold-dim, #8a7234); pointer-events: none; z-index: 2; }
.hero-search-input {
    width: 100%; padding: 16px 20px 16px 52px; font-size: 19px;
    font-family: 'Crimson Pro', serif;
    background: rgba(255,255,255,.07); border: 2px solid var(--border-light, #2a2438);
    border-radius: 14px; color: #f0ece4; outline: none;
    transition: all .3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.hero-search-input:focus { border-color: var(--gold, #c9a84c); background: rgba(255,255,255,.1); box-shadow: 0 4px 30px rgba(201,168,76,.15); }
.hero-search-input::placeholder { color: #6a6560; }
.hero-search-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; z-index: 100; }

.hero-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-cat-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    background: rgba(201,168,76,.08); border: 1px solid rgba(201,168,76,.15);
    color: var(--gold, #c9a84c); font-size: 13px; font-family: 'Crimson Pro', serif;
    text-decoration: none; transition: all .2s;
}
.hero-cat-pill:hover { background: rgba(201,168,76,.15); border-color: var(--gold, #c9a84c); }
.hero-cat-count { background: rgba(201,168,76,.15); padding: 1px 7px; border-radius: 10px; font-size: 11px; }

/* ═══ FEATURED ENTRIES ═══ */
.featured-section { padding: 30px 20px 20px; border-bottom: 1px solid var(--border-light, #2a2438); }
.featured-inner { max-width: 1100px; margin: 0 auto; }
.featured-title { font-family: 'Cinzel', serif; font-size: 18px; color: var(--gold-dim, #8a7234); text-align: center; margin-bottom: 20px; }
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.featured-card {
    display: flex; flex-direction: column;
    background: var(--surface, #16131f); border: 1px solid var(--border-light, #2a2438);
    border-radius: 10px; overflow: hidden;
    text-decoration: none; color: var(--text, #d4cfc6);
    transition: all .25s ease;
}
.featured-card:hover { border-color: var(--gold-dim, #8a7234); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.featured-img { height: 140px; overflow: hidden; background: #0a0818; display: flex; align-items: center; justify-content: center; }
.featured-img img { width: 100%; height: 100%; object-fit: cover; }
.featured-img-empty { color: var(--border-light, #2a2438); font-size: 48px; }
.featured-body { padding: 14px 16px; flex: 1; }
.featured-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--gold-dim, #8a7234); margin-bottom: 4px; }
.featured-name { font-family: 'Cinzel', serif; font-size: 16px; color: var(--gold, #c9a84c); margin-bottom: 6px; line-height: 1.3; }
.featured-snippet { font-size: 13px; color: var(--text-dim, #8a8578); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 768px) {
    .hero-title { font-size: 32px; }
    .hero-uhu { font-size: 56px; }
    .hero-search-input { font-size: 17px; padding: 14px 16px 14px 46px; }
    .featured-grid { grid-template-columns: 1fr; }
    .hero-landing { padding: 30px 16px 28px; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 26px; }
    .hero-subtitle { font-size: 14px; }
    .featured-grid { gap: 12px; }
    .featured-card { flex-direction: row; }
    .featured-img { width: 90px; height: auto; min-height: 90px; }
    .featured-body { padding: 10px 12px; }
}
