@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root{
  --bg: #eef2f1;
  --ink: #0d141c;
  --muted: #516070;
  --card: #ffffff;
  --stroke: rgba(13,20,28,0.12);
  --accent: #16b071;
  --accent-2: #0e8fd4;
  --accent-glow: rgba(14,143,212,0.18);
  --danger: #e44d3a;
  --danger-2: #c63d2e;
  --shadow: 0 18px 40px rgba(11,18,24,.12);
  --radius: 12px;
  --max: 1200px;
  --bg-image: url("WIKIHinterGrund.png");
}

*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  position: relative;
}

body::before{
  content: "";
  position: fixed;
  inset: -20px;
  background-image: var(--bg-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(5px);
  transform: scale(1.04);
  z-index: 0;
}

body > *{
  position: relative;
  z-index: 1;
}

html.theme-dark{
  --bg: #0b1016;
  --ink: #e6ecf2;
  --muted: #9aa7b6;
  --card: #121924;
  --stroke: rgba(230,236,242,0.08);
  --accent: #2ad38b;
  --accent-2: #4aa4ff;
  --accent-glow: rgba(74,164,255,0.22);
  --shadow: 0 18px 40px rgba(0,0,0,.35);
}


a{ color: inherit; text-decoration: none; }
a:hover{ color: var(--accent-2); }

img{ max-width:100%; height:auto; border-radius: 14px; }

.container{
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px;
}

.grid{
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 18px;
  align-items: start;
}

.single{
  max-width: 920px;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(13,20,28,0.10);
  backdrop-filter: blur(10px);
}

.topbar::after{
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
}

.topbar .inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  max-width: var(--max);
  margin:0 auto;
  padding: 14px 20px;
}

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

.logo{
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  line-height: 0;
  font-size: 0;
}

.logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
}

.brand-text{
  display:flex;
  flex-direction:column;
}

.brand-title{
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
}

.brand-sub{
  font-size: 12px;
  color: var(--muted);
}

.actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-toggle{
  display: none;
  padding: 8px 12px;
}

.card{
  position: relative;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (min-width: 980px){
  .sidebar{
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow: auto;
  }
}

.card::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.5);
  pointer-events: none;
}

.card::before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.6;
}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stack > * + *{ margin-top: 14px; }

