.admin-header-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.admin-header-link:hover { color: var(--accent-hover); }
.admin-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.admin-user-label { color: var(--text-muted); font-size: 12px; font-weight: 700; }

/* Login */
.admin-login {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}
.admin-login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.admin-login-card p { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }
.admin-login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Shell */
.admin-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-banner {
  background: #fff4d6;
  border: 1px solid #f0c65a;
  color: #6b5300;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
}
.admin-banner code { background: rgba(0,0,0,0.08); padding: 1px 5px; border-radius: 4px; }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.admin-card h2 { font-size: 17px; }
.email-templates-card { padding: 0; }
.email-templates-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
}
.email-templates-card > summary::-webkit-details-marker { display: none; }
.email-templates-card > summary::after {
  content: "+";
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}
.email-templates-card[open] > summary::after { content: "−"; }
.email-templates-card > summary h2 { margin: 0; }
.email-templates-content { padding: 0 24px 24px; }
.email-template-section + .email-template-section {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 24px;
}
.email-template-section h3 { font-size: 15px; margin: 0 0 8px; }
.email-templates-card > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.admin-card-actions { display: flex; gap: 8px; }
.admin-hint { color: var(--text-muted); font-size: 12.5px; margin: 0 0 16px; }
.admin-hint-tight { margin: 6px 0 0; }
.tracker-summary { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.tracker-quantity { font-weight: 700; white-space: nowrap; }
.tracker-section-heading { font-size: 14px; margin: 20px 0 12px; }
.collection-progress-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.collection-progress-item + .collection-progress-item { border-top: 1px solid var(--border); padding-top: 14px; }
.collection-progress-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.collection-progress-heading span { font-weight: 700; white-space: nowrap; }
.collection-progress-bar {
  display: block;
  width: 100%;
  height: 8px;
  margin: 7px 0 5px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}
.collection-progress-bar::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
.collection-progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.collection-progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.collection-progress-complete .collection-progress-bar::-webkit-progress-value,
.collection-progress-complete .collection-progress-bar::-moz-progress-bar { background: #23834a; }
.collection-progress-note { color: var(--text-muted); font-size: 12px; margin: 0; }
.field-group-nested { margin-top: 10px; }

/* Product form */
.admin-form { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.admin-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.admin-form label { font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.admin-form select {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
}
.admin-form input[type="file"] {
  font-size: 13px;
  padding: 8px 0;
}

.size-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; }
.size-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}

.image-preview {
  margin-top: 10px;
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.image-preview img { width: 100%; height: 100%; object-fit: contain; }

.field-success {
  color: #1a7a3c;
  font-size: 12px;
  margin: 0;
}

.admin-hint-inline {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.order-mail-sent {
  color: #1a7a3c;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

/* Order stats */
.order-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 4px 0 20px;
}
.stat-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat-tile-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-tile-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-small { padding: 8px 14px; font-size: 13px; }

/* Placeholder chips */
.placeholder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.chip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px dashed var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }

.admin-form textarea {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.email-preview {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.email-preview h3 { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; }
.email-preview-subject {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 10px;
}
.email-preview-body {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  margin: 0;
}

/* Tables */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
}
.admin-empty { text-align: center; color: var(--text-muted); padding: 24px; }

/* Status selects */
.status-select {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  min-width: 128px;
  white-space: nowrap;
}
.status-select:disabled { opacity: 0.6; cursor: wait; }
.status-select.status-unbezahlt { background: #fdeaea; color: #b42318; border-color: #f3b8b8; }
.status-select.status-bezahlt { background: #e6f7ec; color: #1a7a3c; border-color: #a8e0bd; }
.status-select.status-pending { background: #f1f2f4; color: #555b66; border-color: #d8dade; }
.status-select.status-bestellt { background: #e8f0fe; color: #1a56db; border-color: #b9d1fb; }
.status-select.status-ausgeliefert { background: #e6f7ec; color: #1a7a3c; border-color: #a8e0bd; }

@media (max-width: 600px) {
  .admin-form-grid { grid-template-columns: 1fr; }
}
