/* Minimal monochrome UI — only flash/status messages use accent colors */

:root {
  --white: #ffffff;
  --black: #0a0a0a;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;

  --bg: var(--gray-50);
  --surface: var(--white);
  --surface-2: var(--gray-100);
  --border: var(--gray-200);
  --text: var(--black);
  --muted: var(--gray-500);
  --primary: var(--black);
  --primary-hover: var(--gray-800);

  /* Nur für Status- / Fehlermeldungen */
  --success: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #86efac;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --error-border: #fca5a5;

  --radius: 6px;
  --shadow: none;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--black); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--gray-600); }

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--black);
  padding: 0 0.75rem;
}

.sidebar nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--gray-600);
  margin-bottom: 0.15rem;
  text-decoration: none;
  font-size: 0.925rem;
}

.sidebar nav a:hover {
  background: var(--gray-100);
  color: var(--black);
  text-decoration: none;
}

.sidebar nav a.active {
  background: var(--black);
  color: var(--white);
  text-decoration: none;
}

.sidebar .section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin: 1.5rem 0 0.4rem 0.75rem;
  font-weight: 600;
}

.sidebar .user-box {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.main {
  padding: 2rem 2.25rem 3rem;
  max-width: 1100px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover {
  background: var(--gray-100);
  text-decoration: none;
  color: var(--black);
}

.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn-primary:hover {
  background: var(--gray-800);
  border-color: var(--gray-800);
  color: var(--white);
}

/* Destruktive Aktion: monochrom, klar durch Invertierung */
.btn-danger {
  background: var(--white);
  color: var(--black);
  border-color: var(--gray-400);
}

.btn-danger:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--gray-700);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--black);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.825rem;
}

label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  color: var(--gray-600);
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  margin-bottom: 1rem;
  font: inherit;
  outline: none;
  transition: border-color 0.12s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gray-500);
}

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.checkbox-row input { width: auto; margin: 0; }
.checkbox-row label { margin: 0; color: var(--text); font-size: 0.9rem; font-weight: 400; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 0.925rem;
}
th {
  color: var(--gray-500);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  letter-spacing: 0.02em;
}

/* Model-/Status-Badges monochrom (kein Farbcode) */
.badge-singleton,
.badge-collection {
  color: var(--gray-700);
  border-color: var(--gray-300);
  background: var(--gray-100);
}

.badge-published {
  color: var(--gray-800);
  border-color: var(--gray-400);
  background: var(--white);
}

.badge-draft {
  color: var(--gray-500);
  border-color: var(--gray-200);
  background: var(--gray-50);
}

/* ---------- Nur hier zusätzliche Farben: Status- & Fehlermeldungen ---------- */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid;
  font-size: 0.925rem;
}

.flash-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.flash-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}
/* --------------------------------------------------------------------------- */

.field-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr 0.7fr 1.2fr auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.field-row label { margin-bottom: 0.2rem; }
.field-row input,
.field-row select { margin-bottom: 0; }

.help {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

code {
  font-size: 0.85em;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  color: var(--gray-800);
}

.guest-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--gray-50);
}

.guest-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.guest-card h1 {
  margin-top: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

.preview-img {
  max-width: 160px;
  max-height: 100px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 0.5rem;
  object-fit: cover;
}

.stat {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.03em;
  color: var(--black);
}

.stat-label {
  color: var(--muted);
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
}

ul {
  color: var(--gray-700);
  padding-left: 1.25rem;
}

ul strong { color: var(--black); }

/* ---------- Language tabs ---------- */
.lang-tabs {
  margin-top: 0.5rem;
}

.lang-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  padding-bottom: 0;
}

.lang-tab {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--gray-600);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: -1px;
}

.lang-tab:hover {
  color: var(--black);
  background: var(--gray-50);
}

.lang-tab.is-active {
  color: var(--black);
  background: var(--white);
  border-color: var(--border);
  border-bottom-color: var(--white);
}

.lang-tab .lang-code {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-400);
  letter-spacing: 0.04em;
}

.lang-tab.is-active .lang-code {
  color: var(--gray-600);
}

.lang-panel {
  padding-top: 0.25rem;
}

.lang-panel[hidden] {
  display: none !important;
}

.field-row-ml {
  grid-template-columns: 1fr 1fr 0.9fr 0.55fr 0.7fr 1.1fr auto;
}

.badge-i18n {
  color: var(--gray-700);
  border-color: var(--gray-400);
  background: var(--white);
}

/* ---------- Simple rich-text editor ---------- */
.rte {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 1rem;
  overflow: hidden;
}

.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--gray-50);
}

.rte-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--black);
  border-radius: 4px;
  padding: 0.28rem 0.45rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  min-width: 1.8rem;
}

.rte-btn:hover {
  background: var(--gray-100);
}

.rte-btn:active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.rte-select {
  appearance: auto;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--black);
  border-radius: 4px;
  padding: 0.28rem 0.4rem;
  font-size: 0.8rem;
  font-family: inherit;
  margin: 0;
  width: auto;
  min-width: 6rem;
}

.rte-sep {
  width: 1px;
  height: 1.25rem;
  background: var(--gray-300);
  margin: 0 0.2rem;
}

.rte-surface {
  min-height: 200px;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  outline: none;
  color: var(--black);
  line-height: 1.55;
  font-size: 0.95rem;
}

.rte-surface:focus {
  box-shadow: inset 0 0 0 1px var(--gray-400);
}

.rte-surface h1 { font-size: 1.75rem; margin: 0.6em 0 0.35em; font-weight: 600; }
.rte-surface h2 { font-size: 1.45rem; margin: 0.6em 0 0.35em; font-weight: 600; }
.rte-surface h3 { font-size: 1.25rem; margin: 0.55em 0 0.3em; font-weight: 600; }
.rte-surface h4 { font-size: 1.1rem; margin: 0.5em 0 0.3em; font-weight: 600; }
.rte-surface h5 { font-size: 1rem; margin: 0.5em 0 0.25em; font-weight: 600; }
.rte-surface h6 { font-size: 0.9rem; margin: 0.5em 0 0.25em; font-weight: 600; }
.rte-surface p { margin: 0.4em 0; }
.rte-surface ul,
.rte-surface ol { margin: 0.4em 0; padding-left: 1.4rem; }
.rte-surface li { margin: 0.15em 0; }
.rte-surface strong { font-weight: 700; }
.rte-surface u { text-decoration: underline; }

textarea.rte-source {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .field-row { grid-template-columns: 1fr 1fr; }
  .main { padding: 1.25rem; }
}
