/* ============================================================
   KG Brav-Jonge — Admin-Bereich (Backend) Stylesheet
   ============================================================ */
:root {
  --a-red:      #E11D2A;
  --a-red-dark: #C01622;
  --a-ink:      #1A1714;
  --a-ink-2:    #4B453E;
  --a-gray:     #8C857C;
  --a-line:     #ECE8E2;
  --a-bg:       #FAF8F5;
  --a-side:     #FFFFFF;
  --a-card:     #FFFFFF;
  --a-radius:   12px;
  --a-shadow:   0 1px 2px rgba(26,23,20,.04), 0 6px 18px -12px rgba(26,23,20,.12);
  --a-serif:    'Source Serif 4', Georgia, serif;
  --a-sans:     'Hanken Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--a-sans); color: var(--a-ink); background: var(--a-bg); font-size: 15px; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { margin: 0; font-family: var(--a-serif); font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Layout ---- */
.admin { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* ---- Sidebar ---- */
.side { background: var(--a-side); border-right: 1px solid var(--a-line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px; }
.side-logo { width: 42px; height: 42px; border-radius: 50%; background: var(--a-red); color: #fff; display: grid; place-items: center; font-family: var(--a-serif); font-weight: 700; font-size: 1rem; flex: none; }
.side-brand b { font-family: var(--a-serif); font-size: 1.05rem; display: block; line-height: 1.15; white-space: nowrap; }
.side-brand > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.side-brand span { font-size: .76rem; color: var(--a-gray); }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 20px; }
.nav-group-label { display: flex; align-items: center; justify-content: space-between; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--a-gray); padding: 18px 10px 8px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--a-ink-2); font-weight: 600; font-size: .92rem; margin: 1px 0; transition: background .14s ease, color .14s ease; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: #F4F1EC; color: var(--a-ink); }
.nav-item.active { background: var(--a-red); color: #fff; box-shadow: 0 6px 16px -8px rgba(225,29,42,.7); }
.nav-item.top { margin-bottom: 4px; }
.nav-item .count { margin-left: auto; background: #F0EFEC; color: var(--a-gray); font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.nav-item.active .count { background: rgba(255,255,255,.25); color: #fff; }
.side-foot { border-top: 1px solid var(--a-line); padding: 14px 16px; }
.side-foot .email { font-size: .82rem; color: var(--a-gray); margin-bottom: 10px; word-break: break-all; }
.btn-logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 1.5px solid var(--a-red); color: var(--a-red); background: transparent; border-radius: 10px; font-weight: 700; transition: background .15s ease, color .15s ease; }
.btn-logout:hover { background: var(--a-red); color: #fff; }
.btn-logout svg { width: 16px; height: 16px; }

/* ---- Main ---- */
.main { padding: 34px 40px 60px; max-width: 1500px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head h1 { font-size: 2rem; }
.page-head .sub { color: var(--a-gray); margin-top: 4px; font-size: .95rem; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--a-red); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 700; font-size: .92rem; box-shadow: 0 10px 24px -12px rgba(225,29,42,.8); transition: background .15s ease, transform .15s ease; white-space: nowrap; }
.btn-primary:hover { background: var(--a-red-dark); transform: translateY(-1px); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-secondary { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--a-ink-2); border: 1.5px solid var(--a-line); border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: .92rem; }
.btn-secondary:hover { border-color: var(--a-gray); }

.section-label { font-family: var(--a-serif); font-weight: 700; font-size: 1.15rem; margin: 8px 0 14px; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
.stat-card { background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 22px 22px 20px; box-shadow: var(--a-shadow); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-height: 116px; }
.stat-card .num { font-family: var(--a-serif); font-size: 2.1rem; font-weight: 700; line-height: 1; }
.stat-card .lab { font-weight: 700; margin-top: 12px; font-size: .95rem; }
.stat-card .sub { color: var(--a-gray); font-size: .82rem; margin-top: 2px; }
.chip { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.chip svg { width: 19px; height: 19px; }
.chip.red { background: #FCE9E9; color: #E11D2A; }
.chip.green { background: #E7F6EC; color: #2E9E5B; }
.chip.orange { background: #FBEEE0; color: #E08A2B; }
.chip.blue { background: #E7EEFB; color: #3A6FD0; }
.chip.yellow { background: #FBF3D9; color: #CD9A1F; }
.chip.teal { background: #E1F2F1; color: #2B8C86; }
.chip.purple { background: #EFEAFB; color: #7C5CD0; }
.chip.pink { background: #FBE6EE; color: #D24C7E; }
.chip.gray { background: #F0F0EE; color: #80786F; }

/* ---- Antrag row ---- */
.block-head { display: flex; align-items: center; gap: 9px; font-family: var(--a-serif); font-weight: 700; font-size: 1.12rem; margin: 26px 0 12px; }
.block-head svg { width: 19px; height: 19px; color: var(--a-red); }
.antrag { background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--a-shadow); margin-bottom: 10px; }
.antrag .name { font-weight: 700; }
.antrag .time { color: var(--a-gray); font-size: .85rem; }

/* ---- Schnellstart ---- */
.panel { background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 24px; box-shadow: var(--a-shadow); margin-top: 26px; }
.qs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.qs { border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 20px; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; cursor: pointer; background: #fff; }
.qs:hover { border-color: var(--a-red); box-shadow: var(--a-shadow); transform: translateY(-2px); }
.qs svg { width: 22px; height: 22px; color: var(--a-red); }
.qs h4 { font-family: var(--a-serif); font-size: 1.02rem; margin: 12px 0 3px; }
.qs p { margin: 0; color: var(--a-gray); font-size: .86rem; }

/* ---- List items ---- */
.list { display: flex; flex-direction: column; gap: 14px; }
.row-card { background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 20px 22px; box-shadow: var(--a-shadow); display: flex; gap: 18px; align-items: flex-start; }
.row-card .rc-main { flex: 1; min-width: 0; }
.row-card .rc-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-card h3 { font-family: var(--a-serif); font-size: 1.18rem; }
.row-card.past h3, .row-card.past .meta { color: var(--a-gray); }
.badge { font-size: .72rem; font-weight: 800; letter-spacing: .03em; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.badge svg { width: 12px; height: 12px; }
.badge.intern { background: #FCE9E9; color: var(--a-red); }
.badge.past { background: #F0EFEC; color: var(--a-gray); }
.badge.green { background: #E7F6EC; color: #2E9E5B; }
.hint { color: var(--a-red); font-style: italic; font-size: .9rem; margin: 8px 0 4px; }
.row-card .meta { color: var(--a-ink-2); font-size: .9rem; margin-top: 4px; line-height: 1.7; }
.rc-actions { display: flex; gap: 8px; flex: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 9px; border: 1.5px solid #F2D9DB; background: #fff; color: var(--a-red); display: grid; place-items: center; transition: background .14s ease, color .14s ease; }
.icon-btn:hover { background: var(--a-red); color: #fff; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.ghost { border-color: var(--a-line); color: var(--a-gray); }
.icon-btn.ghost:hover { background: var(--a-ink); color: #fff; }
.thumb-sm { width: 88px; height: 60px; border-radius: 8px; object-fit: cover; background: linear-gradient(135deg,#E11D2A,#8E1626); flex: none; display: grid; place-items: center; color: rgba(255,255,255,.7); }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }

/* ---- Table ---- */
.note-banner { background: #F4F1EC; border: 1px solid var(--a-line); border-radius: 10px; padding: 13px 16px; font-size: .88rem; color: var(--a-ink-2); margin-bottom: 18px; }
.note-banner b { color: var(--a-ink); }
.table-wrap { background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-radius); box-shadow: var(--a-shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--a-gray); padding: 14px 18px; border-bottom: 1px solid var(--a-line); }
tbody td { padding: 16px 18px; border-bottom: 1px solid var(--a-line); font-size: .92rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FBFAF8; }
td .t-title { display: flex; align-items: center; gap: 12px; font-weight: 600; }
td .t-ic { width: 34px; height: 34px; border-radius: 8px; background: #F0EFEC; color: var(--a-gray); display: grid; place-items: center; flex: none; }
.t-actions { display: flex; gap: 10px; align-items: center; }
.t-actions button, .t-actions a { background: none; border: 0; color: var(--a-gray); padding: 4px; border-radius: 6px; display: inline-grid; place-items: center; }
.t-actions button:hover, .t-actions a:hover { color: var(--a-red); }
.t-actions svg { width: 17px; height: 17px; }

/* ---- Empty state ---- */
.empty { background: var(--a-card); border: 1px dashed var(--a-line); border-radius: var(--a-radius); padding: 60px 24px; text-align: center; color: var(--a-gray); }
.empty svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .5; }
.empty h3 { font-family: var(--a-serif); color: var(--a-ink-2); margin-bottom: 6px; }

/* ---- Forms ---- */
.form-card { background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 28px; box-shadow: var(--a-shadow); max-width: 820px; }
.form-card + .form-card { margin-top: 20px; }
.form-card h3 { font-family: var(--a-serif); font-size: 1.2rem; margin-bottom: 6px; }
.form-card .fc-sub { color: var(--a-gray); font-size: .88rem; margin-bottom: 18px; }
.form-card label { display: block; font-weight: 700; font-size: .88rem; margin: 16px 0 6px; }
.form-card input[type=text], .form-card input[type=email], .form-card input[type=password],
.form-card input[type=number], .form-card input[type=date], .form-card input[type=url],
.form-card select, .form-card textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--a-line); border-radius: 9px;
  font-family: inherit; font-size: .95rem; background: #fff;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--a-red); }
.form-card textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-line { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--a-red); }
.check-line label { margin: 0; }
.form-actions { margin-top: 24px; display: flex; gap: 12px; align-items: center; }
.img-preview { margin-top: 8px; }
.img-preview img { max-height: 120px; border-radius: 8px; border: 1px solid var(--a-line); }

/* ---- Formatierungs-Legende ---- */
.rt-legend { margin-top: 12px; border: 1px solid var(--a-line); background: #FBFAF8; border-radius: 10px; padding: 16px 18px; }
.rt-legend-head { font-weight: 800; margin-bottom: 6px; color: var(--a-ink); }
.rt-legend p { margin: 0 0 10px; color: var(--a-ink-2); font-size: .9rem; }
.rt-legend-tbl { width: auto; border-collapse: collapse; margin-bottom: 8px; }
.rt-legend-tbl td { border: 0; padding: 4px 18px 4px 0; font-size: .9rem; vertical-align: top; }
.rt-legend-tbl code { background: #fff; border: 1px solid var(--a-line); border-radius: 5px; padding: 2px 7px; font-size: .86rem; color: var(--a-red-dark); white-space: nowrap; }
.rt-legend-sub { font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--a-gray); margin: 10px 0 4px; }
.rt-legend-ex pre { margin: 0; background: #fff; border: 1px solid var(--a-line); border-radius: 8px; padding: 12px 14px; font-size: .84rem; line-height: 1.5; white-space: pre-wrap; color: var(--a-ink-2); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---- Flash ---- */
.flash { border-radius: 10px; padding: 13px 18px; margin-bottom: 20px; font-weight: 600; font-size: .92rem; }
.flash.ok { background: #E7F6EC; color: #1F7A45; border: 1px solid #BEE6CC; }
.flash.err { background: #FCE9E9; color: var(--a-red-dark); border: 1px solid #F2C6C9; }

/* ---- Gallery admin ---- */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 14px; margin-top: 18px; }
.gal-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--a-line); background:#fff; }
.gal-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gal-item .cap { padding: 8px 10px; font-size: .82rem; color: var(--a-ink-2); }
.gal-item .del { position: absolute; top: 8px; right: 8px; background: rgba(26,23,20,.72); color:#fff; border:0; width:30px;height:30px;border-radius:8px; display:grid;place-items:center; }
.gal-item .del:hover { background: var(--a-red); }
.gal-item .del svg { width:15px;height:15px; }

/* ---- Login / Setup ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg,#4A0C16,#1A1714); }
.auth-card { background: #fff; border-radius: 16px; padding: 38px 34px; width: 100%; max-width: 400px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); }
.auth-card .logo { width: 56px; height: 56px; border-radius: 50%; background: var(--a-red); color:#fff; display:grid; place-items:center; font-family:var(--a-serif); font-weight:700; font-size:1.2rem; margin: 0 auto 16px; }
.auth-card h1 { font-family: var(--a-serif); text-align: center; font-size: 1.5rem; }
.auth-card p.sub { text-align: center; color: var(--a-gray); margin: 6px 0 22px; font-size: .9rem; }
.auth-card label { display:block; font-weight:700; font-size:.85rem; margin: 14px 0 6px; }
.auth-card input { width:100%; padding: 12px 14px; border:1.5px solid var(--a-line); border-radius:9px; font-family:inherit; font-size:.95rem; }
.auth-card input:focus { outline:none; border-color: var(--a-red); }
.auth-card button { width:100%; margin-top: 22px; background: var(--a-red); color:#fff; border:0; border-radius:10px; padding:13px; font-weight:700; font-size:1rem; }
.auth-card button:hover { background: var(--a-red-dark); }
.auth-card .backlink { display:block; text-align:center; margin-top:16px; color: var(--a-gray); font-size:.86rem; }

/* ---- mobile ---- */
.side-toggle { display: none; }
@media (max-width: 880px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 100; width: 232px; transform: translateX(-100%); transition: transform .3s ease; }
  .side.open { transform: none; }
  .side-toggle { display: inline-grid; place-items: center; position: fixed; top: 14px; left: 14px; z-index: 90; width: 44px; height: 44px; border-radius: 10px; background: var(--a-red); color: #fff; border: 0; box-shadow: var(--a-shadow); }
  .main { padding: 70px 18px 50px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .qs-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } }
