/* Verwaltung – Ernährungsberatung Ahlen */

:root {
  --ink: #17281f;
  --ink-soft: #4c6156;
  --cream: #f6f3ea;
  --paper: #ffffff;
  --base: #123c2c;
  --base-dark: #0b2a1f;
  --accent: #f26b44;
  --accent-dark: #d9532c;
  --gruen: #6ea54c;
  --radius: 20px;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

.admin-topbar {
  background: var(--base-dark);
  color: #eaf2ec;
  padding: 0.9rem 0;
}

.admin-topbar .admin-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.admin-brand img {
  width: 34px;
  height: 34px;
}

.admin-topbar a {
  color: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.85;
}

.admin-topbar a:hover {
  opacity: 1;
}

.admin-container {
  width: min(1200px, 100% - 2rem);
  margin-inline: auto;
}

.admin-main {
  padding: 2rem 0 4rem;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid rgba(23, 40, 31, 0.09);
  box-shadow: 0 12px 30px -20px rgba(23, 40, 31, 0.35);
  padding: 1.6rem;
  margin-bottom: 1.4rem;
}

.card h1,
.card h2,
.card h3 {
  font-family: var(--font-display);
  color: var(--base-dark);
  margin: 0 0 0.6rem;
}

.card h2 {
  font-size: 1.35rem;
}

.card p.hint {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: -0.2rem 0 1rem;
}

.login-card {
  max-width: 420px;
  margin: 3rem auto;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0.8rem 0 0.25rem;
  color: var(--base-dark);
}

input,
textarea,
select {
  width: 100%;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid rgba(23, 40, 31, 0.16);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 107, 68, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--base);
  color: #fff;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px -14px rgba(23, 40, 31, 0.6);
}

.btn--accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.btn--outline {
  background: transparent;
  color: var(--base-dark);
  border: 2px solid rgba(23, 40, 31, 0.18);
}

.btn--danger {
  background: #b23232;
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.tab {
  border: 1.5px solid rgba(23, 40, 31, 0.14);
  background: var(--paper);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-soft);
}

.tab.is-active {
  background: var(--base-dark);
  border-color: var(--base-dark);
  color: #fff;
}

.tab-panel[hidden] {
  display: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1rem;
}

.collection {
  display: grid;
  gap: 1rem;
}

.item {
  border: 1.5px solid rgba(23, 40, 31, 0.12);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  background: #fdfcf8;
}

.item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.item__title {
  font-weight: 800;
  color: var(--base-dark);
  font-size: 0.95rem;
}

.item__actions {
  display: flex;
  gap: 0.4rem;
}

.status {
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 0.9rem;
  display: none;
}

.status.is-visible {
  display: block;
}

.status.is-success {
  background: #e9f2df;
  color: #2f6b23;
  border: 1px solid rgba(110, 165, 76, 0.5);
}

.status.is-error {
  background: #fdeaea;
  color: #a72b2b;
  border: 1px solid rgba(216, 69, 69, 0.4);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.checkline input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.admin-note {
  background: #fbf0d4;
  border: 1px solid rgba(242, 193, 78, 0.6);
  color: #6b4c08;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 760px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Kundenbereich (neu, additiv) ---------- */

.kb-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.kb-admin-table th,
.kb-admin-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid rgba(23, 40, 31, 0.08);
  vertical-align: top;
}

.kb-admin-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.kb-admin-table td:nth-child(2),
.kb-admin-table td:nth-child(3),
.kb-admin-table td:nth-child(4) {
  white-space: nowrap;
}

/* ---------- Produktbild-Upload (neu, additiv) ---------- */

.bild-upload {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0.9rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(23, 40, 31, 0.18);
  align-items: start;
}

.bild-upload__vorschau {
  width: 132px;
  height: 132px;
  border-radius: 16px;
  border: 1px solid rgba(23, 40, 31, 0.12);
  background: #fdfcf8;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.bild-upload__vorschau img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bild-upload__vorschau.is-leer {
  border-style: dashed;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.bild-upload__zone {
  border: 2px dashed rgba(23, 40, 31, 0.2);
  border-radius: 16px;
  padding: 1.05rem 1.1rem;
  display: grid;
  gap: 0.25rem;
  text-align: center;
  cursor: pointer;
  background: #fdfcf8;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.bild-upload__zone strong {
  font-family: var(--font-display);
  color: var(--base-dark);
  font-size: 0.98rem;
}

.bild-upload__zone span {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.bild-upload__zone:hover,
.bild-upload__zone:focus-visible {
  border-color: var(--accent);
  background: #fff7f3;
  outline: none;
}

.bild-upload__zone.is-drag {
  border-color: var(--gruen);
  background: #f3f9ec;
  transform: scale(1.01);
}

.bild-upload__balken {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(23, 40, 31, 0.08);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}

.bild-upload__balken.is-aktiv {
  opacity: 1;
}

.bild-upload__balken span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gruen), var(--accent));
  border-radius: inherit;
  transition: width 0.15s;
}

