/* ============================================================
   OLO Dashboard v2 — App-Shell · Navigation · Aufträge
   ============================================================ */

@import url('assets/olo-session-security.css');

/* Supabase Auth-Gate: Inhalt erst nach Session-Prüfung anzeigen */
html.olo-auth-pending body {
  visibility: hidden;
}

body.dashboard-body {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  background-color: var(--app-background, var(--bg));
}

/* PIN / Sperre: assets/olo-session-security.css + olo-session-security.js */

.dashboard-pin-error.hidden { display: none; }

/* ── App Shell ── */

.dashboard-shell {
  max-width: var(--olo-shell-max);
  margin: 0 auto;
  padding: clamp(18px, 2.5vw, 32px) clamp(18px, 2.5vw, 36px) 60px;
  box-sizing: border-box;
}

/* ── Top Bar ── */

.dashboard-top {
  position: relative;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

/* Account + Mitarbeiter — top left */
.dashboard-header-badges {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 148px);
  min-height: 36px;
  z-index: 20;
}

.dashboard-account-label {
  position: static;
  display: flex;
  align-items: center;
  min-height: 36px;
  max-width: none;
}

.dashboard-staff-picker {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
}

.dashboard-staff-button__prefix {
  color: var(--muted);
  font-weight: 500;
}

.dashboard-staff-button__name {
  color: var(--text);
  font-weight: 600;
  max-width: min(160px, 28vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-staff-button:disabled,
.dashboard-staff-button[aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
}

.dashboard-staff-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: min(280px, calc(100vw - 48px));
  max-height: min(320px, 50vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--olo-radius);
  border: 1px solid var(--border-strong);
  background: var(--card-bg);
  box-shadow: var(--olo-shadow-md);
  z-index: 100;
  box-sizing: border-box;
}

.dashboard-staff-dropdown.hidden {
  display: none;
}

.dashboard-staff-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--olo-radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color var(--olo-transition-fast);
}

.dashboard-staff-option:hover,
.dashboard-staff-option:focus-visible {
  background: var(--olo-accent-subtle);
  outline: none;
}

.dashboard-staff-option.is-active {
  background: var(--olo-selected-bg);
  box-shadow: var(--olo-selected-shadow), inset 0 0 0 1px var(--olo-selected-border);
}

.dashboard-staff-option__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--olo-accent);
}

.dashboard-staff-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.dashboard-staff-option__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.dashboard-staff-empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.dashboard-staff-empty a {
  color: var(--olo-accent);
  font-weight: 600;
  text-decoration: none;
}

.dashboard-staff-empty a:hover,
.dashboard-staff-empty a:focus-visible {
  text-decoration: underline;
}

.dashboard-staff-option__role {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.dashboard-staff-option__check {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--olo-accent);
}

.dashboard-account-label .account-label,
.dashboard-account-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--olo-radius-pill);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--olo-shadow-xs);
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  max-width: 100%;
  box-sizing: border-box;
  transition:
    background-color var(--olo-transition-fast),
    border-color var(--olo-transition-fast),
    color var(--olo-transition-fast),
    transform var(--olo-transition-fast);
}

.dashboard-account-button:hover {
  background: var(--olo-accent-soft);
  border-color: var(--olo-accent-border);
  color: var(--text);
  transform: translateY(-1px);
}

.dashboard-account-button:active {
  transform: translateY(0);
}

.dashboard-account-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.dashboard-account-button::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.45;
  flex-shrink: 0;
}

/* Top-right actions */
.dashboard-top-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-settings-button {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--olo-radius-pill);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--olo-shadow-xs);
  transition:
    background-color var(--olo-transition-fast),
    border-color var(--olo-transition-fast),
    color var(--olo-transition-fast),
    transform var(--olo-transition-fast);
}

.dashboard-settings-button:hover {
  background: var(--olo-accent-soft);
  border-color: var(--olo-accent-border);
  color: var(--text);
  transform: translateY(-1px);
}

.dashboard-settings-button:active  { transform: translateY(0); }
.dashboard-settings-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.dashboard-settings-icon { flex: 0 0 auto; opacity: 0.7; }

.dashboard-settings-text { display: inline; }

@media (max-width: 980px) {
  .dashboard-settings-text { display: none; }
}

