:root {
  --bg: #f6f7f9;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5f6673;
  --brand: #2b4d9c;
  --brand-2: #1f3a75;
  --border: #dfe3ea;
  --ok: #30c48d;
  --warn: #d4a017;
  --err: #ff5c77;
  --topbar-bg: rgba(255, 255, 255, 0.95);
}

:root[data-theme="dark"] {
  --bg: #0f1625;
  --bg-soft: #172133;
  --card: #172133;
  --text: #e7ecf8;
  --muted: #9fb0d2;
  --brand: #8fb2ff;
  --brand-2: #6e99f5;
  --border: #2a3957;
  --ok: #44d39d;
  --warn: #e5bb52;
  --err: #ff7a95;
  --topbar-bg: rgba(15, 22, 37, 0.92);
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

.invalid-highlight {
  outline: 2px solid var(--err);
  outline-offset: 3px;
  border-radius: 16px;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.backend-page {
  background: var(--bg);
}

.container {
  width: min(1024px, 92%);
  margin: 0 auto;
}

.backend-page .container {
  width: min(1680px, 98%);
}

.backend-main {
  padding-top: 2rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

.admin-login-card {
  max-width: 520px;
  margin: 0 auto 1rem;
}

.admin-login-title {
  margin-top: 0;
}

.admin-toolbar {
  margin-bottom: 1rem;
}

.admin-toolbar-title {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  line-height: 1.2;
}

.admin-content-card {
  min-width: 0;
}

.admin-mail-settings-form {
  max-width: 900px;
  margin-bottom: 0;
}

.backend-page .admin-link-text-mobile {
  display: none;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 200;
}

:root[data-theme="dark"] .customer-portal-page,
:root[data-theme="dark"] .customer-portal-page .card,
:root[data-theme="dark"] .customer-portal-page .modal-card,
:root[data-theme="dark"] .customer-portal-page .modal-header,
:root[data-theme="dark"] .customer-portal-page .cp-order,
:root[data-theme="dark"] .customer-portal-page .cp-order-summary,
:root[data-theme="dark"] .customer-portal-page .footer {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

body.theme-dark.customer-portal-page,
body.theme-dark.customer-portal-page .card,
body.theme-dark.customer-portal-page .modal-card,
body.theme-dark.customer-portal-page .modal-header,
body.theme-dark.customer-portal-page .cp-order,
body.theme-dark.customer-portal-page .cp-order-summary,
body.theme-dark.customer-portal-page .footer,
body.theme-dark .topbar {
  background: #172133 !important;
  color: #e7ecf8 !important;
  border-color: #2a3957 !important;
}

body.theme-dark.customer-portal-page input,
body.theme-dark.customer-portal-page select,
body.theme-dark.customer-portal-page textarea,
body.theme-dark.customer-portal-page .admin-link,
body.theme-dark.customer-portal-page .cp-order-meta-badge,
body.theme-dark.customer-portal-page .cp-order-project-type {
  background: #1c2a42 !important;
  color: #e7ecf8 !important;
  border-color: #2a3957 !important;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.topbar-public-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.backend-page .topbar-inner {
  gap: 0.75rem;
  padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
  padding-bottom: 0.85rem;
  padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.admin-link {
  color: #111111;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.admin-link:hover {
  border-bottom-color: var(--brand);
}

.backend-page .admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--brand-2);
  background: color-mix(in oklab, var(--brand) 10%, white);
  border: 1px solid color-mix(in oklab, var(--brand) 28%, var(--border));
  border-bottom: 1px solid color-mix(in oklab, var(--brand) 28%, var(--border));
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.06);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.backend-page .admin-link:hover {
  color: var(--brand);
  background: color-mix(in oklab, var(--brand) 16%, white);
  border-color: color-mix(in oklab, var(--brand) 45%, var(--border));
  border-bottom-color: color-mix(in oklab, var(--brand) 45%, var(--border));
  box-shadow: 0 2px 8px rgba(43, 77, 156, 0.12);
}

.backend-page .admin-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.backend-page .admin-link--home::before {
  content: "←";
  font-size: 1.05em;
  font-weight: 700;
  opacity: 0.88;
  text-decoration: none;
}

@supports not (background: color-mix(in oklab, red, white)) {
  .backend-page .admin-link {
    background: #eef2fb;
    border-color: #c5d0eb;
  }

  .backend-page .admin-link:hover {
    background: #e4eaf8;
    border-color: #9dafe0;
  }
}

.hero {
  padding: 4rem 0 2.2rem;
}

.eyebrow {
  color: var(--brand-2);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 0.82rem;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.lead {
  color: var(--muted);
  max-width: 780px;
  line-height: 1.6;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 10px 30px rgba(17, 17, 17, 0.08);
}

.jobs-highlight-card a:not(.cms-rich-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 1rem;
  background: #f0a910;
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
  transition: background-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.jobs-highlight-card a:not(.cms-rich-btn):hover {
  background: #e09b05;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.jobs-highlight-card a:not(.cms-rich-btn),
.jobs-highlight-card a:not(.cms-rich-btn) * {
  color: #fff !important;
  text-decoration: none !important;
}

.rich-content .cms-rich-btn,
.cms-rich .cms-rich-btn,
.jobs-highlight-card .cms-rich-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0.15rem 0.35rem 0.35rem 0;
  padding: 0.42rem 0.72rem !important;
  border-radius: 10px;
  border: 1px solid rgba(32, 46, 78, 0.18) !important;
  background: #2b4d9c;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.rich-content .cms-rich-btn:hover,
.cms-rich .cms-rich-btn:hover,
.jobs-highlight-card .cms-rich-btn:hover {
  filter: brightness(0.95);
}

.rich-content .cms-rich-btn *,
.cms-rich .cms-rich-btn *,
.jobs-highlight-card .cms-rich-btn * {
  color: inherit !important;
  text-decoration: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2.8rem;
}

.form-grid h2,
.full-width,
.btn,
.status {
  grid-column: 1 / -1;
}

.project-time-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: end;
  column-gap: 2rem;
  row-gap: 1rem;
}

.date-range-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 1rem;
  justify-content: end;
}

.narrow-field {
  max-width: 260px;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 2rem;
}

.checkbox-field {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.dryhire-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  background: #fafbfd;
}

.dryhire-panel h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.dryhire-panel p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.dryhire-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: start;
}

.article-toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.article-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.article-hint {
  margin: 0 0 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--border));
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  color: #244573;
  font-size: 0.88rem;
}

.article-grid[data-loading="1"] {
  opacity: 0.75;
  pointer-events: none;
}

.article-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
}

.mini-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Admin: Eventworx „Angebot erstellen“ — Ladezustand */
.btn-spinner {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, currentColor 20%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.btn.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: wait;
}

.request-card-actions .btn.is-busy {
  min-width: 11rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.article-group h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  color: var(--brand-2);
}

.article-group {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}

.article-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.article-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  margin-bottom: 0.45rem;
}

.article-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.article-line {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.article-item label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.article-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

/* Schmal: max. 3 Ziffern (überschreibt globales input { width: 100% }) */
input.article-qty-input {
  width: 3rem;
  max-width: 3rem;
  flex: 0 0 3rem;
  min-width: 0;
  padding: 0.35rem 0.3rem;
  text-align: center;
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
}

input.article-qty-input::-webkit-outer-spin-button,
input.article-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.selected-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0.8rem;
}

.selected-panel h4 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

.selected-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.selected-item:last-child {
  border-bottom: 0;
}

.article-empty {
  margin: 0;
  color: var(--muted);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: #2f3440;
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in oklab, var(--brand), white 30%);
  border-color: transparent;
}

.btn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #3a62be, var(--brand));
  color: #ffffff;
  padding: 0.85rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(0.97);
}

.btn-small {
  padding: 0.45rem 0.7rem;
  font-size: 0.84rem;
  border-radius: 8px;
}

