/* Sternstunde – Embedded-Admin (Mitternachtsblau, Altgold, Inter/Cormorant) */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/static/fonts/CormorantGaramond-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --midnight: #0B1026;
  --panel: #141B33;
  --line: #26304F;
  --gold: #C9A24B;
  --gold-bright: #E3C878;
  --text: #F4EFE3;
  --text-dim: #A7AFC6;
  --error: #E8A199;
  --ok: #9CC79C;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--midnight);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ------------------------------------------------------------- Kopfzeile */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0D1330 0%, var(--midnight) 100%);
}

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

.brand-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}

.brand-subline {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.tabs { display: flex; gap: 6px; }

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.tab:hover { color: var(--text); }

.tab.is-active {
  color: var(--gold-bright);
  border-color: var(--line);
  background: var(--panel);
}

/* --------------------------------------------------------------- Inhalte */

.content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
}

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

.panel h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
}

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

.panel-hint {
  color: var(--text-dim);
  margin: 4px 0 16px;
  max-width: 70ch;
}

.filter-label { color: var(--text-dim); }

select {
  background: var(--midnight);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
}

/* ---------------------------------------------------------------- Knöpfe */

.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--midnight);
}

.btn:hover { background: var(--gold-bright); border-color: var(--gold-bright); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
}

.btn-ghost:hover { background: rgba(201, 162, 75, 0.12); color: var(--gold-bright); }

.btn-small { padding: 5px 10px; font-size: 13px; }

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

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
}

table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 10px;
  border-bottom: 1px solid rgba(38, 48, 79, 0.6);
  vertical-align: top;
}

table.data tr:last-child td { border-bottom: none; }

.col-actions { text-align: right; }

td.col-actions { text-align: right; white-space: nowrap; }

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

.cell-error {
  color: var(--error);
  font-size: 12px;
  max-width: 34ch;
  overflow-wrap: break-word;
}

.empty {
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0 8px;
}

/* ------------------------------------------------------------ Statuspunkte */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.badge-awaiting::before { background: var(--gold-bright); }
.badge-generating::before { background: #8AB4D8; }
.badge-delivered::before { background: var(--ok); }
.badge-error::before { background: var(--error); }

/* ---------------------------------------------------------------- Banner */

.banner {
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
}

.banner-error { color: var(--error); border-color: rgba(232, 161, 153, 0.5); background: rgba(232, 161, 153, 0.08); }
.banner-ok { color: var(--ok); border-color: rgba(156, 199, 156, 0.4); background: rgba(156, 199, 156, 0.08); }

/* ------------------------------------------- Assistent „Produkt erstellen“ */

.create-form {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px 20px;
  margin: 0 0 20px;
  background: rgba(11, 16, 38, 0.45);
}

.create-form h2 {
  margin: 0 0 4px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
}

.create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  margin-bottom: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.field-wide { grid-column: 1 / -1; }

.create-form input[type="text"],
.create-form textarea {
  background: var(--midnight);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.create-form input[type="text"]:focus-visible,
.create-form textarea:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
}

.motif-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px 16px;
  margin: 0 0 18px;
}

.motif-fieldset legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.motif-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.motif-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.motif-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 108px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: var(--midnight);
}

.motif-card img,
.motif-none {
  width: 88px;
  height: 88px;
  border-radius: 6px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 28px;
  background: var(--panel);
}

.motif-label { font-size: 12px; color: var(--text-dim); text-align: center; }

.motif-option input:checked + .motif-card {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.motif-option input:checked + .motif-card .motif-label { color: var(--gold-bright); }

.motif-option input:focus-visible + .motif-card {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.motif-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.motif-preview {
  display: block;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 12px;
}

.create-actions { display: flex; gap: 10px; }

.product-link { display: inline-block; margin-top: 2px; color: var(--gold); }

.product-link:hover { color: var(--gold-bright); }

.banner a { color: inherit; font-weight: 600; }

/* ---------------------------------------------------------- Einstellungen */

.settings {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 10px 18px;
  margin: 0;
}

.settings dt { color: var(--text-dim); }

.settings dd { margin: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Schalter */

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: var(--line);
  transition: background 0.15s ease;
  cursor: pointer;
}

.switch .slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch input:checked + .slider { background: rgba(201, 162, 75, 0.4); }

.switch input:checked + .slider::before {
  transform: translateX(18px);
  background: var(--gold-bright);
}

.switch input:focus-visible + .slider { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.switch input:disabled + .slider { opacity: 0.4; cursor: not-allowed; }
