.global-search-shell {
  position: relative;
  min-width: 0;
}

.global-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 37px;
  padding: 0 12px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14.6px rgba(0, 0, 0, 0.02);
  color: var(--muted);
}

.global-search svg {
  width: 17px;
  height: 17px;
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.global-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(430px, calc(100vh - var(--topbar-height) - 28px));
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(23, 38, 74, 0.18);
}

.global-search-results[hidden] {
  display: none;
}

.global-search-result,
.global-search-state {
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.global-search-result {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.global-search-result:hover,
.global-search-result:focus-visible {
  outline: 0;
  background: var(--blue-soft);
}

.global-search-result-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f2f4f8;
  color: var(--blue);
}

.global-search-result-icon svg {
  width: 16px;
  height: 16px;
}

.global-search-result-copy {
  min-width: 0;
}

.global-search-result-copy strong,
.global-search-result-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result-copy strong {
  font-size: 12px;
}

.global-search-result-copy small,
.global-search-result-kind,
.global-search-state {
  color: var(--muted);
  font-size: 11px;
}

.global-search-result-kind {
  padding-left: 8px;
}

.global-search-state {
  display: flex;
  align-items: center;
}

.table-state {
  height: 72px;
  color: var(--muted);
  text-align: center;
}

.table-state.is-error,
.backend-detail-state.is-error {
  color: var(--danger);
}

.backend-detail-state {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--muted);
}

.global-search-chips {
  display: flex;
  gap: 6px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.global-search-chip {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.global-search-chip.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.global-search-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.global-search-clear {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
}

.global-search-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.global-search-history-item:hover,
.global-search-history-item:focus-visible {
  background: var(--blue-soft);
}

.global-search-history-item svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.global-search-group-label {
  padding: 8px 12px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sits in flow above the table rather than over the header, so the column headings stay
   readable and nothing is half-covered while rows are selected. */
.list-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 37px;
  padding-right: 12px;
  border-bottom: 1px solid var(--line-strong);
  background: #fff;
}

.list-bulk-actions[hidden] {
  display: none;
}

/* enhanceSelects measures the native select to size its custom shell, but this toolbar is
   hidden when that runs, so an auto width measured as zero and fell back to a 44px floor that
   the label and chevron then fought over. An explicit width survives the hidden measurement. */
.list-bulk-actions .bulk-status-select {
  width: 96px;
  height: 25px;
  margin-left: 2px;
}

.list-bulk-actions .bulk-copy,
.list-bulk-actions .bulk-delete {
  height: 25px;
  gap: 5px;
  padding: 0 9px;
  font-size: 11px;
}

.list-bulk-actions .bulk-copy svg,
.list-bulk-actions .bulk-delete svg {
  width: 12px;
  height: 12px;
}

.order-note-history {
  margin-top: 12px;
}

.order-note-history h2 {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 14px;
}

.order-note-history article {
  position: relative;
  padding: 10px 34px 10px 12px;
  border-radius: 6px;
  background: #f8f9fb;
}

/* Stays out of the way until the note is hovered or the button is focused. */
.note-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

.order-note-history article:hover .note-remove,
.note-remove:focus-visible {
  opacity: 1;
}

.note-remove:hover {
  background: rgba(230, 57, 70, 0.1);
  color: var(--danger);
}

.note-remove svg {
  width: 13px;
  height: 13px;
}

.order-note-history article + article {
  margin-top: 8px;
}

.order-note-history p {
  margin: 0;
  white-space: pre-wrap;
}

.order-note-history small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.backend-pagination {
  margin-top: 10px;
}

.backend-inline-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 0;
  color: #9a4b55;
  font-size: 11px;
}

/* Sign-in gate.
   Uses the same tokens as the rest of the dashboard so the first screen a salon sees does not look
   like a different product. It sits above everything and is removed from the DOM once a session and
   a clinic are resolved. */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--canvas);
}

.auth-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.06);
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
}

.auth-card p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.auth-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}

.auth-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.auth-button {
  margin-top: 8px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-button:hover:not(:disabled) { background: var(--blue-hover); }
.auth-button:disabled { opacity: 0.6; cursor: default; }

.auth-error {
  margin: 0;
  font-size: 12px;
  color: var(--danger);
}

.auth-secondary {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.auth-secondary:hover { background: var(--blue-soft); color: var(--blue); }

/* Loading placeholders are held back briefly before they appear.
   A list that resolves in 150ms would otherwise flash "… werden geladen …" and remove it again,
   which reads as a glitch rather than as progress. Anything slower than the delay still gets a
   clear message. Errors and empty states are never delayed — they are the final answer. */
.table-state.is-pending,
.backend-detail-state.is-pending {
  animation: bemember-pending-in 1ms linear 400ms both;
}

@keyframes bemember-pending-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .table-state.is-pending,
  .backend-detail-state.is-pending {
    animation: none;
  }
}

/* The profile button was drawn around one fixed string ("Anna Meyer") and had white-space: nowrap
   with no bound, so a real account name simply pushed past the pill and over the top bar. A cap
   plus an ellipsis keeps the control the size the design gives it whatever the account is called;
   the full address is on the title attribute. */
.profile-button {
  max-width: 220px;
}

.profile-button > span:first-child {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Same cause as the profile button: the card is 228x176 exactly, sized around "Marie Pommes" and
   "marie.pommes@gmx.net". A real address is longer, does not break at a hyphen, and pushed the
   Ausloggen button straight out of the card. The design's size becomes a minimum rather than a
   fixed box, and long values are allowed to break, so a short name still renders exactly as drawn. */
.profile-drawer-card {
  height: auto;
  min-height: 176px;
}

.profile-drawer-card h3,
.profile-drawer-email,
.profile-drawer-support {
  overflow-wrap: anywhere;
}

/* The product editor's title could not shrink and had nothing to truncate against
   (flex: 0 0 auto, no max-width), so a long treatment name expanded the row until Speichern
   overlapped Löschen. The reward editor already handles this; these are the same rules, so both
   editors now behave identically and a long name ellipsises instead of pushing the actions. */
.product-editor-page .editor-title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 420px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Defence in depth: whatever the title does, the actions keep their size and stay in a row
   rather than being overlapped. */
.editor-title-row {
  min-width: 0;
}

.editor-title-row [data-delete-object],
.editor-title-row .editor-status {
  flex-shrink: 0;
}

/* Unsaved-changes dialog. */
.unsaved-title {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.unsaved-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.unsaved-actions .button {
  min-width: 148px;
  height: 40px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.unsaved-discard {
  border: 0;
  background: #9a9a9a;
  color: #fff;
}

.unsaved-discard:hover { background: #8b8b8b; }

.modal-layer.unsaved-layer .modal {
  padding: 30px 34px;
  border-radius: 18px;
}

/* .table-state already asked for centred, muted text, but `.data-table td` is more specific
   (0,1,1 against 0,1,0) so it won every time regardless of source order — which is why an empty
   list rendered as dark text jammed against the left edge of the table. Qualifying the selector
   is what makes the intended rule apply. */
.data-table td.table-state {
  height: auto;
  padding: 26px 16px;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
}

.data-table td.table-state.is-error {
  color: var(--danger);
}
