.admin-wrap { max-width: 1100px; padding-block: 40px 64px; }

.admin-wrap h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  margin: 0 0 0.2em;
}

.admin-wrap h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 0 0.7em;
}

.admin-back { margin: 0 0 1.6em; }

.gate-card { max-width: 460px; }

.gate-card label { display: block; font-weight: 800; margin-bottom: 0.35em; }

.gate-row {
  display: flex;
  gap: 0.6em;
  align-items: center;
  flex-wrap: wrap;
}

.gate-row input[type="password"], .gate-row input[type="file"] {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf9;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.65em 0.9em;
}

.gate-row input:focus { outline: none; border-color: var(--coral); }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
  margin-bottom: 1.4em;
}

.stat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.8em 1.2em;
  min-width: 130px;
}

.stat-box span {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.2;
}

.stat-box small { color: var(--ink-faint); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.stat-box:nth-child(1) span { color: var(--violet-dark); }
.stat-box:nth-child(2) span { color: var(--coral); }
.stat-box:nth-child(3) span { color: var(--indigo); }
.stat-box:nth-child(4) span { color: var(--peach-dark); }
.stat-box:nth-child(5) span { color: var(--magenta); }
.stat-box:nth-child(6) span { color: var(--violet-dark); }

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7em;
  margin-bottom: 1.4em;
}

.table-card { margin-bottom: 1.4em; }

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

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  min-width: 900px;
}

th, td {
  text-align: left;
  padding: 0.55em 0.7em;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--font-head);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  white-space: nowrap;
}

td.yes { color: var(--violet-dark); font-weight: 800; }
td.no { color: var(--coral); font-weight: 800; }

td.wrap-col { min-width: 160px; white-space: normal; }

td.action-col { white-space: nowrap; }

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8em;
  margin-bottom: 0.6em;
}

.table-head h2 { margin: 0; }

.table-head input[type="search"] {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fffdf9;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.45em 1em;
  min-width: 200px;
}

.table-head input[type="search"]:focus { outline: none; border-color: var(--coral); }

.digest-card { margin-bottom: 1.4em; }

.digest-sub {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.digest-list {
  margin: 0;
  padding-left: 1.4em;
  line-height: 1.7;
}

.digest-count {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--violet-dark);
  white-space: nowrap;
}

.digest-cat {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  margin: 0.9em 0 0.25em;
}

.digest-cat:first-child { margin-top: 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(50, 36, 62, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px;
  overflow-y: auto;
  z-index: 200;
}

/* Wichtig: Autor-CSS schlägt das hidden-Attribut des Browsers –
   deshalb muss die Ausblendung hier explizit stehen. */
.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 720px;
  border-top: 6px solid var(--violet);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1em;
}

@media (max-width: 560px) {
  .modal-grid { grid-template-columns: 1fr; }
}

.modal-actions {
  display: flex;
  gap: 0.7em;
  margin-top: 1.2em;
}

.modal-card .field { margin-bottom: 1em; }

.modal-card .field label { display: block; font-weight: 800; margin-bottom: 0.35em; }

.modal-card input[type="text"],
.modal-card input[type="number"],
.modal-card select,
.modal-card textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf9;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.6em 0.8em;
}

.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus { outline: none; border-color: var(--coral); }

.btn-mini {
  padding: 0.35em 0.9em;
  font-size: 0.8rem;
}

.upload-hint { color: var(--ink-faint); font-size: 0.9rem; }

.upload-card { margin-bottom: 1.4em; }

.upload-status { font-weight: 700; color: var(--violet-dark); min-height: 1.4em; margin: 0.6em 0 0; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.8em;
}

.photo-item { position: relative; }

.photo-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(50, 36, 62, 0.75);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}
.photo-delete:hover { background: var(--coral); }