.eyebrow{
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.title-small{
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.page-title{
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 26px;
  margin: 4px 0;
}

.meta{
  font-size: 12px;
  color: var(--muted);
}

.pill{
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #f6fbf6;
  color: var(--muted);
}

.list{
  display:flex;
  flex-direction:column;
  gap: 12px;
  margin-top: 12px;
}

.is-hidden{
  display: none !important;
}

.category-group{
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(13,20,28,0.08);
  position: relative;
}

.category-group::before{
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.category-group summary{
  list-style: none;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(13,20,28,0.02);
}

.category-group summary::-webkit-details-marker{ display: none; }

.category-group summary::after{
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  margin-left: 6px;
  transform: rotate(-45deg);
  transition: transform .12s ease, border-color .12s ease;
}

.category-group[open] summary::after{
  transform: rotate(45deg);
  border-color: var(--ink);
}

.cat-title{
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.cat-count{
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  background: rgba(14,143,212,0.12);
  border-color: rgba(14,143,212,0.25);
  margin-left: auto;
}

.category-items{
  padding: 10px 12px 14px;
  display: grid;
  gap: 10px;
}

html.theme-dark .category-group{
  background: linear-gradient(135deg, rgba(18,25,36,0.95), rgba(18,25,36,0.8));
  border-color: rgba(230,236,242,0.08);
}

html.theme-dark .cat-count{
  background: rgba(74,164,255,0.18);
  border-color: rgba(74,164,255,0.35);
}

html.theme-dark .category-group summary{
  background: rgba(230,236,242,0.04);
}

html.theme-dark .category-group summary::after{
  border-color: rgba(230,236,242,0.6);
}

.list-item{
  position: relative;
  padding: 14px 16px 14px 22px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.94);
  transition: transform .08s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
  overflow: hidden;
}

.list-item:hover{
  transform: translateY(-1px);
  border-color: rgba(13,20,28,0.20);
  background: #fff;
  box-shadow: 0 10px 22px rgba(13,20,28,0.12);
}

.list-item.active{
  border-color: rgba(22,176,113,0.55);
  background: rgba(22,176,113,0.12);
  box-shadow: inset 3px 0 0 var(--accent), 0 12px 24px rgba(22,176,113,0.14);
}

.list-item::before{
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(14,143,212,0.45);
  transform: translateY(-50%);
}

.list-item.active::before{
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22,176,113,0.15);
}

.list-title{
  font-weight: 600;
}

.list-meta{
  font-size: 12px;
  color: var(--muted);
}

.badge{
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  background: rgba(22,176,113,0.12);
  color: var(--ink);
  border: 1px solid rgba(22,176,113,0.25);
  margin-right: 6px;
}

html.theme-dark .badge{
  background: rgba(42,211,139,0.12);
  border-color: rgba(42,211,139,0.25);
}

.note{
  border: 1px dashed rgba(22,161,92,.45);
  background: rgba(22,161,92,.08);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
}

.muted{ color: var(--muted); }
.small{ font-size: 12px; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}

.menu-toggle{ display: none; }

.btn:hover{ border-color: rgba(16,22,31,.15); }
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(14,143,212,0.22);
}

.btn.primary:hover{ box-shadow: 0 14px 24px rgba(14,143,212,0.28); }

.btn.ghost{
  background: transparent;
}

.btn.danger{
  background: linear-gradient(135deg, var(--danger), #f07c5f);
  color:#fff;
  border-color: transparent;
}

.btn.small{
  padding: 6px 10px;
  font-size: 12px;
}

.form label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  display:block;
  margin: 10px 0 6px;
}

.input, textarea, select{
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}

.input:focus, textarea:focus, select:focus{
  border-color: rgba(14,143,212,0.55);
  box-shadow: 0 0 0 4px rgba(14,143,212,0.14);
}

textarea{ min-height: 260px; resize: vertical; }

/* EasyMDE editor styling */
.EasyMDEContainer{
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.editor-toolbar{
  border: 0;
  padding: 8px;
  gap: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--stroke);
}

.editor-toolbar a{
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(13,20,28,0.04);
  transition: transform .06s ease, background .12s ease, border-color .12s ease, color .12s ease;
}

.editor-toolbar a i{
  color: inherit;
}

.editor-toolbar a:hover,
.editor-toolbar a.active{
  color: var(--ink);
  background: rgba(14,143,212,0.16);
  border-color: rgba(14,143,212,0.35);
}

.editor-toolbar i.separator{
  margin: 0 4px;
  border-left: 1px solid var(--stroke);
}

.CodeMirror{
  border: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.CodeMirror-scroll{
  min-height: 260px;
  padding: 8px 10px 12px;
}

.CodeMirror-gutters{
  border-right: 1px solid var(--stroke);
  background: rgba(13,20,28,0.03);
}

.editor-preview,
.editor-preview-side{
  background: var(--card);
  color: var(--ink);
}

html.theme-dark .editor-toolbar{
  background: #0f1620;
  border-bottom: 1px solid rgba(230,236,242,0.08);
}

html.theme-dark .editor-toolbar a{
  color: #e6ecf2;
  background: rgba(230,236,242,0.12);
  border-color: rgba(230,236,242,0.12);
}

html.theme-dark .editor-toolbar a:hover,
html.theme-dark .editor-toolbar a.active{
  color: var(--ink);
  background: rgba(74,164,255,0.24);
  border-color: rgba(74,164,255,0.45);
}

html.theme-dark .editor-toolbar i.separator{
  border-left: 1px solid rgba(230,236,242,0.22);
}

html.theme-dark .CodeMirror{
  background: #0f1620;
  color: #e6ecf2;
}

html.theme-dark .CodeMirror-gutters{
  border-right: 1px solid rgba(230,236,242,0.08);
  background: rgba(230,236,242,0.05);
}

html.theme-dark .editor-preview,
html.theme-dark .editor-preview-side{
  background: #0f1620;
  color: #e6ecf2;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px){
  .grid2{ grid-template-columns: 1fr; }
}

.search{
  display:flex;
  gap: 10px;
  align-items:center;
}

@media (max-width: 600px){
  .search{ flex-direction: column; align-items: stretch; }
}

.table-wrap{
  width: 100%;
  overflow:auto;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #fff;
}

.table{
  width:100%;
  border-collapse: collapse;
  min-width: 560px;
}

.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--stroke);
  text-align:left;
  vertical-align: top;
  font-size: 14px;
}