/* Logo — nur Dashboard */
.dashboard-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

body.olo-work-mode .dashboard-logo-wrap {
  display: none;
}

/* Account-Button nur auf dem Dashboard (alte Badge-Variante) */
body.olo-work-mode:not(.settings-page) .dashboard-account-label {
  display: none !important;
}

/* Settings: Account-Button oben rechts */
.settings-page .dashboard-top-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-page .dashboard-top-actions .dashboard-settings-button {
  height: 36px;
}

/* Mitarbeiter-Dropdown: Actions (Ausloggen) */
.dashboard-staff-actions {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.dashboard-staff-logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--olo-radius-sm);
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--olo-transition-fast),
    border-color var(--olo-transition-fast),
    transform var(--olo-transition-fast);
}

.dashboard-staff-logout:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 70%, var(--card-bg) 30%);
  transform: translateY(-1px);
}

.dashboard-staff-logout:active { transform: translateY(0); }
.dashboard-staff-logout:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--danger-soft); }

.dashboard-staff-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-staff-logout--business {
  background: var(--card-bg-soft);
  border-color: var(--border);
  color: var(--muted);
}

.dashboard-staff-logout--business:hover {
  border-color: var(--border-strong);
  background: var(--card-bg);
  color: var(--text);
}

/* ── Arbeitsmodus (ohne Logo) ── */

body.olo-work-mode .dashboard-shell {
  padding-top: 16px;
}

body.olo-dashboard-page .dashboard-shell {
  padding-top: 24px;
}

.dashboard-top--work {
  text-align: left;
  margin-bottom: var(--olo-space-4);
  padding-bottom: var(--olo-space-3);
}

.dashboard-top--work .dashboard-top-actions {
  position: absolute;
  top: 0;
  right: 0;
}

.dashboard-top--work .olo-work-header {
  margin-top: 0;
  padding-top: 0;
}

.olo-work-header {
  display: grid;
  grid-template-columns: minmax(112px, 140px) minmax(0, 1fr) auto;
  gap: var(--olo-space-3);
  align-items: center;
  width: 100%;
  padding-right: 120px;
  box-sizing: border-box;
}

.olo-work-header__main {
  min-width: 0;
}

body.olo-work-mode .dashboard-hero-title {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: -0.02em;
}

body.olo-work-mode .dashboard-hero-sub {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

body.olo-work-mode .dashboard-hero,
body.olo-work-mode .dashboard-hero--work {
  max-width: none;
  margin: 0;
  text-align: left;
}

.olo-work-header--settings {
  grid-template-columns: minmax(112px, 140px) minmax(0, 1fr);
  padding-right: 0;
}

.olo-work-back {
  max-width: 140px;
  width: 100%;
  text-decoration: none;
  justify-self: start;
}

.olo-work-header__action {
  max-width: 180px;
  white-space: nowrap;
}

.settings-page .settings-back-row,
.account-admin-back-row {
  display: none;
}

@media (max-width: 720px) {
  .olo-work-header {
    grid-template-columns: 1fr;
    padding-right: 0;
    gap: var(--olo-space-2);
    margin-top: 0;
  }

  .olo-work-header__action {
    max-width: none;
    width: 100%;
  }

  .dashboard-top--work .dashboard-top-actions {
    position: static;
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--olo-space-2);
  }
}

/* Hero */
.dashboard-hero {
  max-width: 440px;
  margin: 0 auto;
}

.dashboard-hero-title {
  margin: 0 0 5px;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.dashboard-hero-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Settings page tweaks ── */
.settings-page .dashboard-hero { max-width: 860px; }
.settings-back-row { margin-top: 14px; display: flex; justify-content: center; }

/* ── Main Layout ── */

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ── Navigation Menu ── */

.dashboard-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 0;
}

.dashboard-menu-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 18px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--olo-radius-sm);
  cursor: pointer;
  letter-spacing: -0.01em;
  transition:
    background-color var(--olo-transition-fast),
    color var(--olo-transition-fast),
    border-color var(--olo-transition-fast);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.dashboard-menu-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 54%;
  background: var(--olo-accent);
  border-radius: var(--olo-radius-pill);
  transition: transform var(--olo-transition-fast);
}

.dashboard-menu-btn:hover {
  background: var(--olo-accent-subtle);
  border-color: var(--olo-accent-border);
  color: var(--text);
}

