/* =============================================================
 * Eva Schönborn — Admin-Stylesheet (UX-Pass 2026-06)
 * Markenkonsistent: Sand/Espresso/Grün, Bricolage-Headlines,
 * warme Anmutung, mobil nutzbar.
 * ============================================================= */

:root {
  --c-ink: #211C17;
  --c-ink-soft: #463E36;
  --c-ink-muted: #7A7066;
  --c-bg: #FFFFFF;
  --c-page: #ECE5DA;
  --c-sand: #F5EFE6;
  --c-line: #E3DBCE;
  --c-bronze: #2F5D49;        /* Akzent = Markengrün */
  --c-bronze-dark: #244A3A;
  --c-success: #2f6f44;
  --c-success-bg: #e8f3ed;
  --c-error: #8a2b2b;
  --c-error-bg: #f9e8e8;
  --ff-disp: 'Bricolage Grotesque', system-ui, sans-serif;
  --ff-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(33,28,23,.04), 0 18px 42px -26px rgba(33,28,23,.20);
}

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

body.admin {
  margin: 0;
  font-family: var(--ff-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-ink);
  background: var(--c-page);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--c-bronze); }

h1, h2, h3, h4 { font-family: var(--ff-disp); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 0.6em; }
h1 { font-size: 1.55rem; font-weight: 400; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

p { margin: 0 0 1em; }
.muted { color: var(--c-ink-muted); }
.text-right { text-align: right; }

/* ---------- Nav ---------- */
.admin__nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--c-page) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line);
}
.admin__nav-inner {
  display: flex; flex-direction: column; gap: .55rem;
  padding: .7rem 1.5rem; max-width: 1140px; margin: 0 auto;
}
.admin__nav-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin__brand { font-family: var(--ff-disp); font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--c-ink); white-space: nowrap; }
.admin__brand-sub { color: var(--c-ink-muted); font-weight: 500; }
.admin__brand-sub::before { content: "· "; }
.admin__tabs { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.admin__tabs a {
  font-family: var(--ff-disp); text-decoration: none; color: var(--c-ink-muted);
  padding-bottom: 4px; border-bottom: 2px solid transparent; font-weight: 500; font-size: .95rem;
}
.admin__tabs a:hover { color: var(--c-ink); }
.admin__tabs a.is-active { color: var(--c-ink); border-bottom-color: var(--c-bronze); }
.admin__user { display: flex; align-items: center; gap: .7rem; font-size: .88rem; color: var(--c-ink-muted); }
.admin__logout { color: var(--c-bronze-dark); text-decoration: none; }
.admin__viewsite {
  font-family: var(--ff-disp); font-size: .82rem; font-weight: 500; text-decoration: none; color: var(--c-bronze-dark);
  border: 1px solid var(--c-line); border-radius: 999px; padding: .32rem .85rem;
  transition: background .2s, color .2s, border-color .2s;
}
.admin__viewsite:hover { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.admin__email { color: var(--c-ink-muted); font-size: .85rem; }

/* Status-Badge (live / im Aufbau) */
.status-badge {
  display: inline-flex; align-items: center; gap: .45rem; font-family: var(--ff-disp);
  font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--c-line); text-decoration: none;
}
.status-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-badge--live { color: #2f6f44; } .status-badge--live::before { background: #36a35e; }
.status-badge--building { color: #9a6512; } .status-badge--building::before { background: #e0992b; }

/* ---------- Layout ---------- */
.admin__main { max-width: 980px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.card {
  background: var(--c-bg); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 1.6rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* Karten-Kopf mit Vorschau-Link */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.card-head h2 { margin: 0; }
.card-sub { margin: .2rem 0 0; font-size: .85rem; color: var(--c-ink-muted); }
.card-preview {
  flex: 0 0 auto; font-family: var(--ff-disp); font-size: .8rem; font-weight: 500; text-decoration: none; color: var(--c-bronze-dark);
  border: 1px solid var(--c-line); border-radius: 999px; padding: .35rem .85rem; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.card-preview:hover { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-size: .85rem; font-weight: 500; color: var(--c-ink-soft); }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="tel"], .field input[type="url"], .field input[type="number"],
.field textarea, .field select {
  width: 100%; font: inherit; padding: .6rem .8rem; border: 1px solid var(--c-line);
  border-radius: 7px; background: var(--c-bg); color: var(--c-ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0; border-color: var(--c-bronze); box-shadow: 0 0 0 3px rgba(47,93,73,.16);
}
.field--check { display: flex; gap: .5rem; align-items: center; }
.field--check input { width: auto; }
.field__hint { font-size: .8rem; color: var(--c-ink-muted); }

.form-row { display: grid; gap: 1rem; }
@media (min-width: 640px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.2rem; font: inherit;
  font-family: var(--ff-disp); font-size: .9rem; font-weight: 500; border: 1px solid transparent;
  border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn--primary { background: var(--c-ink); color: #fff; }
.btn--primary:hover { background: var(--c-bronze); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line); }
.btn--ghost:hover { border-color: var(--c-ink); }
.btn--danger { background: #fff; color: var(--c-error); border-color: var(--c-error); }
.btn--danger:hover { background: var(--c-error); color: #fff; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Notices ---------- */
.notice { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; border-left: 3px solid var(--c-line); font-size: .95rem; }
.notice--success { background: var(--c-success-bg); border-left-color: var(--c-success); color: var(--c-success); }
.notice--error   { background: var(--c-error-bg);   border-left-color: var(--c-error);   color: var(--c-error); }
.notice--info    { background: var(--c-sand);       border-left-color: var(--c-bronze); }

/* ---------- Login ---------- */
.login { max-width: 400px; margin: 4rem auto; background: var(--c-bg); padding: 2.4rem; border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login h1 { margin-top: 0; }
.login button { width: 100%; margin-top: .5rem; justify-content: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--c-line); font-size: .92rem; vertical-align: middle; }
.table th { background: var(--c-sand); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: .5rem; }
.table img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; display: block; }

/* ---------- Quill-Editor ---------- */
.editor-block { margin-bottom: 1.5rem; }
.editor-block label { display: block; font-size: .85rem; font-weight: 500; color: var(--c-ink-soft); margin-bottom: .4rem; }
.editor-block .ql-toolbar { border-color: var(--c-line); border-radius: 7px 7px 0 0; background: var(--c-sand); }
.editor-block .ql-container { border-color: var(--c-line); border-radius: 0 0 7px 7px; background: #fff; font-family: inherit; font-size: 1rem; }
.editor-block .ql-editor { min-height: 80px; }
.editor-block--small .ql-editor { min-height: 48px; }
.editor-block--medium .ql-editor { min-height: 120px; }
.editor-block--large  .ql-editor { min-height: 200px; }

/* ---------- Misc ---------- */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.empty { padding: 2rem; text-align: center; color: var(--c-ink-muted); background: var(--c-bg); border: 1px dashed var(--c-line); border-radius: var(--radius); }
.list-of-strings { display: grid; gap: .7rem; }
.list-of-strings__row { display: grid; grid-template-columns: 1fr auto; gap: .6rem 1rem; align-items: start; padding: 1rem 1.1rem; background: var(--c-page); border: 1px solid var(--c-line); border-radius: 9px; transition: border-color .15s, box-shadow .15s; }
.list-of-strings__row:focus-within { border-color: var(--c-bronze); box-shadow: 0 0 0 3px rgba(47,93,73,.10); }

/* Felder in den Listen genauso großzügig wie überall — volle Breite, nicht abgeschnitten */
.list-of-strings__row input[type="text"],
.list-of-strings__row textarea {
  display: block; width: 100%; box-sizing: border-box; font: inherit;
  padding: .6rem .8rem; border: 1px solid var(--c-line); border-radius: 7px;
  background: var(--c-bg); color: var(--c-ink);
}
.list-of-strings__row input[type="text"]:focus,
.list-of-strings__row textarea:focus {
  outline: 0; border-color: var(--c-bronze); box-shadow: 0 0 0 3px rgba(47,93,73,.16);
}
.list-of-strings__row textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
/* „Entfernen" dezent und ruhig statt schwerer Pille */
.list-of-strings__row [data-remove] { white-space: nowrap; align-self: start; }

/* ---------- Save-Bar (sticky bottom) ---------- */
.save-bar {
  position: sticky; bottom: 0; background: color-mix(in srgb, var(--c-bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--c-line);
  padding: .85rem 1.25rem; margin: 1.5rem -1.25rem -2.5rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; z-index: 5;
}
.save-bar__hint { font-size: .82rem; color: var(--c-ink-muted); align-self: center; }

/* ---------- Portrait-Sektion ---------- */
.portrait-row { display: grid; gap: 1.25rem; grid-template-columns: 200px 1fr; align-items: start; }
@media (max-width: 640px) { .portrait-row { grid-template-columns: 1fr; } }
.portrait-preview img { width: 200px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--c-line); display: block; }
.portrait-placeholder { width: 200px; aspect-ratio: 4 / 5; background: linear-gradient(135deg, var(--c-sand) 0%, #E9E1D2 100%); border: 1px dashed var(--c-line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-family: var(--ff-disp); font-size: 3.5rem; color: var(--c-bronze); }
.portrait-controls input[type=file] { padding: .5rem; background: var(--c-page); border: 1px solid var(--c-line); border-radius: 7px; width: 100%; cursor: pointer; }

/* ---------- Start-Dashboard ---------- */
.dash-hero { margin-bottom: 1.75rem; }
.dash-hero h1 { font-size: 2rem; margin-bottom: .25rem; }
.dash-hero p { color: var(--c-ink-muted); margin: 0; }
.dash-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.dash-card { display: block; text-decoration: none; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); color: var(--c-ink); transition: transform .2s, box-shadow .2s; }
.dash-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px -16px rgba(33,28,23,.32); color: var(--c-ink); }
.dash-card .ey { font-family: var(--ff-disp); font-size: .68rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--c-bronze); margin-bottom: .7rem; }
.dash-card h3 { font-family: var(--ff-disp); font-weight: 500; font-size: 1.15rem; margin: 0 0 .35rem; }
.dash-card p { margin: 0; font-size: .88rem; color: var(--c-ink-muted); }

/* ---------- Bild-Zuschnitt (Cropper) ---------- */
.crop-preview { display: flex; align-items: center; gap: .8rem; margin-top: .6rem; }
.crop-preview[hidden] { display: none; }
.crop-preview img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--c-line); background: var(--c-sand); }

.cropper { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(33,28,23,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cropper[hidden] { display: none; }
.cropper__box { background: var(--c-bg); border-radius: 14px; padding: 1.5rem; max-width: 440px; width: 100%; box-shadow: 0 30px 80px -20px rgba(33,28,23,.55); }
.cropper__head h3 { margin: 0 0 .2rem; font-family: var(--ff-disp); font-weight: 500; }
.cropper__head p { margin: 0 0 1rem; font-size: .85rem; color: var(--c-ink-muted); line-height: 1.45; }
.cropper__stage { display: flex; justify-content: center; }
.cropper__canvas { touch-action: none; border-radius: 8px; background: var(--c-sand); cursor: grab; box-shadow: inset 0 0 0 1px var(--c-line); }
.cropper__canvas:active { cursor: grabbing; }
.cropper__zoom { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0 .25rem; font-size: .82rem; color: var(--c-ink-soft); }
.cropper__range { flex: 1; accent-color: var(--c-bronze); }
.cropper__actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .admin__main { padding: 1.25rem .9rem 5rem; }
  .admin__nav-inner { padding: .6rem .9rem; }
  .admin__tabs { gap: 1.1rem; font-size: .92rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card { padding: 1.1rem; }
  .card-head { flex-direction: column; gap: .5rem; }
  .save-bar { margin: 1.5rem -.9rem -5rem; padding: .8rem .9rem; }
  .dash-hero h1 { font-size: 1.6rem; }
}
