/* Kovo – Stylesheet für Landingpage und Admin-Webseite. Keine externen Schriften, kein CDN. */

:root {
  --page: #0F1013;
  --surface: #17181C;
  --surface-2: #1E2025;
  --surface-3: #262830;
  --border: #2C2E36;
  --text: #F3F3F5;
  --muted: #A3A6AF;
  --faint: #7B7F8A;
  --accent: #FE6901;
  --accent-hover: #FF7F26;
  --accent-ink: #0F1013;
  --accent-soft: rgba(254, 105, 1, 0.14);
  --danger: #F2555A;
  --danger-bg: #C42F35;
  --danger-soft: rgba(242, 85, 90, 0.14);
  --ok: #3DD68C;
  --ok-soft: rgba(61, 214, 140, 0.14);
  --warn: #F5B941;
  --warn-soft: rgba(245, 185, 65, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
p { margin: 0 0 12px; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }

/* ---------- Buttons & Formulare ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-bg); color: #fff; }
.btn-danger:hover { background: #d4383e; }
.btn-small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--muted); font-weight: 600; cursor: pointer; font: inherit; }
.btn-link:hover { color: var(--text); }

label { display: block; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 13px; }

input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--page);
  color: var(--text);
  font: inherit;
}
input::placeholder { color: var(--faint); }

.inline-form { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search], .toolbar input[type=text] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; flex: 0 1 200px; }

/* ---------- Admin-Gerüst ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: rgba(15, 16, 19, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; color: var(--accent); font-weight: 650; }
.mark { width: 32px; height: 32px; flex: none; }
.mark-tile { width: 34px; height: 34px; border-radius: 9px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.mark-tile .mark { width: 24px; height: 24px; color: var(--accent); }

.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.topbar .logout { margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.site-footer { max-width: 1200px; margin: 0 auto; padding: 8px 24px 32px; color: var(--faint); font-size: 13px; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; }
.flash-ok { background: var(--ok-soft); border-color: rgba(61, 214, 140, 0.4); color: #bff3d9; }
.flash-error { background: var(--danger-soft); border-color: rgba(242, 85, 90, 0.45); color: #ffd0d2; }

/* ---------- Karten ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.card .value { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; margin-top: 4px; }
.card .value.small { font-size: 18px; }
.card .note { color: var(--faint); font-size: 13px; margin-top: 2px; }
a.card { display: block; color: var(--text); }
a.card:hover { text-decoration: none; border-color: rgba(254, 105, 1, 0.55); }
a.card .note { color: var(--accent); }
.card.accent { border-color: rgba(254, 105, 1, 0.45); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.card.alert .value { color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel > h2 { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 20px; }

dl.facts { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 13px; }
.empty { padding: 24px; color: var(--muted); text-align: center; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.nav .badge { padding: 0 7px; background: var(--accent); color: var(--accent-ink); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-weight: 600; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

pre.payload {
  margin: 0;
  max-height: 70vh;
  overflow: auto;
  padding: 16px;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #E4E5E9;
  white-space: pre;
  tab-size: 2;
}
pre.log { white-space: pre-wrap; overflow-wrap: anywhere; max-height: none; }

.danger-zone { border-color: rgba(242, 85, 90, 0.45); }
.danger-zone h2 { color: var(--danger); }

/* ---------- Anmeldung ---------- */

.login-wrap { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; }
.login { width: 100%; max-width: 400px; }
.login .panel { padding: 28px; }
.login h1 { font-size: 22px; }

/* ---------- Landingpage ---------- */

body.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(254, 105, 1, 0.16), transparent 60%),
    var(--page);
}
.hero { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; max-width: 760px; margin: 0 auto; }
.hero-icon { width: 128px; height: 128px; border-radius: 30px; box-shadow: 0 20px 60px rgba(254, 105, 1, 0.18), 0 2px 0 rgba(255, 255, 255, 0.04) inset; margin-bottom: 28px; }
.hero h1 { font-size: clamp(44px, 9vw, 72px); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 8px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; margin-bottom: 12px; }
.hero .lead { color: var(--muted); font-size: clamp(17px, 2.6vw, 20px); max-width: 560px; margin: 0 auto 28px; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(254, 105, 1, 0.5);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}
.store-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(254, 105, 1, 0.25); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; width: 100%; margin-top: 44px; text-align: left; }
.feature { background: rgba(23, 24, 28, 0.8); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.feature strong { display: block; margin-bottom: 4px; }
.feature span { color: var(--muted); font-size: 14px; }
.landing-footer { text-align: center; color: var(--faint); font-size: 13px; padding: 24px; }
.hero-error h1 { font-size: 36px; }

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px 12px; }
  .topbar .nav { order: 3; flex-basis: 100%; margin: 0 -8px; padding: 0 8px; }
  .topbar .logout { margin-left: auto; }
  .container { padding: 16px; }
  h1 { font-size: 22px; }
  .card .value { font-size: 24px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: 9px 10px; }
  .hide-sm { display: none; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
  .panel { padding: 16px; }
}