.dashboard-menu-btn:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.dashboard-menu-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.dashboard-menu-btn--placeholder { opacity: 0.85; }

/* ── Dashboard Card ── */

.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--olo-radius-card);
  box-shadow: var(--olo-shadow-sm);
  padding: var(--olo-card-padding);
  box-sizing: border-box;
  transition: box-shadow var(--olo-transition), border-color var(--olo-transition);
}

.dashboard-card:hover {
  box-shadow: var(--olo-shadow-md);
  border-color: var(--border-strong);
}

.dashboard-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--olo-space-3);
  margin-bottom: var(--olo-space-4);
  padding-bottom: var(--olo-space-3);
  border-bottom: 1px solid var(--border);
}

.dashboard-card-header .dashboard-card-title { margin: 0; }

/* Add button */
.add-anamnesis-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--olo-radius-sm);
  background: var(--olo-accent-soft);
  border: 1px solid var(--olo-accent-border);
  color: var(--olo-accent);
  cursor: pointer;
  transition:
    background-color var(--olo-transition-fast),
    border-color var(--olo-transition-fast),
    transform var(--olo-transition-fast);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.add-anamnesis-button:hover {
  background: var(--olo-accent-soft);
  border-color: var(--olo-accent-border);
  color: var(--olo-accent);
  box-shadow: 0 2px 8px var(--olo-accent-glow);
  transform: translateY(-1px);
}

.add-anamnesis-button:active  { transform: translateY(0); }
.add-anamnesis-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.add-anamnesis-button__icon {
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  margin-top: -1px;
}

/* ── Anamnese / Aufträge Table ── */

.dashboard-anamnesis {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.anamnesis-table {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.anamnesis-table-head { flex-shrink: 0; }

.anamnesis-row {
  display: grid;
  /* Kunde ~60 % breiter als zuvor (1.5fr → 2.4fr), andere Spalten leicht kompakter */
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 0.95fr) minmax(0, 1.05fr) minmax(0, 0.8fr) 36px;
  gap: clamp(8px, 1.2vw, 12px);
  align-items: center;
  padding: 12px 14px;
  box-sizing: border-box;
}

.anamnesis-row--head {
  background: var(--card-bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--olo-radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--hint);
}

.anamnesis-cell {
  justify-self: start;
  text-align: left;
  min-width: 0;
}

.anamnesis-cell--kunde {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
}

.anamnesis-list {
  flex: 1;
  margin-top: 10px;
  min-height: 160px;
  max-height: min(660px, 62vh);
  overflow-y: auto;
  border-radius: var(--olo-radius);
  border: 1px solid var(--border);
  background: var(--card-bg-soft);
  padding: 8px;
  box-sizing: border-box;
}

.anamnesis-row--item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--olo-radius-sm);
  padding: 11px 14px;
  margin-bottom: 5px;
  cursor: pointer;
  transition:
    background-color var(--olo-transition-fast),
    border-color var(--olo-transition-fast),
    box-shadow var(--olo-transition-fast);
}

.anamnesis-row--item:hover {
  background: var(--olo-accent-soft);
  border-color: var(--olo-accent-border);
  box-shadow: var(--olo-shadow-xs);
}

.anamnesis-row--item.anamnesis-row--selected {
  background: var(--olo-selected-bg);
  border-color: var(--olo-selected-border);
  box-shadow: var(--olo-selected-shadow), 0 0 0 1px var(--olo-selected-border);
}

.anamnesis-row--item:last-child { margin-bottom: 0; }

/* ── Order editor (last edited by) ── */

.order-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.order-editor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px 4px 8px;
  border-radius: var(--olo-radius-pill);
  border: 1px solid var(--border);
  background: var(--card-bg-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  box-sizing: border-box;
}

.order-editor-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--olo-accent);
}

.order-editor-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-editor-time {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  padding-left: 2px;
}

.anamnesis-cell--editor {
  align-self: center;
}

/* Anamnese Input */
.anamnesis-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--olo-radius-sm);
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-text);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color var(--olo-transition-fast), box-shadow var(--olo-transition-fast);
}

/* Auftragsname / Kunde – breiter, responsiv */
.anamnesis-input--order-name {
  width: 100%;
  min-width: min(100%, 11rem);
  max-width: 100%;
  height: clamp(40px, 4.2vw, 44px);
  padding: 0 clamp(12px, 1.4vw, 16px);
  font-size: clamp(14px, 1.5vw, 15px);
  letter-spacing: -0.01em;
}

.anamnesis-input::placeholder { color: var(--control-placeholder); }

.anamnesis-input:focus {
  outline: none;
  border-color: var(--control-border-focus);
  box-shadow: var(--focus-ring);
}

/* ── Status Badge ── */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: var(--olo-radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid var(--success-border);
}

/* ── Delete Button ── */

.delete-anamnesis-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--olo-radius-xs);
  background: transparent;
  border: 1px solid transparent;
  color: var(--hint);
  cursor: pointer;
  transition:
    background-color var(--olo-transition-fast),
    border-color var(--olo-transition-fast),
    color var(--olo-transition-fast),
    transform var(--olo-transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.delete-anamnesis-button:hover {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
  transform: translateY(-1px);
}

.delete-anamnesis-button:active  { transform: translateY(0); }
.delete-anamnesis-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--danger-soft);
}

.delete-anamnesis-button__icon {
  font-size: 16px;
  line-height: 1;
}

/* ── Empty state ── */

.anamnesis-empty {
  margin: 0;
  padding: 32px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--hint);
  line-height: 1.55;
}

.dashboard-placeholder-text {
  margin: 0;
  font-size: var(--olo-text-sm);
  line-height: 1.6;
  color: var(--muted);
}

/* ── Settings Grid ── */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-card { padding: var(--olo-card-padding); }

.settings-card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.settings-card--design {
  grid-column: 1 / -1;
}

.settings-accent-lead {
  margin: 0 0 var(--olo-space-5);
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 56ch;
}

.settings-design-section {
  margin-bottom: var(--olo-space-5);
}

.settings-design-section--accent {
  margin-bottom: var(--olo-space-4);
  padding-top: var(--olo-space-2);
  border-top: 1px solid var(--border);
}

.settings-design-subtitle {
  margin: 0 0 var(--olo-space-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hint);
}

.settings-design-hint {
  margin: 0 0 var(--olo-space-4);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 52ch;
}

/* ── Light / Dark Mode (nur Einstellungen) ── */

.olo-theme-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--olo-space-3);
  max-width: 560px;
}

.olo-theme-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  min-height: 148px;
  border: 1.5px solid var(--border);
  border-radius: var(--olo-radius);
  background: var(--card-bg);
  box-shadow: var(--olo-shadow-sm);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  transition:
    border-color var(--olo-transition-fast),
    box-shadow var(--olo-transition-fast),
    transform var(--olo-transition-fast),
    background-color var(--olo-transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.olo-theme-mode-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--olo-shadow-md);
  transform: translateY(-2px);
}

.olo-theme-mode-card:focus-visible {
  outline: none;
  border-color: var(--olo-accent-border);
  box-shadow: var(--focus-ring), var(--olo-shadow-md);
}

.olo-theme-mode-card.is-active {
  border-color: var(--olo-accent-border);
  background: var(--olo-accent-subtle);
  box-shadow: var(--olo-shadow-md), 0 0 0 1px var(--olo-accent-border);
}

.olo-theme-mode-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: var(--olo-radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
  min-height: 72px;
  box-sizing: border-box;
}