.table th{
  background: #f3f6f1;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.actions-row{
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alert{
  border: 1px solid rgba(22,176,113,0.4);
  border-left: 4px solid var(--accent);
  background: rgba(22,176,113,0.10);
  padding: 12px 14px;
  border-radius: 10px;
}

.notice{
  border: 1px solid rgba(16,22,31,.12);
  background: rgba(16,22,31,.04);
  padding: 10px 14px;
  border-radius: 8px;
}

.prose{
  font-size: 15px;
  line-height: 1.7;
}

.prose h1{ font-size: 24px; margin: 18px 0 8px; }
.prose h2{ font-size: 20px; margin: 18px 0 8px; }
.prose h3{ font-size: 16px; margin: 16px 0 6px; }
.prose p{ margin: 10px 0; }
.prose ul, .prose ol{ margin: 10px 0 10px 18px; }
.prose li{ margin: 6px 0; }

.prose blockquote{
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: rgba(22,176,113,0.10);
  border-radius: 8px;
}

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

.card{ animation: floatIn .35s ease both; }
.list-item{ animation: floatIn .35s ease both; }

.prose code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  background: #f1f4f0;
  padding: 2px 6px;
  border-radius: 8px;
}

.prose pre{
  background: #0f172a;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 14px;
  overflow:auto;
}

.prose pre code{
  background: transparent;
  padding: 0;
  color: inherit;
}

html.theme-dark .prose code{
  background: #162131;
  color: #eef3f8;
  border: 1px solid rgba(230,236,242,0.12);
}

html.theme-dark .prose pre{
  background: #0b121b;
}

html.theme-dark .prose pre code{
  background: transparent;
  border: 0;
  color: inherit;
}

@media (max-width: 520px){
  .btn{ width: 100%; justify-content:center; }
  .topbar .inner{ flex-direction: column; align-items:flex-start; }
  .actions{ width: 100%; }
}

@media (max-width: 700px){
  .menu-toggle{ display: inline-flex; }
  .actions{ display: flex; width: 100%; gap: 8px; }
  .actions > :not(.menu-toggle){ display: none; }
  .topbar.open .actions > :not(.menu-toggle){ display: inline-flex; }
}
.stats-bar{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat{
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat-label{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 700;
}

.stat-value{
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

html.theme-dark .topbar{
  background: rgba(12,16,22,.85);
  border-bottom: 1px solid rgba(230,236,242,0.08);
}

html.theme-dark .topbar::after{
  background: linear-gradient(90deg, var(--accent), transparent 60%);
}

html.theme-dark .card::after{
  border-color: rgba(255,255,255,0.08);
}

html.theme-dark .list-item{
  background: rgba(18,25,36,0.9);
  border-color: rgba(230,236,242,0.08);
}

html.theme-dark .list-item:hover{
  background: #151d29;
  border-color: rgba(230,236,242,0.12);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
}

html.theme-dark .list-item.active{
  border-color: rgba(42,211,139,0.55);
  background: rgba(42,211,139,0.14);
  box-shadow: inset 3px 0 0 var(--accent), 0 12px 24px rgba(0,0,0,0.45);
}

html.theme-dark .btn{
  background: #0f1620;
  border-color: rgba(230,236,242,0.08);
  color: var(--ink);
}

html.theme-dark .btn.ghost{
  background: transparent;
}

html.theme-dark .btn.primary{
  color: #fff;
}

html.theme-dark .input,
html.theme-dark textarea,
html.theme-dark select{
  background: #0f1620;
  border-color: rgba(230,236,242,0.08);
  color: var(--ink);
}

html.theme-dark .table-wrap{
  background: #121924;
}

html.theme-dark .table th{
  background: #0f1620;
  color: var(--muted);
}

html.theme-dark .stat{
  background: #121924;
}

@media (max-width: 700px){
  .stats-bar{ grid-template-columns: 1fr; }
}