.btn-danger {
  background: linear-gradient(135deg, #cf2f4f, #ad1f3b);
  color: #ffffff;
}

.btn-muted {
  background: linear-gradient(135deg, #7a8498, #646d80);
  color: #ffffff;
  border: none;
}

.request-card-actions .btn-offer-inactive:disabled {
  background: #94a3b8;
  background-image: none;
  color: #f1f5f9;
  opacity: 1;
  cursor: not-allowed;
  filter: none;
}

.request-card-actions .btn-offer-inactive:disabled:hover {
  filter: none;
}

.icon-btn {
  min-width: 40px;
  padding: 0.45rem 0.55rem;
}

.action-cell {
  white-space: nowrap;
}

.action-cell .btn + .btn {
  margin-left: 0.45rem;
}

.status {
  min-height: 1.4rem;
  margin: 0;
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.err {
  color: var(--err);
}

.table-wrapper {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.request-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.request-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 4px 14px rgba(15, 23, 42, 0.07),
    0 10px 32px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.request-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 10px 28px rgba(15, 23, 42, 0.1),
    0 22px 56px rgba(15, 23, 42, 0.09);
}

@media (prefers-reduced-motion: reduce) {
  .request-card {
    transition: none;
  }

  .request-card:hover {
    transform: none;
  }
}

.request-variant-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.request-variant-details {
  border: 1px dashed color-mix(in srgb, var(--border) 84%, var(--brand, #2b4d9c) 16%);
  border-radius: 12px;
  padding: 0.3rem 0.5rem 0.55rem;
  background: color-mix(in srgb, var(--surface, #f8fafc) 88%, #fff);
}

.request-variant-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  padding: 0.2rem 0.15rem;
}

.request-variant-summary::-webkit-details-marker {
  display: none;
}

.request-variant-summary::before {
  content: "▸";
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--brand, #2b4d9c) 60%, var(--muted));
  transform: translateY(-0.5px);
}

.request-variant-details[open] .request-variant-summary::before {
  content: "▾";
}

.request-variant-summary-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  font-size: 0.69rem;
  background: color-mix(in srgb, var(--brand, #2b4d9c) 12%, #fff);
  color: color-mix(in srgb, var(--brand, #2b4d9c) 72%, #1f2937);
}

.request-variant-list {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
}

.request-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.request-header-badges {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.request-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.request-card-header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.request-type-badge {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #edf2ff;
  color: var(--brand-2);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.request-type-badge.is-fullservice {
  background: #e8edfa;
  color: #2b4d9c;
}

.request-type-badge.is-dryhire {
  background: #efe9ff;
  color: #5a3bb3;
}

.request-type-badge.is-installation {
  background: #fffae6;
  color: #c4810e;
}

.request-type-badge.is-streaming {
  background: #ffe6f5;
  color: #9b2e73;
}

.request-type-badge.is-bindlach {
  background: #e8f8ff;
  color: #10788a;
}

.request-type-badge.is-unknown {
  background: #f1f2f5;
  color: #4d5360;
}

.request-state-badge {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.request-state-badge.is-open {
  background: #fff3d9;
  color: #8a5a00;
}

.request-state-badge.is-processed {
  background: #e7f8ef;
  color: #1f7a49;
}

.request-state-badge.is-variant {
  background: #eef2ff;
  color: #3730a3;
}

.request-card-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.request-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.request-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.request-detail-label {
  font-size: 0.73rem;
  color: var(--muted);
}

.request-detail-value {
  font-size: 0.82rem;
  line-height: 1.35;
}

.request-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.request-notes-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  background: color-mix(in srgb, var(--accent, #2563eb) 18%, #fff);
  color: #1e3a5f;
  vertical-align: middle;
}

.request-notes-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: min(68vh, 520px);
  overflow: auto;
  /* Kleiner Innenabstand verhindert, dass Fokusrahmen links abgeschnitten wirkt. */
  padding: 0.15rem;
}

.request-notes-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.request-notes-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 5rem;
  font: inherit;
  line-height: 1.4;
}

.request-notes-form-actions {
  margin-top: 0.5rem;
}

.request-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.request-notes-empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Dashboard: Mitarbeiter-Chat — eine neutrale Karte wie Statistik-Blöcke, ohne Farbakzente */
.staff-room-chat-card {
  margin-top: 2rem;
  padding: 1.25rem 1.35rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.07);
}

.staff-room-chat-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.staff-room-chat-intro {
  margin: 0;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 40rem;
  border-bottom: 1px solid var(--border);
}

.staff-room-chat-card .staff-room-chat-panel.request-notes-panel {
  max-height: min(52vh, 440px);
  margin: 0;
  padding: 0.2rem 0 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.request-note-row {
  display: flex;
}

.request-note-row--own {
  justify-content: flex-end;
}

.request-note-row--other {
  justify-content: flex-start;
}

.request-note-bubble {
  position: relative;
  max-width: min(82%, 560px);
  padding: 0.5rem 0.65rem 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface, #f8fafc) 88%, var(--border));
}

.request-note-row--own .request-note-bubble {
  background: color-mix(in srgb, var(--accent, #2563eb) 18%, #ffffff);
  border-color: color-mix(in srgb, var(--accent, #2563eb) 30%, var(--border));
}

.request-note-row--other .request-note-bubble {
  background: #f2f5f8;
}

.request-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.32rem;
}

.request-note-author-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--accent, #2563eb) 14%, #fff);
  color: #1a365d;
  border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 28%, var(--border));
}

.request-note-when {
  font-size: 0.72rem;
  color: var(--muted);
}

.request-note-body {
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-word;
}

.request-note-delete-icon {
  position: absolute;
  top: 0.25rem;
  right: 0.3rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.83rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.request-note-row--own .request-note-bubble:hover .request-note-delete-icon,
.request-note-row--own .request-note-bubble:focus-within .request-note-delete-icon {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.request-note-delete-icon:hover {
  background: #fff;
}

.cards-empty {
  margin: 0;
  color: #2b4d9c;
  font-size: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 27, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card--cp-edit {
  width: min(920px, 96vw);
  max-height: 90vh;
}

.modal-card--cp-edit .date-range-row {
  justify-content: start;
}

.cp-edit-form-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.request-card--customer-edit {
  border-color: color-mix(in srgb, var(--warning, #c97800) 35%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--warning, #c97800) 25%, transparent),
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 4px 14px rgba(201, 120, 0, 0.09),
    0 12px 34px rgba(15, 23, 42, 0.07);
}

.request-card.request-card--customer-edit:hover {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--warning, #c97800) 32%, transparent),
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 10px 28px rgba(201, 120, 0, 0.11),
    0 22px 56px rgba(15, 23, 42, 0.09);
}

.request-customer-attention-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  background: color-mix(in srgb, var(--warning, #c97800) 22%, #fff);
  color: #6a3b00;
  border: 1px solid color-mix(in srgb, var(--warning, #c97800) 45%, var(--border));
}

.request-customer-edit-section {
  margin: 0.65rem 0 0.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 4%, var(--surface, #f8f9fc));
  border: 1px solid var(--border);
}

.request-customer-edit-attention-line {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text, #1a1d24);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: flex-start;
}

.request-customer-edit-attention-text {
  flex: 1;
  min-width: 0;
}

.request-customer-edit-attention-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-weight: 800;
  background: color-mix(in srgb, var(--warning, #c97800) 28%, #fff);
  color: #5c3200;
  font-size: 0.85rem;
}

.request-customer-edit-diff-title {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-2, #2d3e5c);
}

.request-customer-edit-details {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 3%, var(--surface, #fff));
  overflow: hidden;
}

.request-customer-edit-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  padding: 0.5rem 0.65rem;
  margin: 0;
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-2, #2d3e5c);
  user-select: none;
  transition: background 0.12s ease;
}

.request-customer-edit-summary::-webkit-details-marker {
  display: none;
}

.request-customer-edit-summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.15rem;
  border-right: 2px solid var(--brand-2, #2d3e5c);
  border-bottom: 2px solid var(--brand-2, #2d3e5c);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  vertical-align: middle;
}

.request-customer-edit-details[open] > .request-customer-edit-summary::before {
  transform: rotate(45deg);
  margin-top: 0.1rem;
}

.request-customer-edit-summary:hover {
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.request-customer-edit-summary-title {
  font-weight: 600;
}

.request-customer-edit-details-body {
  padding: 0 0.65rem 0.65rem;
  border-top: 1px solid var(--border);
}

.request-customer-edit-when {
  font-weight: 400;
  color: var(--muted);
}

.request-customer-edit-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: auto;
}

.request-customer-edit-table th,
.request-customer-edit-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  vertical-align: top;
  text-align: left;
}

/* Erste Spalte: kompaktes Label, ohne overlap mit „Zuvor“ (nicht width:1% + table-layout:fixed) */
.request-customer-edit-table th:first-child,
.request-customer-edit-table td:first-child {
  white-space: nowrap;
  width: auto;
  min-width: 9rem;
  max-width: 32%;
  padding-right: 0.75rem;
  font-weight: 600;
}

.request-customer-edit-table td:first-child {
  font-weight: 500;
  color: var(--brand-2, #2d3e5c);
}

.request-customer-edit-table th {
  background: color-mix(in srgb, var(--border) 35%, transparent);
  font-weight: 600;
}

/* Gilt später als Ausnahme zur globalen .backend-page table Regel */
.request-customer-edit-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.request-diff-old {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
}

.request-diff-new {
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 500;
}

/* Dry-Hire: strukturierte Kundenänderung (admin) */
.request-diff-row-dryhire .request-diff-dryhire-cell {
  padding: 0.5rem 0.5rem 0.65rem;
  vertical-align: top;
}

.dh-diff-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dh-diff-intro {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-2, #2d3e5c);
}

.dh-diff-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dh-diff-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.5rem 0.65rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.84rem;
  line-height: 1.4;
}

.dh-diff-badge {
  grid-column: 1;
  align-self: start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.35;
}

.dh-diff-body {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
  min-width: 0;
  width: 100%;
}

.dh-diff-line--removed {
  background: color-mix(in srgb, #b71c1c 7%, var(--surface, #fff));
  border-color: color-mix(in srgb, #b71c1c 22%, var(--border));
}

.dh-diff-line--removed .dh-diff-badge {
  background: color-mix(in srgb, #b71c1c 14%, #fff);
  color: #7f1d1d;
}

.dh-diff-line--added {
  background: color-mix(in srgb, #1b5e20 7%, var(--surface, #fff));
  border-color: color-mix(in srgb, #1b5e20 22%, var(--border));
}

.dh-diff-line--added .dh-diff-badge {
  background: color-mix(in srgb, #1b5e20 14%, #fff);
  color: #1b4d1f;
}

.dh-diff-line--qty {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface, #fff));
  border-color: color-mix(in srgb, var(--brand) 28%, var(--border));
}

.dh-diff-line--qty .dh-diff-badge {
  background: color-mix(in srgb, var(--brand) 16%, #fff);
  color: var(--brand-2, #2d3e5c);
}

.dh-diff-cat {
  color: var(--muted);
  font-size: 0.88em;
  font-weight: 500;
}

.dh-diff-sep {
  color: var(--muted);
  margin: 0 0.05rem;
}

.dh-diff-article {
  font-weight: 600;
}

.dh-diff-qty {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
}

.dh-diff-qty-change {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.dh-diff-qty-from {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.dh-diff-arrow {
  color: var(--muted);
  font-weight: 400;
}

.dh-diff-qty-to {
  color: var(--text, inherit);
}

.modal-card {
  width: min(860px, 96vw);
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-body {
  margin: 0;
  padding: 1rem;
  line-height: 1.45;
  font-family: inherit;
}

.modal-body p {
  margin: 0;
}

.modal-group {
  margin-bottom: 0.9rem;
}

.modal-group:last-child {
  margin-bottom: 0;
}

.modal-group h4 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--brand-2);
}

.modal-group--sketch {
  margin-top: 1rem;
}

/* Anfrageformular: Datei-Upload — wie Textfelder (.dryhire-panel / input) + Primärbutton (.btn-small) */
.request-file-upload {
  margin: 0.15rem 0 0;
  width: 100%;
  max-width: 100%;
}

.request-file-upload-label {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  cursor: pointer;
  flex-direction: column;
  gap: 0;
}

.request-file-upload-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, outline 0.15s ease;
  pointer-events: none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 65%, transparent);
}

:root[data-theme="dark"] .request-file-upload-box,
body.theme-dark .request-file-upload-box {
  box-shadow: none;
}

.request-file-upload-label:hover .request-file-upload-box {
  border-color: color-mix(in oklab, var(--brand), var(--border) 55%);
  background: color-mix(in srgb, var(--brand) 7%, var(--bg-soft));
}

.request-file-upload-label:focus-within .request-file-upload-box {
  outline: 2px solid color-mix(in oklab, var(--brand), white 30%);
  outline-offset: 2px;
  border-color: transparent;
}

.request-file-upload-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(135deg, #3a62be, var(--brand));
  cursor: pointer;
  pointer-events: none;
  border: none;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 12%, transparent);
}

.request-file-upload-label:hover .request-file-upload-cta {
  filter: brightness(0.97);
}

.request-file-upload-meta {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 100%;
}

.request-file-upload-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.request-attachment-preview {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.request-attachment-preview li {
  margin: 0.2rem 0;
}

.request-attachment-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.35rem 0;
}

.request-attachment-admin-list,
.cp-order-attachments {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
}

.request-modal-pre {
  margin: 0;
  max-height: min(70vh, 32rem);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.45;
}

/* Technikbestellung Bindlach – Inhalts-Modal (admin.js buildBindlachTechnikModalHtml) */
.modal-card.modal-card--bindlach {
  width: min(720px, 96vw);
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
  box-shadow: 0 24px 64px rgba(18, 28, 48, 0.2);
}

.modal-card.modal-card--bindlach .modal-header {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, #fff) 0%, #fff 72%);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
}

.modal-card.modal-card--bindlach .modal-body {
  padding: 0;
  background: #fafbfd;
}

.bindlach-request-modal {
  margin: 0;
}

.bindlach-modal-hero {
  padding: 1.1rem 1.25rem 1rem;
  background: linear-gradient(168deg, color-mix(in srgb, var(--brand) 7%, #eef2fb) 0%, #f8fafc 48%, #fff 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, var(--brand) 12%);
}

.bindlach-modal-hero-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #3a62be, var(--brand));
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent);
}

.bindlach-modal-hero-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text);
  letter-spacing: -0.02em;
}

.bindlach-modal-grid {
  padding: 0.5rem 0.65rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: min(calc(82vh - 12rem), 30rem);
  overflow-y: auto;
}

.bindlach-modal-row {
  display: grid;
  grid-template-columns: minmax(8rem, 36%) 1fr;
  gap: 0.45rem 1rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  align-items: first baseline;
  border: 1px solid transparent;
}

.bindlach-modal-row:nth-child(odd) {
  background: #fff;
  border-color: color-mix(in srgb, var(--line) 92%, var(--brand) 6%);
  box-shadow: 0 1px 3px rgba(22, 30, 50, 0.04);
}

.bindlach-modal-row:nth-child(even) {
  background: color-mix(in srgb, var(--bg-soft) 88%, var(--brand) 6%);
}

.bindlach-modal-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--muted);
  line-height: 1.35;
}

.bindlach-modal-value {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.bindlach-modal-row--mic .bindlach-modal-value {
  min-width: 0;
}

.bindlach-modal-mic-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.bindlach-modal-mic-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border));
}

.bindlach-modal-mic-kind {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.bindlach-modal-mic-num {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.2;
}

.bindlach-modal-row--note {
  grid-template-columns: 1fr;
  background: color-mix(in srgb, #f59e0b 8%, var(--bg-soft)) !important;
  border-color: color-mix(in srgb, #f59e0b 22%, var(--border)) !important;
}

.bindlach-modal-value--solo {
  font-size: 0.88rem;
}

.bindlach-modal-empty {
  margin: 0;
  padding: 1.75rem 1.25rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

@media (max-width: 520px) {
  .bindlach-modal-row:not(.bindlach-modal-row--note):not(.bindlach-modal-row--mic) {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .bindlach-modal-row--mic {
    grid-template-columns: 1fr;
  }
}

.modal-group ul {
  margin: 0;
  padding-left: 1.1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

.backend-page table {
  min-width: 0;
  table-layout: fixed;
}

/* Kundenänderungs-Tabelle: festes Layout + schmale Karten würden „Feld“/„Zuvor“ stapeln */
.backend-page .request-customer-edit-table {
  table-layout: auto;
}

th,
td {
  text-align: left;
  padding: 0.68rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.86rem;
}

.backend-page th,
.backend-page td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cell-stack strong,
.cell-stack span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cell-stack span {
  color: var(--muted);
  font-size: 0.84rem;
}

th {
  color: #2f3440;
  background: #fafbfd;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-tab-has-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--err);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.admin-tab-badge[hidden] {
  display: none !important;
}

.request-card.request-card--new {
  border-color: var(--brand);
  box-shadow:
    0 0 0 1px var(--brand),
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 6px 18px rgba(43, 77, 156, 0.1),
    0 14px 40px rgba(43, 77, 156, 0.12);
  background: linear-gradient(160deg, #f5f8ff 0%, #fff 55%);
}

.request-card.request-card--new:hover {
  box-shadow:
    0 0 0 1px var(--brand),
    0 2px 6px rgba(15, 23, 42, 0.07),
    0 12px 32px rgba(43, 77, 156, 0.14),
    0 26px 58px rgba(43, 77, 156, 0.14);
}

.request-new-pill {
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-bottom: 0.2rem;
}

.admin-tabs::-webkit-scrollbar {
  height: 5px;
}

.admin-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.admin-tabs > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .admin-tabs {
    gap: 0.4rem;
    margin-inline: -0.2rem;
    padding-inline: 0.2rem;
  }

  .admin-tabs > .btn-small {
    padding: 0.38rem 0.52rem;
    font-size: 0.78rem;
  }
}

.mail-settings-form .mail-smtp-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0;
}

.mail-smtp-fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1rem 0.5rem;
  margin: 0;
}

.mail-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.mail-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  padding: 0.85rem 1rem 1rem;
}

.mail-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.mail-preview-send-row {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: auto minmax(200px, 360px) auto;
  gap: 0.5rem;
  align-items: center;
}

.mail-preview-type-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.mail-preview-subject {
  margin: 0.65rem 0 0.5rem;
  color: #1f3a75;
  font-weight: 600;
}

.mail-preview-mode-toggle {
  display: inline-flex;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.mail-preview-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.mail-preview-plain {
  margin: 0;
  min-height: 420px;
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.83rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.mail-notify-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.mail-notify-pair .mail-notify-row {
  height: 100%;
  align-items: flex-start;
}

.mail-notify-pair .cookie-switch {
  align-self: center;
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .mail-notify-pair {
    grid-template-columns: 1fr;
  }
  .mail-preview-frame,
  .mail-preview-plain {
    min-height: 320px;
  }
  .mail-preview-send-row {
    grid-template-columns: 1fr;
  }
}

.mail-notify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--bg-soft);
  cursor: pointer;
  color: var(--text);
}

.mail-notify-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.mail-notify-text small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
}

/* Toggle wie in den Cookie-Einstellungen (Website) */
.cookie-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.cookie-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8d3ea;
  transition: background 160ms ease;
  pointer-events: none;
}

.cookie-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease;
}

.cookie-switch input:checked + .cookie-slider {
  background: var(--brand);
}

.cookie-switch input:checked + .cookie-slider::before {
  transform: translateX(20px);
}

.cookie-switch input:focus-visible + .cookie-slider {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.cookie-switch input:disabled + .cookie-slider {
  background: #a7b6d8;
}

.cms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.cms-toast-region {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-end;
  max-width: min(22rem, calc(100vw - 2.2rem));
  pointer-events: none;
}

.cms-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.55rem 0.45rem 0.55rem 0.75rem;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(16, 25, 46, 0.18);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  opacity: 0;
  transform: translateX(0.75rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cms-toast.is-in {
  opacity: 1;
  transform: translateX(0);
}

.cms-toast.is-leaving {
  opacity: 0;
  transform: translateX(0.5rem);
}

.cms-toast.is-success {
  border-color: rgba(34, 120, 80, 0.35);
  background: linear-gradient(135deg, #f6fffa 0%, #fff 70%);
}

.cms-toast.is-error {
  border-color: rgba(180, 50, 50, 0.4);
  background: linear-gradient(135deg, #fff8f8 0%, #fff 70%);
}

.cms-toast-body {
  flex: 1;
  min-width: 0;
}

.cms-toast-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.cms-toast-close {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.1rem 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.cms-toast-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .cms-toast {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

.cms-inline-toolbar {
  position: fixed;
  z-index: 1200;
  display: none;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(16, 25, 46, 0.16);
}

.cms-inline-toolbar.is-visible {
  display: inline-flex;
}

.cms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.cms-grid textarea {
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.83rem;
}

.cms-inline-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.cms-visual-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: start;
}

.cms-split-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(460px, 1fr);
  gap: 1rem;
  align-items: start;
}

.cms-mirror-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.cms-mirror-intro {
  max-width: 960px;
  margin-top: 0;
}

.cms-mirror-struct-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.cms-mirror-struct-label {
  font-size: 0.85rem;
  color: #5a6788;
  margin-right: 0.2rem;
}

.cms-mirror-frame-wrap {
  min-width: 0;
}

.cms-mirror-frame-full {
  height: min(92vh, 1240px);
  min-height: 640px;
}

.cms-mirror-frame-only {
  width: 100%;
  min-width: 0;
}

.cms-image-picker-card {
  max-width: min(960px, 96vw);
  width: 100%;
  max-height: min(90vh, 880px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cms-image-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cms-image-picker-toolbar input[type="file"] {
  font-size: 0.85rem;
  max-width: 100%;
}

.cms-image-picker-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
  align-content: start;
}

.cms-image-picker-tile {
  position: relative;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cms-image-picker-tile:focus-visible {
  outline: 2px solid rgba(43, 77, 156, 0.55);
  outline-offset: 2px;
}

.cms-image-picker-tile-selected {
  border-color: #2b4d9c;
  box-shadow: 0 0 0 2px rgba(43, 77, 156, 0.22);
}

.cms-gallery-order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: #2b4d9c;
  line-height: 1;
  pointer-events: none;
}

.cms-image-picker-slideshow-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(43, 77, 156, 0.04);
}

#cmsImagePickerModal.is-manage-mode #cmsImagePickerSlideshowFooter {
  display: none !important;
}

.cms-image-picker-slideshow-count {
  margin: 0;
  font-size: 0.88rem;
  color: #3d4a63;
}

.cms-image-picker-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: #5a6788;
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .cms-mirror-layout {
    grid-template-columns: 1fr;
  }
}

.cms-visual-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 1rem;
}

.cms-live-preview-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  min-height: 720px;
}

.cms-live-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.cms-live-preview-head h3 {
  margin: 0;
}

.cms-live-preview-frame {
  width: 100%;
  height: 900px;
  border: 0;
  background: #f6f8fc;
}

.cms-mirror {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cms-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfd;
  padding: 0.8rem;
}

.cms-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.cms-item {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.65rem;
  background: #fff;
  margin-bottom: 0.65rem;
}

.cms-item:last-child {
  margin-bottom: 0;
}

.cms-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.cms-field-label {
  margin: 0.45rem 0 0.2rem;
  font-size: 0.8rem;
  color: #5a6788;
  font-weight: 600;
}

.cms-image-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 0.6rem;
  align-items: center;
  margin: 0.5rem 0;
}

.cms-image-row img {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 190px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f3f5fb;
  padding: 0.3rem;
}

.cms-image-row .btn {
  width: fit-content;
  justify-self: start;
  align-self: start;
}

[data-cms-path][contenteditable="true"] {
  border: 1px dashed transparent;
  border-radius: 6px;
  padding: 0.2rem 0.3rem;
  min-height: 1.3rem;
}

[data-cms-path][contenteditable="true"]:hover {
  border-color: #aac0f2;
  background: #f4f8ff;
}

[data-cms-path][contenteditable="true"]:focus {
  outline: none;
  border-color: var(--brand);
  background: #eef4ff;
}

.cms-rich ul,
.cms-rich ol {
  margin: 0.3rem 0 0.3rem 1rem;
}

.cms-rich li {
  margin: 0.15rem 0;
}

.cms-hint {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.cms-pick-image-btn.is-active {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  filter: brightness(0.98);
}

.cms-assets {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.cms-asset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.cms-asset-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  display: block;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.cms-asset-item:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(43, 77, 156, 0.15);
}

.cms-asset-image-wrap {
  position: relative;
  display: block;
}

.cms-asset-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  background: #f3f5fb;
  display: block;
}

.cms-asset-actions {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
}

.cms-asset-delete-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(180, 34, 58, 0.9);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cms-asset-delete-icon:hover {
  background: rgba(150, 24, 46, 0.95);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
  background: var(--card);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .date-range-row {
    grid-template-columns: 1fr;
  }

  .project-time-row {
    grid-template-columns: 1fr;
  }

  .narrow-field {
    max-width: none;
  }

  .checkbox-row {
    flex-direction: column;
    gap: 0.8rem;
  }

  .article-grid {
    gap: 0.65rem;
  }

  .article-toolbar {
    grid-template-columns: 1fr;
  }

  .dryhire-layout {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cms-inline-2 {
    grid-template-columns: 1fr;
  }

  .cms-visual-layout {
    grid-template-columns: 1fr;
  }

  .cms-split-layout {
    grid-template-columns: 1fr;
  }

  .cms-mirror-layout {
    grid-template-columns: 1fr;
  }

  .cms-image-row {
    grid-template-columns: 1fr;
  }

  .cms-asset-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .request-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .request-card-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Backend: Dashboard (eigener Tab) —— */
.admin-dashboard-tab {
  padding-top: 0.15rem;
}

.admin-dashboard {
  margin-bottom: 0;
  padding-bottom: 0.25rem;
  border-bottom: none;
}

.admin-dashboard-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.admin-dashboard-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 44rem;
}

.admin-dashboard-inner .admin-dashboard-kpis {
  margin-bottom: 1rem;
}

.admin-dashboard-split {
  margin-bottom: 0.85rem;
}

.admin-dashboard-split-bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--border);
  max-width: 28rem;
}

.admin-dashboard-split-seg {
  display: block;
  height: 100%;
  min-width: 0;
}

.admin-dashboard-split-seg--dryhire {
  background: #5a3bb3;
}

.admin-dashboard-split-seg--other {
  background: #64748b;
}

.admin-dashboard-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-dashboard-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.admin-dashboard-dot--dryhire {
  background: #5a3bb3;
}

.admin-dashboard-dot--other {
  background: #64748b;
}

/* —— Backend: Statistiken —— */
.admin-stats-intro {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 52rem;
}

.admin-stats-intro-note {
  font-size: 0.9em;
  color: var(--muted);
}

.admin-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stats-kpi-card {
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  box-shadow: 0 4px 18px rgba(17, 17, 17, 0.06);
}

.admin-stats-kpi-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.admin-stats-kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}

.admin-stats-kpi-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-stats-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.admin-stats-chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.07);
}

.admin-stats-chart-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-stats-chart-sub {
  margin: 0.25rem 0 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-stats-canvas-wrap {
  position: relative;
  height: min(320px, 55vw);
  max-height: 340px;
}

.admin-stats-canvas-wrap--donut {
  max-height: 300px;
}

.admin-stats-empty {
  margin: 2rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .admin-stats-canvas-wrap {
    height: 240px;
  }
}

/* —— Backend: Audit-Protokoll —— */
.admin-audit-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 52rem;
}

.admin-audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
}

.admin-audit-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
}

.admin-audit-filter-label {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.admin-audit-filter select {
  min-width: 12rem;
  max-width: min(24rem, 100%);
  padding: 0.38rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  background: var(--surface, #fff);
  color: var(--text);
}

.admin-audit-host {
  min-height: 120px;
}

.admin-audit-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 6px 20px rgba(17, 17, 17, 0.06);
}

.admin-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-audit-table th,
.admin-audit-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.admin-audit-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.admin-audit-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-audit-table tbody tr:hover td {
  background: rgba(43, 77, 156, 0.04);
}

.admin-audit-role {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.admin-audit-cell-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.admin-audit-cell-detail {
  max-width: min(42rem, 92vw);
}

.admin-audit-detail-visual {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}

.admin-audit-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.5rem;
}

.admin-audit-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand) 14%, #fff);
  color: var(--brand-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.admin-audit-ref {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.82em;
  color: var(--text);
  word-break: break-all;
}

.admin-audit-detail-lead {
  margin: 0 0 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.admin-audit-detail-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-audit-detail-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.82rem;
}

.admin-audit-detail-raw {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.76rem;
  color: var(--muted);
  word-break: break-word;
}

.admin-audit-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-audit-kv {
  display: grid;
  grid-template-columns: minmax(5rem, auto) 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
  align-items: start;
}

.admin-audit-kv--single {
  grid-template-columns: minmax(6.5rem, auto) 1fr;
}

.admin-audit-kv dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-audit-kv dd {
  margin: 0;
  font-size: 0.84rem;
  word-break: break-word;
}

.admin-audit-path {
  font-size: 0.8rem;
  line-height: 1.4;
}

.admin-audit-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  width: fit-content;
}

.admin-audit-pill--done {
  background: color-mix(in srgb, #1f7a49 14%, #fff);
  color: #14663a;
}

.admin-audit-pill--open {
  background: color-mix(in srgb, #c97800 16%, #fff);
  color: #7a4a00;
}

.admin-audit-pill--neutral {
  background: color-mix(in srgb, var(--brand) 10%, #f5f7fb);
  color: var(--brand-2);
  font-weight: 600;
}

.admin-audit-meta {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.admin-audit-meta code {
  font-size: 0.8em;
}

/* Protokoll: Freitext „Änderungsdetails“ bei Team-Anpassung Dry Hire */
.admin-audit-staff-change-note {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface, #f8fafc) 92%, var(--border));
}

.admin-audit-staff-change-note p {
  margin: 0.4rem 0 0;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
}

/* Protokoll: gleiche Diff-Tabelle wie bei Projektanfragen-Karten */
.admin-audit-customer-diff-embed {
  margin-top: 0.35rem;
}

.admin-audit-cell-detail .request-customer-edit-table {
  font-size: 0.8rem;
}

.admin-audit-cell-detail .dh-diff-line {
  font-size: 0.78rem;
}

.admin-audit-code {
  display: block;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  color: var(--muted);
}

/* —— Kundenportal (öffentlich) —— */
.customer-portal-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.customer-portal-session-header {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  font-size: 0.86rem;
  color: #466db3;
  font-weight: 600;
  white-space: nowrap;
}

.customer-portal-auth-heading {
  margin: 1.25rem 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
}

#customerPortalLoginCard .customer-portal-auth-heading:first-of-type {
  margin-top: 0;
}

.customer-portal-auth-sep {
  margin: 1.35rem 0 0.25rem;
  border: none;
  border-top: 1px solid var(--border);
}

.portal-form-note-fallback-link {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.9em;
  font-weight: 600;
  white-space: nowrap;
}

.modal-backdrop--cp-portal {
  z-index: 10000;
  align-items: flex-start;
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

#cpEditModal.modal-backdrop:not([hidden]) {
  z-index: 10100;
}

.modal-card--customer-portal {
  width: min(720px, 100%);
  max-width: 100%;
  max-height: min(92dvh, calc(100svh - 1.5rem));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-portal-modal-heading {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.customer-portal-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem 0.95rem 1rem;
  flex: 1;
  min-height: 0;
}

.cp-portal-modal-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.55rem;
}

.customer-portal-modal-login .form-grid {
  margin-bottom: 0.65rem;
}

.customer-portal-modal-login .customer-portal-auth-heading:first-of-type {
  margin-top: 0;
}

.customer-portal-dashboard--modal {
  margin-top: 0.25rem;
}

.customer-portal-welcome {
  margin-bottom: 1.25rem;
}

.cp-order-card {
  margin-bottom: 1rem;
}

.cp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cp-order-details {
  margin: 0;
  border: none;
}

.cp-order-summary {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  list-style: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  user-select: none;
  border-radius: 6px;
}

.cp-order-summary:focus {
  outline: none;
}

.cp-order-summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.cp-order-summary::-webkit-details-marker,
.cp-order-summary::marker {
  display: none;
}

.cp-order-summary-main {
  flex: 1;
  min-width: 0;
}

.cp-order-summary-toggle {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding-top: 0.15rem;
}

.cp-order-expand-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cp-order-expand-icon {
  display: block;
  line-height: 1;
  font-size: 1rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.cp-order-details[open] .cp-order-expand-icon {
  transform: rotate(180deg);
}

.cp-order-expand-body {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.cp-order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.cp-order-title {
  margin: 0;
  font-size: 1.1rem;
}

.cp-order-meta {
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cp-order-meta-sep {
  color: var(--muted);
  opacity: 0.7;
}

.cp-order-meta-rest {
  color: var(--muted);
}

/* Gleiche Farben wie .request-type-badge im Admin (public/styles.css). */
.cp-order-project-type {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  background: #edf2ff;
  color: var(--brand-2);
  border: none;
}

.cp-order-project-type--fullservice {
  background: #e8edfa;
  color: #2b4d9c;
}

.cp-order-project-type--dryhire {
  background: #efe9ff;
  color: #5a3bb3;
}

.cp-order-project-type--installation {
  background: #fffae6;
  color: #c4810e;
}

.cp-order-project-type--streaming {
  background: #ffe6f5;
  color: #9b2e73;
}

.cp-order-project-type--bindlach {
  background: #e8f8ff;
  color: #10788a;
}

.cp-order-project-type--default {
  background: #f1f2f5;
  color: #4d5360;
}

.cp-order-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cp-order-badge.is-open {
  background: #fff3d9;
  color: #8a5a00;
}

.cp-order-badge.is-done {
  background: #dcfce7;
  color: #166534;
}

.cp-order-variant-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #eef2ff;
  color: #3730a3;
}

.cp-order-dl {
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) 1fr;
  gap: 0.35rem 0.85rem;
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
}

.cp-order-dl dt {
  margin: 0;
  color: var(--muted);
}

.cp-order-dl dd {
  margin: 0;
}

.cp-order-dl--full {
  grid-template-columns: minmax(0, 11rem) 1fr;
}

.cp-order-ref {
  font-size: 0.8em;
  word-break: break-all;
}

.cp-order-multiline {
  white-space: pre-wrap;
}

.cp-order-dry-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
}

.cp-order-article-id {
  color: var(--muted);
  font-size: 0.85em;
}

.cp-order-desc {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
}

.cp-order-desc-body {
  margin-top: 0.35rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.cp-order-dry {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
}

.cp-order-sketch {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.cp-order-sketch-body {
  margin-top: 0.45rem;
}

.cp-order-sketch-image {
  display: block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.cp-order-chat {
  margin-top: 0.9rem;
}

.cp-order-chat-panel {
  margin-top: 0.45rem;
}

.cp-order-chat-textarea {
  min-height: 4.6rem;
  margin-top: 20px;
}

.modal-card--cp-chat {
  width: min(760px, 96vw);
  max-height: 86vh;
}

#cpChatHistory.request-notes-list {
  max-height: min(56vh, 430px);
  overflow: auto;
}

#cpChatModal .request-note-row--own {
  justify-content: flex-end;
}

#cpChatModal .request-note-row--other {
  justify-content: flex-start;
}

#cpChatModal .request-note-row--own .request-note-bubble {
  background: #dce9ff;
  border-color: #8eaee8;
}

#cpChatModal .request-note-row--other .request-note-bubble {
  background: #edf2f8;
  border-color: #cfd9e8;
}

#cpChatModal .request-note-row--own .request-note-meta {
  justify-content: flex-end;
  text-align: right;
}

/* Im Kundenportal-Chat eigenes Lösch-Icon nur bei Hover/Fokus anzeigen. */
#cpChatModal .request-note-row--own .request-note-delete-icon {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

#cpChatModal .request-note-row--own .request-note-bubble:hover .request-note-delete-icon,
#cpChatModal .request-note-row--own .request-note-bubble:focus-within .request-note-delete-icon {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

:root[data-theme="dark"] .modal-card--cp-chat,
body.theme-dark .modal-card--cp-chat {
  background: #172133 !important;
  border-color: #2a3957 !important;
}

:root[data-theme="dark"] #cpChatHistory.request-notes-list,
body.theme-dark #cpChatHistory.request-notes-list {
  padding-right: 0.2rem;
}

:root[data-theme="dark"] #cpChatModal .request-note-row--other .request-note-bubble,
body.theme-dark #cpChatModal .request-note-row--other .request-note-bubble {
  background: #22324e;
  border-color: #334a74;
}

:root[data-theme="dark"] #cpChatModal .request-note-row--own .request-note-bubble,
body.theme-dark #cpChatModal .request-note-row--own .request-note-bubble {
  background: #2f4f80;
  border-color: #5b7fc3;
}

:root[data-theme="dark"] #cpChatModal .request-note-body,
:root[data-theme="dark"] #cpChatModal .request-note-author-badge,
:root[data-theme="dark"] #cpChatModal .request-note-when,
:root[data-theme="dark"] #cpChatModal .request-notes-empty,
body.theme-dark #cpChatModal .request-note-body,
body.theme-dark #cpChatModal .request-note-author-badge,
body.theme-dark #cpChatModal .request-note-when,
body.theme-dark #cpChatModal .request-notes-empty {
  color: #e7ecf8;
}

:root[data-theme="dark"] #cpChatModal .request-note-author-badge,
body.theme-dark #cpChatModal .request-note-author-badge {
  background: #1b2a45;
  border-color: #3f5c91;
}

:root[data-theme="dark"] #cpChatModal .request-notes-textarea,
body.theme-dark #cpChatModal .request-notes-textarea {
  background: #1f2d47;
  color: #e7ecf8;
  border-color: #3e5786;
}

:root[data-theme="dark"] #cpChatModal .request-notes-textarea::placeholder,
body.theme-dark #cpChatModal .request-notes-textarea::placeholder {
  color: #9fb0d2;
}

/* ----- Admin backend darkmode (full surface coverage) ----- */
:root[data-theme="dark"] .backend-page,
body.theme-dark.backend-page {
  background: #0f1625 !important;
  color: #e7ecf8;
}

:root[data-theme="dark"] .backend-page .card,
:root[data-theme="dark"] .backend-page .request-card,
:root[data-theme="dark"] .backend-page .modal-card,
:root[data-theme="dark"] .backend-page .admin-stats-kpi-card,
:root[data-theme="dark"] .backend-page .admin-stats-chart-card,
:root[data-theme="dark"] .backend-page .admin-staff-card,
:root[data-theme="dark"] .backend-page .admin-customers-table-wrap,
:root[data-theme="dark"] .backend-page .cms-image-picker-card,
:root[data-theme="dark"] .backend-page .cms-image-picker-slideshow-footer,
body.theme-dark.backend-page .card,
body.theme-dark.backend-page .request-card,
body.theme-dark.backend-page .modal-card,
body.theme-dark.backend-page .admin-stats-kpi-card,
body.theme-dark.backend-page .admin-stats-chart-card,
body.theme-dark.backend-page .admin-staff-card,
body.theme-dark.backend-page .admin-customers-table-wrap,
body.theme-dark.backend-page .cms-image-picker-card,
body.theme-dark.backend-page .cms-image-picker-slideshow-footer {
  background: #172133 !important;
  border-color: #2a3957 !important;
  color: #e7ecf8;
}

:root[data-theme="dark"] .backend-page .modal-header,
:root[data-theme="dark"] .backend-page .request-card-header,
:root[data-theme="dark"] .backend-page .admin-staff-card-summary,
body.theme-dark.backend-page .modal-header,
body.theme-dark.backend-page .request-card-header,
body.theme-dark.backend-page .admin-staff-card-summary {
  background: #1b2a43 !important;
  border-color: #2a3957 !important;
}

:root[data-theme="dark"] .backend-page .request-card-meta,
:root[data-theme="dark"] .backend-page .admin-stats-intro,
:root[data-theme="dark"] .backend-page .admin-customers-intro,
:root[data-theme="dark"] .backend-page .request-notes-empty,
body.theme-dark.backend-page .request-card-meta,
body.theme-dark.backend-page .admin-stats-intro,
body.theme-dark.backend-page .admin-customers-intro,
body.theme-dark.backend-page .request-notes-empty {
  color: #9fb0d2 !important;
}

:root[data-theme="dark"] .backend-page .request-note-row--other .request-note-bubble,
body.theme-dark.backend-page .request-note-row--other .request-note-bubble {
  background: #22324e;
  border-color: #334a74;
}

:root[data-theme="dark"] .backend-page .request-variant-details,
body.theme-dark.backend-page .request-variant-details {
  background: #1a2740;
  border-color: #35507c;
}

:root[data-theme="dark"] .backend-page .request-variant-summary,
body.theme-dark.backend-page .request-variant-summary {
  color: #b8c6e4;
}

:root[data-theme="dark"] .backend-page .request-variant-summary::before,
body.theme-dark.backend-page .request-variant-summary::before {
  color: #89a8df;
}

:root[data-theme="dark"] .backend-page .request-variant-summary-count,
body.theme-dark.backend-page .request-variant-summary-count {
  background: #2a3f66;
  color: #e7ecf8;
}

:root[data-theme="dark"] .backend-page .request-note-row--own .request-note-bubble,
body.theme-dark.backend-page .request-note-row--own .request-note-bubble {
  background: #2f4f80;
  border-color: #5b7fc3;
}

/* Autoren-Badge: Basis nutzt helles color-mix(#fff) — im Darkmode eigene Fläche. */
:root[data-theme="dark"] .backend-page .request-note-author-badge,
body.theme-dark.backend-page .request-note-author-badge {
  background: #2a3f66 !important;
  color: #e7ecf8 !important;
  border-color: #4a6899 !important;
}

:root[data-theme="dark"] .backend-page .request-note-body,
:root[data-theme="dark"] .backend-page .request-note-when,
body.theme-dark.backend-page .request-note-body,
body.theme-dark.backend-page .request-note-when {
  color: #e7ecf8;
}

:root[data-theme="dark"] .backend-page .staff-room-chat-card,
body.theme-dark.backend-page .staff-room-chat-card {
  background: #172133 !important;
  border-color: #2a3957 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4) !important;
}

:root[data-theme="dark"] .backend-page .staff-room-chat-intro,
body.theme-dark.backend-page .staff-room-chat-intro {
  border-bottom-color: #2a3957 !important;
}

/* „Änderung durch Kunde“ (<details>) + strukturierte Dry-Hire-Diffs: kein helles color-mix(#fff). */
:root[data-theme="dark"] .backend-page .request-customer-edit-section,
body.theme-dark.backend-page .request-customer-edit-section {
  background: #1a2740 !important;
  border-color: #35507c !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-attention-line,
body.theme-dark.backend-page .request-customer-edit-attention-line {
  color: #e7ecf8 !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-attention-icon,
body.theme-dark.backend-page .request-customer-edit-attention-icon {
  background: #5c4518 !important;
  color: #fcd9a4 !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-diff-title,
body.theme-dark.backend-page .request-customer-edit-diff-title {
  color: #c5d4f0 !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-details,
body.theme-dark.backend-page .request-customer-edit-details {
  background: #1a2740 !important;
  border-color: #35507c !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-summary,
body.theme-dark.backend-page .request-customer-edit-summary {
  color: #e7ecf8 !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-summary:hover,
body.theme-dark.backend-page .request-customer-edit-summary:hover {
  background: rgba(91, 127, 195, 0.14) !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-summary::before,
body.theme-dark.backend-page .request-customer-edit-summary::before {
  border-right-color: #9fb0d2 !important;
  border-bottom-color: #9fb0d2 !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-details-body,
body.theme-dark.backend-page .request-customer-edit-details-body {
  border-top-color: #35507c !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-when,
body.theme-dark.backend-page .request-customer-edit-when {
  color: #9fb0d2 !important;
}

:root[data-theme="dark"] .backend-page .request-customer-edit-table td:first-child,
body.theme-dark.backend-page .request-customer-edit-table td:first-child {
  color: #c5d4f0 !important;
}

:root[data-theme="dark"] .backend-page .request-diff-old,
body.theme-dark.backend-page .request-diff-old {
  color: #9fb0d2 !important;
}

:root[data-theme="dark"] .backend-page .request-diff-new,
body.theme-dark.backend-page .request-diff-new {
  color: #f0f4fc !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-intro,
body.theme-dark.backend-page .dh-diff-intro {
  color: #c5d4f0 !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-line,
body.theme-dark.backend-page .dh-diff-line {
  background: #1f2d47 !important;
  border-color: #3e5786 !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-line--removed,
body.theme-dark.backend-page .dh-diff-line--removed {
  background: rgba(183, 28, 28, 0.22) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-line--removed .dh-diff-badge,
body.theme-dark.backend-page .dh-diff-line--removed .dh-diff-badge {
  background: rgba(153, 27, 27, 0.45) !important;
  color: #fecaca !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-line--added,
body.theme-dark.backend-page .dh-diff-line--added {
  background: rgba(21, 128, 61, 0.22) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-line--added .dh-diff-badge,
body.theme-dark.backend-page .dh-diff-line--added .dh-diff-badge {
  background: rgba(22, 101, 52, 0.45) !important;
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-line--qty,
body.theme-dark.backend-page .dh-diff-line--qty {
  background: #243a5c !important;
  border-color: #4a6899 !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-line--qty .dh-diff-badge,
body.theme-dark.backend-page .dh-diff-line--qty .dh-diff-badge {
  background: #35507c !important;
  color: #dbe4f5 !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-cat,
:root[data-theme="dark"] .backend-page .dh-diff-sep,
:root[data-theme="dark"] .backend-page .dh-diff-qty,
:root[data-theme="dark"] .backend-page .dh-diff-qty-from,
:root[data-theme="dark"] .backend-page .dh-diff-arrow,
body.theme-dark.backend-page .dh-diff-cat,
body.theme-dark.backend-page .dh-diff-sep,
body.theme-dark.backend-page .dh-diff-qty,
body.theme-dark.backend-page .dh-diff-qty-from,
body.theme-dark.backend-page .dh-diff-arrow {
  color: #9fb0d2 !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-article,
body.theme-dark.backend-page .dh-diff-article {
  color: #f0f4fc !important;
}

:root[data-theme="dark"] .backend-page .dh-diff-qty-to,
body.theme-dark.backend-page .dh-diff-qty-to {
  color: #e7ecf8 !important;
}

/* Audit-Protokoll: Tabellenkopf / Hover nutzen feste Light-Farben in der Basis-CSS. */
:root[data-theme="dark"] .backend-page .admin-audit-table-scroll,
body.theme-dark.backend-page .admin-audit-table-scroll {
  background: #172133 !important;
  border-color: #2a3957 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .backend-page .admin-audit-table th,
body.theme-dark.backend-page .admin-audit-table th {
  background: #1b2a43 !important;
  color: #e7ecf8 !important;
  border-bottom-color: #2a3957 !important;
}

:root[data-theme="dark"] .backend-page .admin-audit-table td,
body.theme-dark.backend-page .admin-audit-table td {
  border-bottom-color: #2a3957 !important;
}

:root[data-theme="dark"] .backend-page .admin-audit-table tbody tr:hover td,
body.theme-dark.backend-page .admin-audit-table tbody tr:hover td {
  background: rgba(91, 127, 195, 0.1) !important;
}

:root[data-theme="dark"] .backend-page .admin-audit-chip,
body.theme-dark.backend-page .admin-audit-chip {
  background: #2a3f66 !important;
  color: #dbe4f5 !important;
}

:root[data-theme="dark"] .backend-page .admin-audit-pill--done,
body.theme-dark.backend-page .admin-audit-pill--done {
  background: rgba(21, 128, 61, 0.35) !important;
  color: #bbf7d0 !important;
}

:root[data-theme="dark"] .backend-page .admin-audit-pill--open,
body.theme-dark.backend-page .admin-audit-pill--open {
  background: rgba(212, 160, 23, 0.25) !important;
  color: #fde68a !important;
}

:root[data-theme="dark"] .backend-page .admin-audit-pill--neutral,
body.theme-dark.backend-page .admin-audit-pill--neutral {
  background: #2a3f66 !important;
  color: #c5d4f0 !important;
}

:root[data-theme="dark"] .backend-page input,
:root[data-theme="dark"] .backend-page select,
:root[data-theme="dark"] .backend-page textarea,
:root[data-theme="dark"] .backend-page option,
body.theme-dark.backend-page input,
body.theme-dark.backend-page select,
body.theme-dark.backend-page textarea,
body.theme-dark.backend-page option {
  background: #1f2d47 !important;
  color: #e7ecf8 !important;
  border-color: #3e5786 !important;
}

:root[data-theme="dark"] .backend-page input::placeholder,
:root[data-theme="dark"] .backend-page textarea::placeholder,
body.theme-dark.backend-page input::placeholder,
body.theme-dark.backend-page textarea::placeholder {
  color: #9fb0d2 !important;
}

:root[data-theme="dark"] .backend-page table,
:root[data-theme="dark"] .backend-page th,
:root[data-theme="dark"] .backend-page td,
body.theme-dark.backend-page table,
body.theme-dark.backend-page th,
body.theme-dark.backend-page td {
  background: #172133 !important;
  color: #e7ecf8 !important;
  border-color: #2a3957 !important;
}

/* Fallback for stray hardcoded white inline surfaces in backend. */
:root[data-theme="dark"] .backend-page [style*="background:#fff"],
:root[data-theme="dark"] .backend-page [style*="background: #fff"],
:root[data-theme="dark"] .backend-page [style*="background:#ffffff"],
:root[data-theme="dark"] .backend-page [style*="background: #ffffff"],
body.theme-dark.backend-page [style*="background:#fff"],
body.theme-dark.backend-page [style*="background: #fff"],
body.theme-dark.backend-page [style*="background:#ffffff"],
body.theme-dark.backend-page [style*="background: #ffffff"] {
  background: #172133 !important;
  color: #e7ecf8 !important;
  border-color: #2a3957 !important;
}

:root[data-theme="dark"] .backend-page .admin-staff-create-form,
body.theme-dark.backend-page .admin-staff-create-form {
  background: #1a2740 !important;
  border-color: #35507c !important;
}

:root[data-theme="dark"] .backend-page .admin-staff-create-form .admin-staff-create-toggle,
body.theme-dark.backend-page .admin-staff-create-form .admin-staff-create-toggle {
  background: #1f2d47 !important;
  border-color: #3e5786 !important;
}

:root[data-theme="dark"] .backend-page .admin-staff-create-form,
:root[data-theme="dark"] .backend-page .admin-staff-create-form label,
:root[data-theme="dark"] .backend-page .admin-staff-create-form strong,
:root[data-theme="dark"] .backend-page .admin-staff-create-form small,
body.theme-dark.backend-page .admin-staff-create-form,
body.theme-dark.backend-page .admin-staff-create-form label,
body.theme-dark.backend-page .admin-staff-create-form strong,
body.theme-dark.backend-page .admin-staff-create-form small {
  color: #e7ecf8 !important;
}

:root[data-theme="dark"] .backend-page .admin-staff-create-form small,
body.theme-dark.backend-page .admin-staff-create-form small {
  color: #b8c6e4 !important;
}

.cp-order-edit-wrap {
  margin-top: 0.95rem;
}

.cp-order-edit-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #3a62be, #2b4d9c);
  box-shadow: 0 4px 12px rgba(43, 77, 156, 0.24);
}

.cp-order-edit-btn:hover {
  filter: brightness(1.06);
}

.cp-order-variant-btn {
  border-radius: 999px;
}

/* —— Backend: Kundenkonten —— */
.admin-customers-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 52rem;
}

.admin-customers-intro a {
  color: var(--brand);
}

.admin-customers-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.admin-customers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-customers-table th,
.admin-customers-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.admin-customers-table th {
  background: #f8fafc;
  font-weight: 600;
}

.admin-customers-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-customers-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-customers-note {
  max-width: 14rem;
}

.admin-customers-meta {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-customers-actions {
  white-space: nowrap;
}

.admin-customers-actions .btn + .btn {
  margin-left: 0.35rem;
}

.lead-small {
  font-size: 0.95rem;
  line-height: 1.55;
}

.portal-form-note {
  margin: 0 0 1.1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(95, 102, 115, 0.08);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.portal-form-note a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
}

/* Admin: Benutzer & Rechte */
.admin-staff-hero {
  margin-bottom: 1.35rem;
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 168, 85, 0.14) 0%, rgba(95, 102, 115, 0.08) 55%, rgba(56, 124, 168, 0.09) 100%);
  border: 1px solid var(--border);
}

.admin-staff-hero-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-staff-hero-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 52rem;
}

.admin-staff-status {
  margin-bottom: 0.85rem;
}

.admin-staff-create-form {
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.admin-staff-create-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-staff-create-form .admin-staff-create-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0.35rem 0.25rem;
  border: 1px dashed color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 10px;
}

.admin-staff-create-form .admin-staff-create-toggle .cookie-switch {
  margin-right: 0.5rem;
}

.admin-staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 1.15rem;
  align-items: start;
}

.admin-staff-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-staff-card:hover {
  border-color: rgba(212, 168, 85, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.admin-staff-card.is-self {
  border-color: rgba(56, 124, 168, 0.55);
  box-shadow: 0 0 0 1px rgba(56, 124, 168, 0.12);
}

.admin-staff-card-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.05rem 1rem 1rem 0.85rem;
  margin: 0;
  list-style: none;
  cursor: pointer;
  border-radius: 14px 14px 0 0;
  user-select: none;
}

.admin-staff-card-summary::-webkit-details-marker {
  display: none;
}

.admin-staff-card:not([open]) > .admin-staff-card-summary {
  border-radius: 14px;
}

.admin-staff-card-chevron {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  background: rgba(95, 102, 115, 0.08);
  transition: color 0.15s ease, background 0.15s ease;
}

.admin-staff-card-chevron::before {
  content: "›";
  display: block;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.admin-staff-card[open] > .admin-staff-card-summary .admin-staff-card-chevron {
  color: var(--text);
  background: rgba(212, 168, 85, 0.2);
}

.admin-staff-card[open] > .admin-staff-card-summary .admin-staff-card-chevron::before {
  transform: rotate(90deg);
}

.admin-staff-card-summary:hover .admin-staff-card-chevron {
  color: var(--text);
  background: rgba(95, 102, 115, 0.12);
}

.admin-staff-card-summary:focus {
  outline: none;
}

.admin-staff-card-summary:focus-visible {
  outline: 2px solid rgba(56, 124, 168, 0.55);
  outline-offset: 2px;
}

.admin-staff-card-panel {
  padding: 0 1.15rem 1.05rem;
  border-top: 1px solid var(--border);
  animation: admin-staff-panel-in 0.22s ease;
}

@keyframes admin-staff-panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-staff-card-head {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.admin-staff-avatar {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #387ca8, #2a5f82);
}

.is-self .admin-staff-avatar {
  background: linear-gradient(145deg, #d4a855, #b8893a);
}

.admin-staff-idblock {
  min-width: 0;
}

.admin-staff-name {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-staff-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-word;
}

.admin-staff-meta-sep {
  margin: 0 0.25rem;
  opacity: 0.55;
}

.admin-staff-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.admin-staff-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.45rem;
  border-radius: 6px;
  background: rgba(95, 102, 115, 0.1);
  color: var(--text);
}

.admin-staff-chip--portal {
  background: rgba(56, 124, 168, 0.12);
  color: #2a5f82;
}

.admin-staff-chip--backend {
  background: rgba(212, 168, 85, 0.18);
  color: #7a5a1e;
}

.admin-staff-chip--off {
  background: rgba(95, 102, 115, 0.08);
  color: var(--muted);
  font-weight: 500;
}

.admin-staff-chip--you {
  background: rgba(56, 124, 168, 0.15);
  color: #2a5f82;
}

.admin-staff-access-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.5rem;
}

@media (min-width: 520px) {
  .admin-staff-access-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

.admin-staff-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.admin-staff-toggle .cookie-switch {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.admin-staff-toggle span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.admin-staff-toggle strong {
  font-size: 0.88rem;
}

.admin-staff-toggle small {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.admin-staff-role-row {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(95, 102, 115, 0.06);
  border: 1px solid var(--border);
}

.admin-staff-role-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-staff-role-select {
  max-width: 16rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  background: var(--surface, #fff);
}

.admin-staff-role-hint {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.admin-staff-perms {
  margin-top: 1rem;
}

.admin-staff-perms-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-staff-perm-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-staff-perm-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.admin-staff-perm-row:hover {
  background: rgba(95, 102, 115, 0.05);
  border-color: var(--border);
}

.admin-staff-perm-row .cookie-switch {
  flex-shrink: 0;
  margin-top: 0.12rem;
}

.admin-staff-perm-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.admin-staff-perm-text strong {
  font-size: 0.86rem;
}

.admin-staff-perm-text small {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

.admin-staff-card-foot {
  min-height: 1.15rem;
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-staff-card-foot.is-ok {
  color: #2d7a4e;
  font-weight: 500;
}

.admin-staff-card-foot.is-err {
  color: #b42318;
  font-weight: 500;
}

/* —— Backend: Mobil & Safe Areas —— */
@media (max-width: 720px) {
  .backend-page .container {
    width: 100%;
    max-width: none;
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
  }

  .backend-main {
    padding-top: 1.15rem;
  }

  .backend-page .admin-link-text-desktop {
    display: none;
  }

  .backend-page .admin-link-text-mobile {
    display: inline;
  }

  .backend-page .card {
    padding: 1rem 0.9rem;
    border-radius: 14px;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
  }

  .admin-toolbar .btn-small {
    align-self: flex-start;
    min-height: 44px;
    padding: 0.45rem 0.9rem;
  }

  .brand-logo {
    height: 32px;
  }

  .backend-page .topbar-inner {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .backend-page .admin-link {
    padding: 0.48rem 0.8rem;
    font-size: 0.8rem;
  }

  .admin-tabs {
    gap: 0.35rem;
    padding-bottom: 0.35rem;
    overscroll-behavior-x: contain;
  }

  .admin-tabs > .btn-small {
    min-height: 44px;
    padding: 0.4rem 0.58rem;
    font-size: 0.76rem;
    touch-action: manipulation;
  }

  .mail-notify-pair {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .mail-settings-form .mail-smtp-inner {
    grid-template-columns: 1fr;
  }

  .admin-mail-settings-form {
    max-width: none;
  }

  .cms-mirror-frame-full {
    min-height: 220px;
    height: min(70dvh, 680px);
  }

  .cms-live-preview-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.6rem 0.7rem;
  }

  .cms-live-preview-head .cms-hint {
    font-size: 0.76rem;
    line-height: 1.4;
  }

  .cms-actions .btn-small {
    flex: 1 1 auto;
    min-width: min(100%, 9.5rem);
    min-height: 44px;
    justify-content: center;
  }

  .admin-stats-charts {
    grid-template-columns: 1fr;
  }

  .admin-stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .admin-stats-kpi-value {
    font-size: 1.32rem;
  }

  .admin-stats-kpi-card {
    padding: 0.85rem 0.95rem;
  }

  .admin-stats-canvas-wrap {
    height: min(252px, 62vw);
    max-height: 280px;
  }

  .admin-audit-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .admin-audit-filter {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .admin-audit-filter select {
    width: 100%;
    max-width: none;
    min-height: 44px;
  }

  .admin-audit-intro,
  .admin-stats-intro,
  .admin-customers-intro {
    font-size: 0.9rem;
  }

  .admin-staff-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .admin-staff-create-form {
    grid-template-columns: 1fr;
  }

  .admin-staff-hero {
    padding: 1rem 0.9rem;
  }

  .admin-staff-hero-title {
    font-size: 1.12rem;
  }

  .admin-customers-table-wrap {
    margin-inline: -0.2rem;
    -webkit-overflow-scrolling: touch;
  }

  .admin-customers-table {
    font-size: 0.8rem;
  }

  .admin-customers-table th,
  .admin-customers-table td {
    padding: 0.5rem 0.45rem;
  }

  .request-card-actions .btn-small,
  .request-card-actions .btn {
    min-height: 42px;
  }

  .modal-backdrop {
    padding: max(0.6rem, env(safe-area-inset-top, 0px)) max(0.55rem, env(safe-area-inset-right, 0px))
      max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.55rem, env(safe-area-inset-left, 0px));
    align-items: center;
  }

  .modal-card {
    width: min(860px, 100%);
    max-height: min(86dvh, calc(100svh - 1.25rem));
  }

  .modal-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .cms-image-picker-card {
    max-height: min(90dvh, 100vh);
    width: 100%;
  }

  .cms-image-picker-toolbar {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .cms-image-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    padding: 0.65rem;
  }

  .cms-toast-region {
    right: max(0.45rem, env(safe-area-inset-right, 0px));
    left: max(0.45rem, env(safe-area-inset-left, 0px));
    bottom: max(0.6rem, env(safe-area-inset-bottom, 0px));
    max-width: none;
    align-items: stretch;
  }

  .backend-page .form-grid {
    margin-bottom: 1.2rem;
  }
}

@media (max-width: 380px) {
  .admin-stats-summary {
    grid-template-columns: 1fr;
  }

  .admin-tabs > .btn-small {
    font-size: 0.72rem;
    padding: 0.38rem 0.48rem;
  }
}

.layout-sketch-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border, #dfe3ea);
  border-radius: 10px;
  background: #fff;
  cursor: crosshair;
  /* Touch: Scroll/Zoom nicht stehlen — Zeichnen per Pointer Events */
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.layout-sketch-preview {
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--border, #dfe3ea);
  border-radius: 10px;
  background: #fff;
}

#layoutSketchPreviewWrap {
  margin-top: 0.7rem;
  position: relative;
  display: inline-block;
}

#cpEditSketchPreviewWrap {
  margin-top: 0.7rem;
  position: relative;
  display: block;
  max-width: 100%;
}

#cpEditSketchPreviewWrap .layout-sketch-preview {
  max-width: min(560px, 100%);
}

#cpEditSketchPreviewWrap .layout-sketch-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 10px;
}

.layout-sketch-delete-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(31, 41, 55, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.layout-sketch-delete-btn:hover {
  background: #fee2e2;
}

.sketch-tool-btn {
  width: 56px;
  min-width: 56px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2b4d9c;
  opacity: 0.66;
}

.sketch-tool-btn.is-active {
  opacity: 1;
}

.sketch-tool-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sketch-action-btn {
  min-width: 86px;
  font-size: 0.78rem;
  padding: 0.32rem 0.55rem;
}

.sketch-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.sketch-toolbar .sketch-action-btn {
  min-width: 72px;
  padding: 0.28rem 0.5rem;
}

/* Backend: Dry-Hire-Artikel durch Mitarbeitende bearbeiten */
.modal-card--staff-dryhire {
  width: min(760px, 96vw);
  max-height: 92vh;
}

.staff-dryhire-edit-body {
  max-height: calc(92vh - 4.5rem);
  overflow: auto;
}

.staff-dryhire-edit-intro {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.staff-dryhire-edit-label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.staff-dryhire-edit-textarea {
  width: 100%;
  margin-top: 0.35rem;
  font: inherit;
  min-height: 4rem;
  resize: vertical;
}

.staff-dryhire-edit-field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

.staff-dryhire-edit-heading {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
}

.staff-dryhire-edit-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.staff-dryhire-edit-row {
  display: grid;
  grid-template-columns: 1fr 5.5rem auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 4%, var(--surface, #fff));
}

.staff-dryhire-edit-row-meta {
  font-size: 0.82rem;
  line-height: 1.35;
  min-width: 0;
}

.staff-dryhire-edit-row-meta small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.staff-dryhire-edit-row input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 0.28rem 0.4rem;
  font: inherit;
}

.staff-dryhire-catalog-status {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 1.2rem;
}

.staff-dryhire-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
  align-items: flex-end;
}

.staff-dryhire-catalog-toolbar label {
  font-size: 0.82rem;
  font-weight: 600;
}

.staff-dryhire-catalog-toolbar select,
.staff-dryhire-catalog-toolbar input {
  margin-top: 0.25rem;
  font: inherit;
  display: block;
}

.staff-dryhire-catalog-search {
  flex: 1;
  min-width: 10rem;
}

.staff-dryhire-catalog-search input {
  width: 100%;
}

.staff-dryhire-catalog-grid {
  max-height: 220px;
  overflow: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem;
}

.staff-dryhire-catalog-grid .article-item {
  cursor: pointer;
}

.staff-dryhire-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

:root[data-theme="dark"] .backend-page .staff-dryhire-edit-row,
body.theme-dark.backend-page .staff-dryhire-edit-row {
  background: #1f2d47 !important;
  border-color: #3e5786 !important;
}

:root[data-theme="dark"] .backend-page .staff-dryhire-catalog-grid,
body.theme-dark.backend-page .staff-dryhire-catalog-grid {
  background: #172133;
  border-color: #2a3957;
}