.olo-theme-mode-preview--light {
  background: linear-gradient(180deg, #f8f9fc 0%, #eef1f7 100%);
}

.olo-theme-mode-preview--dark {
  background: linear-gradient(180deg, #1a1d26 0%, #12151c 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

.olo-theme-mode-preview__bar {
  height: 8px;
  border-radius: 999px;
  width: 42%;
}

.olo-theme-mode-preview--light .olo-theme-mode-preview__bar {
  background: rgba(130, 122, 245, 0.55);
}

.olo-theme-mode-preview--dark .olo-theme-mode-preview__bar {
  background: rgba(130, 122, 245, 0.75);
}

.olo-theme-mode-preview__card {
  height: 14px;
  border-radius: 4px;
  width: 88%;
}

.olo-theme-mode-preview--light .olo-theme-mode-preview__card {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.olo-theme-mode-preview--light .olo-theme-mode-preview__card--muted {
  width: 64%;
  background: #e8ebf2;
}

.olo-theme-mode-preview--dark .olo-theme-mode-preview__card {
  background: #2a2f3a;
}

.olo-theme-mode-preview--dark .olo-theme-mode-preview__card--muted {
  width: 64%;
  background: #22262f;
}

.olo-theme-mode-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 28px;
}

.olo-theme-mode-card__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.olo-theme-mode-card__hint {
  font-size: 12px;
  color: var(--muted);
}

.olo-theme-mode-card__check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--olo-check-bg);
  color: var(--olo-check-text);
  border: 2px solid var(--olo-check-border);
  box-shadow: var(--olo-shadow-xs);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity var(--olo-transition-fast),
    transform var(--olo-transition-fast);
}

.olo-theme-mode-card.is-active .olo-theme-mode-card__check {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 560px) {
  .olo-theme-mode-picker {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* ── Akzentfarbe-Auswahl (SaaS / Premium) ── */

.olo-accent-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--olo-space-4);
  max-width: 720px;
}

.olo-accent-swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 18px 12px 16px;
  min-height: 156px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--olo-radius-card);
  background: var(--card-bg);
  box-shadow: var(--olo-shadow-sm);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition:
    border-color var(--olo-transition),
    box-shadow var(--olo-transition),
    transform var(--olo-transition),
    background-color var(--olo-transition);
  -webkit-tap-highlight-color: transparent;
}

.olo-accent-swatch:hover {
  border-color: var(--border-strong);
  box-shadow: var(--olo-shadow-md);
  transform: translateY(-3px);
}

.olo-accent-swatch:focus-visible {
  outline: none;
  border-color: var(--olo-accent-border);
  box-shadow: var(--focus-ring), var(--olo-shadow-md);
}

.olo-accent-swatch__ring {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 84px;
  height: 84px;
  margin-left: -42px;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 0 0 transparent;
  transition:
    opacity var(--olo-transition),
    box-shadow var(--olo-transition),
    transform var(--olo-transition);
  pointer-events: none;
}

.olo-accent-swatch__color {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 22px rgba(0, 0, 0, 0.14);
  transition:
    transform var(--olo-transition),
    box-shadow var(--olo-transition);
}

.olo-accent-swatch__color--neutral {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 22px rgba(0, 0, 0, 0.1);
}

body.dark-mode .olo-accent-swatch__color {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 26px rgba(0, 0, 0, 0.42);
}

body.dark-mode .olo-accent-swatch__color--neutral {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 26px rgba(0, 0, 0, 0.38);
}

.olo-accent-swatch:hover .olo-accent-swatch__color {
  transform: scale(1.04);
}

.olo-accent-swatch__label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1.3;
}

.olo-accent-swatch__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--olo-check-bg);
  color: var(--olo-check-text);
  border: 2px solid var(--olo-check-border);
  box-shadow: var(--olo-shadow-xs);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity var(--olo-transition-fast),
    transform var(--olo-transition-fast);
}

.olo-accent-swatch.is-active {
  border-color: var(--olo-accent-border);
  background: var(--olo-accent-subtle);
  box-shadow:
    var(--olo-shadow-md),
    0 0 0 1px var(--olo-accent-border);
  transform: translateY(-2px);
}

.olo-accent-swatch.is-active .olo-accent-swatch__ring {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--olo-accent-soft), 0 0 20px var(--olo-accent-glow);
}

.olo-accent-swatch.is-active .olo-accent-swatch__color {
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 10px 28px var(--olo-accent-glow);
}

.olo-accent-swatch.is-active .olo-accent-swatch__check {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 1100px) {
  .olo-accent-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }
}

@media (max-width: 834px) {
  .olo-accent-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--olo-space-3);
  }

  .olo-accent-swatch {
    min-height: 148px;
    padding: 16px 10px 14px;
  }

  .olo-accent-swatch__color {
    width: 68px;
    height: 68px;
  }

  .olo-accent-swatch__ring {
    width: 76px;
    height: 76px;
    margin-left: -38px;
  }
}

@media (max-width: 720px) {
  .olo-accent-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .olo-accent-picker {
    grid-template-columns: 1fr;
  }

  .olo-accent-swatch {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    min-height: 0;
    padding: 14px 16px;
  }

  .olo-accent-swatch__ring {
    top: 50%;
    left: 58px;
    margin-top: -38px;
    margin-left: -38px;
  }

  .olo-accent-swatch__label {
    text-align: left;
    flex: 1;
  }
}

.settings-toggle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--olo-radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg-soft);
  margin-bottom: 6px;
  transition: border-color var(--olo-transition-fast), background-color var(--olo-transition-fast);
}

.settings-toggle-row:hover {
  border-color: var(--border-strong);
  background: var(--card-bg);
}
.settings-toggle-row:last-child { margin-bottom: 0; }

.settings-toggle-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.settings-toggle-help {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.45;
}

.settings-switch {
  width: 18px;
  height: 18px;
  accent-color: var(--olo-accent);
  cursor: pointer;
}

.supplier-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.supplier-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--olo-radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg-soft);
  transition: border-color var(--olo-transition-fast);
}

.supplier-checkbox:hover { border-color: var(--border-strong); }

.supplier-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--olo-accent);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 12px;
}

.settings-field { min-width: 0; }

.settings-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hint);
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.settings-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--olo-radius-sm);
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-text);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color var(--olo-transition-fast), box-shadow var(--olo-transition-fast);
}

.settings-input:focus {
  outline: none;
  border-color: var(--control-border-focus);
  box-shadow: var(--focus-ring);
}

/* ── Responsive ── */

@media (max-width: 1100px) {
  .dashboard-main {
    grid-template-columns: 1fr;
    gap: var(--olo-space-5);
  }
  .dashboard-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .dashboard-menu-btn {
    justify-content: center;
    text-align: center;
    min-height: 50px;
    font-size: 14px;
    padding: 0 12px;
    letter-spacing: 0;
  }
  .dashboard-menu-btn::before { display: none; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .supplier-checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .anamnesis-row {
    grid-template-columns: minmax(0, 2.65fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 0.82fr) 36px;
  }
}

@media (max-width: 900px) {
  .dashboard-shell { padding: 18px 18px 48px; }
  .anamnesis-row {
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.9fr) minmax(0, 0.98fr) minmax(0, 0.78fr) 34px;
    gap: 8px;
    padding: 11px 12px;
  }
}

@media (max-width: 834px) {
  .dashboard-shell { padding: 14px 14px 40px; }
  .dashboard-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .dashboard-menu-btn {
    min-height: 46px;
    font-size: 14px;
  }
  .anamnesis-row--head {
    display: none;
  }

  .anamnesis-row--item {
    grid-template-columns: minmax(0, 1fr) auto 32px;
    grid-template-rows: auto auto auto;
    gap: 8px 10px;
    align-items: start;
    padding: 12px;
  }

  .anamnesis-cell--kunde {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
  }

  .anamnesis-input--order-name {
    min-width: 0;
    width: 100%;
    height: 44px;
    font-size: 15px;
    padding: 0 14px;
  }

  .anamnesis-cell--editor {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    align-self: start;
  }

  .anamnesis-cell--datum {
    grid-column: 1;
    grid-row: 3;
    font-size: 12px;
    color: var(--muted);
  }

  .anamnesis-cell--status {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
  }

  .anamnesis-cell--aktion {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  .dashboard-top { padding-bottom: 16px; margin-bottom: 20px; }
  .dashboard-header-badges { max-width: calc(100% - 180px); }
}

@media (max-width: 640px) {
  .dashboard-menu { grid-template-columns: 1fr; }
  .supplier-checkbox-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

@media (max-width: 834px) and (orientation: portrait) {
  .dashboard-staff-dropdown {
    min-width: min(300px, calc(100vw - 32px));
    max-height: min(360px, 45vh);
  }

  .dashboard-staff-button__name {
    max-width: min(200px, 36vw);
  }
}

@media (max-width: 480px) {
  .dashboard-settings-text { display: none; }
  .dashboard-header-badges {
    max-width: 100%;
    position: static;
    margin-bottom: 12px;
    justify-content: center;
  }

  .dashboard-account-label .account-label,
  .dashboard-staff-button {
    font-size: 11px;
  }

  .dashboard-staff-dropdown {
    left: 50%;
    transform: translateX(-50%);
  }
}
