/* Sexy-Dates – Verwaltung & Installer. Hell, freundlich, mobil zuerst. */

@font-face { font-family: "DM Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/dm-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/dm-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: italic; font-display: swap; src: url("fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2"); }

:root {
  --bg: #FBF8F5;
  --surface: #FFFFFF;
  --text: #2B2A2E;
  --muted: #6B6670;
  --line: #EFE7E2;
  --line-strong: #E2D6CF;
  --primary: #A84C60;
  --primary-dark: #8C3C4F;
  --blush: #F4E4E1;
  --gold-bg: #F7EEDC;  --gold-text: #6E5020;
  --ok-bg: #E6F0E9;    --ok-text: #2F5A3D;
  --warn-bg: #FBF0DA;  --warn-text: #6E4F12;
  --err-bg: #F9E3E3;   --err-text: #8E2A2A;
  --info-bg: #E8EEF6;  --info-text: #2D4A6E;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(120, 60, 70, .07);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--sans); }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; }
code { background: var(--blush); padding: 1px 6px; border-radius: 6px; }
pre { background: #F6F1EE; border: 1px solid var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; }
h1, h2, h3 { line-height: 1.2; }
h2 { font: 600 26px/1.2 var(--serif); margin: 28px 0 12px; }
h3 { font-size: 17px; margin: 18px 0 8px; }
small, .muted { color: var(--muted); }
:focus-visible { outline: 3px solid rgba(168, 76, 96, .35); outline-offset: 2px; }

/* ---------- Marke ---------- */
.brand { font: 700 24px/1 var(--serif); color: var(--text); text-decoration: none; display: inline-flex; align-items: baseline; gap: 1px; }
.brand em { font-style: italic; font-weight: 600; color: var(--primary); }
.brand-sub { font: 500 12px/1 var(--sans); color: var(--muted); margin-left: 10px; letter-spacing: .06em; text-transform: uppercase; }
.brand.big { font-size: 34px; margin-bottom: 8px; }

/* ---------- Grundgerüst ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.shell { display: flex; min-height: calc(100vh - 60px); }
.sidenav { width: 260px; flex: none; background: var(--surface); border-right: 1px solid var(--line); padding: 12px 10px 24px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav-link svg { color: var(--muted); flex: none; }
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--blush); color: var(--primary-dark); }
.nav-link.active svg { color: var(--primary); }
.nav-link.as-button { width: 100%; border: none; background: none; font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.nav-foot { margin-top: auto; padding: 18px 12px 0; font-size: 13px; color: var(--muted); }
.content { flex: 1; min-width: 0; padding: 24px 32px 64px; max-width: 1200px; }
.page-title { font: 600 36px/1.15 var(--serif); margin: 4px 0 20px; }
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .sidenav { position: fixed; top: 60px; bottom: 0; left: 0; z-index: 40; transform: translateX(-105%); transition: transform .2s ease; overflow-y: auto; box-shadow: var(--shadow); }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 60px 0 0 0; z-index: 35; background: rgba(43, 42, 46, .25); }
  .content { padding: 18px 16px 56px; }
  .page-title { font-size: 30px; }
  .brand-sub { display: none; }
}

/* ---------- Karten, Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
.stat .label { font-size: 14px; color: var(--muted); }
.stat .value { font: 700 32px/1.1 var(--serif); }
.stat .sub { font-size: 13px; color: var(--muted); }
a.stat:hover { border-color: var(--line-strong); color: var(--text); }
.grid2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Meldungen & Plaketten ---------- */
.alert { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-weight: 500; }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); }
.alert.err { background: var(--err-bg); color: var(--err-text); }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); }
.alert.info { background: var(--info-bg); color: var(--info-text); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 10px; background: #F1ECE9; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.err { background: var(--err-bg); color: var(--err-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.gold { background: var(--gold-bg); color: var(--gold-text); }
.badge.info { background: var(--info-bg); color: var(--info-text); }
.tag { font: 600 12px var(--sans); background: var(--blush); color: var(--primary-dark); padding: 3px 8px; border-radius: 8px; vertical-align: middle; }

/* ---------- Formulare ---------- */
.form label, label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: #4E4952; margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  font: 400 16px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; min-height: 48px; padding: 10px 14px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid rgba(168, 76, 96, .15); }
input[type=file] { font: inherit; padding: 10px 0; }
.hint { font-size: 14px; font-weight: 400; color: var(--muted); margin: -4px 0 14px; }
label .hint { margin: 0; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 500; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--primary); background: var(--primary); color: #FFFFFF; font: 600 16px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #FFFFFF; }
.btn.secondary { background: var(--surface); color: var(--primary); }
.btn.secondary:hover { background: var(--blush); color: var(--primary-dark); }
.btn.danger { background: var(--surface); color: var(--err-text); border-color: #E2B4B4; }
.btn.danger:hover { background: var(--err-bg); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.inline-form { display: inline; }

/* ---------- Reiter ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: thin; }
.tab { flex: none; min-height: 42px; padding: 0 16px; border-radius: 21px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; text-decoration: none; font-weight: 500; font-size: 15px; }
.tab.active { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }

/* ---------- Tabellen (auf dem Handy als Karten) ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
@media (max-width: 700px) {
  table.list.stack thead { display: none; }
  table.list.stack, table.list.stack tbody, table.list.stack tr, table.list.stack td { display: block; width: 100%; }
  table.list.stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 4px; margin-bottom: 10px; background: var(--surface); }
  table.list.stack td { border: none; padding: 6px 10px; }
  table.list.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
}
.empty { color: var(--muted); padding: 20px 0; text-align: center; }

/* ---------- Checklisten ---------- */
.checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.checks li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.checks li span { width: 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.checks li.ok span { background: var(--ok-bg); color: var(--ok-text); }
.checks li.bad span { background: var(--err-bg); color: var(--err-text); }
.checks li.warn span { background: var(--warn-bg); color: var(--warn-text); }
.checks small { width: 100%; padding-left: 34px; margin-top: -4px; }
.steps li { margin-bottom: 12px; }

/* ---------- Anmeldung / Installer ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; background: var(--blush); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 22px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { font: 600 32px/1.15 var(--serif); margin: 6px 0 16px; }
.auth-card .lead { color: var(--muted); }
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-card .actions .btn { width: auto; }
.qr { display: flex; justify-content: center; padding: 16px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; margin: 0 0 14px; }
.qr svg { width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font: 600 16px ui-monospace, Menlo, Consolas, monospace; background: #F6F1EE; border-radius: 12px; padding: 14px; text-align: center; }
.secret { font: 600 15px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; word-break: break-all; background: #F6F1EE; padding: 10px 12px; border-radius: 10px; }

/* ---------- Fortschritt ---------- */
.progress { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.progress li { padding-left: 28px; position: relative; }
.progress li::before { content: "✓"; position: absolute; left: 0; color: var(--ok-text); font-weight: 700; }

/* ---------- Rechte-Matrix ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input { width: 22px; height: 22px; accent-color: var(--primary); }

/* ---------- Update 3: Prüfzentrale ---------- */
.nav-count { margin-left: auto; background: var(--gold-bg); color: var(--gold-text); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; }
.tab .n { background: rgba(255,255,255,.9); color: var(--primary); border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 700; margin-left: 8px; }
.tab:not(.active) .n { background: var(--gold-bg); color: var(--gold-text); }
.tab.disabled { color: var(--muted); border-style: dashed; }
.review { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.review-media { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.review-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.media-video { background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.media-video video { display: block; width: 100%; max-height: 520px; background: #000; }
.media-video .soll { padding: 12px 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.media-video .soll strong { color: var(--primary); letter-spacing: .04em; }
.id-pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.id-pics a { display: block; border-radius: 12px; overflow: hidden; background: #E9E3DE; border: 1px solid var(--line); }
.id-pics img { display: block; width: 100%; height: 180px; object-fit: contain; background: #E9E3DE; }
.id-pics span { display: block; padding: 6px 10px; font-size: 13px; color: var(--muted); background: #FFFFFF; }
.placeholder-media { padding: 40px 16px; text-align: center; color: var(--muted); background: #F1ECE9; border-radius: 12px; }
.reasons { display: flex; flex-direction: column; gap: 4px; }
.reasons label { flex-direction: row !important; align-items: center; gap: 10px; min-height: 40px; margin: 0 !important; font-weight: 500 !important; color: var(--text) !important; }
.reasons input { width: 20px; height: 20px; accent-color: var(--primary); }
.reasons .hard { color: var(--err-text) !important; }
.decision { display: flex; flex-direction: column; gap: 10px; }
.decision .btn { width: 100%; }
.btn.approve { background: #3F6B4E; border-color: #3F6B4E; }
.btn.approve:hover { background: #2F5A3D; border-color: #2F5A3D; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 700px) { .decision-sticky { position: sticky; bottom: 0; background: var(--surface); padding: 12px; margin: 0 -16px -56px; border-top: 1px solid var(--line); } }
/* Schalter/Häkchen in Formularen: Kästchen links neben dem Text */
.form label.switch { flex-direction: row; align-items: center; gap: 12px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.switch input { flex: none; }

/* ---------- Update 4: Inserate prüfen, Nutzer ---------- */
.review-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rp { position: relative; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: #F1ECE9; }
.rp.new { border-color: var(--gold-text); }
.rp img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.rp .tag-cover { position: absolute; top: 6px; left: 6px; background: #FFFFFF; color: var(--primary-dark); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.rp .dup { position: absolute; top: 34px; left: 6px; right: 6px; background: var(--err-bg); color: var(--err-text); font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 6px; }
.rp-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-choice label { margin: 0; cursor: pointer; }
.rp-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rp-choice span { display: flex; align-items: center; justify-content: center; min-height: 40px; font-size: 13px; font-weight: 600; background: #FFFFFF; color: var(--muted); border-top: 1px solid var(--line); }
.rp-choice .ok span { border-right: 1px solid var(--line); }
.rp-choice .ok input:checked + span { background: var(--ok-bg); color: var(--ok-text); }
.rp-choice .no input:checked + span { background: var(--err-bg); color: var(--err-text); }
.rp-choice input:focus-visible + span { outline: 3px solid rgba(168, 76, 96, .35); outline-offset: -3px; }
.kvrow { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 15px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label { flex: 1 1 160px; margin: 0 !important; }
.filters .btn { flex: none; }
textarea.page-body { min-height: 380px; font-family: var(--sans); line-height: 1.55; }
input[type=time], input[type=search], input[type=tel], input[type=url] { font: 400 16px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; min-height: 48px; padding: 8px 12px; }

/* Finanzen (Update 6) */
.price-admin { display: grid; grid-template-columns: 90px minmax(0, 160px) auto; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.form .price-admin label { margin: 0; flex-direction: row; align-items: center; gap: 8px; }
.form .price-admin label.switch { min-height: 40px; }
.ledger-mini { font-size: 14px; }
.ledger-mini .kvrow { border-bottom: 1px solid var(--line); padding: 6px 0; }

/* Einstellungen: Feld mit Erklärung */
.setting-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.setting-row > small.hint { margin: 0; font-size: 13px; }
.checks li strong { flex: 1 1 0; min-width: 0; }

/* ---------- Darkmode (nur Verwaltung, per Umschalter oben rechts) ---------- */
.topbar-right { display: inline-flex; gap: 8px; align-items: center; }
.theme-toggle .ti { display: none; }
html[data-theme-mode="light"] .ti-light, html[data-theme-mode="dark"] .ti-dark, html[data-theme-mode="auto"] .ti-auto { display: inline-flex; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17161A; --surface: #211F25; --text: #ECE8EC; --muted: #A9A3AD;
  --line: #34313A; --line-strong: #46424E;
  --primary: #D9788C; --primary-dark: #E899A9; --blush: #3A2A30;
  --gold-bg: #3A3220; --gold-text: #E9CF8E;
  --ok-bg: #1F3327; --ok-text: #9AD3AE;
  --warn-bg: #3B3119; --warn-text: #EBCB85;
  --err-bg: #3C2224; --err-text: #F0A3A3;
  --info-bg: #1F2D40; --info-text: #9FC1EA;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] pre, html[data-theme="dark"] .codes, html[data-theme="dark"] .secret { background: #1B1A1F; }
html[data-theme="dark"] .badge { background: #2C2A32; }
html[data-theme="dark"] .form label, html[data-theme="dark"] label.field { color: #CFC9D2; }
html[data-theme="dark"] .btn { color: #17161A; }
html[data-theme="dark"] .btn:hover { color: #17161A; }
html[data-theme="dark"] .btn.secondary { color: var(--primary); }
html[data-theme="dark"] .btn.secondary:hover { color: var(--primary-dark); }
html[data-theme="dark"] .btn.danger { color: var(--err-text); border-color: #6B3A3D; }
html[data-theme="dark"] .tab.active { color: #17161A; }
html[data-theme="dark"] .tab .n { background: rgba(0,0,0,.25); color: inherit; }
html[data-theme="dark"] .btn.approve { background: #4F8A63; border-color: #4F8A63; color: #fff; }
html[data-theme="dark"] .btn.approve:hover { background: #5E9C73; border-color: #5E9C73; }
html[data-theme="dark"] .id-pics a, html[data-theme="dark"] .id-pics img, html[data-theme="dark"] .placeholder-media, html[data-theme="dark"] .rp { background: #2A282F; }
html[data-theme="dark"] .id-pics span, html[data-theme="dark"] .media-video, html[data-theme="dark"] .rp-choice span, html[data-theme="dark"] .rp .tag-cover { background: var(--surface); }
html[data-theme="dark"] .qr { background: #FFFFFF; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #1B1A1F; color: var(--text); border-color: var(--line-strong); }
html[data-theme="dark"] ::placeholder { color: #7D7783; }
html[data-theme="dark"] body.nav-open .nav-backdrop { background: rgba(0, 0, 0, .55); }
html[data-theme="dark"] img { opacity: .92; }

/* hidden-Attribut gilt immer (auch bei Knöpfen mit eigener Anzeige) */
[hidden] { display: none !important; }