.bild-upload__status {
  grid-column: 1 / -1;
  font-size: 0.84rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.bild-upload__status.is-success {
  color: #2f6b23;
  font-weight: 700;
}

.bild-upload__status.is-error {
  color: #a72b2b;
  font-weight: 700;
}

.bild-upload__aktionen {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- Mediathek-Overlay (neu, additiv) ---------- */

.medien-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 42, 31, 0.6);
  display: grid;
  place-items: center;
  padding: 1.4rem;
  z-index: 60;
}

.medien-box {
  background: #fff;
  border-radius: 20px;
  width: min(980px, 100%);
  max-height: 84vh;
  overflow: auto;
  padding: 1.4rem;
  box-shadow: 0 30px 60px -30px rgba(11, 42, 31, 0.6);
}

.medien-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.medien-kopf h3 {
  margin: 0;
}

.medien-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(23, 40, 31, 0.16);
  background: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
}

.medien-close:hover {
  border-color: var(--accent);
  color: var(--base-dark);
}

.medien-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.medien-item {
  position: relative;
  border: 1px solid rgba(23, 40, 31, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #fdfcf8;
  display: grid;
}

.medien-item img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s;
}

.medien-item img:hover {
  transform: scale(1.04);
}

.medien-item__name {
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.medien-item__del {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(178, 50, 50, 0.92);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.medien-item:hover .medien-item__del {
  opacity: 1;
}

/* Dokumente je Kunde (neu, additiv) */

.dok-admin {
  margin-top: 0.6rem;
}

.dok-admin input[type="text"] {
  max-width: 240px;
}

.dok-admin .btn-row {
  align-items: center;
}

.dok-admin label.btn {
  display: inline-flex;
  cursor: pointer;
}

.dok-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(23, 40, 31, 0.08);
  flex-wrap: wrap;
}

.dok-zeile:last-child {
  border-bottom: 0;
}

.dok-zeile__aktionen {
  display: inline-flex;
  gap: 0.4rem;
}

/* Buchungs-Status (neu, additiv) */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill--angefragt {
  background: #fbf0d4;
  color: #6b4c08;
  border: 1px solid rgba(217, 165, 44, 0.45);
}

.pill--bestaetigt {
  background: #e9f2df;
  color: #2f6b23;
  border: 1px solid rgba(110, 165, 76, 0.45);
}

.pill--abgelehnt {
  background: #fdeaea;
  color: #a72b2b;
  border: 1px solid rgba(216, 69, 69, 0.4);
}

.pill--storniert {
  background: #eef0ee;
  color: var(--ink-soft);
  border: 1px solid rgba(23, 40, 31, 0.14);
}

.buchung-status {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

/* Erstkontakt-Einsendungen (neu, additiv) */

.ek-admin__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ek-admin__head .hint {
  margin: 0;
}

.kb-admin-table tbody th {
  width: 210px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--base-dark);
}

.kb-admin-table td {
  white-space: pre-line;
}

