:root {
  color-scheme: dark;
  --bg: #06070c;
  --surface: #0d121a;
  --panel: #0d121a;
  --surface-soft: #111b25;
  --text: #effff8;
  --muted: #91aaa6;
  --line: #213745;
  --accent: #00f5a0;
  --accent-strong: #00d7ff;
  --accent-warm: #78b7dc;
  --accent-cool: #79c99b;
  --call-accent: #78b7dc;
  --fahrdienst-accent: #79c99b;
  --grid: rgba(0, 215, 255, 0.08);
  --shadow: 0 24px 70px rgba(0, 245, 160, 0.12);
  --radius: 8px;
  --max-width: 1180px;
  --field-bg: #121d26;
  --field-bg-strong: #172630;
  --field-text: #f8fffb;
  --field-muted: #a9bfbb;
  --field-border: #355262;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e3ebf0;
  --surface: #ffffff;
  --panel: #ffffff;
  --surface-soft: #d8e3e8;
  --text: #0b1118;
  --muted: #344b5a;
  --line: #91a7b5;
  --accent: #00b67a;
  --accent-strong: #007d9f;
  --accent-warm: #2f7fad;
  --accent-cool: #2f8c5d;
  --call-accent: #2f7fad;
  --fahrdienst-accent: #2f8c5d;
  --grid: rgba(0, 125, 159, 0.11);
  --shadow: 0 20px 48px rgba(30, 55, 75, 0.16);
  --field-bg: #ffffff;
  --field-bg-strong: #f3f7f6;
  --field-text: #0b1118;
  --field-muted: #4d6170;
  --field-border: #7f97a8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(135deg, rgba(0, 245, 160, 0.07), transparent 34%),
    var(--bg);
  background-attachment: fixed;
  background-size: 44px 44px, 44px 44px, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.026) 0,
    rgba(255, 255, 255, 0.026) 1px,
    transparent 1px,
    transparent 7px
  );
  mix-blend-mode: screen;
}

body > * {
  position: relative;
  z-index: 1;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  color: var(--field-text);
  caret-color: var(--accent-strong);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
select,
textarea {
  background-color: var(--field-bg);
}

input::placeholder,
textarea::placeholder {
  color: var(--field-muted);
  opacity: 1;
}

select option {
  background: var(--field-bg-strong);
  color: var(--field-text);
}

.site-header,
.section,
.site-footer {
  width: min(calc(100% - 32px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 72px;
  margin-top: 16px;
  padding: 12px 14px 12px 18px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(0, 245, 160, 0.05), 0 18px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  justify-content: center;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #07120d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 950;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 42%, transparent);
}

.main-nav,
.header-left-actions,
.header-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.main-nav {
  justify-content: center;
  gap: 26px;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.site-footer a:hover {
  color: var(--accent-strong);
}

.header-left-actions {
  position: absolute;
  left: 14px;
  gap: 10px;
}

.header-actions {
  position: absolute;
  right: 14px;
  gap: 10px;
}

.top-action-button {
  min-height: 34px;
  padding: 8px 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 999px;
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 12%, transparent);
}

.header-left-actions a[href*="area=1"] {
  border-color: color-mix(in srgb, var(--call-accent) 48%, var(--line));
  box-shadow: 0 0 20px color-mix(in srgb, var(--call-accent) 13%, transparent);
}

.header-left-actions a[href*="area=3"] {
  border-color: color-mix(in srgb, var(--fahrdienst-accent) 48%, var(--line));
  box-shadow: 0 0 20px color-mix(in srgb, var(--fahrdienst-accent) 13%, transparent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-weight: 850;
  cursor: pointer;
}

.button {
  color: #07120d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: 1px solid transparent;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 46px color-mix(in srgb, var(--accent-strong) 32%, transparent);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line);
  box-shadow: none;
}

.button-danger {
  color: var(--text);
  background: color-mix(in srgb, var(--danger, #ff5d6c) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--danger, #ff5d6c) 52%, var(--line));
  box-shadow: none;
}

.icon-button,
.menu-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(0, 215, 255, 0.04);
}

.icon-button {
  position: relative;
}

.sun-icon,
.moon-icon {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: opacity 180ms ease, transform 180ms ease;
}

.sun-icon {
  background: var(--accent-cool);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-cool) 22%, transparent);
}

.moon-icon {
  opacity: 0;
  transform: translateX(4px);
  background: var(--text);
  box-shadow: -6px 0 0 0 var(--surface-soft);
}

:root[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: translateX(-4px);
}

:root[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: translateX(0);
}

.menu-button {
  display: none;
  gap: 4px;
}

.menu-button span {
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: 0;
}

.section-heading p,
.imprint-card p,
.legal-card p {
  color: var(--muted);
}

.access-button,
.call-duty-panel,
.employee-directory-panel,
.imprint-card,
.legal-card,
.dialog-card {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.access-button::before,
.call-duty-panel::before,
.employee-directory-panel::before,
.imprint-card::before,
.legal-card::before,
.dialog-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--accent-strong), var(--accent-warm));
}

.section {
  padding: clamp(64px, 9vw, 98px) 0;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 28px;
  text-align: center;
}

.section-heading h1,
.section-heading h2 {
  font-size: clamp(2.1rem, 4.5vw, 4rem);
}

.heading-stack {
  display: grid;
  justify-content: center;
  gap: 22px;
}

.heading-stack .button {
  justify-self: center;
}

.button-large {
  min-height: 58px;
  padding: 0 30px;
  font-size: 1.08rem;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

.access-button {
  --area-color: var(--accent);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 190px;
  padding: 22px;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.access-button::before {
  background: linear-gradient(90deg, var(--area-color), color-mix(in srgb, var(--area-color) 64%, #ffffff), var(--area-color));
}

.area-red {
  --area-color: var(--call-accent);
}

.area-blue {
  --area-color: var(--call-accent);
}

.area-cyan {
  --area-color: var(--call-accent);
}

.area-yellow {
  --area-color: var(--fahrdienst-accent);
}

.area-green {
  --area-color: var(--fahrdienst-accent);
}

.access-button:not(.access-disabled):hover,
.access-button:not(.access-disabled):focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--area-color) 60%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--area-color) 22%, transparent), 0 24px 58px rgba(0, 0, 0, 0.22);
}

.access-split {
  align-content: stretch;
  justify-items: stretch;
  gap: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.access-split-link {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 0;
  padding: 14px 18px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.access-split-link + .access-split-link {
  border-top: 1px solid color-mix(in srgb, var(--area-color) 42%, var(--line));
}

.access-split-link:hover,
.access-split-link:focus-visible {
  background: color-mix(in srgb, var(--area-color) 13%, transparent);
  outline: none;
}

.employee-split {
  --area-color: var(--accent);
}

.employee-split::before {
  background: linear-gradient(90deg, var(--call-accent), color-mix(in srgb, var(--call-accent) 42%, var(--fahrdienst-accent)), var(--fahrdienst-accent));
}

.employee-split .access-split-link {
  --area-color: var(--accent);
}

.employee-split .access-split-link + .access-split-link {
  border-top-color: color-mix(in srgb, var(--call-accent) 45%, var(--fahrdienst-accent));
}

.employee-hub {
  --area-color: var(--accent);
  order: 4;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-content: stretch;
  justify-items: stretch;
  gap: 0;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.employee-hub::before {
  background: linear-gradient(90deg, var(--call-accent), color-mix(in srgb, var(--call-accent) 42%, var(--fahrdienst-accent)), var(--fahrdienst-accent));
}

.employee-hub--no-testphase {
  grid-template-rows: 1fr;
}

.employee-hub--no-testphase .employee-hub-main {
  height: 100%;
}

.employee-hub-title,
.employee-hub-main,
.employee-hub-links,
.employee-hub-testphase {
  position: relative;
  z-index: 1;
}

.employee-hub-main {
  display: grid;
  align-content: center;
  gap: 13px;
  min-height: 0;
  padding: 17px 22px 16px;
  background:
    radial-gradient(circle at 50% 78%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%),
    linear-gradient(135deg, color-mix(in srgb, var(--call-accent) 13%, transparent), color-mix(in srgb, var(--fahrdienst-accent) 14%, transparent));
}

.employee-hub-title {
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 0;
  color: var(--text);
  font-size: clamp(1.16rem, 1.8vw, 1.52rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 28%, transparent);
}

.employee-hub-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
}

.employee-hub-link {
  position: relative;
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 6px 10px;
  color: #041418;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--area-color) 78%, #ffffff), color-mix(in srgb, var(--area-color) 62%, #ffffff));
  border: 1px solid color-mix(in srgb, var(--area-color) 58%, transparent);
  border-radius: 8px;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--area-color) 16%, transparent);
  transition: background 180ms ease, transform 180ms ease;
}

.employee-hub-link + .employee-hub-link {
  border-top: 1px solid color-mix(in srgb, var(--area-color) 58%, transparent);
}

.employee-hub-link span {
  color: inherit;
  font-size: clamp(0.78rem, 0.95vw, 0.92rem);
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.employee-hub-link:hover,
.employee-hub-link:focus-visible {
  background: linear-gradient(135deg, color-mix(in srgb, var(--area-color) 86%, #ffffff), color-mix(in srgb, var(--area-color) 68%, #ffffff));
  outline: none;
}

.employee-hub-testphase {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 0;
  padding: 14px 22px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  border-top: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  transition: background 180ms ease, color 180ms ease;
}

.employee-hub-testphase:hover,
.employee-hub-testphase:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: none;
}

.employee-hub-testphase .access-kicker {
  color: color-mix(in srgb, var(--accent) 78%, #ffffff);
  font-size: clamp(0.8rem, 1vw, 0.95rem);
}

.employee-hub-testphase strong {
  font-size: clamp(1.12rem, 1.72vw, 1.48rem);
}

.testphase-card {
  --area-color: var(--fahrdienst-accent);
}

@media (min-width: 1121px) {
  .employee-hub {
    grid-column: 4;
    grid-row: 1;
  }
}

.testphase-page-card {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2vw, 22px);
}

.testphase-page-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.testphase-page-head h1 {
  margin-bottom: 5px;
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.testphase-page-head p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-weight: 760;
}

.testphase-empty {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--fahrdienst-accent) 6%, var(--surface-soft));
}

.testphase-empty strong {
  color: var(--text);
  font-size: 1.05rem;
}

.testphase-empty p {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.testphase-case-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.testphase-case-section + .testphase-case-section {
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 22%, var(--line));
}

.testphase-case-section-head {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.testphase-case-section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

.testphase-case-section-head p:not(.eyebrow) {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 760;
}

.testphase-case-section-head > strong {
  display: inline-flex;
  min-width: 44px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--fahrdienst-accent) 68%, var(--text));
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--fahrdienst-accent) 10%, var(--surface));
}

.testphase-case-section-archive {
  opacity: 0.9;
}

.testphase-case-section-archive .testphase-transfer-card {
  border-color: color-mix(in srgb, var(--muted) 24%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--muted) 7%, transparent), transparent),
    color-mix(in srgb, var(--surface-soft) 90%, transparent);
}

.testphase-case-grid {
  display: grid;
  gap: 10px;
}

.testphase-transfer-card {
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 36%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--fahrdienst-accent) 8%, transparent), transparent),
    color-mix(in srgb, var(--surface-soft) 88%, transparent);
  overflow: hidden;
}

.testphase-transfer-summary {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(220px, 1.35fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.testphase-transfer-summary::-webkit-details-marker {
  display: none;
}

.testphase-transfer-summary::after {
  content: "Mehr";
  grid-column: 3;
  justify-self: end;
  align-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.testphase-transfer-card[open] .testphase-transfer-summary::after {
  content: "Weniger";
}

.testphase-transfer-main,
.testphase-transfer-location {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.testphase-transfer-main span,
.testphase-transfer-main small,
.testphase-transfer-location small,
.testphase-info-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.testphase-transfer-main strong {
  color: var(--text);
  font-size: clamp(1.3rem, 2.1vw, 2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.testphase-transfer-location {
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 30%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.testphase-transfer-location strong {
  color: var(--text);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.testphase-status-pill {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  padding: 7px 11px;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 46%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--fahrdienst-accent) 14%, var(--surface));
}

.testphase-status-open {
  color: color-mix(in srgb, var(--text) 90%, var(--muted));
}

.testphase-status-moving {
  color: #ecfeff;
  border-color: color-mix(in srgb, var(--accent-cool) 58%, var(--line));
  background: color-mix(in srgb, #0e7490 62%, var(--surface));
}

.testphase-status-done {
  color: #f0fdf4;
  border-color: color-mix(in srgb, #22c55e 58%, var(--line));
  background: color-mix(in srgb, #166534 68%, var(--surface));
}

.testphase-transfer-detail {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 18%, var(--line));
}

.testphase-transfer-card:not([open]) .testphase-transfer-detail {
  display: none;
}

.testphase-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.testphase-info-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 24%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.testphase-info-wide {
  grid-column: 1 / -1;
}

.testphase-info-item strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.testphase-info-item span {
  color: var(--muted);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.testphase-info-status {
  border-color: color-mix(in srgb, var(--fahrdienst-accent) 44%, var(--line));
}

.testphase-status-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.testphase-status-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
}

.testphase-status-select-moving {
  color: #ecfeff;
  border-color: color-mix(in srgb, var(--accent-cool) 58%, var(--line));
  background: color-mix(in srgb, #0e7490 62%, var(--surface));
}

.testphase-status-select-done {
  color: #f0fdf4;
  border-color: color-mix(in srgb, #22c55e 58%, var(--line));
  background: color-mix(in srgb, #166534 68%, var(--surface));
}

.testphase-status-form .button {
  min-height: 40px;
  padding: 8px 12px;
  white-space: nowrap;
}

.testphase-route-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.testphase-route-button {
  background: linear-gradient(135deg, var(--fahrdienst-accent), var(--accent-cool));
}

.testphase-route-missing {
  padding: 10px 12px;
  color: #92400e;
  font-weight: 900;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fef3c7;
}

:root[data-theme="light"] .testphase-transfer-card,
:root[data-theme="light"] .testphase-info-item {
  background-color: rgba(255, 255, 255, 0.82);
}

.access-placeholder {
  cursor: default;
}

.access-placeholder:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.split-disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.split-disabled::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background: rgba(125, 135, 142, 0.62);
  backdrop-filter: grayscale(1) brightness(0.76);
}

.split-disabled .access-kicker,
.split-disabled strong {
  opacity: 0.42;
}

.split-state {
  right: 14px;
  bottom: 12px;
}

.split-work-state {
  top: 12px;
  right: 12px;
}

.access-split-link .access-kicker {
  font-size: clamp(0.78rem, 1vw, 0.98rem);
}

.access-split-link strong {
  font-size: clamp(1.08rem, 1.6vw, 1.6rem);
}

.access-finder-dialer .access-split-link {
  padding: 15px 18px;
}

.access-dialer-group {
  cursor: default;
}

.access-dialer-group:hover,
.access-dialer-group:focus-visible {
  background: transparent;
}

.dialer-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(230px, 100%);
  margin-top: 3px;
}

.dialer-choice {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 36px;
  padding: 6px 10px;
  color: #041418;
  font-size: 0.92rem;
  font-weight: 950;
  text-decoration: none;
  background: color-mix(in srgb, var(--area-color) 84%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--area-color) 64%, #ffffff);
  border-radius: 8px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--area-color) 16%, transparent);
}

.dialer-choice:hover,
.dialer-choice:focus-visible {
  background: color-mix(in srgb, var(--area-color) 72%, #ffffff);
  outline: none;
}

.dialer-choice-disabled {
  color: rgba(255, 255, 255, 0.72);
  cursor: not-allowed;
  background: rgba(125, 135, 142, 0.36);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.dialer-choice-disabled small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.access-kicker {
  display: block;
  max-width: 100%;
  color: color-mix(in srgb, var(--area-color) 82%, #ffffff);
  font-size: clamp(0.9rem, 1.25vw, 1.08rem);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.access-button strong {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: clamp(1.28rem, 2vw, 1.95rem);
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
  text-shadow: 0 0 28px color-mix(in srgb, var(--area-color) 34%, transparent);
}

.access-dialer-group strong {
  font-size: clamp(1.2rem, 1.8vw, 1.8rem);
}

.access-button > .access-kicker,
.access-button > strong {
  position: relative;
  z-index: 1;
}

.access-disabled {
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.6);
}

.access-placeholder {
  cursor: default;
}

.access-placeholder:hover,
.access-placeholder:focus-visible {
  transform: none;
}

.access-disabled::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  content: "";
  background: rgba(125, 135, 142, 0.62);
  backdrop-filter: grayscale(1) brightness(0.76);
}

.access-disabled .access-kicker,
.access-disabled strong {
  opacity: 0.42;
}

.access-state {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  padding: 7px 11px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(33, 39, 44, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.access-work-state {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  padding: 7px 11px;
  color: #07120d;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--area-color) 84%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--area-color) 62%, #ffffff);
  border-radius: 999px;
  box-shadow: 0 0 24px color-mix(in srgb, var(--area-color) 22%, transparent);
}

.call-duty-panel {
  --area-color: var(--call-accent);
  grid-column: 1 / span 2;
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 458px;
  padding: 30px;
  color: var(--text);
  background:
    radial-gradient(circle at 22% 0%, color-mix(in srgb, var(--area-color) 20%, transparent), transparent 38%),
    color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--area-color) 62%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 22px 58px color-mix(in srgb, var(--area-color) 14%, transparent);
}

.call-duty-panel::before {
  background: linear-gradient(90deg, var(--area-color), color-mix(in srgb, var(--area-color) 64%, #ffffff), var(--area-color));
}

.drive-duty-panel {
  --area-color: var(--fahrdienst-accent);
  grid-column: 3 / span 2;
}

.call-duty-title {
  display: grid;
  gap: 8px;
}

.call-duty-title span {
  color: var(--area-color);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.call-duty-title strong {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.95;
}

.call-duty-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.call-duty-block {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 260px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.call-duty-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: uppercase;
}

.call-duty-list {
  display: grid;
  gap: 10px;
}

.call-duty-list p {
  margin: 0;
  color: var(--muted);
}

.call-duty-entry {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--area-color) 28%, var(--line));
  border-radius: 8px;
}

.call-duty-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: start;
}

.call-duty-entry-head strong {
  font-size: 1.1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.call-duty-entry-head span,
.call-duty-time {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.call-duty-entry-head span {
  max-width: 18ch;
  text-align: right;
  white-space: normal;
}

.call-duty-phone {
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

a.call-duty-phone {
  text-decoration: none;
}

a.call-duty-phone:hover {
  color: var(--area-color);
}

.call-duty-updated {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.employee-directory-panel {
  --area-color: var(--accent-strong);
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.employee-directory-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
}

.employee-directory-head div {
  display: grid;
  gap: 4px;
}

.employee-directory-head span {
  color: var(--area-color);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.employee-directory-head strong {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.employee-directory-head label {
  display: grid;
  gap: 6px;
  width: min(360px, 100%);
  color: var(--muted);
  font-weight: 800;
}

.employee-directory-head input {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.employee-directory-head input:focus {
  border-color: var(--area-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--area-color) 18%, transparent);
}

.employee-directory-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.employee-directory-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.employee-directory-table th,
.employee-directory-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.employee-directory-table th {
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.045);
}

.employee-directory-table td {
  color: var(--text);
  font-weight: 750;
}

.employee-directory-table td:nth-child(2),
.employee-directory-table td:nth-child(3) {
  color: var(--muted);
}

.employee-directory-table tr:last-child td {
  border-bottom: 0;
}

.employee-directory-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.password-dialog {
  width: min(calc(100% - 32px), 480px);
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.password-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.dialog-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.dialog-card h2 {
  margin: 0;
  line-height: 1.1;
}

.dialog-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

.dialog-card input {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.password-field input {
  min-height: 54px;
}

.password-toggle {
  min-width: 112px;
  min-height: 54px;
  padding: 0 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 92%, #ffffff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 850;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #07120d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.dialog-card input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-strong) 18%, transparent);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.dialog-status {
  min-height: 24px;
  margin: 0;
  color: var(--accent-strong);
  font-weight: 850;
}

.imprint-section {
  padding-top: 36px;
}

.imprint-card,
.legal-card {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 34px);
}

.imprint-card p,
.legal-card p {
  margin: 0 0 18px;
}

.imprint-card p:last-child,
.legal-card p:last-child {
  margin-bottom: 0;
}

.imprint-card strong,
.legal-card strong,
.legal-card h2 {
  color: var(--text);
}

.legal-card h2 {
  margin: 30px 0 10px;
  font-size: 1.25rem;
}

.legal-card ul {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--muted);
}

.legal-card li {
  line-height: 1.55;
}

.action-card {
  display: grid;
  justify-items: start;
  gap: 16px;
}

.imprint-card a,
.legal-card a {
  color: var(--accent-strong);
  overflow-wrap: anywhere;
}

.legal-card .button {
  color: #07120d;
}

.site-footer {
  justify-content: space-between;
  gap: 14px;
  padding: 30px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.cookie-withdraw-link {
  appearance: none;
  padding: 0 18px 0 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  border: 0;
  border-right: 1px solid currentColor;
  cursor: pointer;
}

.cookie-withdraw-link:hover,
.cookie-withdraw-link:focus-visible {
  color: var(--accent-strong);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .access-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .call-duty-panel {
    grid-column: 1 / span 2;
  }

  .drive-duty-panel {
    grid-column: 1 / span 2;
  }
}

@media (max-width: 1040px) {
  .main-nav {
    position: fixed;
    top: 96px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 11px 8px;
  }

  .menu-button {
    display: grid;
  }

  .access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .call-duty-panel {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .drive-duty-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .password-field {
    grid-template-columns: 1fr;
  }

  .password-toggle {
    width: 100%;
  }

  .site-header {
    width: min(calc(100% - 20px), var(--max-width));
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    min-height: 66px;
    margin-top: 10px;
  }

  .header-left-actions,
  .header-actions {
    position: static;
    justify-content: center;
    flex-wrap: wrap;
  }

  .brand span:last-child {
    display: inline;
  }

  .section,
  .site-footer {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .access-grid {
    grid-template-columns: 1fr;
  }

  .employee-hub,
  .testphase-card {
    grid-column: 1;
    grid-row: auto;
  }

  .call-duty-panel {
    grid-column: 1;
    padding: 22px;
  }

  .drive-duty-panel {
    grid-column: 1;
  }

  .call-duty-content {
    grid-template-columns: 1fr;
  }
}

.top-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.top-link:hover,
.top-link:focus-visible {
  color: var(--accent);
}

.top-link.top-action-button {
  color: var(--text);
}

.top-link.top-action-button:hover,
.top-link.top-action-button:focus-visible {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

.top-link.top-action-button.is-active {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.access-button {
  color: var(--text);
  text-decoration: none;
}

.access-login-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.login-access-button {
  grid-column: 2 / span 2;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #07120d;
  text-decoration: none;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.22);
}

.login-section {
  min-height: 56vh;
  display: grid;
  place-items: center;
}

.login-card-page {
  width: min(420px, 100%);
}

.login-device-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.login-device-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 850;
}

.login-device-option {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  cursor: pointer;
}

.login-device-option input {
  grid-row: span 2;
  width: 18px;
  height: 18px;
}

.login-device-option span {
  color: var(--text);
  font-weight: 900;
}

.login-device-option small {
  color: var(--muted);
  font-weight: 760;
}

.login-card-page h1,
.admin-section h1 {
  margin: 0;
}

.admin-tab-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: var(--shadow-soft);
}

.admin-tab-button {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 14px;
  color: var(--muted);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.admin-tab-button strong {
  color: var(--text);
  font-size: 0.98rem;
}

.admin-tab-button span {
  font-size: 0.76rem;
  font-weight: 750;
}

.admin-tab-button:hover {
  border-color: color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
}

.admin-tab-button.is-active {
  color: color-mix(in srgb, var(--accent-cool) 74%, var(--text));
  border-color: color-mix(in srgb, var(--accent-cool) 58%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-cool) 15%, var(--surface-soft)), var(--surface-soft));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-cool) 12%, transparent);
}

.admin-tab-button.is-active strong {
  color: var(--text);
}

.admin-section [data-admin-tab-panel][hidden] {
  display: none !important;
}

.account-heading {
  display: grid;
  gap: 18px;
  justify-content: center;
  max-width: 520px;
  text-align: left;
}

.admin-top-grid {
  display: block;
  margin-bottom: 18px;
}

.admin-top-grid .account-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  max-width: none;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow-soft);
}

.admin-maintenance-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.admin-email-reminder-card {
  grid-column: 1 / -1;
  gap: 10px;
  border-color: color-mix(in srgb, #ef4444 55%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, #ef4444 9%, var(--panel)), var(--panel));
}

.admin-email-reminder-card.is-enabled {
  border-color: color-mix(in srgb, #22c55e 58%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, #22c55e 9%, var(--panel)), var(--panel));
}

.admin-email-reminder-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.admin-email-reminder-head h2,
.admin-email-reminder-card p {
  margin: 0;
}

.admin-setting-state {
  display: inline-flex;
  min-width: 64px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  color: #fee2e2;
  border: 1px solid #ef4444;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.38);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.admin-email-reminder-card.is-enabled .admin-setting-state {
  color: #dcfce7;
  border-color: #22c55e;
  background: rgba(20, 83, 45, 0.4);
}

.admin-email-reminder-form {
  display: flex;
  justify-content: flex-start;
}

.admin-setting-enable {
  color: #052e16;
  border-color: #22c55e;
  background: linear-gradient(135deg, #86efac, #22c55e);
}

.admin-setting-disable {
  color: #ffffff;
  border-color: #ef4444;
  background: linear-gradient(135deg, #991b1b, #dc2626);
}

:root[data-theme="light"] .admin-email-reminder-card {
  border-color: #c85b5b;
  background: linear-gradient(135deg, #fff0f0, #ffffff);
}

:root[data-theme="light"] .admin-email-reminder-card.is-enabled {
  border-color: #3b9560;
  background: linear-gradient(135deg, #edf9f1, #ffffff);
}

:root[data-theme="light"] .admin-setting-state {
  color: #7f1d1d;
  background: #fee2e2;
}

:root[data-theme="light"] .admin-email-reminder-card.is-enabled .admin-setting-state {
  color: #14532d;
  background: #dcfce7;
}

.admin-panel-heading {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-panel-heading h2,
.admin-panel-heading p {
  margin: 0;
}

.admin-panel-heading > p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.account-picker {
  display: grid;
  gap: 6px;
  width: min(520px, 100%);
  color: var(--muted);
  font-weight: 700;
}

.account-picker select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.account-picker select option {
  color: #111827;
}

.admin-account-actions {
  display: grid;
  grid-template-columns: auto minmax(260px, 340px);
  gap: 12px;
  align-items: end;
  width: auto;
}

.admin-account-actions .button {
  width: 100%;
  min-height: 48px;
  white-space: nowrap;
}

.account-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.account-search input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

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

.admin-accounts-grid {
  grid-template-columns: 1fr;
}

.profile-grid {
  grid-template-columns: repeat(3, minmax(260px, 360px));
  justify-content: start;
}

.profile-card-main {
  grid-column: 1;
}

.profile-card-password {
  grid-column: 2;
}

.profile-card-phone {
  grid-column: 3;
  width: auto;
}

.admin-card {
  display: grid;
  gap: 14px;
  max-width: none;
  margin: 0;
}

.admin-side-stack,
.storage-restore-stack {
  display: grid;
  gap: 14px;
  align-items: start;
}

.storage-restore-card {
  gap: 9px;
  padding: 14px;
}

.storage-restore-card--call {
  --area-color: var(--call-accent);
}

.storage-restore-card--fahrdienst {
  --area-color: var(--fahrdienst-accent);
}

.storage-restore-card--call::before,
.storage-restore-card--fahrdienst::before {
  background: linear-gradient(90deg, var(--area-color), color-mix(in srgb, var(--area-color) 54%, #ffffff), var(--area-color));
}

.storage-restore-card--call h2,
.storage-restore-card--fahrdienst h2 {
  color: color-mix(in srgb, var(--area-color) 70%, var(--text));
}

.storage-restore-card h2 {
  margin: 0;
  font-size: 0.98rem;
}

.storage-path-box {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.storage-path-box span,
.storage-path-box small {
  font-size: 0.73rem;
  font-weight: 800;
}

.storage-path-box code {
  color: var(--text);
  font-size: 0.74rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.storage-restore-form {
  gap: 6px;
}

.storage-restore-form label {
  gap: 5px;
  font-size: 0.86rem;
}

.storage-restore-form select {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.storage-restore-form .button {
  min-height: 34px;
  font-size: 0.9rem;
}

.tagebuch-recovery-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.tagebuch-recovery-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tagebuch-recovery-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tagebuch-recovery-item strong,
.tagebuch-recovery-item span,
.tagebuch-recovery-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tagebuch-recovery-item strong {
  color: var(--text);
  font-size: 0.92rem;
}

.tagebuch-recovery-item span,
.tagebuch-recovery-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.tagebuch-recovery-item .button {
  min-height: 36px;
  padding: 8px 10px;
  white-space: nowrap;
}


.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.admin-form textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
  font: inherit;
}

.admin-form select option {
  color: #111827;
}

.announcement-admin-card {
  align-self: start;
  width: min(820px, 100%);
  min-height: 220px;
}

.announcement-form {
  gap: 10px;
}

.announcement-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.announcement-actions .button {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
}

.announcement-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dialer-section {
  padding-top: clamp(20px, 4vw, 42px);
}

.dialer-standalone-body {
  min-height: 100vh;
  background: var(--bg);
}

.dialer-standalone-body::before {
  display: none;
}

.dialer-standalone-body .dialer-section {
  width: min(1060px, calc(100% - 24px));
  padding: 22px 0 34px;
}

.dialer-standalone-shell {
  display: block;
  min-height: auto;
}

.dialer-standalone-card {
  width: 100%;
  max-height: none;
  overflow: visible;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, #000000), color-mix(in srgb, var(--surface) 98%, #000000));
  border: 1px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dialer-standalone-card .bestatter-modal-head {
  position: static;
  margin-bottom: 4px;
  cursor: default;
}

.dialer-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dialer-toolbar h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dialer-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(420px, 1.35fr);
  gap: 18px;
  align-items: start;
}

.dialer-side-column {
  display: grid;
  gap: 18px;
}

.dialer-panel {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  box-shadow: var(--shadow);
}

.dialer-primary-panel {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.dialer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialer-panel-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialer-panel-head strong {
  color: var(--text);
  font-size: 1.3rem;
}

.dialer-form,
.dialer-detail-grid {
  display: grid;
  gap: 12px;
}

.dialer-form label,
.dialer-detail-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.dialer-form input,
.dialer-form select,
.dialer-form textarea,
.dialer-detail-grid input,
.dialer-detail-grid textarea,
.dialer-search-row input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dialer-case-number-field {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.dialer-case-number-field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialer-case-number-field strong {
  color: var(--text);
  font-size: 1.05rem;
}

.dialer-form textarea,
.dialer-detail-grid textarea {
  resize: vertical;
}

.dialer-form-actions,
.dialer-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.dialer-empty-state {
  display: grid;
  gap: 8px;
  min-height: 190px;
  align-content: center;
  padding: 22px;
  color: var(--muted);
  border: 1px dashed color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.dialer-empty-state strong {
  color: var(--text);
}

.dialer-case-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dialer-case-count {
  display: grid;
  gap: 4px;
  min-height: 86px;
  align-content: center;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dialer-case-count:hover,
.dialer-case-count:focus-visible,
.dialer-case-count.is-active {
  border-color: color-mix(in srgb, var(--accent-strong) 58%, var(--line));
  background: color-mix(in srgb, var(--accent-strong) 12%, transparent);
  outline: none;
}

.dialer-case-count:hover,
.dialer-case-count:focus-visible {
  transform: translateY(-2px);
}

.dialer-case-count span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialer-case-count strong {
  color: var(--text);
  font-size: 2rem;
}

.dialer-info-panel {
  border-color: color-mix(in srgb, var(--accent-cool) 34%, var(--line));
}

.dialer-info-form {
  display: grid;
  gap: 10px;
}

.dialer-info-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.dialer-info-form input,
.dialer-info-form textarea,
.dialer-info-form select,
.dialer-info-edit-form input,
.dialer-info-edit-form select {
  width: 100%;
  padding: 12px;
  color: var(--text);
  line-height: 1.45;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
}

.dialer-info-form textarea {
  min-height: 112px;
  max-height: 260px;
  resize: vertical;
}

.dialer-info-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.dialer-info-actions small {
  color: var(--muted);
  line-height: 1.35;
}

.dialer-info-post-list {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

.dialer-info-post-list > p {
  margin: 0;
  color: var(--muted);
}

.dialer-info-post {
  display: grid;
  gap: 8px;
  padding: 12px;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.dialer-info-post p {
  margin: 0;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dialer-info-post small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.dialer-info-post-footer {
  display: grid;
  gap: 8px;
}

.dialer-info-edit {
  display: grid;
  gap: 8px;
}

.dialer-info-edit summary {
  width: fit-content;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--accent-strong);
  font-weight: 900;
  list-style: none;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  cursor: pointer;
}

.dialer-info-edit summary::-webkit-details-marker {
  display: none;
}

.dialer-info-edit-form {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.dialer-info-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

.dialer-info-edit-form textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px;
  color: var(--text);
  line-height: 1.45;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  resize: vertical;
}

.call-notes-section {
  max-width: var(--max-width);
}

.call-notes-panel {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.call-notes-search {
  display: grid;
  gap: 6px;
  width: min(340px, 100%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.call-notes-search input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 850;
  text-transform: none;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
  outline: none;
}

.call-notes-search input:focus {
  border-color: var(--accent-cool);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-cool) 18%, transparent);
}

.call-notes-panel .dialer-info-post-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.call-notes-panel .dialer-info-post-list > p,
.call-notes-empty {
  grid-column: 1 / -1;
}

.call-notes-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-weight: 900;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
}

.call-notes-panel .dialer-info-post {
  gap: 7px;
  min-width: 0;
  padding: 10px 12px;
  cursor: pointer;
  outline: none;
}

.call-notes-panel .dialer-info-post:focus-visible {
  border-color: var(--accent-cool);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-cool) 18%, transparent);
}

.call-notes-panel .dialer-info-post p {
  font-size: 0.95rem;
  line-height: 1.36;
}

.call-notes-panel .dialer-info-post small {
  font-size: 0.74rem;
}

.call-notes-subject {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.24;
}

.call-notes-panel .dialer-info-form {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  align-items: end;
}

.call-notes-panel .dialer-info-form label:first-of-type {
  grid-column: 1;
}

.call-notes-panel .dialer-info-form label:nth-of-type(2) {
  grid-column: 1 / -1;
}

.call-notes-panel .dialer-info-form label:nth-of-type(3) {
  grid-column: 2;
  grid-row: 1;
}

.call-notes-panel .dialer-info-form textarea {
  min-height: 82px;
}

.call-notes-panel .dialer-info-actions {
  grid-column: 1 / -1;
}

.call-notes-panel .dialer-info-edit summary {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.call-notes-entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.call-notes-entry-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.call-notes-color-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.call-notes-color-neutral {
  border-left: 5px solid color-mix(in srgb, var(--muted) 58%, var(--line));
}

.call-notes-color-gelb {
  border-left: 5px solid #facc15;
  background: color-mix(in srgb, #facc15 10%, var(--surface-soft));
}

.call-notes-color-rot {
  border-left: 5px solid #ef4444;
  background: color-mix(in srgb, #ef4444 10%, var(--surface-soft));
}

.call-notes-color-blau {
  border-left: 5px solid #38bdf8;
  background: color-mix(in srgb, #38bdf8 10%, var(--surface-soft));
}

.call-notes-color-gruen {
  border-left: 5px solid #22c55e;
  background: color-mix(in srgb, #22c55e 10%, var(--surface-soft));
}

.call-notes-color-pill-neutral {
  background: color-mix(in srgb, var(--muted) 12%, var(--surface));
}

.call-notes-color-pill-gelb {
  color: #2f2200;
  background: #fde68a;
  border-color: #facc15;
}

.call-notes-color-pill-rot {
  color: #fff7f7;
  background: #dc2626;
  border-color: #ef4444;
}

.call-notes-color-pill-blau {
  color: #06263a;
  background: #7dd3fc;
  border-color: #38bdf8;
}

.call-notes-color-pill-gruen {
  color: #052e16;
  background: #86efac;
  border-color: #22c55e;
}

.call-notes-sort-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
}

.call-notes-sort-actions form {
  margin: 0;
}

.call-notes-sort-actions .button {
  width: 34px;
  min-height: 30px;
  padding: 5px 6px;
  font-size: 0.98rem;
}

.call-notes-sort-actions .button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
  transform: none;
}

.call-notes-entry-actions {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  margin-top: 2px;
  padding: 7px;
  background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-cool) 20%, var(--line));
  border-radius: 8px;
}

.dialer-info-post.is-actions-visible .call-notes-entry-actions,
.dialer-info-post:focus-within .call-notes-entry-actions {
  display: flex;
}

.call-notes-delete-form {
  margin: 0 0 0 auto;
}

.call-notes-entry-actions .dialer-info-edit[open] {
  flex-basis: 100%;
  order: 10;
}

.call-notes-entry-actions .dialer-info-edit[open] summary {
  margin-bottom: 8px;
}

.call-notes-entry-actions .dialer-info-edit[open] + .call-notes-sort-actions {
  order: 1;
}

.call-notes-entry-actions .dialer-info-edit[open] ~ .call-notes-delete-form {
  order: 2;
}

.call-notes-delete-form .button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .call-notes-panel .dialer-info-post-list,
  .call-notes-panel .dialer-info-form {
    grid-template-columns: 1fr;
  }

  .call-notes-panel .dialer-info-form label:first-of-type,
  .call-notes-panel .dialer-info-form label:nth-of-type(2),
  .call-notes-panel .dialer-info-form label:nth-of-type(3),
  .call-notes-panel .dialer-info-actions {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Dashboard im hellen Modus: klare Ebenen und Abgrenzungen wie im dunklen Design. */
:root[data-theme="light"] .dashboard-content-grid {
  gap: 16px;
}

:root[data-theme="light"] .dashboard-duty-card,
:root[data-theme="light"] .dashboard-side-card,
:root[data-theme="light"] .dashboard-table-card {
  border-width: 2px;
  border-style: solid;
  border-radius: 10px;
  box-shadow:
    0 14px 32px rgba(30, 55, 75, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

:root[data-theme="light"] .dashboard-duty-card-call {
  background: linear-gradient(180deg, #f8fbff, #edf5fb);
  border-color: #5f8fb3;
  border-top: 4px solid #2563a8;
}

:root[data-theme="light"] .dashboard-duty-card-drive {
  background: linear-gradient(180deg, #f8fcfa, #edf7f1);
  border-color: #5f9678;
  border-top: 4px solid #238050;
}

:root[data-theme="light"] .dashboard-side-card {
  background: linear-gradient(180deg, #fbfcfd, #eef3f6);
  border-color: #7c94a5;
  border-top: 4px solid #526f84;
}

:root[data-theme="light"] .dashboard-open-orders-card {
  background: linear-gradient(180deg, #fbfdfc, #eef7f2);
  border-color: #5f9678;
  border-top: 4px solid #238050;
}

:root[data-theme="light"] .dashboard-card-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #b3c2cc;
}

:root[data-theme="light"] .dashboard-duty-card-call .dashboard-card-head {
  border-bottom-color: #9ebbd1;
}

:root[data-theme="light"] .dashboard-duty-card-drive .dashboard-card-head,
:root[data-theme="light"] .dashboard-open-orders-card .dashboard-card-head {
  border-bottom-color: #9fc2ad;
}

:root[data-theme="light"] .dashboard-card-head h2 {
  color: #081a2c;
  font-weight: 950;
}

:root[data-theme="light"] .dashboard-card-head span,
:root[data-theme="light"] .dashboard-duty-columns small,
:root[data-theme="light"] .dashboard-table-count {
  color: #344b5e;
}

:root[data-theme="light"] .dashboard-duty-columns {
  gap: 12px;
}

:root[data-theme="light"] .dashboard-duty-columns > div {
  padding: 11px;
  background: #e9f0f4;
  border: 2px solid #879eae;
  border-radius: 9px;
  box-shadow:
    inset 0 1px 3px rgba(30, 55, 75, 0.1),
    0 4px 10px rgba(30, 55, 75, 0.06);
}

:root[data-theme="light"] .dashboard-duty-card-call .dashboard-duty-columns > div {
  background: #e9f2f8;
  border-color: #7fa5c0;
}

:root[data-theme="light"] .dashboard-duty-card-drive .dashboard-duty-columns > div {
  background: #e9f3ed;
  border-color: #7da58e;
}

:root[data-theme="light"] .dashboard-duty-card .call-duty-list {
  gap: 9px;
}

:root[data-theme="light"] .dashboard-duty-card .call-duty-entry {
  padding: 10px;
  color: #102033;
  background: #ffffff;
  border: 1px solid #9aafbd;
  border-left-width: 4px;
  border-radius: 7px;
  box-shadow: 0 3px 9px rgba(30, 55, 75, 0.09);
}

:root[data-theme="light"] .dashboard-duty-card-call .call-duty-entry {
  border-left-color: #2f72ad;
}

:root[data-theme="light"] .dashboard-duty-card-drive .call-duty-entry {
  border-left-color: #2b8557;
}

:root[data-theme="light"] .dashboard-duty-card .call-duty-entry-head strong,
:root[data-theme="light"] .dashboard-duty-card .call-duty-phone {
  color: #071827;
  font-weight: 950;
}

:root[data-theme="light"] .dashboard-duty-card .call-duty-entry-head span,
:root[data-theme="light"] .dashboard-duty-card .call-duty-time,
:root[data-theme="light"] .dashboard-duty-card .call-duty-updated {
  color: #40566a;
}

:root[data-theme="light"] .dashboard-live-list li {
  padding-inline: 7px;
  background: #ffffff;
  border-top: 1px solid #a6b6c1;
}

:root[data-theme="light"] .dashboard-table-wrap {
  border: 1px solid #8fa4b3;
  border-radius: 8px;
  background: #ffffff;
}

:root[data-theme="light"] .dashboard-table th {
  color: #172e42;
  background: #d7e2e9;
  border-color: #8fa4b3;
}

:root[data-theme="light"] .dashboard-table td {
  color: #102033;
  background: #ffffff;
  border-color: #a9bac5;
}

:root[data-theme="light"] .dashboard-table tbody tr:nth-child(even) td {
  background: #edf3f6;
}

:root[data-theme="light"] .dashboard-table tbody tr:hover td {
  background: #dfedf5;
}

.dialer-info-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dialer-info-status {
  display: grid;
  gap: 6px;
  min-height: 82px;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
}

.dialer-info-status span,
.dialer-info-list > span,
.dialer-info-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialer-info-status strong {
  color: var(--text);
  font-size: 1.65rem;
}

.dialer-info-status-offen {
  border-color: color-mix(in srgb, var(--accent-cool) 42%, var(--line));
}

.dialer-info-status-bestatter_nicht_erreicht {
  background: color-mix(in srgb, #7f1d1d 18%, var(--surface-soft));
  border-color: color-mix(in srgb, #ef4444 48%, var(--line));
}

.dialer-info-status-in_klaerung {
  background: color-mix(in srgb, #92400e 16%, var(--surface-soft));
  border-color: color-mix(in srgb, #f59e0b 48%, var(--line));
}

.dialer-info-status-fertig {
  background: color-mix(in srgb, #166534 18%, var(--surface-soft));
  border-color: color-mix(in srgb, #22c55e 48%, var(--line));
}

.dialer-info-list {
  display: grid;
  gap: 9px;
}

.dialer-info-list p {
  margin: 0;
  color: var(--muted);
}

.dialer-info-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.dialer-info-item:hover,
.dialer-info-item:focus-visible {
  border-color: color-mix(in srgb, var(--accent-strong) 58%, var(--line));
  background: color-mix(in srgb, var(--accent-strong) 9%, var(--surface));
  outline: none;
  transform: translateY(-1px);
}

.dialer-info-item strong {
  color: var(--text);
}

.dialer-info-item small {
  color: var(--muted);
  line-height: 1.4;
}

.dialer-case-list {
  display: grid;
  gap: 10px;
}

.dialer-call-card {
  --dialer-card-bg: color-mix(in srgb, var(--surface) 92%, #ffffff 8%);
  --dialer-card-field-bg: rgba(255, 255, 255, 0.03);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--dialer-card-bg);
  background-size: 28px 28px, 28px 28px, auto;
  overflow: hidden;
}

.dialer-call-card:nth-child(even) {
  --dialer-card-bg: color-mix(in srgb, var(--surface-soft) 84%, #ffffff 16%);
  --dialer-card-field-bg: rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] .dialer-call-card {
  --dialer-card-bg: #ffffff;
  --dialer-card-field-bg: rgba(255, 255, 255, 0.66);
}

:root[data-theme="light"] .dialer-call-card:nth-child(even) {
  --dialer-card-bg: #edf1f0;
  --dialer-card-field-bg: rgba(255, 255, 255, 0.78);
}

.dialer-call-card[open] {
  border-color: color-mix(in srgb, var(--accent-strong) 58%, var(--line));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--accent-strong) 12%, transparent);
}

.dialer-call-front {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 270px);
  gap: 10px;
  align-items: start;
  padding: 10px;
  cursor: pointer;
  list-style: none;
}

.dialer-call-front::-webkit-details-marker {
  display: none;
}

.dialer-call-left,
.dialer-call-actions {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.dialer-call-left {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dialer-call-main,
.dialer-call-meta,
.dialer-call-deceased,
.dialer-call-location,
.dialer-call-person,
.dialer-call-subject,
.dialer-call-package,
.dialer-call-status,
.dialer-call-totenschein,
.dialer-call-number,
.dialer-drive-sms {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  background: var(--dialer-card-field-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
}

.dialer-call-main {
  grid-column: 1 / -1;
  grid-row: 1;
}

.dialer-call-subject {
  grid-column: 1;
  grid-row: 4;
}

.dialer-call-package {
  grid-column: 2;
  grid-row: 4;
}

.dialer-call-status {
  grid-column: auto;
  grid-row: auto;
  align-content: center;
  min-height: 0;
}

.dialer-call-main,
.dialer-call-deceased,
.dialer-call-location,
.dialer-call-subject,
.dialer-call-package {
  min-height: 58px;
}

.dialer-call-person {
  min-height: 78px;
}

.dialer-status-select,
.dialer-totenschein-select,
.dialer-transporter-select {
  width: 100%;
  min-width: 160px;
  min-height: 42px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
  box-shadow: none;
  cursor: pointer;
  text-shadow: none;
}

.dialer-totenschein-select {
  min-width: 190px;
  min-height: 50px;
  padding: 10px 14px;
  font-size: 1.05rem;
}

.dialer-status-select.is-saving,
.dialer-totenschein-select.is-saving,
.dialer-transporter-select.is-saving {
  opacity: 0.72;
}

.dialer-status-select.is-error,
.dialer-totenschein-select.is-error,
.dialer-transporter-select.is-error {
  outline: 2px solid #ef4444;
}

.dialer-status-offen {
  border-color: color-mix(in srgb, var(--accent-cool) 44%, var(--line));
}

.dialer-status-bestatter_nicht_erreicht {
  color: #fff7ed;
  background: color-mix(in srgb, #7f1d1d 68%, var(--surface));
  border-color: color-mix(in srgb, #ef4444 62%, var(--line));
}

.dialer-status-in_klaerung {
  color: #fff7ed;
  background: color-mix(in srgb, #92400e 64%, var(--surface));
  border-color: color-mix(in srgb, #f59e0b 62%, var(--line));
}

.dialer-status-fertig {
  color: #f0fdf4;
  background: color-mix(in srgb, #166534 68%, var(--surface));
  border-color: color-mix(in srgb, #22c55e 66%, var(--line));
}

.dialer-totenschein-unbekannt {
  border-color: color-mix(in srgb, var(--accent-cool) 44%, var(--line));
}

.dialer-totenschein-ja {
  color: #f0fdf4;
  background: color-mix(in srgb, #166534 68%, var(--surface));
  border-color: color-mix(in srgb, #22c55e 66%, var(--line));
}

.dialer-totenschein-nein {
  color: #fff7ed;
  background: color-mix(in srgb, #7f1d1d 68%, var(--surface));
  border-color: color-mix(in srgb, #ef4444 62%, var(--line));
}

.dialer-call-transporter {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  background: var(--dialer-card-field-bg);
  border: 1px solid color-mix(in srgb, var(--accent-cool) 22%, var(--line));
  border-radius: 8px;
}

.dialer-transporter-nicht_erreicht {
  color: #fff7ed;
  background: color-mix(in srgb, #92400e 64%, var(--surface));
  border-color: color-mix(in srgb, #f59e0b 62%, var(--line));
}

.dialer-transporter-erreicht {
  color: #f0fdf4;
  background: color-mix(in srgb, #166534 68%, var(--surface));
  border-color: color-mix(in srgb, #22c55e 66%, var(--line));
}

.dialer-transporter-in_ueberfuehrung {
  color: #ecfeff;
  background: color-mix(in srgb, #0e7490 66%, var(--surface));
  border-color: color-mix(in srgb, var(--accent-cool) 66%, var(--line));
}

.dialer-transporter-keine_ueberfuehrung {
  color: #f8fafc;
  background: color-mix(in srgb, #475569 72%, var(--surface));
  border-color: color-mix(in srgb, #94a3b8 64%, var(--line));
}

.dialer-call-main span,
.dialer-call-meta span,
.dialer-call-assigned span,
.dialer-call-deceased span,
.dialer-call-location span,
.dialer-call-person span,
.dialer-call-subject span,
.dialer-call-package span,
.dialer-call-status span,
.dialer-call-totenschein span,
.dialer-call-number span,
.dialer-call-transporter span,
.dialer-call-detail-grid span,
.dialer-call-note span,
.dialer-call-questions > span,
.dialer-call-bestatter > span,
.dialer-bestatter-preview-head span,
.dialer-bestatter-preview-help small,
.dialer-bestatter-preview-questions > small,
.dialer-bestatter-data-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialer-call-main strong,
.dialer-call-deceased strong,
.dialer-call-location strong,
.dialer-call-person strong,
.dialer-call-subject strong,
.dialer-call-package strong,
.dialer-call-status strong,
.dialer-call-number strong,
.dialer-call-detail-grid strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: break-word;
}

.dialer-call-assigned strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.dialer-category-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow-wrap: anywhere;
}

.dialer-category-sterbefall {
  color: #fecaca;
  border-color: color-mix(in srgb, #ef4444 58%, var(--line));
  background: color-mix(in srgb, #7f1d1d 42%, var(--surface));
}

.dialer-category-rechnung {
  color: #dbeafe;
  border-color: color-mix(in srgb, #60a5fa 58%, var(--line));
  background: color-mix(in srgb, #1d4ed8 34%, var(--surface));
}

.dialer-category-termin {
  color: #fef3c7;
  border-color: color-mix(in srgb, #f59e0b 62%, var(--line));
  background: color-mix(in srgb, #92400e 38%, var(--surface));
}

.dialer-category-rueckruf {
  color: #dcfce7;
  border-color: color-mix(in srgb, #22c55e 58%, var(--line));
  background: color-mix(in srgb, #166534 38%, var(--surface));
}

.dialer-category-sonstiges {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}

.dialer-call-package {
  border-color: color-mix(in srgb, var(--accent-cool) 34%, var(--line));
}

.dialer-call-package small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.3;
}

.dialer-call-package.is-covered {
  border-color: color-mix(in srgb, #22c55e 62%, var(--line));
  background: color-mix(in srgb, #166534 18%, var(--dialer-card-field-bg));
}

.dialer-call-package.is-covered small {
  color: #86efac;
}

.dialer-call-package.is-outside {
  border-color: color-mix(in srgb, #ef4444 64%, var(--line));
  background: color-mix(in srgb, #7f1d1d 22%, var(--dialer-card-field-bg));
}

.dialer-call-package.is-outside small {
  color: #fecaca;
}

.dialer-call-package.is-unknown {
  border-color: color-mix(in srgb, #f59e0b 60%, var(--line));
  background: color-mix(in srgb, #92400e 16%, var(--dialer-card-field-bg));
}

.dialer-call-package.is-unknown small {
  color: #fde68a;
}

:root[data-theme="light"] .dialer-call-package.is-covered small {
  color: #166534;
}

:root[data-theme="light"] .dialer-call-package.is-outside small {
  color: #991b1b;
}

:root[data-theme="light"] .dialer-call-package.is-unknown small {
  color: #92400e;
}

.dialer-call-meta-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.dialer-call-meta {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  padding: 7px 9px;
}

.dialer-call-meta strong {
  grid-column: 1;
  min-width: 0;
  color: var(--text);
  font-size: 0.86rem;
  overflow-wrap: break-word;
}

.dialer-call-meta time {
  grid-column: 1;
  grid-row: auto;
  align-self: start;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: normal;
}

.dialer-call-meta .dialer-call-update-label {
  margin-top: 6px;
}

.dialer-call-meta small {
  color: color-mix(in srgb, var(--muted) 92%, var(--text));
  font-size: 0.72rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dialer-call-person {
  grid-column: 1 / -1;
  grid-row: 3;
  grid-template-columns: minmax(0, 1fr);
}

.dialer-call-deceased {
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr);
}

.dialer-call-location {
  grid-column: 1 / -1;
  grid-row: 3;
  grid-template-columns: minmax(0, 1fr);
  border-color: color-mix(in srgb, var(--fahrdienst-accent) 42%, var(--line));
  background: color-mix(in srgb, var(--fahrdienst-accent) 8%, var(--dialer-card-field-bg));
}

.dialer-call-left.has-location .dialer-call-person {
  grid-row: 4;
}

.dialer-call-left.has-location .dialer-call-subject,
.dialer-call-left.has-location .dialer-call-package {
  grid-row: 5;
}

.dialer-call-deceased strong,
.dialer-call-location strong,
.dialer-call-person strong {
  font-weight: 750;
}

.dialer-call-main small,
.dialer-call-location small,
.dialer-call-person small {
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: break-word;
}

.dialer-call-actions {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 8px;
  align-self: start;
  justify-self: stretch;
  min-width: 142px;
}

.dialer-call-edit-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dialer-call-edit-panel .button,
.dialer-case-delete-form {
  min-width: 170px;
}

.dialer-case-delete-form {
  display: grid;
}

.dialer-case-delete-button {
  width: 100%;
  color: #fecaca;
  background: color-mix(in srgb, #7f1d1d 72%, var(--surface));
  border-color: color-mix(in srgb, #ef4444 62%, var(--line));
}

.dialer-case-delete-button:hover,
.dialer-case-delete-button:focus-visible {
  color: #ffffff;
  background: color-mix(in srgb, #991b1b 82%, var(--surface));
  border-color: #ef4444;
}

.dialer-case-modal-delete-form {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

.dialer-case-modal-delete-form .dialer-case-delete-button {
  width: min(260px, 100%);
}

.dialer-call-actions .button {
  justify-self: stretch;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  text-align: center;
}

.dialer-call-number {
  border-color: color-mix(in srgb, var(--accent-cool) 30%, var(--line));
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
}

.dialer-call-number strong {
  font-size: 1.05rem;
}

.dialer-call-card.is-sms-open {
  position: relative;
  z-index: 30;
  overflow: visible;
}

.dialer-drive-sms {
  position: relative;
  padding: 0;
  background: transparent;
  border: 0;
}

.dialer-drive-sms-toggle {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #07120d;
  font-weight: 950;
  cursor: pointer;
  background: linear-gradient(135deg, var(--fahrdienst-accent), color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--accent-cool)));
  border-color: color-mix(in srgb, var(--fahrdienst-accent) 40%, var(--line));
  border-style: solid;
  border-width: 1px;
  border-radius: 8px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--fahrdienst-accent) 16%, transparent);
}

.dialer-drive-sms-toggle::after {
  content: "v";
  margin-left: 8px;
  font-size: 0.8rem;
}

.dialer-drive-sms.is-open .dialer-drive-sms-toggle::after {
  content: "^";
}

.dialer-drive-sms-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  width: min(310px, calc(100vw - 36px));
  max-height: 360px;
  gap: 8px;
  padding: 10px;
  overflow: auto;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    color-mix(in srgb, var(--surface) 94%, var(--fahrdienst-accent) 6%);
  background-size: 28px 28px, 28px 28px, auto;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 50%, var(--line));
  border-radius: 8px;
  box-shadow: 0 18px 44px color-mix(in srgb, #000 28%, transparent);
}

.dialer-drive-sms-panel[hidden] {
  display: none;
}

.dialer-drive-sms-panel > strong {
  color: color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--text));
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialer-drive-sms-panel > small {
  color: var(--muted);
  font-weight: 750;
}

.dialer-drive-sms-list {
  display: grid;
  gap: 6px;
}

.dialer-drive-sms-person {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 8px;
  color: var(--text);
  text-decoration: none;
  background: color-mix(in srgb, var(--surface) 86%, var(--fahrdienst-accent));
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 46%, var(--line));
  border-radius: 7px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dialer-drive-sms-person:hover,
.dialer-drive-sms-person:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--line));
  background: color-mix(in srgb, var(--fahrdienst-accent) 18%, var(--surface));
}

.dialer-drive-sms-person strong {
  font-size: 0.92rem;
  font-weight: 900;
}

.dialer-drive-sms-person small,
.dialer-drive-sms-person em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.dialer-drive-sms-person.is-disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.dialer-drive-sms-person.is-disabled:hover,
.dialer-drive-sms-person.is-disabled:focus-visible {
  transform: none;
}

.dialer-call-detail {
  display: grid;
  gap: 14px;
  padding: 0 14px 14px;
}

.dialer-call-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dialer-call-detail-grid > div,
.dialer-call-note,
.dialer-call-questions,
.dialer-call-bestatter,
.dialer-bestatter-preview {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dialer-call-note p,
.dialer-call-questions p,
.dialer-bestatter-help,
.dialer-bestatter-preview-help p,
.dialer-bestatter-preview-questions p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  overflow-wrap: anywhere;
}

.dialer-call-signature {
  display: block;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-style: italic;
  overflow-wrap: anywhere;
}

.dialer-bestatter-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dialer-bestatter-data-grid > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.dialer-bestatter-data-grid strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.dialer-bestatter-readiness {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--fahrdienst-accent) 10%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.dialer-bestatter-readiness[hidden] {
  display: none;
}

.dialer-bestatter-readiness-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.dialer-bestatter-readiness-head small,
.dialer-bestatter-readiness-grid small,
.dialer-bestatter-readiness-note small {
  color: color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--text));
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dialer-bestatter-readiness-head strong {
  color: var(--text);
}

.dialer-bestatter-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dialer-bestatter-readiness-grid > div,
.dialer-bestatter-readiness-note {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 26%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.dialer-bestatter-readiness-grid strong,
.dialer-bestatter-readiness-note p {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.dialer-bestatter-readiness-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.dialer-bestatter-preview {
  border-color: color-mix(in srgb, var(--accent-cool) 42%, var(--line));
  background: color-mix(in srgb, var(--accent-cool) 8%, transparent);
}

.dialer-bestatter-preview[hidden] {
  display: none;
}

.dialer-bestatter-preview-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  justify-content: space-between;
}

.dialer-bestatter-preview-head strong {
  color: var(--text);
}

.dialer-bestatter-preview-help {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.dialer-bestatter-preview-help[hidden] {
  display: none;
}

.dialer-bestatter-preview-questions {
  display: grid;
  gap: 7px;
}

.dialer-call-questions ul,
.dialer-bestatter-preview-questions ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.dialer-call-questions li,
.dialer-bestatter-preview-questions li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 22%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.dialer-call-questions li strong,
.dialer-bestatter-preview-questions li strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.dialer-call-questions li small,
.dialer-bestatter-preview-questions li span {
  color: var(--muted);
  font-weight: 850;
}

.dialer-case-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 0.9fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.dialer-case-card div {
  display: grid;
  gap: 4px;
}

.dialer-case-card strong {
  color: var(--text);
}

.dialer-case-card span,
.dialer-case-card small,
.dialer-case-card time {
  color: var(--muted);
}

.dialer-case-card time {
  justify-self: end;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 800;
}

.dialer-case-edit {
  justify-self: end;
  min-height: 36px;
  padding: 8px 12px;
}

.dialer-case-email {
  border-color: color-mix(in srgb, #ef4444 56%, var(--line));
}

.dialer-email-not_sent,
.dialer-email-error {
  color: #fecaca;
  background: color-mix(in srgb, #7f1d1d 72%, var(--surface));
  border-color: color-mix(in srgb, #ef4444 62%, var(--line));
}

.dialer-email-sent {
  color: #dcfce7;
  background: color-mix(in srgb, #166534 76%, var(--surface));
  border-color: color-mix(in srgb, #22c55e 68%, var(--line));
}

.dialer-case-email.is-sending {
  color: var(--text);
  background: color-mix(in srgb, var(--accent-cool) 30%, var(--surface));
  border-color: color-mix(in srgb, var(--accent-cool) 56%, var(--line));
}

.dialer-email-reminder-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  align-items: center;
  padding: 9px 10px;
  color: var(--text);
  border: 1px solid color-mix(in srgb, #f59e0b 48%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, #92400e 18%, var(--surface-soft));
  cursor: pointer;
}

.dialer-email-reminder-toggle input {
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #16a34a;
}

.dialer-email-reminder-toggle span {
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.2;
}

.dialer-email-reminder-toggle small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
}

.dialer-email-reminder-toggle.is-checked {
  border-color: color-mix(in srgb, #22c55e 64%, var(--line));
  background: color-mix(in srgb, #166534 28%, var(--surface-soft));
}

.dialer-email-reminder-toggle.is-saving {
  opacity: 0.65;
  cursor: wait;
}

:root[data-theme="light"] .dialer-email-reminder-toggle {
  color: #3f2b08;
  border-color: #c98a20;
  background: #fff3cf;
}

:root[data-theme="light"] .dialer-email-reminder-toggle.is-checked {
  color: #14532d;
  border-color: #24935a;
  background: #dcfce7;
}

.dialer-email-update-fields {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  color: var(--text);
  border: 1px solid color-mix(in srgb, #f59e0b 58%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, #92400e 16%, var(--surface-soft));
}

.dialer-email-update-fields[hidden] {
  display: none;
}

.dialer-form-update-fields {
  grid-column: 1 / -1;
}

.dialer-form-update-fields > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.dialer-email-update-fields legend {
  padding: 0 5px;
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.25;
}

.dialer-email-update-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.dialer-call-detail > .dialer-email-update-fields {
  width: 100%;
  box-sizing: border-box;
}

.dialer-email-update-options label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  cursor: pointer;
}

.dialer-email-update-options label:has(input:checked) {
  border-color: color-mix(in srgb, #22c55e 68%, var(--line));
  background: color-mix(in srgb, #166534 30%, var(--surface));
}

.dialer-email-update-options input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #16a34a;
}

.dialer-email-update-options span,
.dialer-email-update-note span {
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.25;
}

.dialer-email-update-note {
  display: grid;
  gap: 5px;
}

.dialer-email-update-note textarea {
  min-height: 64px;
  resize: vertical;
}

.dialer-email-update-error {
  color: #fecaca;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.3;
}

.dialer-email-update-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 2px;
}

.dialer-email-update-actions > small {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
}

.dialer-email-update-save.button {
  min-width: 240px;
  border-color: color-mix(in srgb, #10b981 72%, var(--line));
  background: linear-gradient(135deg, #0f9f77, #0891b2);
  color: #f7fffc;
  box-shadow: 0 8px 20px color-mix(in srgb, #059669 22%, transparent);
}

.dialer-email-update-save.button:hover,
.dialer-email-update-save.button:focus-visible {
  border-color: #34d399;
  background: linear-gradient(135deg, #0e8f6d, #087f9d);
  color: #fff;
}

.dialer-email-update-save.button.is-dirty {
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px color-mix(in srgb, #f59e0b 22%, transparent), 0 8px 20px color-mix(in srgb, #059669 22%, transparent);
}

.dialer-email-update-save.button.is-saving {
  cursor: wait;
  opacity: 0.78;
}

.dialer-update-history {
  display: grid;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid color-mix(in srgb, #38bdf8 48%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, #075985 13%, var(--surface-soft));
}

.dialer-update-history[hidden] {
  display: none;
}

.dialer-update-history > header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, #38bdf8 34%, var(--line));
}

.dialer-update-history > header div {
  display: grid;
  gap: 2px;
}

.dialer-update-history > header span {
  color: #7dd3fc;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialer-update-history > header h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.dialer-update-history > header > strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, #38bdf8 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #0369a1 20%, var(--surface));
  color: #bae6fd;
  font-size: 0.72rem;
}

.dialer-update-history ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dialer-update-history-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-left: 4px solid #22c55e;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.dialer-update-history-meta {
  display: flex;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.dialer-update-history-meta strong {
  color: var(--text);
  font-size: 0.78rem;
}

.dialer-update-history-meta span,
.dialer-update-history-legacy {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.dialer-update-history-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.dialer-update-history-tags span {
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, #34d399 48%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #166534 25%, var(--surface));
  color: #bbf7d0;
  font-size: 0.69rem;
  font-weight: 850;
  line-height: 1.2;
}

.dialer-update-history-note,
.dialer-update-history-legacy {
  margin: 0;
}

.dialer-update-history-note {
  padding: 8px 9px;
  border-left: 3px solid #f59e0b;
  border-radius: 5px;
  background: color-mix(in srgb, #92400e 16%, var(--surface-soft));
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre-wrap;
}

:root[data-theme="light"] .dialer-email-update-fields {
  color: #172033;
  border-color: #b7791f;
  background: #fff7df;
}

:root[data-theme="light"] .dialer-email-update-fields legend {
  color: #8a4b08;
}

:root[data-theme="light"] .dialer-email-update-options label {
  border-color: #c9d4df;
  background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .dialer-email-update-options label:has(input:checked) {
  border-color: #24935a;
  background: #dcfce7;
}

:root[data-theme="light"] .dialer-email-update-error {
  color: #b91c1c;
}

:root[data-theme="light"] .dialer-email-update-actions > small {
  color: #526274;
}

:root[data-theme="light"] .dialer-email-update-save.button {
  border-color: #087f5b;
  background: linear-gradient(135deg, #087f5b, #087a99);
  color: #fff;
  box-shadow: 0 8px 18px rgba(4, 120, 87, 0.18);
}

:root[data-theme="light"] .dialer-email-update-save.button:hover,
:root[data-theme="light"] .dialer-email-update-save.button:focus-visible {
  background: linear-gradient(135deg, #076c4e, #066780);
}

:root[data-theme="light"] .dialer-update-history {
  border-color: #6ca7c7;
  background: #eef7fb;
}

:root[data-theme="light"] .dialer-update-history > header {
  border-color: #b5d3e3;
}

:root[data-theme="light"] .dialer-update-history > header span {
  color: #075985;
}

:root[data-theme="light"] .dialer-update-history > header > strong {
  border-color: #7cb2cf;
  background: #dceff8;
  color: #123f59;
}

:root[data-theme="light"] .dialer-update-history-item {
  border-color: #c5d7e2;
  border-left-color: #16834c;
  background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="light"] .dialer-update-history-tags span {
  border-color: #68a982;
  background: #dcf3e5;
  color: #14532d;
}

:root[data-theme="light"] .dialer-update-history-note {
  border-left-color: #b7680b;
  background: #fff6de;
  color: #3f2b12;
}

@media (max-width: 980px) {
  .dialer-email-update-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dialer-email-update-options {
    grid-template-columns: 1fr;
  }

  .dialer-email-update-actions,
  .dialer-email-update-save.button {
    width: 100%;
  }
}

.dialer-uesn-state {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.dialer-uesn-state span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.dialer-uesn-state.is-yes span {
  background: #22c55e;
}

.dialer-uesn-state.is-no span {
  background: #ef4444;
}

.dialer-case-modal {
  width: min(1040px, calc(100vw - 32px));
}

.dialer-case-modal.dialer-standalone-card {
  width: 100%;
}

.dialer-case-modal .dialer-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.dialer-field-wide,
.dialer-case-modal .dialer-sterbefall-note,
.dialer-case-modal .dialer-bestatter-preview,
.dialer-case-modal .dialer-assist-box,
.dialer-case-modal .dialer-modal-actions {
  grid-column: 1 / -1;
}

.dialer-form [hidden],
.dialer-sterbefall-note[hidden],
.dialer-bestatter-preview[hidden] {
  display: none !important;
}

.dialer-death-location-field {
  gap: 7px;
}

.dialer-death-location-field small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.dialer-sterbefall-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  color: color-mix(in srgb, var(--text) 92%, #f59e0b);
  border: 1px solid color-mix(in srgb, #f59e0b 62%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, #f59e0b 18%, transparent), transparent),
    color-mix(in srgb, #f59e0b 8%, var(--surface));
}

.dialer-sterbefall-note strong {
  color: #f59e0b;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialer-sterbefall-note span {
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  font-weight: 850;
  line-height: 1.35;
}

:root[data-theme="light"] .dialer-sterbefall-note {
  color: #3f2a05;
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.18), transparent),
    #fff7ed;
  border-color: #f59e0b;
}

:root[data-theme="light"] .dialer-sterbefall-note strong {
  color: #9a3412;
}

:root[data-theme="light"] .dialer-sterbefall-note span {
  color: #3f2a05;
}

.dialer-assist-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-strong) 8%, transparent), transparent),
    rgba(255, 255, 255, 0.025);
}

.dialer-assist-head,
.dialer-assist-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dialer-assist-head div {
  display: grid;
  gap: 2px;
}

.dialer-assist-head span {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialer-assist-head strong {
  color: var(--text);
  font-size: 1.05rem;
}

.dialer-assist-head small {
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.dialer-assist-actions .button {
  min-height: 38px;
  padding: 8px 12px;
}

.dialer-assist-box textarea[readonly] {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.dialer-assist-status {
  min-height: 22px;
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
}

.dialer-assist-status.is-error {
  color: #fecaca;
}

.dialer-modal-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dialer-modal-actions .dialer-save-send-button,
.dialer-modal-actions .dialer-save-only-button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 11px 14px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.dialer-modal-actions strong {
  font-size: 0.94rem;
  font-weight: 950;
  letter-spacing: 0.015em;
}

.dialer-modal-actions small {
  font-size: 0.75rem;
  font-weight: 800;
}

.dialer-save-send-button.button {
  border-color: #31d0a2;
}

.dialer-save-only-button.button {
  color: var(--text);
  border: 2px solid #72869a;
  background: #263544;
  box-shadow: none;
}

.dialer-save-only-button.button:hover,
.dialer-save-only-button.button:focus-visible {
  color: var(--text);
  border-color: #9eb0c0;
  background: #314252;
  box-shadow: 0 0 0 3px rgba(158, 176, 192, 0.18);
}

:root[data-theme="light"] .dialer-save-only-button.button {
  color: #172a3a;
  border-color: #6d8295;
  background: #e4ebf1;
}

:root[data-theme="light"] .dialer-save-only-button.button:hover,
:root[data-theme="light"] .dialer-save-only-button.button:focus-visible {
  border-color: #4f6579;
  background: #d8e2ea;
  box-shadow: 0 0 0 3px rgba(79, 101, 121, 0.16);
}

.dialer-case-question-list {
  display: grid;
  gap: 9px;
}

.dialer-question-answer-form {
  display: grid;
  gap: 10px;
}

.dialer-case-question-field {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 22%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.dialer-case-question-field > strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.dialer-question-answer-field {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr);
  align-items: center;
}

.dialer-question-answer-field > strong,
.dialer-question-answer-field > small {
  min-width: 0;
}

.dialer-question-answer-field > small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 850;
}

.dialer-question-answer-field select,
.dialer-question-answer-field textarea {
  width: 100%;
}

.dialer-question-answer-actions {
  display: flex;
  justify-content: flex-end;
}

.dialer-checkbox-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
}

.dialer-checkbox-line {
  display: inline-flex !important;
  grid-template-columns: none !important;
  width: fit-content;
  gap: 10px !important;
  align-items: center;
  color: var(--text) !important;
  font-weight: 850 !important;
  cursor: pointer;
}

.dialer-checkbox-line input[type="checkbox"] {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  flex: 0 0 22px;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

.bestatter-mask {
  display: grid;
  gap: 16px;
}

.bestatter-title-row {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.bestatter-title-row h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.bestatter-search-form {
  display: grid;
  gap: 14px;
}

.bestatter-search-box {
  position: relative;
}

.bestatter-search-box input {
  width: 100%;
  min-height: 40px;
  padding: 9px 42px 9px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.bestatter-clear {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--accent-cool);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transform: translateY(-50%);
}

.bestatter-actions-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.bestatter-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.bestatter-table-card,
.bestatter-form-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
}

.bestatter-table-card {
  overflow: hidden;
}

.bestatter-table-shell {
  width: 100%;
  overflow: auto;
}

.bestatter-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.bestatter-table th,
.bestatter-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.bestatter-table th {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  font-weight: 900;
}

.bestatter-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--surface-soft) 64%, transparent);
}

.bestatter-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--accent-cool) 28%, transparent);
}

.bestatter-table tbody tr.is-locked {
  opacity: 0.72;
  background: color-mix(in srgb, #ef4444 8%, var(--surface-soft));
}

.bestatter-table tbody tr.is-subhouse td:first-child {
  padding-left: 26px;
}

.bestatter-house-name {
  font-weight: 850;
}

.bestatter-house-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 40%, var(--line));
  border-radius: 999px;
}

.bestatter-house-badge.is-main-house {
  color: color-mix(in srgb, var(--fahrdienst-accent) 74%, var(--text));
  background: color-mix(in srgb, var(--fahrdienst-accent) 13%, transparent);
}

.bestatter-house-badge.is-subhouse {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
}

.bestatter-house-badge.is-group {
  color: #d9f99d;
  border-color: color-mix(in srgb, #84cc16 48%, var(--line));
  background: color-mix(in srgb, #65a30d 20%, var(--surface-soft));
}

.bestatter-house-badge + small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
}

.bestatter-edit-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.bestatter-edit-link {
  color: var(--accent-cool);
}

.bestatter-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bestatter-row-actions form {
  margin: 0;
}

.bestatter-lock-state {
  display: inline-flex;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 950;
  border: 1px solid;
  border-radius: 999px;
}

.bestatter-lock-state.is-active {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(16, 185, 129, 0.14);
}

.bestatter-lock-state.is-locked {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(239, 68, 68, 0.14);
}

.bestatter-lock-button {
  min-height: 32px;
  padding: 5px 9px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  border: 1px solid;
  border-radius: 7px;
  cursor: pointer;
}

.bestatter-lock-button.is-lock {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(239, 68, 68, 0.12);
}

.bestatter-lock-button.is-unlock {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(16, 185, 129, 0.12);
}

.bestatter-lock-button:hover,
.bestatter-lock-button:focus-visible {
  filter: brightness(1.18);
}

.bestatter-status {
  font-size: 1.25rem;
  font-weight: 900;
}

.bestatter-empty {
  color: var(--muted);
}

.bestatter-form-card {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 24px);
}

.bestatter-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(1, 8, 12, 0.84);
  backdrop-filter: blur(3px);
  overflow: auto;
}

.bestatter-modal {
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, #000000), color-mix(in srgb, var(--surface) 98%, #000000));
  border: 1px solid color-mix(in srgb, var(--accent-cool) 52%, var(--line));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bestatter-modal-head {
  grid-template-columns: 1fr auto;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -24px -24px 4px;
  padding: 16px 24px;
  cursor: grab;
  user-select: none;
  background: color-mix(in srgb, var(--panel) 98%, #000000);
  border-bottom: 1px solid var(--line);
}

.bestatter-modal-head:active {
  cursor: grabbing;
}

.bestatter-modal.is-dragging {
  user-select: none;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.82), 0 0 0 1px color-mix(in srgb, var(--accent-cool) 72%, var(--line));
}

.bestatter-modal-close {
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.bestatter-modal-close:hover {
  color: var(--text);
  border-color: var(--accent-cool);
}

.dialer-standalone-card .bestatter-modal-head:active {
  cursor: default;
}

.dialer-close-page {
  width: min(620px, calc(100% - 24px));
  padding-top: clamp(34px, 10vh, 90px);
}

.dialer-close-page .dialer-panel {
  gap: 14px;
}

.dialer-close-page h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.8rem);
}

.dialer-close-page p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.dialer-close-fallback {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-cool) 8%, transparent);
}

.bestatter-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.bestatter-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.bestatter-field {
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
}

.bestatter-field span {
  color: var(--text);
  font-weight: 500;
}

.bestatter-structure-field {
  align-items: start;
}

.bestatter-structure-field small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 750;
}

.bestatter-readonly-status strong {
  color: var(--text);
}

.bestatter-field-check input {
  width: 18px;
  min-height: 18px;
  justify-self: start;
}

.bestatter-form input,
.bestatter-form select,
.bestatter-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bestatter-form textarea {
  resize: vertical;
}

.bestatter-field-check input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  justify-self: start;
}

.bestatter-form .span-2 {
  grid-column: 1 / -1;
}

.bestatter-readonly-fieldset {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.bestatter-readonly-fieldset:disabled input,
.bestatter-readonly-fieldset:disabled select,
.bestatter-readonly-fieldset:disabled textarea {
  color: var(--text);
  cursor: default;
  opacity: 0.92;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
}

.bestatter-readonly-hint,
.bestatter-readonly-note {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.bestatter-readonly-hint {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-cool) 8%, transparent);
}

.bestatter-readonly-note {
  align-self: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
}

.bestatter-emergency-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--fahrdienst-accent) 10%, transparent), transparent 60%),
    color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.bestatter-emergency-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.bestatter-emergency-head span {
  color: color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--text));
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bestatter-emergency-head small {
  color: var(--muted);
  font-weight: 850;
}

.bestatter-emergency-fields {
  display: grid;
  gap: 12px;
}

.bestatter-emergency-note textarea {
  min-height: 118px;
}

.bestatter-questions {
  display: grid;
  gap: 12px;
  margin-top: 2px;
}

.bestatter-question-head {
  display: grid;
  grid-template-columns: 160px auto;
  gap: 12px;
  align-items: center;
}

.bestatter-question-head > span {
  color: var(--text);
  font-weight: 500;
}

.bestatter-question-head .button {
  justify-self: end;
}

.bestatter-question-table-shell {
  margin-left: 160px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
}

.bestatter-question-table {
  width: 100%;
  border-collapse: collapse;
}

.bestatter-question-table th,
.bestatter-question-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.bestatter-question-table th {
  color: var(--text);
  font-weight: 900;
}

.bestatter-question-table th:last-child,
.bestatter-question-table td:last-child {
  width: 120px;
  text-align: right;
}

.bestatter-question-table th:nth-child(3),
.bestatter-question-table td:nth-child(3) {
  width: 150px;
}

.bestatter-question-table select {
  width: 150px;
}

.bestatter-question-sort {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.bestatter-question-sort-button {
  min-height: 34px;
  padding: 8px 9px;
  font-size: 0.82rem;
}

.bestatter-question-sort-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.bestatter-question-remove {
  min-height: 34px;
  padding: 8px 10px;
}

.bestatter-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.bestatter-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bestatter-portal-admin {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--fahrdienst-accent) 7%, transparent);
}

.bestatter-portal-admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
}

.bestatter-portal-admin-head div {
  display: grid;
  gap: 2px;
}

.bestatter-portal-admin-head span,
.bestatter-portal-info b {
  color: color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--text));
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bestatter-portal-admin-head strong {
  color: var(--text);
  font-size: 1.05rem;
}

.bestatter-portal-admin-head small,
.bestatter-portal-info small {
  color: var(--muted);
  font-weight: 800;
}

.bestatter-portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bestatter-portal-info {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.bestatter-portal-info span {
  color: var(--text);
  font-weight: 900;
}

.bestatter-portal-info .is-warning {
  color: #fca5a5;
}

.bestatter-access-main {
  width: min(100%, 1480px);
}

.bestatter-access-topbar,
.bestatter-access-section-head,
.bestatter-access-top-actions,
.bestatter-access-savebar,
.bestatter-access-account-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.bestatter-access-topbar p,
.bestatter-access-section-head p,
.bestatter-access-empty p {
  margin: 4px 0 0;
  color: var(--muted);
}

.bestatter-access-top-actions {
  justify-content: flex-end;
}

.bestatter-access-editor,
.bestatter-access-list-section {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.bestatter-access-section-head h2,
.bestatter-access-account-card h3 {
  margin: 0;
}

.bestatter-access-section-head > span {
  color: var(--muted);
  font-weight: 850;
}

.bestatter-access-form {
  display: grid;
  gap: 14px;
}

.bestatter-access-form-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 28%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.bestatter-access-form-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.bestatter-access-form-card-head > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--surface);
  font-weight: 950;
  border-radius: 50%;
  background: var(--fahrdienst-accent);
}

.bestatter-access-form-card-head div {
  display: grid;
  gap: 2px;
}

.bestatter-access-form-card-head strong {
  color: var(--text);
  font-size: 1.05rem;
}

.bestatter-access-form-card-head small {
  color: var(--muted);
  font-weight: 750;
}

.bestatter-access-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bestatter-access-fields label,
.bestatter-access-main-select {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 850;
}

.bestatter-access-fields input:not([type="checkbox"]),
.bestatter-access-main-select select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.bestatter-access-toggle {
  display: flex !important;
  gap: 10px !important;
  align-items: center;
  align-self: end;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.bestatter-access-toggle input,
.bestatter-access-house-option input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  accent-color: var(--fahrdienst-accent);
}

.bestatter-access-house-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 520px;
  padding: 3px 7px 3px 3px;
  overflow: auto;
  scrollbar-color: color-mix(in srgb, var(--fahrdienst-accent) 55%, var(--line)) transparent;
}

.bestatter-access-house-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, auto);
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.bestatter-access-house-search {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 850;
}

.bestatter-access-house-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--field-text);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--field-bg);
}

.bestatter-access-house-summary {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
}

.bestatter-access-house-summary > strong {
  color: var(--text);
  font-size: 1rem;
}

.bestatter-access-house-summary > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.bestatter-access-house-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.bestatter-access-house-summary .button {
  min-height: 38px;
  padding: 8px 11px;
}

.bestatter-access-house-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
  border: 1px dashed var(--line);
  border-radius: 9px;
}

.bestatter-access-house-group[hidden],
.bestatter-access-house-option[hidden],
.bestatter-access-house-empty[hidden] {
  display: none;
}

.bestatter-access-house-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.bestatter-access-house-group legend {
  max-width: calc(100% - 12px);
  padding: 0 7px;
  color: color-mix(in srgb, var(--fahrdienst-accent) 74%, var(--text));
  font-weight: 950;
}

.bestatter-access-house-option {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  cursor: pointer;
}

.bestatter-access-house-option:hover {
  border-color: var(--fahrdienst-accent);
  background: color-mix(in srgb, var(--fahrdienst-accent) 8%, transparent);
}

.bestatter-access-house-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--line));
  background: color-mix(in srgb, var(--fahrdienst-accent) 13%, var(--surface));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--fahrdienst-accent) 84%, #ffffff);
}

.bestatter-access-house-option.is-locked {
  opacity: 0.58;
  cursor: not-allowed;
  border-color: color-mix(in srgb, #ef4444 26%, var(--line));
  background: color-mix(in srgb, #ef4444 6%, transparent);
}

.bestatter-access-house-option.is-locked:hover {
  border-color: color-mix(in srgb, #ef4444 26%, var(--line));
}

.bestatter-access-house-option.is-subhouse {
  margin-left: 18px;
}

.bestatter-access-house-option > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.bestatter-access-house-option strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bestatter-access-house-option small {
  color: var(--muted);
  font-weight: 750;
}

.bestatter-access-savebar {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--fahrdienst-accent) 8%, var(--surface));
}

.bestatter-access-savebar > div {
  display: grid;
  gap: 2px;
}

.bestatter-access-savebar span {
  color: var(--muted);
  font-weight: 800;
}

.bestatter-access-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bestatter-access-account-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.bestatter-access-account-card.is-active {
  border-color: color-mix(in srgb, #34d399 38%, var(--line));
}

.bestatter-access-account-head > div {
  display: grid;
  gap: 2px;
}

.bestatter-access-account-head > div > span,
.bestatter-access-account-card dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bestatter-access-state {
  padding: 4px 9px;
  color: #d1fae5;
  font-size: 0.74rem;
  font-weight: 950;
  border: 1px solid rgba(52, 211, 153, 0.42);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
}

.bestatter-access-account-card.is-inactive .bestatter-access-state {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-soft);
}

.bestatter-access-account-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.bestatter-access-account-card dl div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.bestatter-access-account-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 800;
}

.bestatter-access-warning {
  margin: 0;
  color: #fca5a5;
  font-weight: 800;
}

.bestatter-access-empty {
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

@media (max-width: 1100px) {
  .bestatter-access-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .bestatter-access-fields,
  .bestatter-access-house-groups,
  .bestatter-access-account-grid {
    grid-template-columns: 1fr;
  }

  .bestatter-access-house-toolbar {
    grid-template-columns: 1fr;
  }

  .bestatter-access-house-summary {
    justify-items: start;
    text-align: left;
  }

  .bestatter-access-house-summary > div {
    width: 100%;
    justify-content: flex-start;
  }

  .bestatter-access-top-actions,
  .bestatter-access-top-actions .button,
  .bestatter-access-savebar .button {
    width: 100%;
  }

  .bestatter-access-house-option.is-subhouse {
    margin-left: 10px;
  }
}

.bestatter-portal-house-field {
  align-items: start;
}

.bestatter-portal-house-field select {
  min-height: 190px;
}

.bestatter-portal-house-field small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 750;
}

.bestatter-portal-body {
  min-height: 100vh;
}

.bestatter-portal-shell {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  padding: clamp(34px, 6vw, 72px) 0;
}

.bestatter-portal-login {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.bestatter-portal-house-select {
  width: min(620px, 100%);
}

.bestatter-portal-house-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.bestatter-portal-house-list form,
.bestatter-portal-actions form {
  margin: 0;
}

.bestatter-portal-house-list button {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 13px 15px;
  color: var(--text);
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  cursor: pointer;
}

.bestatter-portal-house-list button:hover,
.bestatter-portal-house-list button:focus-visible {
  border-color: var(--fahrdienst-accent);
  background: color-mix(in srgb, var(--fahrdienst-accent) 16%, var(--surface-soft));
  transform: translateY(-1px);
}

.bestatter-portal-house-list strong {
  font-size: 1rem;
}

.bestatter-portal-house-list span,
.bestatter-portal-house-footer > span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.bestatter-portal-house-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.bestatter-portal-login-head,
.bestatter-portal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.bestatter-portal-login-head {
  margin-bottom: 10px;
}

.bestatter-portal-actions {
  flex-wrap: wrap;
}

.bestatter-portal-login h1,
.bestatter-portal-header h1,
.bestatter-portal-card h2 {
  margin: 0;
  line-height: 1.05;
}

.bestatter-portal-muted {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.bestatter-portal-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 20px 52px color-mix(in srgb, var(--fahrdienst-accent) 10%, transparent);
}

.bestatter-portal-header span {
  color: var(--muted);
  font-weight: 800;
}

.bestatter-portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.bestatter-portal-nav a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
}

.bestatter-portal-nav a span {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 950;
}

.bestatter-portal-nav a strong {
  min-width: 30px;
  padding: 3px 8px;
  color: color-mix(in srgb, var(--fahrdienst-accent) 72%, var(--text));
  text-align: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fahrdienst-accent) 15%, transparent);
}

.bestatter-portal-nav a:hover,
.bestatter-portal-nav a:focus-visible {
  border-color: var(--fahrdienst-accent);
  transform: translateY(-1px);
}

.bestatter-portal-nav a.is-active {
  border-color: var(--fahrdienst-accent);
  background: color-mix(in srgb, var(--fahrdienst-accent) 18%, var(--surface-soft));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--fahrdienst-accent) 14%, transparent);
}

.bestatter-portal-nav a.is-active strong {
  color: var(--surface);
  background: var(--fahrdienst-accent);
}

.bestatter-portal-shell > .flash {
  margin-bottom: 14px;
}

.bestatter-portal-shell .bestatter-portal-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: start;
}

.bestatter-portal-card {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 20px;
}

.bestatter-portal-card::before {
  background: linear-gradient(90deg, var(--fahrdienst-accent), color-mix(in srgb, var(--fahrdienst-accent) 54%, #ffffff), var(--fahrdienst-accent));
}

.bestatter-portal-card-main {
  grid-column: 1;
}

.bestatter-portal-form-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 26%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--fahrdienst-accent) 6%, transparent);
}

.bestatter-portal-form-section > span {
  color: color-mix(in srgb, var(--fahrdienst-accent) 70%, var(--text));
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bestatter-portal-check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 900;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.bestatter-portal-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--fahrdienst-accent);
}

.bestatter-portal-data {
  display: grid;
  gap: 8px;
  margin: 0;
}

.bestatter-portal-data div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.bestatter-portal-data dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bestatter-portal-data dd {
  margin: 0;
  color: var(--text);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.bestatter-portal-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.bestatter-portal-cases {
  grid-column: 1 / -1;
  scroll-margin-top: 18px;
}

.bestatter-portal-case-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.bestatter-portal-case {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.bestatter-portal-case > summary {
  display: grid;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.bestatter-portal-case > summary::-webkit-details-marker {
  display: none;
}

.bestatter-portal-case > summary::after {
  content: "Anklicken";
  justify-self: start;
  padding: 4px 9px;
  color: color-mix(in srgb, var(--fahrdienst-accent) 76%, var(--text));
  font-size: 0.76rem;
  font-weight: 950;
  border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 34%, var(--line));
  border-radius: 999px;
}

.bestatter-portal-case[open] > summary::after {
  content: "Schliessen";
}

.bestatter-portal-case.is-closed {
  opacity: 0.78;
  background: color-mix(in srgb, var(--surface-soft) 54%, transparent);
}

.bestatter-portal-case[open] {
  grid-column: 1 / -1;
}

.bestatter-portal-case > summary div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.bestatter-portal-case-detail {
  display: grid;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bestatter-portal-case-data {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
}

.bestatter-portal-case-data div,
.bestatter-portal-case-section,
.bestatter-portal-email-log {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 54%, transparent);
}

.bestatter-portal-case-data-wide {
  grid-column: 1 / -1;
}

.bestatter-portal-case-data dt,
.bestatter-portal-case-section h3,
.bestatter-portal-email-log small {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bestatter-portal-case-data dd,
.bestatter-portal-case-section p,
.bestatter-portal-email-log p {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.bestatter-portal-case-section {
  display: grid;
  gap: 8px;
}

.bestatter-portal-case-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bestatter-portal-case-section li {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 60%, transparent);
}

.bestatter-portal-email-list {
  display: grid;
  gap: 8px;
}

.bestatter-portal-email-log summary {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.bestatter-portal-email-log div {
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.bestatter-portal-email-log pre {
  max-height: 320px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.bestatter-portal-case strong,
.bestatter-portal-case b {
  color: var(--text);
}

.bestatter-portal-case span,
.bestatter-portal-case small {
  color: var(--muted);
  font-weight: 800;
}

.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(6px);
}

.cookie-consent-dialog {
  position: relative;
  width: min(970px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  color: var(--text);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, #ffffff 2%), color-mix(in srgb, var(--surface) 98%, #000000 2%));
  border: 1px solid color-mix(in srgb, var(--accent-strong) 42%, var(--line));
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
}

.cookie-consent-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.cookie-consent-close:hover,
.cookie-consent-close:focus-visible {
  color: var(--text);
  border-color: var(--accent-strong);
}

.cookie-consent-head {
  display: grid;
  gap: 4px;
  padding-right: 42px;
  text-align: center;
}

.cookie-consent-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.15;
}

.cookie-consent-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.cookie-consent-copy {
  display: grid;
  gap: 10px;
}

.cookie-consent-copy p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  line-height: 1.5;
}

.cookie-consent-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cookie-consent-links a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-consent-actions {
  display: grid;
  gap: 10px;
}

.cookie-consent-actions .button {
  width: 100%;
  min-height: 46px;
}

.cookie-category-list {
  display: grid;
  gap: 10px;
}

.cookie-category {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cookie-category.is-required {
  opacity: 0.86;
}

.cookie-category-check {
  padding-top: 2px;
}

.cookie-category input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent-strong);
}

.cookie-category strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

.cookie-category small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-settings-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 60;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-strong) 38%, var(--line));
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.cookie-settings-fab:hover,
.cookie-settings-fab:focus-visible {
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

:root[data-theme="light"] .cookie-consent-overlay {
  background: rgba(11, 17, 24, 0.48);
}

:root[data-theme="light"] .cookie-consent-dialog {
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(20, 45, 50, 0.22);
}

:root[data-theme="light"] .cookie-settings-fab {
  background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 760px) {
  .cookie-consent-body {
    grid-template-columns: 1fr;
  }

  .cookie-consent-head {
    text-align: left;
  }

  .cookie-settings-fab {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
}

@media (max-width: 900px) {
  .dialer-toolbar,
  .dialer-panel-head,
  .dialer-form-actions,
  .dialer-search-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dialer-toolbar,
  .dialer-panel-head {
    display: grid;
  }

  .dialer-workspace {
    grid-template-columns: 1fr;
  }

  .dialer-case-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .testphase-page-head,
  .testphase-transfer-summary,
  .testphase-route-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .testphase-status-pill,
  .testphase-transfer-summary::after {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }

  .testphase-info-grid {
    grid-template-columns: 1fr;
  }

  .testphase-status-form {
    grid-template-columns: 1fr;
  }

  .testphase-route-actions .button,
  .testphase-route-missing,
  .testphase-status-form .button {
    width: 100%;
    text-align: center;
  }

  .bestatter-title-row {
    justify-content: flex-start;
  }

  .bestatter-title-row h2 {
    font-size: 2rem;
  }

  .bestatter-actions-row,
  .bestatter-form-actions,
  .dialer-assist-actions,
  .dialer-modal-actions,
  .dialer-case-card,
  .dialer-call-front,
  .dialer-call-meta-row,
  .dialer-call-detail-grid,
  .dialer-bestatter-data-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dialer-case-card time,
  .dialer-call-meta time {
    justify-self: start;
  }

  .dialer-call-actions {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
  }

  .dialer-call-left {
    grid-template-columns: 1fr;
  }

  .dialer-case-edit {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
  }

  .dialer-call-meta,
  .dialer-call-deceased,
  .dialer-call-location,
  .dialer-call-person,
  .dialer-call-subject,
  .dialer-call-package,
  .dialer-call-status,
  .dialer-call-totenschein,
  .dialer-call-number,
  .dialer-drive-sms,
  .dialer-call-transporter {
    grid-template-columns: 1fr;
    grid-column: auto;
    grid-row: auto;
  }

  .dialer-call-status,
  .dialer-call-totenschein,
  .dialer-call-package {
    min-height: auto;
  }

  .dialer-call-meta span,
  .dialer-call-meta strong,
  .dialer-call-meta time,
  .dialer-call-meta small,
  .dialer-call-deceased span,
  .dialer-call-deceased strong,
  .dialer-call-location span,
  .dialer-call-location strong,
  .dialer-call-location small,
  .dialer-call-person span,
  .dialer-call-person strong,
  .dialer-call-person small,
  .dialer-call-subject span,
  .dialer-call-subject strong,
  .dialer-call-package span,
  .dialer-call-package strong,
  .dialer-call-package small,
  .dialer-call-status span,
  .dialer-call-status strong,
  .dialer-call-totenschein span,
  .dialer-call-number span,
  .dialer-call-number strong,
  .dialer-drive-sms span,
  .dialer-call-transporter span {
    grid-column: auto;
  }

  .bestatter-workspace,
  .dialer-case-modal .dialer-form,
  .bestatter-form {
    grid-template-columns: 1fr;
  }

  .bestatter-field,
  .bestatter-question-head {
    grid-template-columns: 1fr;
  }

  .bestatter-structure-field small {
    grid-column: auto;
  }

  .bestatter-question-head .button {
    justify-self: stretch;
  }

  .bestatter-question-table-shell {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .drive-orders-page .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .drive-orders-page .brand-subtitle,
  .drive-orders-page .header-actions .top-link[href="Dailer/dialer.php?view=telefonat"],
  .drive-orders-page .header-actions .top-link[href="profile.php"] {
    display: none;
  }

  .drive-orders-page .section {
    padding: 10px;
  }

  .testphase-page-card {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
  }

  .testphase-page-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .testphase-page-head h1 {
    font-size: 1.95rem;
    line-height: 1;
  }

  .testphase-page-head p:not(.eyebrow) {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .testphase-case-section {
    gap: 8px;
    margin-top: 12px;
  }

  .testphase-case-section + .testphase-case-section {
    padding-top: 12px;
  }

  .testphase-case-section-head {
    align-items: flex-start;
  }

  .testphase-case-section-head h2 {
    font-size: 1.25rem;
  }

  .testphase-case-section-head p:not(.eyebrow) {
    display: none;
  }

  .testphase-case-section-head > strong {
    min-width: 38px;
    min-height: 32px;
    font-size: 0.95rem;
  }

  .testphase-case-grid {
    gap: 8px;
  }

  .testphase-transfer-card {
    border-radius: 8px;
  }

  .testphase-transfer-summary {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
  }

  .testphase-transfer-main {
    grid-column: 1 / 2;
  }

  .testphase-transfer-location {
    grid-column: 1 / -1;
    padding: 8px;
  }

  .testphase-transfer-main strong {
    font-size: 1.45rem;
  }

  .testphase-status-pill {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    padding: 6px 9px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .testphase-transfer-summary::after {
    grid-column: 1 / -1;
    justify-self: stretch;
    padding: 7px 10px;
    text-align: center;
    border: 1px solid color-mix(in srgb, var(--fahrdienst-accent) 28%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--fahrdienst-accent) 8%, var(--surface));
  }

  .testphase-transfer-detail {
    gap: 8px;
    padding: 0 10px 10px;
  }

  .testphase-info-grid {
    gap: 8px;
  }

  .testphase-info-item {
    padding: 9px 10px;
  }

  .testphase-status-form {
    gap: 8px;
  }

  .testphase-status-select,
  .testphase-status-form .button,
  .testphase-route-actions .button,
  .testphase-route-missing {
    min-height: 46px;
    font-size: 1rem;
  }

  .testphase-route-actions {
    gap: 8px;
  }
}

@media (max-width: 390px) {
  .drive-orders-page .testphase-transfer-summary {
    grid-template-columns: 1fr;
  }

  .drive-orders-page .testphase-status-pill {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .drive-orders-page .testphase-page-head h1 {
    font-size: 1.72rem;
  }
}

.announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.announcement-overlay[hidden] {
  display: none;
}

.announcement-dialog {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 184, 166, 0.2), transparent 36%),
    color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-strong) 48%, var(--line));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.announcement-dialog h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.announcement-message {
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.announcement-read-note,
.announcement-error {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 8px;
}

.announcement-read-note {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-strong) 36%, var(--line));
}

.announcement-error {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.34);
}

body.email-reminder-open {
  overflow: hidden;
}

.email-reminder-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(9px);
}

.email-reminder-overlay[hidden] {
  display: none;
}

.email-reminder-dialog {
  position: relative;
  width: min(760px, 100%);
  display: grid;
  gap: 16px;
  max-height: min(760px, calc(100vh - 40px));
  padding: clamp(22px, 4vw, 34px);
  overflow: auto;
  color: var(--text);
  border: 1px solid rgba(251, 146, 60, 0.48);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 15% 0%, rgba(249, 115, 22, 0.2), transparent 38%),
    color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.54);
}

.email-reminder-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  color: var(--muted);
  font-size: 1.55rem;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  cursor: pointer;
}

.email-reminder-head {
  padding-right: 42px;
}

.email-reminder-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.email-reminder-summary {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.email-reminder-list {
  display: grid;
  gap: 10px;
}

.email-reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 8px;
  background: rgba(124, 45, 18, 0.14);
}

.email-reminder-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.email-reminder-item-actions {
  display: grid;
  gap: 7px;
  min-width: 220px;
}

.email-reminder-item-actions .button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  text-align: center;
}

.email-reminder-item span {
  color: #fdba74;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.email-reminder-item strong {
  color: var(--text);
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.email-reminder-item small {
  color: var(--muted);
  font-weight: 720;
}

.email-reminder-actions {
  display: flex;
  justify-content: flex-end;
}

:root[data-theme="light"] .email-reminder-overlay {
  background: rgba(15, 23, 42, 0.5);
}

:root[data-theme="light"] .email-reminder-dialog {
  border-color: rgba(234, 88, 12, 0.34);
  background:
    radial-gradient(circle at 15% 0%, rgba(251, 146, 60, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.98);
}

:root[data-theme="light"] .email-reminder-item {
  border-color: rgba(234, 88, 12, 0.24);
  background: rgba(255, 247, 237, 0.9);
}

:root[data-theme="light"] .email-inbox-count {
  color: #475569;
}

:root[data-theme="light"] .email-inbox-count.has-new-mail {
  color: #047857;
  background: rgba(209, 250, 229, 0.9);
}

:root[data-theme="light"] .email-inbox-item {
  border-color: rgba(8, 145, 178, 0.24);
  background: rgba(236, 254, 255, 0.76);
}

@media (max-width: 720px) {
  .email-reminder-item,
  .email-inbox-item {
    grid-template-columns: 1fr;
  }

  .email-reminder-item .button,
  .email-reminder-actions .button {
    width: 100%;
  }

  .email-inbox-item > div:last-child {
    text-align: left;
  }

  .email-inbox-head-actions {
    justify-content: flex-start;
  }
}

.announcement-read-list {
  display: grid;
  gap: 6px;
  max-height: 120px;
  overflow: auto;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.announcement-read-list span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.permission-grid-special {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.permission-grid label,
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 800;
}

.switch-line input {
  min-height: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.permission-grid input,
.check-line input {
  min-height: 0;
  width: auto;
}

.admin-modal-open {
  overflow: hidden;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
}

.admin-modal-backdrop[hidden] {
  display: none;
}

.admin-create-modal {
  width: min(760px, 100%);
  max-height: min(880px, calc(100vh - 36px));
  overflow: auto;
  box-shadow: 0 28px 96px rgba(0, 0, 0, 0.5);
}

.admin-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.admin-modal-head h2 {
  margin: 4px 0 0;
}

.admin-modal-close {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.55rem;
  font-weight: 900;
  cursor: pointer;
}

.admin-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.admin-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.account-list {
  display: grid;
  gap: 12px;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.account-card.is-open {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  box-shadow: 0 16px 54px rgba(0, 0, 0, 0.2);
}

.account-summary-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(240px, 1.2fr) minmax(180px, 0.75fr);
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 14px 16px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.account-summary-button:hover,
.account-card.is-open .account-summary-button {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.account-summary-main,
.account-summary-meta,
.account-summary-login {
  min-width: 0;
}

.account-summary-main,
.account-summary-login {
  display: grid;
  gap: 4px;
}

.account-summary-main strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.account-summary-main small,
.account-summary-login small {
  color: var(--muted);
  font-weight: 800;
}

.account-summary-login b {
  color: var(--text);
  font-size: 0.92rem;
}

.account-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 900;
}

.account-state-pill.is-active,
.account-state-pill.is-seen {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.34);
  border-color: rgba(34, 197, 94, 0.48);
}

.account-state-pill.is-inactive,
.account-state-pill.is-never {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(251, 191, 36, 0.48);
}

.account-state-pill.is-locked {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.34);
  border-color: rgba(248, 113, 113, 0.58);
}

.account-state-pill.is-warning {
  color: #fed7aa;
  background: rgba(124, 45, 18, 0.28);
  border-color: rgba(251, 146, 60, 0.5);
}

.account-detail-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.account-detail-panel[hidden] {
  display: none;
}

.account-detail-panel .admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.account-detail-panel .admin-form h3,
.account-detail-panel .admin-form .permission-grid,
.account-detail-panel .admin-form .account-lock-box,
.account-detail-panel .admin-form .account-login-warning,
.account-detail-panel .admin-form > .button {
  grid-column: 1 / -1;
}

.account-detail-panel .admin-form > .button {
  justify-self: start;
  min-width: 220px;
}

.account-card h3 {
  margin: 0;
}

.account-lock-box,
.account-login-warning {
  display: grid;
  gap: 6px;
  margin: 4px 0;
  padding: 10px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 8px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.32);
}

.account-login-warning {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(120, 53, 15, 0.26);
  font-weight: 800;
}

.muted-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.account-admin-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.account-login-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-login-info strong {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 0.95rem;
}

.account-login-info span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-login-info b {
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
}

.delete-form {
  margin: 0;
}

.delete-form button {
  min-height: 38px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  cursor: pointer;
}

.flash {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
}

.flash.success {
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.flash.error,
.dialog-status {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.employee-directory-head input,
.dialog-card input,
.account-picker select,
.account-search input,
.admin-form input,
.admin-form select,
.admin-form textarea,
.dialer-form input,
.dialer-form select:not(.dialer-status-select):not(.dialer-totenschein-select):not(.dialer-transporter-select),
.dialer-form textarea,
.dialer-detail-grid input,
.dialer-detail-grid textarea,
.dialer-search-row input,
.dialer-info-form textarea,
.dialer-info-edit-form textarea,
.dialer-question-answer-field select,
.dialer-question-answer-field textarea,
.dialer-assist-box textarea,
.bestatter-search-box input,
.bestatter-form input,
.bestatter-form select,
.bestatter-form textarea {
  color: var(--field-text);
  background: var(--field-bg);
  border-color: var(--field-border);
}

.employee-directory-head input:focus,
.dialog-card input:focus,
.account-picker select:focus,
.account-search input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.dialer-form input:focus,
.dialer-form select:focus,
.dialer-form textarea:focus,
.dialer-detail-grid input:focus,
.dialer-detail-grid textarea:focus,
.dialer-search-row input:focus,
.dialer-info-form textarea:focus,
.dialer-info-edit-form textarea:focus,
.dialer-question-answer-field select:focus,
.dialer-question-answer-field textarea:focus,
.bestatter-search-box input:focus,
.bestatter-form input:focus,
.bestatter-form select:focus,
.bestatter-form textarea:focus {
  border-color: var(--accent-strong);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-strong) 18%, transparent);
}

.dialer-call-detail-grid > div,
.dialer-call-note,
.dialer-call-questions,
.dialer-call-bestatter,
.dialer-call-location,
.dialer-bestatter-preview,
.dialer-bestatter-data-grid > div,
.dialer-bestatter-readiness,
.dialer-bestatter-readiness-grid > div,
.dialer-bestatter-readiness-note,
.dialer-bestatter-preview-help,
.dialer-call-questions li,
.dialer-bestatter-preview-questions li,
.dialer-case-card,
.switch-line,
.account-card,
.account-login-info,
.announcement-read-list {
  color: var(--text);
  background-color: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

:root[data-theme="light"] .dialer-call-detail-grid > div,
:root[data-theme="light"] .dialer-call-note,
:root[data-theme="light"] .dialer-call-questions,
:root[data-theme="light"] .dialer-call-bestatter,
:root[data-theme="light"] .dialer-call-location,
:root[data-theme="light"] .dialer-bestatter-preview,
:root[data-theme="light"] .dialer-bestatter-data-grid > div,
:root[data-theme="light"] .dialer-bestatter-readiness,
:root[data-theme="light"] .dialer-bestatter-readiness-grid > div,
:root[data-theme="light"] .dialer-bestatter-readiness-note,
:root[data-theme="light"] .dialer-bestatter-preview-help,
:root[data-theme="light"] .dialer-call-questions li,
:root[data-theme="light"] .dialer-bestatter-preview-questions li,
:root[data-theme="light"] .dialer-case-card,
:root[data-theme="light"] .switch-line,
:root[data-theme="light"] .account-card,
:root[data-theme="light"] .account-login-info,
:root[data-theme="light"] .announcement-read-list {
  background-color: color-mix(in srgb, var(--surface) 92%, var(--surface-soft));
}

:root[data-theme="light"] .account-lock-box {
  color: #7f1d1d;
  background: #fef2f2;
}

:root[data-theme="light"] .account-state-pill.is-active,
:root[data-theme="light"] .account-state-pill.is-seen {
  color: #14532d;
  background: #dcfce7;
  border-color: #86efac;
}

:root[data-theme="light"] .account-state-pill.is-inactive,
:root[data-theme="light"] .account-state-pill.is-never {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

:root[data-theme="light"] .account-state-pill.is-locked {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

:root[data-theme="light"] .account-state-pill.is-warning {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}

:root[data-theme="light"] .account-login-warning {
  color: #92400e;
  background: #fffbeb;
}

:root[data-theme="light"] .admin-tab-nav {
  border-color: #aebfcb;
  background: #eef4f8;
  box-shadow: 0 10px 24px rgba(30, 55, 75, 0.12);
}

:root[data-theme="light"] .admin-tab-button {
  color: #496173;
}

:root[data-theme="light"] .admin-tab-button strong {
  color: #102033;
}

:root[data-theme="light"] .admin-tab-button:hover {
  border-color: #7f9bad;
  background: #ffffff;
}

:root[data-theme="light"] .admin-tab-button.is-active {
  color: #075b96;
  border-color: #2682b5;
  background: linear-gradient(135deg, #dff3ff, #ffffff);
  box-shadow: 0 8px 18px rgba(38, 130, 181, 0.16);
}

:root[data-theme="light"] .flash.success {
  color: #14532d;
  background: #ecfdf5;
}

:root[data-theme="light"] .flash.error,
:root[data-theme="light"] .dialog-status,
:root[data-theme="light"] .announcement-error {
  color: #991b1b;
  background: #fef2f2;
}

@media (max-width: 900px) {
  .admin-tab-nav,
  .admin-maintenance-grid,
  .admin-panel-heading,
  .admin-top-grid .account-heading {
    grid-template-columns: 1fr;
  }

  .admin-tab-nav {
    display: grid;
  }

  .admin-top-grid .account-heading {
    display: grid;
    align-items: stretch;
  }

  .account-heading {
    display: grid;
  }

  .admin-top-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .profile-card-main,
  .profile-card-password,
  .profile-card-phone {
    grid-column: auto;
    width: auto;
  }

  .announcement-actions {
    grid-template-columns: 1fr;
  }

  .admin-account-actions,
  .admin-form-row,
  .admin-modal-actions,
  .account-summary-button,
  .account-detail-panel .admin-form,
  .bestatter-portal-grid,
  .bestatter-portal-shell .bestatter-portal-grid {
    grid-template-columns: 1fr;
  }

  .bestatter-portal-house-field small {
    grid-column: auto;
  }

  .bestatter-portal-card-main,
  .bestatter-portal-cases {
    grid-column: auto;
    grid-row: auto;
  }

  .admin-account-actions .button,
  .account-detail-panel .admin-form > .button {
    width: 100%;
  }

  .tagebuch-recovery-item {
    grid-template-columns: 1fr;
  }

  .tagebuch-recovery-item .button {
    width: 100%;
  }

  .account-admin-footer,
  .account-login-info {
    grid-template-columns: 1fr;
  }

  .login-access-button {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.dashboard-shell-body {
  min-height: 100vh;
  color: #edf6ff;
  background:
    linear-gradient(120deg, rgba(17, 24, 39, 0.96), rgba(4, 16, 27, 0.98)),
    var(--bg);
}

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 12px;
  background:
    linear-gradient(180deg, rgba(6, 18, 32, 0.98), rgba(4, 13, 23, 0.98)),
    color-mix(in srgb, var(--surface) 92%, #020617);
  border-right: 1px solid rgba(148, 163, 184, 0.18);
}

.dashboard-brand {
  display: grid;
  gap: 4px;
  padding: 0 10px;
  color: #f8fafc;
  text-decoration: none;
}

.dashboard-brand strong {
  font-size: 1.04rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dashboard-brand span {
  color: #38bdf8;
}

.dashboard-brand small,
.dashboard-sidebar-footer,
.dashboard-sidebar-footer a {
  color: #94a3b8;
  font-weight: 760;
}

.dashboard-nav,
.dashboard-quick-actions {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dashboard-nav-item,
.dashboard-quick-action {
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  color: #dbeafe;
  text-decoration: none;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.76));
  box-shadow: 0 5px 14px rgba(2, 8, 23, 0.16);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.dashboard-nav-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.dashboard-nav-item > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 950;
}

.dashboard-nav-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.dashboard-nav-item strong,
.dashboard-quick-action {
  font-size: 0.85rem;
  font-weight: 850;
}

.dashboard-nav-badge {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  color: #ffffff;
  background: #ef4444;
  border-radius: 999px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
}

.dashboard-nav-item.is-active,
.dashboard-nav-item:hover,
.dashboard-nav-item:focus-visible {
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.56);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(14, 165, 233, 0.12));
  box-shadow: inset 4px 0 0 #38bdf8, 0 7px 18px rgba(2, 8, 23, 0.22);
  transform: translateX(2px);
}

.dashboard-nav-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dashboard-quick-actions {
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.dashboard-quick-actions > small {
  padding: 0 10px;
  color: #94a3b8;
  font-weight: 850;
}

.dashboard-quick-action {
  grid-template-columns: 1fr;
  min-height: 40px;
  color: #f8fafc;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.dashboard-quick-action-call {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.36), rgba(14, 165, 233, 0.18));
  border-color: rgba(59, 130, 246, 0.4);
}

.dashboard-quick-action-drive {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.34), rgba(20, 184, 166, 0.14));
  border-color: rgba(34, 197, 94, 0.34);
}

.dashboard-quick-action-dialer {
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.34), rgba(217, 70, 239, 0.14));
  border-color: rgba(168, 85, 247, 0.34);
}

.dashboard-quick-action-admin {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.35), rgba(245, 158, 11, 0.14));
  border-color: rgba(245, 158, 11, 0.34);
}

.dashboard-sidebar-footer {
  display: grid;
  gap: 5px;
  padding: 12px 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.82rem;
}

.dashboard-sidebar-footer a {
  text-decoration: none;
}

.dashboard-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px clamp(14px, 1.6vw, 24px) 24px;
}

.dashboard-main > .section {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.dashboard-main .section-heading {
  max-width: none;
  margin: 0 0 18px;
  text-align: left;
}

.dashboard-main .section-heading h1,
.dashboard-main .section-heading h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
}

.dashboard-userbar .top-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #dbeafe;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 850;
}

.dashboard-userbar .top-link:hover,
.dashboard-userbar .top-link:focus-visible,
.dashboard-userbar .top-link.is-active {
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.56);
  background: rgba(37, 99, 235, 0.22);
}

.dashboard-topbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.dashboard-topbar h1 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.dashboard-topbar p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-weight: 760;
}

.dashboard-search {
  position: relative;
  display: grid;
  gap: 0;
  min-width: 0;
}

.dashboard-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.dashboard-search input {
  min-height: 42px;
  padding: 0 13px;
  color: #e2e8f0;
  background: rgba(2, 8, 23, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
}

.dashboard-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #07111f;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.dashboard-search-results[hidden],
.dashboard-search-row[hidden] {
  display: none;
}

.dashboard-search-row {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.dashboard-search-row strong {
  color: #f8fafc;
}

.dashboard-search-row span {
  position: static;
  width: auto;
  height: auto;
  color: #94a3b8;
  overflow: visible;
}

.dashboard-search-empty {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 31;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  color: #cbd5e1;
  background: #07111f;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.dashboard-userbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.dashboard-topbar > .dashboard-userbar:last-child {
  grid-column: -2 / -1;
}

.drive-orders-dashboard-main {
  gap: 14px;
}

.drive-orders-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.drive-orders-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.drive-orders-summary-strip article {
  display: grid;
  gap: 5px;
  min-height: 104px;
  align-content: center;
  padding: 16px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.16), rgba(20, 184, 166, 0.06)),
    rgba(15, 23, 42, 0.5);
}

.drive-orders-summary-strip span {
  color: #86efac;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drive-orders-summary-strip strong {
  color: #f8fafc;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1;
}

.drive-orders-summary-strip small {
  color: #94a3b8;
  font-weight: 780;
}

.drive-orders-page .testphase-page-card {
  width: 100%;
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 16px;
  color: #e5edf7;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 8, 23, 0.7)),
    rgba(2, 8, 23, 0.54);
  box-shadow: none;
}

.drive-orders-page .testphase-case-section {
  margin-top: 0;
}

.drive-orders-page .testphase-case-section + .testphase-case-section {
  padding-top: 18px;
  border-top-color: rgba(148, 163, 184, 0.18);
}

.drive-orders-page .testphase-case-section-head {
  align-items: center;
}

.drive-orders-page .testphase-case-section-head h2 {
  font-size: clamp(1.18rem, 1.7vw, 1.55rem);
}

.drive-orders-page .testphase-case-section-head p:not(.eyebrow) {
  max-width: 720px;
}

.drive-orders-page .testphase-case-section-head > strong {
  color: #d1fae5;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
}

.drive-orders-page .testphase-transfer-card {
  border-color: rgba(34, 197, 94, 0.22);
  background:
    linear-gradient(90deg, rgba(22, 163, 74, 0.1), transparent 48%),
    rgba(15, 23, 42, 0.74);
}

.drive-orders-page .testphase-transfer-card:hover {
  border-color: rgba(34, 197, 94, 0.42);
}

.drive-orders-page .testphase-transfer-summary {
  grid-template-columns: minmax(180px, 0.86fr) minmax(260px, 1.4fr) minmax(120px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.drive-orders-page .testphase-transfer-main strong {
  font-size: clamp(1.2rem, 1.8vw, 1.65rem);
}

.drive-orders-page .testphase-transfer-location {
  min-height: 54px;
  background: rgba(2, 8, 23, 0.28);
}

.drive-orders-page .testphase-status-pill {
  align-self: center;
  font-size: 0.86rem;
  font-weight: 950;
  white-space: nowrap;
}

.drive-orders-page .testphase-transfer-detail {
  padding: 12px;
  background: rgba(2, 8, 23, 0.18);
}

.drive-orders-page .testphase-info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.drive-orders-page .testphase-info-status,
.drive-orders-page .testphase-info-wide {
  grid-column: span 2;
}

.drive-orders-page .testphase-info-item {
  background: rgba(15, 23, 42, 0.52);
}

.dashboard-notification {
  position: relative;
}

.dashboard-notification-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #cbd5e1;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.dashboard-notification-button:hover,
.dashboard-notification-button[aria-expanded="true"] {
  color: #f8fafc;
  background: rgba(59, 130, 246, 0.14);
}

.dashboard-notification-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-notification-button > span {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #ef4444;
  border: 2px solid #07111f;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
}

.dashboard-notification-button > span[hidden],
.dashboard-notification-menu a[hidden],
.dashboard-notification-menu p[hidden] {
  display: none;
}

.dashboard-notification-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  padding: 12px;
  color: #e2e8f0;
  background: #07111f;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.dashboard-notification-menu[hidden] {
  display: none;
}

.dashboard-notification-menu strong {
  color: #f8fafc;
  font-size: 0.95rem;
}

.dashboard-notification-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 10px;
  color: #dbeafe;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.dashboard-notification-menu a:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

.dashboard-notification-menu a.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.dashboard-notification-menu em {
  min-width: 28px;
  padding: 4px 8px;
  color: #f8fafc;
  background: rgba(37, 99, 235, 0.32);
  border-radius: 999px;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.dashboard-notification-menu p {
  margin: 0;
  color: #94a3b8;
  font-weight: 760;
}

.dashboard-user {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  color: #f8fafc;
  text-decoration: none;
}

.dashboard-user > span {
  grid-row: span 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #e0f2fe;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.42), rgba(37, 99, 235, 0.24));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 999px;
  font-weight: 950;
}

.dashboard-user strong,
.dashboard-user small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-user small {
  color: #94a3b8;
  font-weight: 760;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.dashboard-stat-card,
.dashboard-duty-card,
.dashboard-side-card,
.dashboard-table-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(6, 18, 32, 0.92)),
    color-mix(in srgb, var(--surface) 86%, #020617);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.dashboard-stat-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 13px;
}

a.dashboard-stat-card {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.dashboard-stat-card:hover,
a.dashboard-stat-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.3);
}

.dashboard-stat-card span,
.dashboard-card-head span,
.dashboard-duty-columns small,
.dashboard-table th {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-stat-card strong {
  color: #f8fafc;
  font-size: 1.58rem;
  line-height: 1;
}

.dashboard-stat-dialer-link strong {
  font-size: 1.3rem;
  line-height: 1.15;
}

.dashboard-stat-card small {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 760;
}

.dashboard-stat-blue {
  border-color: rgba(59, 130, 246, 0.38);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-green {
  border-color: rgba(34, 197, 94, 0.34);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.22), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-purple {
  border-color: rgba(168, 85, 247, 0.34);
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.24), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-amber {
  border-color: rgba(245, 158, 11, 0.36);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.24), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-cyan {
  border-color: rgba(20, 184, 166, 0.34);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.22), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-red {
  border-color: rgba(244, 63, 94, 0.36);
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.22), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-email {
  border-color: rgba(249, 115, 22, 0.42);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.26), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-email.has-items {
  border-color: rgba(251, 146, 60, 0.8);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12), 0 18px 48px rgba(0, 0, 0, 0.22);
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 12px;
  align-items: start;
}

.dashboard-duty-card,
.dashboard-side-card,
.dashboard-table-card {
  padding: 13px;
}

.dashboard-duty-card-call {
  border-color: rgba(59, 130, 246, 0.38);
}

.dashboard-duty-card-drive {
  border-color: rgba(34, 197, 94, 0.34);
}

.dashboard-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dashboard-card-head h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.05rem;
}

.dashboard-card-head a {
  color: #60a5fa;
  font-weight: 850;
  text-decoration: none;
}

.dashboard-card-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 10px;
  text-align: right;
  font-size: 0.82rem;
}

.dashboard-card-links a {
  white-space: nowrap;
}

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

.dashboard-duty-columns > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.3);
}

.dashboard-duty-card .call-duty-entry {
  padding: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.dashboard-duty-card .call-duty-list {
  gap: 8px;
}

.dashboard-duty-card .call-duty-entry-head {
  gap: 3px 10px;
}

.dashboard-duty-card .call-duty-entry-head strong {
  font-size: 0.96rem;
  line-height: 1.18;
}

.dashboard-duty-card .call-duty-entry-head span {
  max-width: 16ch;
  font-size: 0.75rem;
}

.dashboard-side-stack {
  display: grid;
  gap: 12px;
}

.dashboard-live-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-live-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  color: #dbeafe;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-weight: 780;
}

.dashboard-live-list li:first-child {
  border-top: 0;
}

.dashboard-live-list span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.dashboard-live-list .is-green {
  background: #22c55e;
}

.dashboard-live-list .is-amber {
  background: #f59e0b;
}

.dashboard-live-list .is-red {
  background: #f43f5e;
}

.dashboard-presence-list {
  display: grid;
  gap: 6px;
  margin: 9px 0 8px;
  padding: 0;
  list-style: none;
}

.dashboard-live-card .dashboard-presence-list {
  max-height: 318px;
  overflow-y: auto;
  padding-right: 4px;
}

.dashboard-live-card .dashboard-presence-list::-webkit-scrollbar {
  width: 8px;
}

.dashboard-live-card .dashboard-presence-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.34);
  border-radius: 999px;
}

.dashboard-presence-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 9px;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.dashboard-presence-list li.is-loading {
  color: #94a3b8;
  font-weight: 760;
}

.dashboard-presence-list > li > span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.dashboard-presence-list .is-green {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.dashboard-presence-list div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-presence-list strong,
.dashboard-presence-list small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-presence-list strong {
  color: #f8fafc;
  font-weight: 920;
}

.dashboard-presence-list small {
  color: #94a3b8;
  font-weight: 760;
}

.dashboard-live-summary {
  margin-top: 8px;
}

.dashboard-live-summary strong {
  color: #f8fafc;
}

.dashboard-shift-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
}

.dashboard-shift-summary span {
  color: #cbd5e1;
}

.dashboard-shift-summary strong {
  justify-self: end;
  padding: 5px 9px;
  color: #bfdbfe;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
}

.dashboard-table-card {
  display: grid;
  gap: 9px;
}

.dashboard-open-orders-card {
  border-color: rgba(34, 197, 94, 0.26);
}

.dashboard-table-count {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.dashboard-table th,
.dashboard-table td {
  padding: 9px 10px;
  color: #dbeafe;
  text-align: left;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.dashboard-table th {
  border-top: 0;
}

.dashboard-table a {
  color: #60a5fa;
  font-weight: 850;
  text-decoration: none;
}

.dashboard-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-delete-form {
  margin: 0;
}

.dashboard-delete-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-delete-button:hover,
.dashboard-delete-button:focus-visible {
  background: rgba(220, 38, 38, 0.38);
  color: #fff1f2;
}

.dashboard-team-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
  color: #bbf7d0;
  font-weight: 900;
}

.dashboard-team-badge small {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-team-form {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.dashboard-team-form select,
.dashboard-team-form button {
  min-height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
  color: #e2e8f0;
  font-weight: 850;
}

.dashboard-team-form select {
  min-width: 0;
  padding: 0 8px;
}

.dashboard-team-form button {
  padding: 0 9px;
  cursor: pointer;
}

.dashboard-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-weight: 900;
}

.dashboard-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.dashboard-status-offen {
  color: #93c5fd;
}

.dashboard-status-bestatter_nicht_erreicht {
  color: #f87171;
}

.dashboard-status-in_klaerung {
  color: #fbbf24;
}

.dashboard-status-in_ueberfuehrung {
  color: #34d399;
}

.dashboard-status-fertig {
  color: #4ade80;
}

.dashboard-empty {
  margin: 0;
  padding: 16px;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.messages-main {
  gap: 18px;
}

.messages-topbar {
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr) auto;
}

.messages-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.messages-summary-strip span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 10px 12px;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.78rem;
  font-weight: 850;
}

.messages-summary-strip strong {
  color: #f8fafc;
  font-size: 1.35rem;
  line-height: 1;
}

.messages-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.messages-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(6, 18, 32, 0.92)),
    color-mix(in srgb, var(--surface) 86%, #020617);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.messages-panel-call {
  border-color: rgba(59, 130, 246, 0.34);
}

.messages-panel-drive {
  border-color: rgba(34, 197, 94, 0.32);
}

.messages-panel-email {
  border-color: rgba(34, 211, 238, 0.38);
}

.messages-panel-email .messages-kicker {
  color: #67e8f9;
}

.messages-email-card em {
  color: #67e8f9;
}

.messages-panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.messages-panel-head h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.25rem;
}

.messages-panel-head a {
  color: #60a5fa;
  font-weight: 850;
  text-decoration: none;
}

.messages-list {
  display: grid;
  gap: 10px;
}

.messages-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 13px 14px;
  color: #e2e8f0;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.messages-card:hover,
.messages-card:focus-visible {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

.messages-card-important {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(127, 29, 29, 0.18);
}

.messages-kicker {
  color: #93c5fd;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.messages-panel-drive .messages-kicker {
  color: #86efac;
}

.messages-card strong {
  color: #f8fafc;
  font-size: 1.02rem;
  line-height: 1.25;
}

.messages-card small {
  color: #cbd5e1;
  font-weight: 720;
  line-height: 1.4;
}

.messages-card em {
  color: #94a3b8;
  font-style: normal;
  font-weight: 850;
}

.email-dailer-account-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.12);
}

.email-dailer-account-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.email-dailer-account-summary strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.email-inbox-grid,
.email-inbox-panel {
  display: grid;
  gap: 14px;
}

.email-inbox-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.email-inbox-count {
  padding: 7px 10px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 900;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
}

.email-inbox-count.has-new-mail {
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(5, 150, 105, 0.16);
}

.email-inbox-loading,
.email-inbox-empty,
.email-inbox-error {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 74%, transparent);
}

.email-inbox-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(127, 29, 29, 0.16);
}

.email-inbox-list {
  display: grid;
  gap: 10px;
}

.email-inbox-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.08);
}

.email-inbox-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.email-inbox-item > div:last-child {
  text-align: right;
}

.email-inbox-item span {
  color: #67e8f9;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.email-inbox-item strong,
.email-inbox-item time {
  color: var(--text);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.email-inbox-item small,
.email-inbox-footer small {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.email-inbox-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.legal-dashboard-main,
.profile-dashboard-main {
  max-width: 1320px;
}

.legal-dashboard-topbar {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.legal-dashboard-grid,
.profile-dashboard-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.legal-dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-dashboard-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.profile-summary-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.legal-dashboard-card,
.profile-dashboard-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: clamp(18px, 2.2vw, 26px);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(6, 18, 32, 0.92)),
    color-mix(in srgb, var(--surface) 86%, #020617);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.legal-dashboard-card::before,
.profile-dashboard-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(34, 197, 94, 0.75));
}

.legal-dashboard-card-wide,
.legal-dashboard-card-main {
  grid-column: 1 / -1;
}

.legal-dashboard-card h2,
.profile-dashboard-card h2 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.legal-dashboard-card p,
.legal-dashboard-card li,
.profile-dashboard-card p {
  color: #cbd5e1;
  line-height: 1.58;
}

.legal-dashboard-card p,
.legal-dashboard-card ul,
.profile-dashboard-card p {
  margin: 0;
}

.legal-dashboard-card strong,
.legal-dashboard-card a {
  color: #f8fafc;
}

.legal-dashboard-card a:hover,
.legal-dashboard-card a:focus-visible {
  color: #7dd3fc;
}

.legal-dashboard-card ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.legal-two-column-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-warning-card {
  border-color: rgba(248, 113, 113, 0.42);
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.26), rgba(15, 23, 42, 0.88)),
    color-mix(in srgb, var(--surface) 86%, #020617);
}

.legal-cookie-button {
  min-height: 42px;
  padding: 0 14px;
  color: #dbeafe;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.profile-dashboard-card {
  align-content: start;
}

.profile-dashboard-card .admin-form {
  display: grid;
  gap: 12px;
}

.profile-dashboard-card .button {
  width: 100%;
}

.profile-dashboard-password .admin-form {
  grid-template-columns: 1fr;
}

:root[data-theme="light"] .dashboard-shell-body {
  color: #0f172a;
  background:
    linear-gradient(120deg, rgba(238, 249, 247, 0.98), rgba(244, 247, 251, 0.98)),
    var(--bg);
}

:root[data-theme="light"] .dashboard-sidebar {
  background: rgba(248, 250, 252, 0.96);
  border-right-color: rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .dashboard-brand,
:root[data-theme="light"] .dashboard-topbar h1,
:root[data-theme="light"] .dashboard-user,
:root[data-theme="light"] .dashboard-stat-card strong,
:root[data-theme="light"] .dashboard-card-head h2,
:root[data-theme="light"] .dashboard-table a {
  color: #0f172a;
}

:root[data-theme="light"] .dashboard-nav-item,
:root[data-theme="light"] .dashboard-nav-item strong,
:root[data-theme="light"] .dashboard-quick-action,
:root[data-theme="light"] .dashboard-userbar .top-link,
:root[data-theme="light"] .dashboard-search input,
:root[data-theme="light"] .dashboard-table th,
:root[data-theme="light"] .dashboard-table td,
:root[data-theme="light"] .dashboard-live-list li,
:root[data-theme="light"] .dashboard-table-count,
:root[data-theme="light"] .dashboard-empty {
  color: #102033;
}

:root[data-theme="light"] .dashboard-brand small,
:root[data-theme="light"] .dashboard-topbar p,
:root[data-theme="light"] .dashboard-user small,
:root[data-theme="light"] .dashboard-stat-card span,
:root[data-theme="light"] .dashboard-card-head span,
:root[data-theme="light"] .dashboard-duty-columns small,
:root[data-theme="light"] .dashboard-table th,
:root[data-theme="light"] .dashboard-quick-actions > small {
  color: #475569;
}

:root[data-theme="light"] .dashboard-nav-item > span {
  color: #075985;
  background: #eff6ff;
  border-color: rgba(14, 116, 144, 0.22);
}

:root[data-theme="light"] .dashboard-nav-item.is-active,
:root[data-theme="light"] .dashboard-nav-item:hover,
:root[data-theme="light"] .dashboard-nav-item:focus-visible,
:root[data-theme="light"] .dashboard-userbar .top-link:hover,
:root[data-theme="light"] .dashboard-userbar .top-link:focus-visible,
:root[data-theme="light"] .dashboard-userbar .top-link.is-active {
  color: #082f49;
  background: #dbeafe;
  border-color: #60a5fa;
}

:root[data-theme="light"] .dashboard-quick-action-call {
  color: #082f49;
  background: #dbeafe;
  border-color: #60a5fa;
}

:root[data-theme="light"] .dashboard-quick-action-drive {
  color: #064e3b;
  background: #d1fae5;
  border-color: #6ee7b7;
}

:root[data-theme="light"] .dashboard-quick-action-dialer {
  color: #4c1d95;
  background: #ede9fe;
  border-color: #c4b5fd;
}

:root[data-theme="light"] .dashboard-quick-action-admin {
  color: #7c2d12;
  background: #ffedd5;
  border-color: #fdba74;
}

:root[data-theme="light"] .dashboard-search input,
:root[data-theme="light"] .dashboard-search-results,
:root[data-theme="light"] .dashboard-duty-columns > div,
:root[data-theme="light"] .dashboard-empty {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .dashboard-presence-list li {
  color: #102033;
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .dashboard-presence-list strong,
:root[data-theme="light"] .dashboard-live-summary strong {
  color: #0f172a;
}

:root[data-theme="light"] .dashboard-presence-list small,
:root[data-theme="light"] .dashboard-presence-list li.is-loading {
  color: #64748b;
}

:root[data-theme="light"] .dashboard-team-badge {
  color: #047857;
}

:root[data-theme="light"] .dashboard-team-badge small {
  color: #64748b;
}

:root[data-theme="light"] .dashboard-team-form select,
:root[data-theme="light"] .dashboard-team-form button {
  color: #102033;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .dashboard-team-form button {
  color: #065f46;
  background: #d1fae5;
  border-color: #86efac;
}

:root[data-theme="light"] .dashboard-delete-button {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

:root[data-theme="light"] .dashboard-delete-button:hover,
:root[data-theme="light"] .dashboard-delete-button:focus-visible {
  background: #fecaca;
  color: #7f1d1d;
}

:root[data-theme="light"] .dashboard-stat-card,
:root[data-theme="light"] .dashboard-duty-card,
:root[data-theme="light"] .dashboard-side-card,
:root[data-theme="light"] .dashboard-table-card,
:root[data-theme="light"] .messages-panel,
:root[data-theme="light"] .dashboard-duty-columns > div {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .dashboard-stat-blue {
  background: #eff6ff;
  border-color: #93c5fd;
}

:root[data-theme="light"] .dashboard-stat-green {
  background: #ecfdf5;
  border-color: #86efac;
}

:root[data-theme="light"] .dashboard-stat-purple {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

:root[data-theme="light"] .dashboard-stat-amber {
  background: #fffbeb;
  border-color: #fcd34d;
}

:root[data-theme="light"] .dashboard-stat-cyan {
  background: #ecfeff;
  border-color: #67e8f9;
}

:root[data-theme="light"] .dashboard-stat-red {
  background: #fff1f2;
  border-color: #fda4af;
}

:root[data-theme="light"] .dashboard-stat-email {
  background: #fff7ed;
  border-color: #fdba74;
}

:root[data-theme="light"] .dashboard-stat-email.has-items {
  background: #ffedd5;
  border-color: #fb923c;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12), 0 18px 44px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .dashboard-duty-card-call {
  border-color: #93c5fd;
}

:root[data-theme="light"] .dashboard-duty-card-drive,
:root[data-theme="light"] .dashboard-open-orders-card {
  border-color: #86efac;
}

:root[data-theme="light"] .dashboard-table th,
:root[data-theme="light"] .dashboard-table td,
:root[data-theme="light"] .dashboard-live-list li {
  border-color: rgba(15, 23, 42, 0.13);
}

:root[data-theme="light"] .messages-panel-call {
  border-color: rgba(59, 130, 246, 0.3);
}

:root[data-theme="light"] .messages-panel-drive {
  border-color: rgba(34, 197, 94, 0.28);
}

:root[data-theme="light"] .messages-panel-email {
  border-color: rgba(8, 145, 178, 0.3);
}

:root[data-theme="light"] .messages-summary-strip span,
:root[data-theme="light"] .messages-card {
  color: #102033;
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .messages-summary-strip strong,
:root[data-theme="light"] .messages-panel-head h2,
:root[data-theme="light"] .messages-card strong {
  color: #0f172a;
}

:root[data-theme="light"] .messages-card small,
:root[data-theme="light"] .messages-card em {
  color: #526458;
}

:root[data-theme="light"] .messages-card-important {
  border-color: rgba(220, 38, 38, 0.32);
  background: rgba(254, 226, 226, 0.72);
}

:root[data-theme="light"] .legal-dashboard-card,
:root[data-theme="light"] .profile-dashboard-card,
:root[data-theme="light"] .dashboard-main .legal-card,
:root[data-theme="light"] .dashboard-main .dialog-card,
:root[data-theme="light"] .dashboard-main .dialer-panel,
:root[data-theme="light"] .dashboard-main .dialer-info-post,
:root[data-theme="light"] .dashboard-main .testphase-transfer-card,
:root[data-theme="light"] .dashboard-main .testphase-info-item,
:root[data-theme="light"] .dashboard-main .account-table th,
:root[data-theme="light"] .dashboard-main .account-table td {
  color: #102033;
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .drive-orders-summary-strip article,
:root[data-theme="light"] .drive-orders-page .testphase-page-card,
:root[data-theme="light"] .drive-orders-page .testphase-transfer-card,
:root[data-theme="light"] .drive-orders-page .testphase-info-item {
  color: #102033;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(14, 165, 233, 0.035)),
    rgba(255, 255, 255, 0.88);
  border-color: rgba(21, 128, 61, 0.2);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

:root[data-theme="light"] .drive-orders-summary-strip span {
  color: #047857;
}

:root[data-theme="light"] .drive-orders-summary-strip strong,
:root[data-theme="light"] .drive-orders-page .testphase-case-section-head h2,
:root[data-theme="light"] .drive-orders-page .testphase-transfer-main strong,
:root[data-theme="light"] .drive-orders-page .testphase-transfer-location strong,
:root[data-theme="light"] .drive-orders-page .testphase-info-item strong {
  color: #0f172a;
}

:root[data-theme="light"] .drive-orders-summary-strip small,
:root[data-theme="light"] .drive-orders-page .testphase-case-section-head p,
:root[data-theme="light"] .drive-orders-page .testphase-transfer-main span,
:root[data-theme="light"] .drive-orders-page .testphase-transfer-main small,
:root[data-theme="light"] .drive-orders-page .testphase-transfer-location small,
:root[data-theme="light"] .drive-orders-page .testphase-info-item small,
:root[data-theme="light"] .drive-orders-page .testphase-info-item span {
  color: #475569;
}

:root[data-theme="light"] .drive-orders-page .testphase-transfer-detail,
:root[data-theme="light"] .drive-orders-page .testphase-transfer-location {
  background: rgba(255, 255, 255, 0.68);
}

:root[data-theme="light"] .legal-dashboard-card h2,
:root[data-theme="light"] .profile-dashboard-card h2,
:root[data-theme="light"] .legal-dashboard-card strong,
:root[data-theme="light"] .legal-dashboard-card a,
:root[data-theme="light"] .dashboard-main .dialer-panel strong,
:root[data-theme="light"] .dashboard-main .dialer-info-post strong,
:root[data-theme="light"] .dashboard-main .testphase-transfer-card strong,
:root[data-theme="light"] .dashboard-main .admin-card h2,
:root[data-theme="light"] .dashboard-main .account-table th {
  color: #0f172a;
}

:root[data-theme="light"] .legal-dashboard-card p,
:root[data-theme="light"] .legal-dashboard-card li,
:root[data-theme="light"] .profile-dashboard-card p,
:root[data-theme="light"] .dashboard-main .dialer-panel p,
:root[data-theme="light"] .dashboard-main .dialer-info-post p,
:root[data-theme="light"] .dashboard-main .testphase-transfer-card span,
:root[data-theme="light"] .dashboard-main .testphase-transfer-card small {
  color: #334155;
}

:root[data-theme="light"] .legal-warning-card {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(254, 242, 242, 0.84);
}

:root[data-theme="light"] .legal-cookie-button {
  color: #102033;
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.14);
}

:root[data-theme="light"] .dashboard-search-results,
:root[data-theme="light"] .dashboard-search-empty,
:root[data-theme="light"] .dashboard-notification-menu {
  background: #ffffff;
}

:root[data-theme="light"] .dashboard-notification-button {
  color: #334155;
}

:root[data-theme="light"] .dashboard-notification-button:hover,
:root[data-theme="light"] .dashboard-notification-button[aria-expanded="true"] {
  color: #0f172a;
  background: rgba(37, 99, 235, 0.1);
}

:root[data-theme="light"] .dashboard-notification-button > span {
  border-color: #ffffff;
}

:root[data-theme="light"] .dashboard-notification-menu {
  color: #102033;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .dashboard-notification-menu strong,
:root[data-theme="light"] .dashboard-notification-menu a {
  color: #0f172a;
}

:root[data-theme="light"] .dashboard-notification-menu a {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .dashboard-notification-menu p {
  color: #64748b;
}

@media (max-width: 1280px) {
  .dashboard-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-side-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .messages-topbar {
    grid-template-columns: 1fr;
  }

  .profile-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .profile-dashboard-password .admin-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .dashboard-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-sidebar-footer {
    display: none;
  }

  .dashboard-topbar {
    grid-template-columns: 1fr;
  }

  .dashboard-userbar {
    justify-content: flex-start;
  }

  .dashboard-content-grid,
  .dashboard-side-stack,
  .dashboard-duty-columns,
  .messages-grid,
  .email-inbox-grid,
  .legal-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .legal-two-column-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-main,
  .dashboard-sidebar {
    padding: 14px;
  }

  .dashboard-stat-grid,
  .dashboard-nav,
  .messages-summary-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-userbar {
    flex-wrap: wrap;
  }

  .dashboard-table {
    min-width: 700px;
  }
}

@media (max-width: 980px) {
  .drive-orders-summary-strip {
    grid-template-columns: 1fr;
  }

  .drive-orders-page .testphase-transfer-summary {
    grid-template-columns: 1fr;
  }

  .drive-orders-page .testphase-status-pill,
  .drive-orders-page .testphase-transfer-summary::after {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }

  .drive-orders-page .testphase-info-grid {
    grid-template-columns: 1fr;
  }

  .drive-orders-page .testphase-info-status,
  .drive-orders-page .testphase-info-wide {
    grid-column: auto;
  }

  .drive-orders-page .testphase-status-form {
    grid-template-columns: 1fr;
  }

  .drive-orders-page .testphase-status-form .button,
  .drive-orders-page .testphase-route-actions .button,
  .drive-orders-page .testphase-route-missing {
    width: 100%;
    text-align: center;
  }
}

/* Light mode readability pass: keep the layout, but make surfaces and text crisp. */
:root[data-theme="light"] {
  --light-ink: #0b1726;
  --light-text: #102033;
  --light-muted: #34495c;
  --light-line: #96aab9;
  --light-line-soft: #bbc9d3;
  --light-panel: #ffffff;
}

:root[data-theme="light"] body,
:root[data-theme="light"] .dashboard-shell-body,
:root[data-theme="light"] .dialer-standalone-body,
:root[data-theme="light"] .drive-orders-page,
:root[data-theme="light"] .bestatter-portal-body {
  color: var(--light-text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.74)),
    linear-gradient(120deg, rgba(226, 246, 243, 0.98), rgba(239, 247, 255, 0.96)),
    var(--bg);
}

:root[data-theme="light"] .dashboard-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 250, 0.96));
  border-right-color: var(--light-line);
  box-shadow: 10px 0 34px rgba(15, 23, 42, 0.07);
}

:root[data-theme="light"] .dashboard-brand,
:root[data-theme="light"] .dashboard-brand strong,
:root[data-theme="light"] .dashboard-topbar h1,
:root[data-theme="light"] .dashboard-card-head h2,
:root[data-theme="light"] .dashboard-stat-card strong,
:root[data-theme="light"] .dashboard-table a,
:root[data-theme="light"] .dashboard-user strong,
:root[data-theme="light"] .messages-panel-head h2,
:root[data-theme="light"] .legal-dashboard-card h2,
:root[data-theme="light"] .profile-dashboard-card h2,
:root[data-theme="light"] .dialer-toolbar h1,
:root[data-theme="light"] .bestatter-title-row h2,
:root[data-theme="light"] .testphase-page-head h1 {
  color: var(--light-ink);
}

:root[data-theme="light"] .dashboard-brand small,
:root[data-theme="light"] .dashboard-topbar p,
:root[data-theme="light"] .dashboard-card-head span,
:root[data-theme="light"] .dashboard-stat-card span,
:root[data-theme="light"] .dashboard-stat-card small,
:root[data-theme="light"] .dashboard-user small,
:root[data-theme="light"] .messages-card small,
:root[data-theme="light"] .messages-card em,
:root[data-theme="light"] .dashboard-duty-columns small,
:root[data-theme="light"] .dashboard-table th,
:root[data-theme="light"] .dashboard-presence-list small,
:root[data-theme="light"] .dashboard-sidebar-footer,
:root[data-theme="light"] .dashboard-sidebar-footer a {
  color: var(--light-muted);
}

:root[data-theme="light"] .dashboard-stat-card,
:root[data-theme="light"] .dashboard-duty-card,
:root[data-theme="light"] .dashboard-side-card,
:root[data-theme="light"] .dashboard-table-card,
:root[data-theme="light"] .messages-panel,
:root[data-theme="light"] .legal-dashboard-card,
:root[data-theme="light"] .profile-dashboard-card,
:root[data-theme="light"] .admin-card,
:root[data-theme="light"] .dialog-card,
:root[data-theme="light"] .dialer-panel,
:root[data-theme="light"] .bestatter-table-card,
:root[data-theme="light"] .bestatter-form-card,
:root[data-theme="light"] .testphase-page-card,
:root[data-theme="light"] .testphase-transfer-card,
:root[data-theme="light"] .bestatter-portal-card {
  color: var(--light-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 252, 0.92));
  border-color: var(--light-line);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .dashboard-duty-columns > div,
:root[data-theme="light"] .dashboard-presence-list li,
:root[data-theme="light"] .messages-card,
:root[data-theme="light"] .dashboard-search-results,
:root[data-theme="light"] .dashboard-notification-menu,
:root[data-theme="light"] .dialer-call-detail-grid > div,
:root[data-theme="light"] .dialer-call-note,
:root[data-theme="light"] .dialer-call-questions,
:root[data-theme="light"] .dialer-call-bestatter,
:root[data-theme="light"] .dialer-bestatter-preview,
:root[data-theme="light"] .dialer-bestatter-data-grid > div,
:root[data-theme="light"] .bestatter-readonly-fieldset,
:root[data-theme="light"] .bestatter-emergency-section,
:root[data-theme="light"] .bestatter-questions,
:root[data-theme="light"] .account-card,
:root[data-theme="light"] .account-login-info,
:root[data-theme="light"] .testphase-info-item {
  color: var(--light-text);
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--light-line);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea,
:root[data-theme="light"] .dashboard-search input,
:root[data-theme="light"] .dialer-form input,
:root[data-theme="light"] .dialer-form select,
:root[data-theme="light"] .dialer-form textarea,
:root[data-theme="light"] .bestatter-form input,
:root[data-theme="light"] .bestatter-form select,
:root[data-theme="light"] .bestatter-form textarea,
:root[data-theme="light"] .account-picker select,
:root[data-theme="light"] .account-search input {
  color: var(--light-ink);
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.22);
}

:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: #66758a;
  opacity: 1;
}

:root[data-theme="light"] .dashboard-nav-item,
:root[data-theme="light"] .dashboard-quick-action,
:root[data-theme="light"] .dashboard-userbar .top-link,
:root[data-theme="light"] .dashboard-notification-button,
:root[data-theme="light"] .legal-cookie-button {
  color: var(--light-text);
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.76);
}

:root[data-theme="light"] .dashboard-nav-item.is-active,
:root[data-theme="light"] .dashboard-nav-item:hover,
:root[data-theme="light"] .dashboard-nav-item:focus-visible,
:root[data-theme="light"] .dashboard-userbar .top-link:hover,
:root[data-theme="light"] .dashboard-userbar .top-link:focus-visible,
:root[data-theme="light"] .dashboard-userbar .top-link.is-active {
  color: #06203a;
  background: linear-gradient(135deg, #dbeafe, #eef7ff);
  border-color: #3b82f6;
}

:root[data-theme="light"] .dashboard-nav-item.is-active strong,
:root[data-theme="light"] .dashboard-nav-item:hover strong,
:root[data-theme="light"] .dashboard-nav-item:focus-visible strong {
  color: #06203a;
}

:root[data-theme="light"] .dashboard-quick-action-call {
  color: #06325f;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border-color: #60a5fa;
}

:root[data-theme="light"] .dashboard-quick-action-drive {
  color: #064e3b;
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  border-color: #34d399;
}

:root[data-theme="light"] .dashboard-quick-action-dialer {
  color: #4c1d95;
  background: linear-gradient(135deg, #ede9fe, #faf5ff);
  border-color: #a78bfa;
}

:root[data-theme="light"] .dashboard-quick-action-admin {
  color: #7c2d12;
  background: linear-gradient(135deg, #ffedd5, #fff7ed);
  border-color: #fb923c;
}

:root[data-theme="light"] .call-duty-entry,
:root[data-theme="light"] .dashboard-table tbody tr,
:root[data-theme="light"] .bestatter-table tbody tr,
:root[data-theme="light"] .account-summary-button,
:root[data-theme="light"] .dialer-case-card,
:root[data-theme="light"] .dialer-info-post,
:root[data-theme="light"] .bestatter-portal-case {
  color: var(--light-text);
  background: rgba(255, 255, 255, 0.84);
  border-color: var(--light-line);
}

:root[data-theme="light"] .call-duty-entry strong,
:root[data-theme="light"] .dashboard-table td,
:root[data-theme="light"] .bestatter-table td,
:root[data-theme="light"] .messages-card strong,
:root[data-theme="light"] .dialer-case-card strong,
:root[data-theme="light"] .dialer-info-post strong,
:root[data-theme="light"] .bestatter-portal-case strong,
:root[data-theme="light"] .account-summary-main strong {
  color: var(--light-ink);
}

:root[data-theme="light"] .dashboard-table th,
:root[data-theme="light"] .bestatter-table th,
:root[data-theme="light"] .account-table th {
  color: #334155;
  background: rgba(226, 232, 240, 0.72);
  border-color: var(--light-line);
}

:root[data-theme="light"] .dashboard-table td,
:root[data-theme="light"] .bestatter-table td,
:root[data-theme="light"] .account-table td {
  border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .messages-card-important {
  color: #7f1d1d;
  background: #fff1f2;
  border-color: #fda4af;
}

:root[data-theme="light"] .dashboard-notification-menu a:hover,
:root[data-theme="light"] .dashboard-notification-menu a:focus-visible,
:root[data-theme="light"] .messages-card:hover,
:root[data-theme="light"] .messages-card:focus-visible,
:root[data-theme="light"] a.dashboard-stat-card:hover,
:root[data-theme="light"] a.dashboard-stat-card:focus-visible {
  background: #eef6ff;
  border-color: #60a5fa;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.12);
}

/* Sichtbarer, barrierearmer Hell-/Dunkel-Umschalter fuer das gesamte Portal. */
.icon-button[data-theme-toggle] {
  grid-template-columns: 22px auto;
  gap: 8px;
  width: auto;
  min-width: 102px;
  padding: 0 13px;
  font-weight: 900;
  white-space: nowrap;
}

.icon-button[data-theme-toggle] .sun-icon,
.icon-button[data-theme-toggle] .moon-icon {
  position: relative;
  grid-column: 1;
  grid-row: 1;
}

.theme-toggle-label {
  grid-column: 2;
  color: currentColor;
  font-size: 0.86rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.icon-button[data-theme-toggle]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-strong) 55%, transparent);
  outline-offset: 3px;
}

:root[data-theme="light"] body::before {
  opacity: 0.12;
  mix-blend-mode: multiply;
}

:root[data-theme="light"] .site-header,
:root[data-theme="light"] .dashboard-topbar,
:root[data-theme="light"] .dialog-card,
:root[data-theme="light"] .login-card-page,
:root[data-theme="light"] .announcement-dialog,
:root[data-theme="light"] .email-reminder-dialog {
  color: var(--light-text);
  background-color: #ffffff;
  border-color: var(--light-line);
}

:root[data-theme="light"] .icon-button[data-theme-toggle] {
  color: #0b1726;
  background: #ffffff;
  border-color: #64748b;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .button-secondary,
:root[data-theme="light"] .password-toggle {
  color: #0b1726;
  background: #ffffff;
  border-color: #64748b;
}

:root[data-theme="light"] .flash.success {
  color: #065f46;
  background: #ecfdf5;
  border-color: #34d399;
}

:root[data-theme="light"] .flash.error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #f87171;
}

@media (max-width: 640px) {
  .icon-button[data-theme-toggle] {
    min-width: 92px;
    padding-inline: 10px;
  }
}

/* Heller Modus mit klaren Abgrenzungen wie im dunklen Design. */
:root[data-theme="light"] body,
:root[data-theme="light"] .dashboard-shell-body,
:root[data-theme="light"] .dialer-standalone-body,
:root[data-theme="light"] .drive-orders-page,
:root[data-theme="light"] .bestatter-portal-body {
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 222, 128, 0.24), transparent 27%),
    radial-gradient(circle at 92% 8%, rgba(203, 190, 255, 0.22), transparent 29%),
    linear-gradient(120deg, #e7eef3, #edf3f6 52%, #e4eee9);
}

:root[data-theme="light"] .dashboard-sidebar {
  border-right: 2px solid #8fa4b3;
  box-shadow: 8px 0 24px rgba(30, 55, 75, 0.12);
}

:root[data-theme="light"] .dashboard-topbar {
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #96aab9;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(30, 55, 75, 0.11);
}

:root[data-theme="light"] .dashboard-stat-card,
:root[data-theme="light"] .dashboard-duty-card,
:root[data-theme="light"] .dashboard-side-card,
:root[data-theme="light"] .dashboard-table-card,
:root[data-theme="light"] .messages-panel,
:root[data-theme="light"] .legal-dashboard-card,
:root[data-theme="light"] .profile-dashboard-card,
:root[data-theme="light"] .admin-card,
:root[data-theme="light"] .dialog-card,
:root[data-theme="light"] .dialer-panel,
:root[data-theme="light"] .bestatter-table-card,
:root[data-theme="light"] .bestatter-form-card,
:root[data-theme="light"] .testphase-page-card,
:root[data-theme="light"] .testphase-transfer-card,
:root[data-theme="light"] .bestatter-portal-card,
:root[data-theme="light"] .site-header,
:root[data-theme="light"] .announcement-dialog,
:root[data-theme="light"] .email-reminder-dialog {
  background: #ffffff;
  border-color: #96aab9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 26px rgba(30, 55, 75, 0.13);
}

:root[data-theme="light"] .dashboard-duty-columns > div,
:root[data-theme="light"] .dashboard-presence-list li,
:root[data-theme="light"] .messages-card,
:root[data-theme="light"] .dashboard-search-results,
:root[data-theme="light"] .dashboard-notification-menu,
:root[data-theme="light"] .dialer-call-detail-grid > div,
:root[data-theme="light"] .dialer-call-note,
:root[data-theme="light"] .dialer-call-questions,
:root[data-theme="light"] .dialer-call-bestatter,
:root[data-theme="light"] .dialer-bestatter-preview,
:root[data-theme="light"] .dialer-bestatter-data-grid > div,
:root[data-theme="light"] .bestatter-readonly-fieldset,
:root[data-theme="light"] .bestatter-emergency-section,
:root[data-theme="light"] .bestatter-questions,
:root[data-theme="light"] .account-card,
:root[data-theme="light"] .account-login-info,
:root[data-theme="light"] .testphase-info-item,
:root[data-theme="light"] .call-duty-entry,
:root[data-theme="light"] .dialer-case-card,
:root[data-theme="light"] .dialer-info-post,
:root[data-theme="light"] .bestatter-portal-case {
  color: #102033;
  background: #f5f8fa;
  border-color: #a8bac7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .dashboard-nav-item {
  color: #102033;
  background: rgba(255, 255, 255, 0.72);
  border-color: #c0cdd6;
}

:root[data-theme="light"] .dashboard-nav-item.is-active,
:root[data-theme="light"] .dashboard-nav-item:hover,
:root[data-theme="light"] .dashboard-nav-item:focus-visible {
  color: #06203a;
  background: #dcecff;
  border-color: #3f83c5;
  box-shadow: inset 4px 0 0 #2563a8;
}

:root[data-theme="light"] .dashboard-quick-actions,
:root[data-theme="light"] .dashboard-sidebar-footer {
  border-color: #a8bac7;
}

:root[data-theme="light"] .dashboard-stat-blue {
  background: #e6f1ff;
  border-color: #4f91d0;
}

:root[data-theme="light"] .dashboard-stat-green {
  background: #e5f7ec;
  border-color: #4da776;
}

:root[data-theme="light"] .dashboard-stat-purple {
  background: #f0eaff;
  border-color: #8c70c8;
}

:root[data-theme="light"] .dashboard-stat-amber {
  background: #fff4d8;
  border-color: #d6992d;
}

:root[data-theme="light"] .dashboard-stat-cyan {
  background: #e4f7fa;
  border-color: #3d98a6;
}

:root[data-theme="light"] .dashboard-stat-red {
  background: #ffe8ec;
  border-color: #ce6678;
}

:root[data-theme="light"] .dashboard-stat-email,
:root[data-theme="light"] .dashboard-stat-email.has-items {
  background: #ffead2;
  border-color: #df7726;
  box-shadow: 0 0 0 2px rgba(223, 119, 38, 0.14), 0 10px 26px rgba(30, 55, 75, 0.12);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea,
:root[data-theme="light"] .dashboard-search input,
:root[data-theme="light"] .dialer-form input,
:root[data-theme="light"] .dialer-form select,
:root[data-theme="light"] .dialer-form textarea,
:root[data-theme="light"] .bestatter-form input,
:root[data-theme="light"] .bestatter-form select,
:root[data-theme="light"] .bestatter-form textarea,
:root[data-theme="light"] .account-picker select,
:root[data-theme="light"] .account-search input {
  color: #0b1726;
  background: #ffffff;
  border-color: #7f97a8;
  box-shadow: inset 0 1px 2px rgba(30, 55, 75, 0.08);
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  border-color: #007d9f;
  outline: 3px solid rgba(0, 125, 159, 0.18);
  outline-offset: 1px;
}

:root[data-theme="light"] .button-secondary,
:root[data-theme="light"] .password-toggle,
:root[data-theme="light"] .dashboard-userbar .top-link,
:root[data-theme="light"] .dashboard-notification-button,
:root[data-theme="light"] .legal-cookie-button,
:root[data-theme="light"] .dashboard-team-form select,
:root[data-theme="light"] .dashboard-team-form button {
  color: #102033;
  background: #f8fafc;
  border-color: #71899a;
}

:root[data-theme="light"] .dashboard-table th,
:root[data-theme="light"] .bestatter-table th,
:root[data-theme="light"] .account-table th {
  color: #1d3348;
  background: #dce6ed;
  border-color: #9dafbd;
}

:root[data-theme="light"] .dashboard-table td,
:root[data-theme="light"] .bestatter-table td,
:root[data-theme="light"] .account-table td {
  border-color: #b4c3ce;
}

:root[data-theme="light"] .dashboard-table tbody tr:nth-child(even),
:root[data-theme="light"] .bestatter-table tbody tr:nth-child(even),
:root[data-theme="light"] .account-table tbody tr:nth-child(even) {
  background: #f3f7f9;
}

:root[data-theme="light"] .dashboard-table tbody tr:hover,
:root[data-theme="light"] .bestatter-table tbody tr:hover,
:root[data-theme="light"] .account-table tbody tr:hover {
  background: #e7f1f7;
}

:root[data-theme="light"] .dashboard-card-head a,
:root[data-theme="light"] .dashboard-table a,
:root[data-theme="light"] .bestatter-table a {
  color: #075b96;
}

/* Aktueller Bereitschaftsbestatter im neuen Dailer. */
.dialer-on-call-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  padding: clamp(16px, 2.5vw, 22px);
  border: 1px solid color-mix(in srgb, #f59e0b 58%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, #f59e0b 12%, transparent), transparent 62%),
    var(--panel);
  box-shadow: var(--shadow);
}

.dialer-on-call-details {
  display: block;
  padding: 0;
  overflow: hidden;
}

.dialer-on-call-summary {
  display: grid;
  grid-template-columns: minmax(170px, 0.55fr) minmax(240px, 1fr) auto;
  gap: 10px 18px;
  align-items: center;
  min-height: 64px;
  padding: 15px clamp(16px, 2.5vw, 22px);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.dialer-on-call-summary::-webkit-details-marker {
  display: none;
}

.dialer-on-call-summary > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialer-on-call-summary > strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.dialer-on-call-summary > em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 36px 6px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
  position: relative;
}

.dialer-on-call-summary > em::after {
  content: "+";
  position: absolute;
  right: 12px;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
}

.dialer-on-call-details[open] .dialer-on-call-summary > em::after {
  content: "−";
}

.dialer-on-call-details[open] .dialer-on-call-summary {
  border-bottom: 1px solid var(--line);
}

.dialer-on-call-card-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.1fr);
  gap: 20px;
  align-items: center;
  padding: clamp(16px, 2.5vw, 22px);
}

.dialer-on-call-card.is-ready {
  border-color: color-mix(in srgb, #22c55e 62%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, #22c55e 11%, transparent), transparent 62%),
    var(--panel);
}

.dialer-on-call-card.is-unavailable {
  border-color: color-mix(in srgb, #ef4444 66%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, #ef4444 12%, transparent), transparent 62%),
    var(--panel);
}

.dialer-on-call-status,
.dialer-on-call-compact {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.dialer-on-call-status > div,
.dialer-on-call-compact > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dialer-on-call-dot {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 5px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14);
}

.is-ready .dialer-on-call-dot {
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
}

.is-unavailable .dialer-on-call-dot {
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.14);
}

.dialer-on-call-status small,
.dialer-on-call-compact small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialer-on-call-status span:not(.dialer-on-call-dot) {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.dialer-on-call-status strong {
  color: var(--text);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  overflow-wrap: anywhere;
}

.dialer-on-call-status p,
.dialer-on-call-compact p,
.dialer-on-call-readonly {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.dialer-on-call-contact {
  display: flex;
  gap: 7px 14px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.dialer-on-call-contact b,
.dialer-on-call-contact a,
.dialer-on-call-compact a {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.dialer-on-call-contact a:hover,
.dialer-on-call-compact a:hover {
  text-decoration: underline;
}

.dialer-on-call-note {
  max-width: 62ch;
  padding: 7px 9px;
  border-left: 3px solid color-mix(in srgb, var(--accent-cool) 55%, var(--line));
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.dialer-on-call-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dialer-on-call-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.dialer-on-call-bestatter-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-cool) 6%, var(--surface-soft));
}

.dialer-on-call-picker-heading {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-cool) 28%, var(--line));
}

.dialer-on-call-picker-heading strong {
  color: var(--text);
  font-size: 0.9rem;
}

.dialer-on-call-picker-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.dialer-on-call-search-field {
  display: grid;
  gap: 6px;
}

.dialer-on-call-search-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.dialer-on-call-search-row > input[type="search"] {
  min-width: 0;
  padding-left: 42px;
  padding-right: 116px;
  color: var(--text);
  font-weight: 800;
  border-color: color-mix(in srgb, var(--accent-cool) 56%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-cool) 14%, transparent) 0 38px, transparent 38px),
    var(--field-bg, rgba(255, 255, 255, 0.04));
}

.dialer-on-call-search-row::before {
  content: "⌕";
  position: absolute;
  z-index: 1;
  margin-left: 13px;
  color: var(--accent-cool);
  font-size: 1.25rem;
  font-weight: 950;
  pointer-events: none;
}

.dialer-on-call-search-clear {
  position: absolute;
  right: 6px;
  min-height: 32px;
  padding: 5px 9px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-cool) 14%, var(--surface-soft));
  cursor: pointer;
}

.dialer-on-call-search-clear:hover,
.dialer-on-call-search-clear:focus-visible {
  border-color: var(--accent-cool);
  background: color-mix(in srgb, var(--accent-cool) 22%, var(--surface-soft));
}

.dialer-on-call-search-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 7px 9px;
  border-left: 3px solid color-mix(in srgb, var(--accent-cool) 58%, var(--line));
  background: color-mix(in srgb, var(--accent-cool) 9%, transparent);
}

.dialer-on-call-search-feedback > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.78rem;
}

.dialer-on-call-search-feedback > strong.is-active {
  color: var(--text);
}

.dialer-on-call-search-feedback > small {
  padding: 5px 9px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 38%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-cool) 12%, var(--surface-soft));
}

.dialer-on-call-search-feedback > small.is-empty {
  color: #fecaca;
  border-color: color-mix(in srgb, #ef4444 58%, var(--line));
  background: color-mix(in srgb, #7f1d1d 28%, var(--surface-soft));
}

.dialer-on-call-bestatter-picker select[data-on-call-bestatter-select] {
  border-width: 2px;
  border-color: color-mix(in srgb, #22c55e 54%, var(--line));
  background: color-mix(in srgb, #22c55e 7%, var(--field-bg, rgba(255, 255, 255, 0.04)));
}

.dialer-on-call-form input:not([type="radio"]),
.dialer-on-call-form select,
.dialer-on-call-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  border: 1px solid var(--field-border, var(--line));
  border-radius: 8px;
  background: var(--field-bg, rgba(255, 255, 255, 0.04));
}

.dialer-on-call-form textarea {
  resize: vertical;
}

.dialer-on-call-field-help {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.4;
}

.dialer-on-call-form input:focus,
.dialer-on-call-form select:focus,
.dialer-on-call-form textarea:focus {
  border-color: var(--accent-cool);
  outline: 3px solid color-mix(in srgb, var(--accent-cool) 18%, transparent);
  outline-offset: 1px;
}

.dialer-on-call-wide,
.dialer-on-call-actions {
  grid-column: 1 / -1;
}

.dialer-availability-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.dialer-availability-switch legend {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.dialer-availability-switch label {
  position: relative;
  display: block;
  cursor: pointer;
}

.dialer-availability-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dialer-availability-switch span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.dialer-availability-switch input[value="bereit"]:checked + span {
  color: #dcfce7;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.22);
}

.dialer-availability-switch input[value="eingeschraenkt"]:checked + span {
  color: #fef3c7;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
}

.dialer-availability-switch input[value="nicht_bereit"]:checked + span {
  color: #fee2e2;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.dialer-availability-switch input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent-cool) 24%, transparent);
  outline-offset: 2px;
}

.dialer-on-call-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dialer-on-call-compact {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1.45fr) minmax(220px, 0.75fr);
  gap: 12px;
  align-items: start;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, #f59e0b 58%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, #f59e0b 9%, var(--surface-soft));
}

.dialer-on-call-compact-transporter {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 12px;
  border-left: 3px solid color-mix(in srgb, #22c55e 70%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.dialer-on-call-compact-transporter strong {
  font-size: 1rem;
}

.dialer-on-call-compact-transporter.is-missing {
  border-left-color: #ef4444;
  background: color-mix(in srgb, #ef4444 9%, var(--panel));
}

.dialer-on-call-compact-transporter.is-missing strong {
  color: #ef4444;
}

.dialer-on-call-compact.is-ready {
  border-color: color-mix(in srgb, #22c55e 58%, var(--line));
  background: color-mix(in srgb, #22c55e 9%, var(--surface-soft));
}

.dialer-on-call-compact.is-unavailable {
  border-color: color-mix(in srgb, #ef4444 62%, var(--line));
  background: color-mix(in srgb, #ef4444 10%, var(--surface-soft));
}

.dialer-on-call-compact strong {
  color: var(--text);
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

:root[data-theme="light"] .dialer-on-call-card {
  color: #102033;
  border-color: #c48316;
  background: linear-gradient(135deg, #fff4d7, #ffffff 62%);
  box-shadow: 0 10px 26px rgba(30, 55, 75, 0.13);
}

:root[data-theme="light"] .dialer-on-call-summary > span,
:root[data-theme="light"] .dialer-on-call-summary > em {
  color: #34495c;
}

:root[data-theme="light"] .dialer-on-call-summary > strong,
:root[data-theme="light"] .dialer-on-call-summary > em::after {
  color: #102033;
}

:root[data-theme="light"] .dialer-on-call-summary > em {
  border-color: #8fa4b3;
  background: #f5f8fa;
}

:root[data-theme="light"] .dialer-on-call-card.is-ready {
  border-color: #3b9560;
  background: linear-gradient(135deg, #e7f7ed, #ffffff 62%);
}

:root[data-theme="light"] .dialer-on-call-card.is-unavailable {
  border-color: #c85b5b;
  background: linear-gradient(135deg, #ffeaea, #ffffff 62%);
}

:root[data-theme="light"] .dialer-on-call-status strong,
:root[data-theme="light"] .dialer-on-call-compact strong {
  color: #102033;
}

:root[data-theme="light"] .dialer-on-call-status small,
:root[data-theme="light"] .dialer-on-call-status span:not(.dialer-on-call-dot),
:root[data-theme="light"] .dialer-on-call-status p,
:root[data-theme="light"] .dialer-on-call-compact small,
:root[data-theme="light"] .dialer-on-call-compact p,
:root[data-theme="light"] .dialer-on-call-readonly,
:root[data-theme="light"] .dialer-on-call-form label {
  color: #34495c;
}

:root[data-theme="light"] .dialer-on-call-bestatter-picker {
  border-color: #6e95aa;
  background: #edf4f7;
}

:root[data-theme="light"] .dialer-on-call-search-row > input[type="search"] {
  border-color: #5f8ea8;
  background:
    linear-gradient(90deg, #dcecf5 0 38px, transparent 38px),
    #ffffff;
}

:root[data-theme="light"] .dialer-on-call-search-feedback {
  border-left-color: #4f87a5;
  background: #dcebf2;
}

:root[data-theme="light"] .dialer-on-call-search-feedback > small {
  color: #123b55;
  border-color: #7da3b9;
  background: #e6f1f7;
}

:root[data-theme="light"] .dialer-on-call-search-clear {
  color: #123b55;
  border-color: #7da3b9;
  background: #e6f1f7;
}

:root[data-theme="light"] .dialer-on-call-bestatter-picker select[data-on-call-bestatter-select] {
  border-color: #3b9560;
  background: #f0fbf4;
}

:root[data-theme="light"] .dialer-on-call-contact b,
:root[data-theme="light"] .dialer-on-call-contact a,
:root[data-theme="light"] .dialer-on-call-compact a {
  color: #123b55;
}

:root[data-theme="light"] .dialer-availability-switch span {
  color: #34495c;
  border-color: #8fa4b3;
  background: #f5f8fa;
}

:root[data-theme="light"] .dialer-availability-switch input[value="bereit"]:checked + span {
  color: #14532d;
  border-color: #3b9560;
  background: #dcfce7;
}

:root[data-theme="light"] .dialer-availability-switch input[value="eingeschraenkt"]:checked + span {
  color: #713f12;
  border-color: #c48316;
  background: #fef3c7;
}

:root[data-theme="light"] .dialer-availability-switch input[value="nicht_bereit"]:checked + span {
  color: #7f1d1d;
  border-color: #c85b5b;
  background: #fee2e2;
}

:root[data-theme="light"] .dialer-on-call-compact {
  border-color: #c48316;
  background: #fff6df;
}

:root[data-theme="light"] .dialer-on-call-compact.is-ready {
  border-color: #3b9560;
  background: #edf9f1;
}

:root[data-theme="light"] .dialer-on-call-compact.is-unavailable {
  border-color: #c85b5b;
  background: #fff0f0;
}

:root[data-theme="light"] .dialer-on-call-compact-transporter {
  border-left-color: #27854e;
  background: rgba(255, 255, 255, 0.76);
}

:root[data-theme="light"] .dialer-on-call-compact-transporter.is-missing {
  border-left-color: #b42323;
  background: #fff0f0;
}

:root[data-theme="light"] .dialer-on-call-compact-transporter.is-missing strong {
  color: #991b1b;
}

@media (max-width: 800px) {
  .dialer-on-call-card {
    grid-template-columns: 1fr;
  }

  .dialer-on-call-summary,
  .dialer-on-call-card-body {
    grid-template-columns: 1fr;
  }

  .dialer-on-call-summary > em {
    justify-self: stretch;
  }

  .dialer-on-call-form,
  .dialer-availability-switch {
    grid-template-columns: 1fr;
  }

  .dialer-on-call-search-row > input[type="search"] {
    padding-right: 12px;
  }

  .dialer-on-call-search-clear {
    position: static;
    justify-self: start;
  }

  .dialer-on-call-compact {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dialer-on-call-compact-transporter {
    grid-column: 2;
    margin-top: 4px;
  }
}

/* Seitenmenue: Admin bleibt als sicherheitsrelevanter Bereich dauerhaft rot markiert. */
.dashboard-nav-item--admin,
.dashboard-nav-item--admin:hover,
.dashboard-nav-item--admin:focus-visible,
.dashboard-nav-item--admin.is-active,
:root[data-theme="light"] .dashboard-nav-item--admin,
:root[data-theme="light"] .dashboard-nav-item--admin:hover,
:root[data-theme="light"] .dashboard-nav-item--admin:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--admin.is-active {
  color: #ffffff;
  border-color: #ef4444;
  background: linear-gradient(135deg, #991b1b, #dc2626);
  box-shadow: inset 4px 0 0 #fecaca, 0 7px 18px rgba(127, 29, 29, 0.28);
}

.dashboard-nav-item--admin strong,
.dashboard-nav-item--admin > span,
:root[data-theme="light"] .dashboard-nav-item--admin strong,
:root[data-theme="light"] .dashboard-nav-item--admin > span {
  color: #ffffff;
}

.dashboard-nav-item--admin > span,
:root[data-theme="light"] .dashboard-nav-item--admin > span {
  border-color: rgba(254, 202, 202, 0.7);
  background: rgba(127, 29, 29, 0.4);
}

/* Pinnwand: klare blaue Orientierung mit hohem Kontrast. */
.dashboard-nav-item--pinboard,
.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible,
.dashboard-nav-item--pinboard.is-active,
:root[data-theme="light"] .dashboard-nav-item--pinboard,
:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--pinboard.is-active {
  color: #ffffff;
  border-color: #60a5fa;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  box-shadow: inset 4px 0 0 #bfdbfe, 0 7px 18px rgba(30, 64, 175, 0.25);
}

.dashboard-nav-item--pinboard strong,
.dashboard-nav-item--pinboard > span,
:root[data-theme="light"] .dashboard-nav-item--pinboard strong,
:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  color: #ffffff;
}

/* Dailer: kompakte Falluebersicht ohne sichtbares Infoboard. */
.dialer-workspace-cases-only {
  grid-template-columns: minmax(0, 1fr);
}

.dialer-cases-panel {
  gap: 14px;
}

.dialer-case-stats-with-new {
  grid-template-columns: minmax(240px, 1.8fr) repeat(4, minmax(0, 1fr));
}

.dialer-new-case-count {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 112px;
  padding: 20px 24px;
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-soft));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--accent) 76%, transparent);
}

.dialer-new-case-count .dialer-new-case-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: inherit;
  font-size: inherit;
  text-transform: none;
}

.dialer-new-case-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, transparent);
  border-radius: 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.dialer-new-case-count:hover,
.dialer-new-case-count:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 78%, var(--line));
  background: color-mix(in srgb, var(--accent) 23%, var(--surface-soft));
}

.dialer-new-case-copy > span {
  color: color-mix(in srgb, var(--accent) 62%, var(--text));
  font-size: 0.82rem;
}

.dialer-new-case-copy strong {
  color: var(--text);
  font-size: clamp(1.3rem, 1.5vw, 1.6rem);
  line-height: 1.15;
}

:root[data-theme="light"] .dialer-new-case-count {
  border-color: #39825a;
  background: #cce9d6;
  box-shadow: inset 4px 0 0 #39825a, 0 8px 18px rgba(35, 105, 67, 0.14);
}

:root[data-theme="light"] .dialer-new-case-count:hover,
:root[data-theme="light"] .dialer-new-case-count:focus-visible {
  border-color: #2e704c;
  background: #bce0c8;
}

:root[data-theme="light"] .dialer-new-case-copy > span,
:root[data-theme="light"] .dialer-new-case-copy strong,
:root[data-theme="light"] .dialer-new-case-icon {
  color: #153d24;
}

@media (max-width: 1120px) {
  .dialer-case-stats-with-new {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialer-new-case-count {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .dialer-case-stats-with-new {
    grid-template-columns: 1fr;
  }

  .dialer-new-case-count {
    grid-column: auto;
  }
}

/* Neutrale Menuepunkte bleiben auch bei Hover und aktiver Seite farbstabil. */
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin),
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible,
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin).is-active {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.24);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.76));
  box-shadow: 0 5px 14px rgba(2, 8, 23, 0.16);
  transform: none;
}

:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin),
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin).is-active {
  color: #102033;
  border-color: #c0cdd6;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 5px 14px rgba(30, 55, 75, 0.1);
  transform: none;
}

:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin) strong,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover strong,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible strong,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin).is-active strong {
  color: #102033;
}

/* Die obere Pinnwand-Kachel bleibt wie in der Vorlage; der Menuebutton ist etwas dunkler. */
.dashboard-stat-blue,
:root[data-theme="light"] .dashboard-stat-blue {
  color: #ffffff;
  border-color: #2563eb;
  background: linear-gradient(135deg, #2856c4, #2f6fe5);
}

.dashboard-nav-item--pinboard,
.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible,
.dashboard-nav-item--pinboard.is-active,
:root[data-theme="light"] .dashboard-nav-item--pinboard,
:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--pinboard.is-active {
  border-color: rgba(96, 165, 250, 0.58);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.32), rgba(14, 165, 233, 0.14));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.78), 0 7px 18px rgba(2, 8, 23, 0.2);
  transform: none;
}

.dashboard-nav-item--pinboard,
.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible,
.dashboard-nav-item--pinboard.is-active,
.dashboard-nav-item--pinboard strong,
.dashboard-nav-item--pinboard > span {
  color: #eef8ff;
}

:root[data-theme="light"] .dashboard-nav-item--pinboard,
:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--pinboard.is-active {
  color: #123b63;
  border-color: rgba(58, 126, 181, 0.72);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.28), rgba(75, 156, 215, 0.18));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.82), 0 7px 17px rgba(30, 85, 130, 0.14);
}

:root[data-theme="light"] .dashboard-nav-item--pinboard strong,
:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  color: #123b63;
}

:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  border-color: rgba(58, 126, 181, 0.58);
  background: rgba(255, 255, 255, 0.42);
}

/* Finale Farbabstimmung: rechte Pinnwand-Kachel und dezente Menue-Hoverfarben. */
.dashboard-stat-blue {
  color: #eef8ff;
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.13));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.66), 0 10px 24px rgba(2, 8, 23, 0.2);
  transform: none;
}

a.dashboard-stat-blue:hover,
a.dashboard-stat-blue:focus-visible {
  border-color: rgba(96, 165, 250, 0.66);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.18));
}

.dashboard-stat-blue span,
.dashboard-stat-blue strong,
.dashboard-stat-blue small {
  color: #eef8ff;
}

:root[data-theme="light"] .dashboard-stat-blue {
  color: #123b63;
  border-color: rgba(58, 126, 181, 0.68);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.24), rgba(75, 156, 215, 0.15));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.72), 0 9px 20px rgba(30, 85, 130, 0.13);
}

:root[data-theme="light"] a.dashboard-stat-blue:hover,
:root[data-theme="light"] a.dashboard-stat-blue:focus-visible {
  border-color: rgba(58, 126, 181, 0.82);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.31), rgba(75, 156, 215, 0.21));
}

:root[data-theme="light"] .dashboard-stat-blue span,
:root[data-theme="light"] .dashboard-stat-blue strong,
:root[data-theme="light"] .dashboard-stat-blue small {
  color: #123b63;
}

.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible {
  border-color: rgba(96, 165, 250, 0.42);
  background: linear-gradient(135deg, rgba(38, 55, 75, 0.96), rgba(23, 38, 57, 0.84));
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, 0.48), 0 7px 17px rgba(2, 8, 23, 0.2);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible {
  color: #102f4a;
  border-color: #9ab8ca;
  background: rgba(225, 238, 247, 0.78);
  box-shadow: inset 3px 0 0 #76a4c0, 0 7px 17px rgba(30, 70, 98, 0.12);
  transform: translateX(2px);
}

.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible {
  border-color: rgba(96, 165, 250, 0.72);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.39), rgba(14, 165, 233, 0.2));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.9), 0 8px 19px rgba(2, 8, 23, 0.24);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible {
  color: #0e3559;
  border-color: rgba(58, 126, 181, 0.86);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.35), rgba(75, 156, 215, 0.24));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.92), 0 8px 18px rgba(30, 85, 130, 0.17);
  transform: translateX(2px);
}

.dashboard-nav-item--dialer-new:hover,
.dashboard-nav-item--dialer-new:focus-visible {
  color: #f1fff5;
  border-color: #72aa83;
  background: linear-gradient(135deg, #2b6740, #397c51);
  box-shadow: inset 4px 0 0 #92c9a2, 0 8px 18px rgba(10, 45, 22, 0.3);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item--dialer-new:hover,
:root[data-theme="light"] .dashboard-nav-item--dialer-new:focus-visible {
  color: #12351f;
  border-color: #467a56;
  background: linear-gradient(135deg, #afd5ba, #94c8a3);
  box-shadow: inset 4px 0 0 #39734c, 0 8px 18px rgba(26, 91, 48, 0.21);
  --dialer-compact-layout-source: 1;
  transform: translateX(2px);
}

/* Abschliessende Prioritaet fuer die kontrastreiche Dashboard-Ansicht im Hellmodus. */
:root[data-theme="light"] .dashboard-duty-card-call {
  background: linear-gradient(180deg, #f8fbff, #e9f2f8);
  border-color: #5f8fb3;
}

:root[data-theme="light"] .dashboard-duty-card-drive {
  background: linear-gradient(180deg, #f8fcfa, #e8f3ed);
  border-color: #5f9678;
}

:root[data-theme="light"] .dashboard-side-card {
  background: linear-gradient(180deg, #fbfcfd, #ebf1f4);
  border-color: #7c94a5;
}

:root[data-theme="light"] .dashboard-open-orders-card {
  background: linear-gradient(180deg, #fbfdfc, #e9f4ed);
  border-color: #5f9678;
}

:root[data-theme="light"] .dashboard-duty-card-call .dashboard-duty-columns > div {
  background: #e4eef5;
  border-color: #739ab7;
}

:root[data-theme="light"] .dashboard-duty-card-drive .dashboard-duty-columns > div {
  background: #e3efe8;
  border-color: #729a82;
}

:root[data-theme="light"] .dashboard-duty-card .call-duty-entry {
  color: #102033;
  background: #ffffff;
  border-color: #91a7b6;
  box-shadow: 0 4px 11px rgba(30, 55, 75, 0.11);
}

:root[data-theme="light"] .dashboard-duty-card-call .call-duty-entry {
  border-left-color: #2f72ad;
}

:root[data-theme="light"] .dashboard-duty-card-drive .call-duty-entry {
  border-left-color: #2b8557;
}

:root[data-theme="light"] .dashboard-live-list li {
  background: #ffffff;
  border-color: #9dafbb;
}

:root[data-theme="light"] .dashboard-table-wrap {
  background: #ffffff;
  border-color: #8098a9;
}

:root[data-theme="light"] .dashboard-table th {
  color: #172e42;
  background: #d3dfe7;
  border-color: #879eae;
}

:root[data-theme="light"] .dashboard-table td {
  color: #102033;
  background: #ffffff;
  border-color: #a2b4c0;
}

:root[data-theme="light"] .dashboard-table tbody tr:nth-child(even) td {
  background: #eaf1f5;
}

:root[data-theme="light"] .dashboard-table tbody tr:hover td {
  background: #dcebf3;
}

.legacy-ticket-page {
  display: grid;
  gap: 20px;
}

.legacy-ticket-summary,
.legacy-ticket-search,
.legacy-ticket-detail,
.legacy-ticket-list-card {
  border: 1px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, var(--accent-cool) 4%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.13);
}

.legacy-ticket-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
  border-left: 5px solid var(--accent-cool);
}

.legacy-ticket-summary h2,
.legacy-ticket-summary p,
.legacy-ticket-detail h3,
.legacy-ticket-list-card h3,
.legacy-ticket-list-card p {
  margin: 0;
}

.legacy-ticket-summary > strong {
  flex: 0 0 auto;
  padding: 11px 16px;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 62%, var(--line));
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent-cool) 14%, var(--panel));
  font-size: 1.05rem;
}

.legacy-ticket-search {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 16px;
}

.legacy-ticket-search label {
  display: grid;
  flex: 1 1 520px;
  gap: 7px;
  min-width: 240px;
  color: var(--muted);
  font-weight: 800;
}

.legacy-ticket-search input {
  width: 100%;
  min-height: 46px;
}

.legacy-ticket-detail {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-color: color-mix(in srgb, #22c55e 48%, var(--line));
}

.legacy-ticket-detail > header,
.legacy-ticket-list-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legacy-ticket-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
}

.legacy-ticket-detail-grid > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 86%, var(--accent-cool) 14%);
}

.legacy-ticket-detail-grid span,
.legacy-ticket-table small,
.legacy-ticket-answer-list article > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.legacy-ticket-detail-grid strong {
  overflow-wrap: anywhere;
}

.legacy-ticket-bestatter-link {
  margin: 0;
}

.legacy-ticket-bestatter-link a {
  color: var(--accent-cool);
  font-weight: 900;
}

.legacy-ticket-notes,
.legacy-ticket-answers {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.legacy-ticket-notes h4,
.legacy-ticket-answers h4,
.legacy-ticket-notes p,
.legacy-ticket-answers p {
  margin: 0;
}

.legacy-ticket-notes p,
.legacy-ticket-answers > p {
  margin-top: 10px;
  line-height: 1.55;
}

.legacy-ticket-answer-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.legacy-ticket-answer-list article {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.legacy-ticket-answer-list article p {
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.legacy-ticket-list-card {
  overflow: hidden;
}

.legacy-ticket-list-card > header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.legacy-ticket-list-card > header > span {
  color: var(--muted);
  font-weight: 800;
}

.legacy-ticket-table-wrap {
  overflow-x: auto;
}

.legacy-ticket-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.legacy-ticket-table th,
.legacy-ticket-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.legacy-ticket-table th {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 82%, var(--accent-cool) 18%);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.legacy-ticket-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--accent-cool) 5%, transparent);
}

.legacy-ticket-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-cool) 11%, transparent);
}

.legacy-ticket-table td:first-child {
  display: grid;
  gap: 4px;
}

.legacy-ticket-open {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.legacy-ticket-empty {
  padding: 28px 20px;
  color: var(--muted);
}

.legacy-ticket-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
}

.legacy-ticket-pagination span {
  color: var(--muted);
  font-weight: 800;
}

.legacy-ticket-pagination .is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

:root[data-theme="light"] .legacy-ticket-summary,
:root[data-theme="light"] .legacy-ticket-search,
:root[data-theme="light"] .legacy-ticket-detail,
:root[data-theme="light"] .legacy-ticket-list-card {
  border-color: #7f9fb4;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(44, 69, 87, 0.16);
}

:root[data-theme="light"] .legacy-ticket-detail-grid > div,
:root[data-theme="light"] .legacy-ticket-notes,
:root[data-theme="light"] .legacy-ticket-answers {
  border-color: #a9bcc9;
  background: #edf4f7;
}

@media (max-width: 1050px) {
  .legacy-ticket-detail-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 700px) {
  .legacy-ticket-summary,
  .legacy-ticket-search,
  .legacy-ticket-detail > header,
  .legacy-ticket-list-card > header,
  .legacy-ticket-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .legacy-ticket-search label {
    flex-basis: auto;
    min-width: 0;
  }

  .legacy-ticket-detail-grid,
  .legacy-ticket-answer-list {
    grid-template-columns: 1fr;
  }

  .legacy-ticket-pagination {
    text-align: center;
  }
}

.dashboard-nav-item--admin:hover,
.dashboard-nav-item--admin:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--admin:hover,
:root[data-theme="light"] .dashboard-nav-item--admin:focus-visible {
  color: #ffffff;
  border-color: #dc2626;
  background: linear-gradient(135deg, #881919, #c52222);
  box-shadow: inset 4px 0 0 #fca5a5, 0 8px 19px rgba(127, 29, 29, 0.34);
  --dialer-compact-layout-source: 1;
  transform: translateX(2px);
}

/* Die beiden neuen Fallstatus bleiben offen und sind farblich eigenstaendig. */
.dialer-status-krankenhaus {
  color: #eef2ff;
  background: color-mix(in srgb, #3730a3 68%, var(--surface));
  border-color: #818cf8;
}

.dialer-status-totenschein_fehlt {
  color: #fff1f2;
  background: color-mix(in srgb, #7f1d1d 70%, var(--surface));
  border-color: #f87171;
}

.dialer-info-status-krankenhaus {
  background: color-mix(in srgb, #3730a3 18%, var(--surface-soft));
  border-color: #818cf8;
}

.dialer-info-status-totenschein_fehlt {
  background: color-mix(in srgb, #7f1d1d 18%, var(--surface-soft));
  border-color: #f87171;
}

.dashboard-status-krankenhaus {
  color: #a5b4fc;
}

.dashboard-status-totenschein_fehlt {
  color: #fca5a5;
}

:root[data-theme="light"] .dialer-status-krankenhaus {
  color: #312e81;
  background: #e0e7ff;
  border-color: #6366f1;
}

:root[data-theme="light"] .dialer-status-totenschein_fehlt {
  color: #7f1d1d;
  background: #fecaca;
  border-color: #dc2626;
}

:root[data-theme="light"] .dashboard-status-krankenhaus {
  color: #3730a3;
}

:root[data-theme="light"] .dashboard-status-totenschein_fehlt {
  color: #b91c1c;
}

/* Totenschein und Ueberfuehrung bleiben auch in der kompakten Fallkarte rechts sichtbar. */
.dialer-case-list {
  gap: 30px;
  padding-block: 8px 18px;
}

.dialer-call-card {
  margin-block: 3px;
  border-top-width: 3px;
  border-right-width: 3px;
  border-bottom-width: 3px;
  border-left-width: 8px;
  outline: 4px solid color-mix(in srgb, var(--surface) 88%, transparent);
  outline-offset: 4px;
  box-shadow: 0 14px 32px rgba(2, 8, 23, 0.3);
}

.dialer-call-card:not([open]) .dialer-call-front {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  gap: 12px 20px;
  align-items: stretch;
}

.dialer-call-card:not([open]) .dialer-call-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px;
  align-content: start;
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
}

.dialer-call-card:not([open]) .dialer-call-status {
  grid-column: 1;
  grid-row: 1;
}

.dialer-call-card:not([open]) .dialer-call-number {
  grid-column: 2;
  grid-row: 1;
}

.dialer-call-card:not([open]) .dialer-call-totenschein {
  grid-column: 1;
  grid-row: 2;
}

.dialer-call-card:not([open]) .dialer-call-transporter {
  grid-column: 2;
  grid-row: 2;
}

.dialer-call-card:not([open]) .dialer-call-status,
.dialer-call-card:not([open]) .dialer-call-number,
.dialer-call-card:not([open]) .dialer-call-totenschein,
.dialer-call-card:not([open]) .dialer-call-transporter {
  min-width: 0;
  min-height: 68px;
  align-content: center;
}

.dialer-call-card:not([open]) .dialer-status-select,
.dialer-call-card:not([open]) .dialer-totenschein-select,
.dialer-call-card:not([open]) .dialer-transporter-select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  font-size: 0.8rem;
}

:root[data-theme="light"] .dialer-call-card {
  outline-color: rgba(225, 232, 238, 0.96);
  box-shadow: 0 15px 30px rgba(30, 55, 75, 0.22);
}

@media (max-width: 1180px) {
  .dialer-call-card:not([open]) .dialer-call-front {
    grid-template-columns: 1fr;
  }

  .dialer-call-card:not([open]) .dialer-call-actions {
    grid-column: 1;
    padding-top: 12px;
    padding-left: 0;
    border-top: 2px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .dialer-call-card:not([open]) .dialer-call-actions {
    grid-template-columns: 1fr;
  }

  .dialer-call-card:not([open]) .dialer-call-status,
  .dialer-call-card:not([open]) .dialer-call-number,
  .dialer-call-card:not([open]) .dialer-call-totenschein,
  .dialer-call-card:not([open]) .dialer-call-transporter {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Finale Farbabstimmung: transparente Pinnwand-Kachel und dezente Hoverfarben. */
.dashboard-stat-blue {
  color: #eef8ff;
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.13));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.66), 0 10px 24px rgba(2, 8, 23, 0.2);
}

a.dashboard-stat-blue:hover,
a.dashboard-stat-blue:focus-visible {
  border-color: rgba(96, 165, 250, 0.66);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.18));
}

.dashboard-stat-blue span,
.dashboard-stat-blue strong,
.dashboard-stat-blue small {
  color: #eef8ff;
}

:root[data-theme="light"] .dashboard-stat-blue {
  color: #123b63;
  border-color: rgba(58, 126, 181, 0.68);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.24), rgba(75, 156, 215, 0.15));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.72), 0 9px 20px rgba(30, 85, 130, 0.13);
}

:root[data-theme="light"] a.dashboard-stat-blue:hover,
:root[data-theme="light"] a.dashboard-stat-blue:focus-visible {
  border-color: rgba(58, 126, 181, 0.82);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.31), rgba(75, 156, 215, 0.21));
}

:root[data-theme="light"] .dashboard-stat-blue span,
:root[data-theme="light"] .dashboard-stat-blue strong,
:root[data-theme="light"] .dashboard-stat-blue small {
  color: #123b63;
}

/* Neutrale Menuepunkte: nur eine leichte Blau-Grau-Abweichung beim Hover. */
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible {
  border-color: rgba(96, 165, 250, 0.42);
  background: linear-gradient(135deg, rgba(38, 55, 75, 0.96), rgba(23, 38, 57, 0.84));
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, 0.48), 0 7px 17px rgba(2, 8, 23, 0.2);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible {
  color: #102f4a;
  border-color: #9ab8ca;
  background: rgba(225, 238, 247, 0.78);
  box-shadow: inset 3px 0 0 #76a4c0, 0 7px 17px rgba(30, 70, 98, 0.12);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover strong,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible strong {
  color: #102f4a;
}

/* Pinnwand: derselbe transparente Grundton, beim Hover nur etwas satter. */
.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible {
  border-color: rgba(96, 165, 250, 0.72);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.39), rgba(14, 165, 233, 0.2));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.9), 0 8px 19px rgba(2, 8, 23, 0.24);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible {
  color: #0e3559;
  border-color: rgba(58, 126, 181, 0.86);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.35), rgba(75, 156, 215, 0.24));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.92), 0 8px 18px rgba(30, 85, 130, 0.17);
  transform: translateX(2px);
}

/* Dailer Neu: Salbeigruen wird beim Hover nur leicht dunkler. */
.dashboard-nav-item--dialer-new:hover,
.dashboard-nav-item--dialer-new:focus-visible {
  border-color: #72aa83;
  background: linear-gradient(135deg, #2b6740, #397c51);
  box-shadow: inset 4px 0 0 #92c9a2, 0 8px 18px rgba(10, 45, 22, 0.3);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item--dialer-new:hover,
:root[data-theme="light"] .dashboard-nav-item--dialer-new:focus-visible {
  color: #12351f;
  border-color: #467a56;
  background: linear-gradient(135deg, #afd5ba, #94c8a3);
  box-shadow: inset 4px 0 0 #39734c, 0 8px 18px rgba(26, 91, 48, 0.21);
  --dialer-compact-layout-source: 1;
  transform: translateX(2px);
}

/* Admin: der rote Bereich bleibt rot und wird beim Hover nur dezent dunkler. */
.dashboard-nav-item--admin:hover,
.dashboard-nav-item--admin:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--admin:hover,
:root[data-theme="light"] .dashboard-nav-item--admin:focus-visible {
  color: #ffffff;
  border-color: #dc2626;
  background: linear-gradient(135deg, #881919, #c52222);
  box-shadow: inset 4px 0 0 #fca5a5, 0 8px 19px rgba(127, 29, 29, 0.34);
  --dialer-compact-layout-source: 1;
  transform: translateX(2px);
}

.dashboard-nav-item--pinboard > span,
:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  border-color: rgba(219, 234, 254, 0.75);
  background: rgba(30, 58, 138, 0.38);
}

/* Dailer Neu: ruhiges Salbeigruen statt eines grellen Signaltons. */
.dashboard-nav-item--dialer-new,
.dashboard-nav-item--dialer-new:hover,
.dashboard-nav-item--dialer-new:focus-visible,
.dashboard-nav-item--dialer-new.is-active,
:root[data-theme="light"] .dashboard-nav-item--dialer-new,
:root[data-theme="light"] .dashboard-nav-item--dialer-new:hover,
:root[data-theme="light"] .dashboard-nav-item--dialer-new:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--dialer-new.is-active {
  color: #153d24;
  border-color: #6ba47b;
  background: linear-gradient(135deg, #d9f1df, #bfe2c9);
  box-shadow: inset 4px 0 0 #3f7d53, 0 7px 18px rgba(26, 91, 48, 0.18);
}

.dashboard-nav-item--dialer-new strong,
.dashboard-nav-item--dialer-new > span,
:root[data-theme="light"] .dashboard-nav-item--dialer-new strong,
:root[data-theme="light"] .dashboard-nav-item--dialer-new > span {
  color: #153d24;
}

.dashboard-nav-item--dialer-new > span,
:root[data-theme="light"] .dashboard-nav-item--dialer-new > span {
  border-color: rgba(42, 105, 61, 0.5);
  background: rgba(255, 255, 255, 0.46);
}

/* Direkter Zugang zum E-Mail-Dailer innerhalb von Dailer Neu. */
.dashboard-userbar .dialer-email-link {
  gap: 7px;
  color: #dff7e6;
  border-color: rgba(107, 164, 123, 0.68);
  background: rgba(45, 111, 65, 0.24);
}

.dashboard-userbar .dialer-email-link:hover,
.dashboard-userbar .dialer-email-link:focus-visible {
  color: #ffffff;
  border-color: #86c497;
  background: rgba(45, 111, 65, 0.4);
}

:root[data-theme="light"] .dashboard-userbar .dialer-email-link {
  color: #174b29;
  border-color: #6ba47b;
  background: #e5f4e9;
}

:root[data-theme="light"] .dashboard-userbar .dialer-email-link:hover,
:root[data-theme="light"] .dashboard-userbar .dialer-email-link:focus-visible {
  color: #103a20;
  border-color: #4f8a60;
  background: #d5ebdb;
}

/* Kompakte Fallkarten: ruhige Uebersicht, Details erst nach dem Aufklappen. */
.dialer-case-list {
  gap: 22px;
  padding: 5px 0 10px;
}

.dialer-call-card {
  border-width: 2px;
  border-left-width: 5px;
  border-color: color-mix(in srgb, var(--accent-cool) 54%, var(--line));
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.22);
}

.dialer-call-card:nth-child(even) {
  border-left-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

.dialer-call-card[open] {
  border-color: color-mix(in srgb, var(--accent-strong) 72%, var(--line));
  box-shadow: 0 20px 46px color-mix(in srgb, var(--accent-strong) 18%, rgba(2, 8, 23, 0.3));
}

.dialer-case-expand-button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 150px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  color: #e6f7ff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 66%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-cool) 18%, var(--surface-soft));
  cursor: pointer;
}

.dialer-case-expand-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.dialer-call-card[open] .dialer-case-expand-button::after {
  transform: translateY(2px) rotate(225deg);
}

.dialer-case-expand-button:hover,
.dialer-case-expand-button:focus-visible {
  color: #ffffff;
  border-color: var(--accent-cool);
  background: color-mix(in srgb, var(--accent-cool) 30%, var(--surface-soft));
  outline: none;
}

.dialer-call-card:not([open]) .dialer-call-front {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  gap: 10px 16px;
  align-items: center;
  padding: 12px 14px;
}

.dialer-call-card:not([open]) .dialer-call-left {
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, 0.75fr);
  gap: 8px;
}

.dialer-call-card:not([open]) .dialer-call-main {
  grid-column: 1;
  grid-row: 1;
  min-height: 56px;
}

.dialer-call-card:not([open]) .dialer-call-deceased {
  grid-column: 2;
  grid-row: 1;
  min-height: 56px;
}

.dialer-call-compact-info {
  display: none;
}

.dialer-call-card:not([open]) .dialer-call-compact-info {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(105px, 0.55fr) minmax(150px, 0.85fr) minmax(190px, 1.25fr) minmax(150px, 0.9fr) minmax(120px, 0.65fr);
  gap: 8px;
}

.dialer-call-compact-info > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--dialer-card-field-bg) 88%, transparent);
}

.dialer-call-compact-info span,
.dialer-call-compact-info strong,
.dialer-call-compact-info small {
  display: block;
}

.dialer-call-compact-info span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dialer-call-compact-info strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialer-call-compact-info small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialer-call-compact-email.dialer-email-sent {
  border-color: rgba(34, 197, 94, 0.68);
  background: rgba(22, 101, 52, 0.24);
}

.dialer-call-compact-email.dialer-email-external {
  border-color: rgba(34, 197, 94, 0.68);
  background: rgba(21, 128, 61, 0.2);
}

.dialer-call-compact-email.dialer-email-failed,
.dialer-call-compact-email.dialer-email-error,
.dialer-call-compact-email.dialer-email-not_sent {
  border-color: rgba(239, 68, 68, 0.68);
  background: rgba(127, 29, 29, 0.24);
}

.dialer-call-card:not([open]) .dialer-call-location,
.dialer-call-card:not([open]) .dialer-call-person,
.dialer-call-card:not([open]) .dialer-call-subject,
.dialer-call-card:not([open]) .dialer-call-package,
.dialer-call-card:not([open]) .dialer-call-meta-row,
.dialer-call-card:not([open]) .dialer-case-email,
.dialer-call-card:not([open]) .dialer-email-update-fields,
.dialer-call-card:not([open]) .dialer-email-reminder-toggle,
.dialer-call-card:not([open]) .dialer-drive-sms {
  display: none;
}

.dialer-call-card:not([open]) .dialer-call-actions {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.65fr);
  gap: 8px;
  align-items: stretch;
}

.dialer-call-card:not([open]) .dialer-call-status,
.dialer-call-card:not([open]) .dialer-call-number {
  min-height: 56px;
}

.dialer-call-card:not([open]) .dialer-status-select {
  min-width: 0;
  min-height: 38px;
  padding: 6px 9px;
  font-size: 0.86rem;
}

:root[data-theme="light"] .dialer-call-card {
  border-color: #5f8ea8;
  box-shadow: 0 10px 25px rgba(30, 55, 75, 0.15);
}

:root[data-theme="light"] .dialer-call-card:nth-child(even) {
  border-left-color: #498a68;
}

:root[data-theme="light"] .dialer-case-expand-button {
  color: #123b55;
  border-color: #5f8ea8;
  background: #e6f1f7;
}

:root[data-theme="light"] .dialer-case-expand-button:hover,
:root[data-theme="light"] .dialer-case-expand-button:focus-visible {
  color: #082f49;
  border-color: #367597;
  background: #d5e8f2;
}

@media (max-width: 820px) {
  .dialer-call-card:not([open]) .dialer-call-front,
  .dialer-call-card:not([open]) .dialer-call-left {
    grid-template-columns: 1fr;
  }

  .dialer-call-card:not([open]) .dialer-call-main,
  .dialer-call-card:not([open]) .dialer-call-deceased {
    grid-column: 1;
    grid-row: auto;
  }

  .dialer-call-card:not([open]) .dialer-call-actions {
    grid-template-columns: minmax(0, 1fr) minmax(100px, 0.55fr);
  }

  .dialer-call-card:not([open]) .dialer-call-compact-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialer-case-expand-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .dialer-call-card:not([open]) .dialer-call-compact-info {
    grid-template-columns: 1fr;
  }
}

/* Farbige Wechselkacheln erleichtern die Zuordnung benachbarter Faelle. */
.dialer-call-card:nth-child(odd) {
  --dialer-card-bg: color-mix(in srgb, #0e7490 10%, var(--surface));
  --dialer-card-field-bg: color-mix(in srgb, #0e7490 7%, var(--surface-soft));
  border-color: color-mix(in srgb, #38bdf8 62%, var(--line));
  border-left-color: #38bdf8;
}

.dialer-call-card:nth-child(even) {
  --dialer-card-bg: color-mix(in srgb, #15803d 11%, var(--surface));
  --dialer-card-field-bg: color-mix(in srgb, #15803d 8%, var(--surface-soft));
  border-color: color-mix(in srgb, #4ade80 58%, var(--line));
  border-left-color: #4ade80;
}

:root[data-theme="light"] .dialer-call-card:nth-child(odd) {
  --dialer-card-bg: #eef7fb;
  --dialer-card-field-bg: rgba(255, 255, 255, 0.82);
  border-color: #4f8fab;
  border-left-color: #257aa0;
  box-shadow: 0 10px 25px rgba(37, 122, 160, 0.15);
}

:root[data-theme="light"] .dialer-call-card:nth-child(even) {
  --dialer-card-bg: #edf7f0;
  --dialer-card-field-bg: rgba(255, 255, 255, 0.84);
  border-color: #57906a;
  border-left-color: #317a4b;
  box-shadow: 0 10px 25px rgba(49, 122, 75, 0.14);
}

/* Statusfarben bleiben auch im hellen Modus eindeutig und kontrastreich. */
:root[data-theme="light"] .dialer-status-bestatter_nicht_erreicht,
:root[data-theme="light"] .dialer-totenschein-nein {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #dc2626;
}

:root[data-theme="light"] .dialer-status-fertig,
:root[data-theme="light"] .dialer-totenschein-ja,
:root[data-theme="light"] .dialer-transporter-erreicht {
  color: #14532d;
  background: #dcfce7;
  border-color: #16a34a;
}

:root[data-theme="light"] .dialer-status-in_klaerung,
:root[data-theme="light"] .dialer-transporter-nicht_erreicht {
  color: #713f12;
  background: #fef3c7;
  border-color: #d97706;
}

:root[data-theme="light"] .dialer-status-offen,
:root[data-theme="light"] .dialer-totenschein-unbekannt {
  color: #164e63;
  background: #e0f2fe;
  border-color: #0284c7;
}

/* Dashboard bleibt in jedem Zustand neutral und farbstabil. */
.dashboard-nav-item--dashboard,
.dashboard-nav-item--dashboard.is-active,
.dashboard-nav-item--dashboard:hover,
.dashboard-nav-item--dashboard:focus-visible {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.24);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.76));
  box-shadow: 0 5px 14px rgba(2, 8, 23, 0.16);
  transform: none;
}

:root[data-theme="light"] .dashboard-nav-item--dashboard,
:root[data-theme="light"] .dashboard-nav-item--dashboard.is-active,
:root[data-theme="light"] .dashboard-nav-item--dashboard:hover,
:root[data-theme="light"] .dashboard-nav-item--dashboard:focus-visible {
  color: #102033;
  border-color: #c0cdd6;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 14px rgba(30, 55, 75, 0.1);
  transform: none;
}

:root[data-theme="light"] .dashboard-nav-item--dashboard strong,
:root[data-theme="light"] .dashboard-nav-item--dashboard.is-active strong,
:root[data-theme="light"] .dashboard-nav-item--dashboard:hover strong,
:root[data-theme="light"] .dashboard-nav-item--dashboard:focus-visible strong {
  color: #102033;
}

/* Pinnwand-Kachel und Pinnwand-Menue verwenden bewusst dieselbe blaue Flaeche. */
.dashboard-stat-blue,
.dashboard-nav-item--pinboard,
.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible,
.dashboard-nav-item--pinboard.is-active {
  color: #ffffff;
  border-color: #60a5fa;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  box-shadow: inset 4px 0 0 #bfdbfe, 0 10px 24px rgba(30, 64, 175, 0.28);
}

.dashboard-stat-blue span,
.dashboard-stat-blue strong,
.dashboard-stat-blue small,
.dashboard-nav-item--pinboard strong,
.dashboard-nav-item--pinboard > span {
  color: #ffffff;
}

:root[data-theme="light"] .dashboard-stat-blue,
:root[data-theme="light"] .dashboard-nav-item--pinboard,
:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--pinboard.is-active {
  color: #ffffff;
  border-color: #2d6593;
  background: linear-gradient(135deg, #2b5f8c, #3478a8);
  box-shadow: inset 4px 0 0 #9fc7e2, 0 10px 24px rgba(31, 78, 113, 0.26);
}

:root[data-theme="light"] .dashboard-stat-blue span,
:root[data-theme="light"] .dashboard-stat-blue strong,
:root[data-theme="light"] .dashboard-stat-blue small,
:root[data-theme="light"] .dashboard-nav-item--pinboard strong,
:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  color: #ffffff;
}

/* Kraeftigere, aber weiterhin ruhige Flaechen im hellen Modus. */
:root[data-theme="light"] .dashboard-stat-green {
  background: #cce9d6;
  border-color: #39825a;
}

:root[data-theme="light"] .dashboard-stat-purple {
  background: #ddd2f2;
  border-color: #7557ad;
}

:root[data-theme="light"] .dashboard-stat-amber {
  background: #f5dda6;
  border-color: #b87816;
}

:root[data-theme="light"] .dashboard-stat-cyan {
  background: #c9e7eb;
  border-color: #2e7f8b;
}

:root[data-theme="light"] .dashboard-stat-red {
  background: #f4c5ce;
  border-color: #b9475d;
}

:root[data-theme="light"] .dashboard-stat-email,
:root[data-theme="light"] .dashboard-stat-email.has-items {
  background: #f3c99f;
  border-color: #c16119;
}

:root[data-theme="light"] .dashboard-nav-item--dialer-new,
:root[data-theme="light"] .dashboard-nav-item--dialer-new:hover,
:root[data-theme="light"] .dashboard-nav-item--dialer-new:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--dialer-new.is-active {
  background: linear-gradient(135deg, #b9ddc3, #9dccaa);
  border-color: #4f875f;
}

:root[data-theme="light"] .dialer-call-card:nth-child(odd) {
  --dialer-card-bg: #dcebf3;
  --dialer-card-field-bg: rgba(255, 255, 255, 0.9);
  border-color: #3d7f9d;
  border-left-color: #1f6c90;
  box-shadow: 0 10px 25px rgba(31, 108, 144, 0.19);
}

:root[data-theme="light"] .dialer-call-card:nth-child(even) {
  --dialer-card-bg: #dcece1;
  --dialer-card-field-bg: rgba(255, 255, 255, 0.9);
  border-color: #3f8056;
  border-left-color: #276d40;
  box-shadow: 0 10px 25px rgba(39, 109, 64, 0.18);
}

:root[data-theme="light"] .dialer-status-bestatter_nicht_erreicht,
:root[data-theme="light"] .dialer-totenschein-nein {
  background: #fecaca;
}

:root[data-theme="light"] .dialer-status-fertig,
:root[data-theme="light"] .dialer-totenschein-ja,
:root[data-theme="light"] .dialer-transporter-erreicht {
  background: #bbf7d0;
}

:root[data-theme="light"] .dialer-status-in_klaerung,
:root[data-theme="light"] .dialer-transporter-nicht_erreicht {
  background: #fde68a;
}

:root[data-theme="light"] .dialer-status-offen,
:root[data-theme="light"] .dialer-totenschein-unbekannt {
  background: #bae6fd;
}

/* Pinnwand-Farbkorrektur: obere Kachel behaelt ihre urspruengliche Farbe;
   der linke Pinnwand-Button uebernimmt genau diese Flaeche. */
.dashboard-stat-blue,
.dashboard-nav-item--pinboard,
.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible,
.dashboard-nav-item--pinboard.is-active {
  border-color: rgba(59, 130, 246, 0.38);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(15, 23, 42, 0.9));
}

.dashboard-stat-blue span {
  color: #94a3b8;
}

.dashboard-stat-blue strong,
.dashboard-nav-item--pinboard strong,
.dashboard-nav-item--pinboard > span {
  color: #f8fafc;
}

.dashboard-stat-blue small {
  color: #cbd5e1;
}

:root[data-theme="light"] .dashboard-stat-blue,
:root[data-theme="light"] .dashboard-nav-item--pinboard,
:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--pinboard.is-active {
  color: #102033;
  border-color: #4f91d0;
  background: #e6f1ff;
  box-shadow: inset 4px 0 0 #4f91d0, 0 7px 18px rgba(30, 85, 130, 0.17);
}

:root[data-theme="light"] .dashboard-stat-blue span {
  color: #36536d;
}

:root[data-theme="light"] .dashboard-stat-blue strong,
:root[data-theme="light"] .dashboard-nav-item--pinboard strong,
:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  color: #102033;
}

:root[data-theme="light"] .dashboard-stat-blue small {
  color: #264560;
}

:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  border-color: #4f91d0;
  background: rgba(255, 255, 255, 0.58);
}

/* Einheitliche Pinnwand-Signalfarbe entsprechend der Portalnavigation. */
.dashboard-stat-blue,
:root[data-theme="light"] .dashboard-stat-blue {
  color: #ffffff;
  border-color: #2563eb;
  background: linear-gradient(135deg, #2856c4, #2f6fe5);
  box-shadow: inset 4px 0 0 #9fc1ff, 0 8px 20px rgba(37, 84, 184, 0.25);
  transform: none;
}

.dashboard-stat-blue span,
.dashboard-stat-blue strong,
.dashboard-stat-blue small,
:root[data-theme="light"] .dashboard-stat-blue span,
:root[data-theme="light"] .dashboard-stat-blue strong,
:root[data-theme="light"] .dashboard-stat-blue small {
  color: #ffffff;
}

/* Finale Farbabstimmung: transparente Pinnwandflaechen und dezente Hoverfarben. */
.dashboard-stat-blue {
  color: #eef8ff;
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.13));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.66), 0 10px 24px rgba(2, 8, 23, 0.2);
  transform: none;
}

a.dashboard-stat-blue:hover,
a.dashboard-stat-blue:focus-visible {
  border-color: rgba(96, 165, 250, 0.66);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.18));
}

.dashboard-stat-blue span,
.dashboard-stat-blue strong,
.dashboard-stat-blue small {
  color: #eef8ff;
}

:root[data-theme="light"] .dashboard-stat-blue {
  color: #123b63;
  border-color: rgba(58, 126, 181, 0.68);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.24), rgba(75, 156, 215, 0.15));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.72), 0 9px 20px rgba(30, 85, 130, 0.13);
}

:root[data-theme="light"] a.dashboard-stat-blue:hover,
:root[data-theme="light"] a.dashboard-stat-blue:focus-visible {
  border-color: rgba(58, 126, 181, 0.82);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.31), rgba(75, 156, 215, 0.21));
}

:root[data-theme="light"] .dashboard-stat-blue span,
:root[data-theme="light"] .dashboard-stat-blue strong,
:root[data-theme="light"] .dashboard-stat-blue small {
  color: #123b63;
}

.dashboard-nav-item--pinboard,
.dashboard-nav-item--pinboard.is-active {
  color: #eef8ff;
  border-color: rgba(96, 165, 250, 0.58);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.32), rgba(14, 165, 233, 0.14));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.78), 0 7px 18px rgba(2, 8, 23, 0.2);
  transform: none;
}

.dashboard-nav-item--pinboard:hover,
.dashboard-nav-item--pinboard:focus-visible {
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.72);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.39), rgba(14, 165, 233, 0.2));
  box-shadow: inset 4px 0 0 rgba(96, 165, 250, 0.9), 0 8px 19px rgba(2, 8, 23, 0.24);
  transform: translateX(2px);
}

.dashboard-nav-item--pinboard strong,
.dashboard-nav-item--pinboard > span {
  color: inherit;
}

:root[data-theme="light"] .dashboard-nav-item--pinboard,
:root[data-theme="light"] .dashboard-nav-item--pinboard.is-active {
  color: #123b63;
  border-color: rgba(58, 126, 181, 0.72);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.28), rgba(75, 156, 215, 0.18));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.82), 0 7px 17px rgba(30, 85, 130, 0.14);
  transform: none;
}

:root[data-theme="light"] .dashboard-nav-item--pinboard:hover,
:root[data-theme="light"] .dashboard-nav-item--pinboard:focus-visible {
  color: #0e3559;
  border-color: rgba(58, 126, 181, 0.86);
  background: linear-gradient(135deg, rgba(69, 135, 190, 0.35), rgba(75, 156, 215, 0.24));
  box-shadow: inset 4px 0 0 rgba(43, 112, 168, 0.92), 0 8px 18px rgba(30, 85, 130, 0.17);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item--pinboard > span {
  border-color: rgba(58, 126, 181, 0.58);
  background: rgba(255, 255, 255, 0.42);
}

.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
.dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible {
  border-color: rgba(96, 165, 250, 0.42);
  background: linear-gradient(135deg, rgba(38, 55, 75, 0.96), rgba(23, 38, 57, 0.84));
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, 0.48), 0 7px 17px rgba(2, 8, 23, 0.2);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):hover,
:root[data-theme="light"] .dashboard-nav-item:not(.dashboard-nav-item--pinboard):not(.dashboard-nav-item--dialer-new):not(.dashboard-nav-item--admin):focus-visible {
  color: #102f4a;
  border-color: #9ab8ca;
  background: rgba(225, 238, 247, 0.78);
  box-shadow: inset 3px 0 0 #76a4c0, 0 7px 17px rgba(30, 70, 98, 0.12);
  transform: translateX(2px);
}

.dashboard-nav-item--dialer-new:hover,
.dashboard-nav-item--dialer-new:focus-visible {
  color: #f1fff5;
  border-color: #72aa83;
  background: linear-gradient(135deg, #2b6740, #397c51);
  box-shadow: inset 4px 0 0 #92c9a2, 0 8px 18px rgba(10, 45, 22, 0.3);
  transform: translateX(2px);
}

:root[data-theme="light"] .dashboard-nav-item--dialer-new:hover,
:root[data-theme="light"] .dashboard-nav-item--dialer-new:focus-visible {
  color: #12351f;
  border-color: #467a56;
  background: linear-gradient(135deg, #afd5ba, #94c8a3);
  box-shadow: inset 4px 0 0 #39734c, 0 8px 18px rgba(26, 91, 48, 0.21);
  transform: translateX(2px);
}

/* Uebersichtliche, durchsuchbare Bestatter-Auswahl statt abgeschnittener Browserliste. */
.dialer-bestatter-picker-field {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.dialer-bestatter-picker-field > label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 900;
}

.dialer-bestatter-combobox {
  position: relative;
  min-width: 0;
}

.dialer-bestatter-combobox::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  pointer-events: none;
  transform: translateY(-50%) rotate(45deg);
}

.dialer-bestatter-combobox > input {
  width: 100%;
  padding-right: 44px;
}

.dialer-bestatter-options {
  position: absolute;
  z-index: 120;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: min(460px, 55vh);
  overflow: auto;
  color: var(--text);
  border: 2px solid color-mix(in srgb, var(--accent-cool) 68%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, #07111d 4%);
  box-shadow: 0 22px 52px rgba(2, 8, 23, 0.48);
}

.dialer-bestatter-options-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-cool) 6%);
}

.dialer-bestatter-options-head strong {
  font-size: 0.88rem;
}

.dialer-bestatter-options-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.dialer-bestatter-option-list {
  display: grid;
  gap: 7px;
  padding: 9px;
}

.dialer-bestatter-option {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 25%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.dialer-bestatter-option:nth-child(even) {
  background: color-mix(in srgb, var(--accent-cool) 7%, var(--surface-soft));
}

.dialer-bestatter-option:hover,
.dialer-bestatter-option:focus-visible,
.dialer-bestatter-option.is-active {
  border-color: var(--accent-cool);
  background: color-mix(in srgb, var(--accent-cool) 18%, var(--surface-soft));
  outline: none;
  transform: translateX(2px);
}

.dialer-bestatter-option > strong {
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dialer-bestatter-option-meta {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(150px, 0.9fr);
  gap: 6px;
}

.dialer-bestatter-option-meta b {
  min-width: 0;
  padding: 5px 7px;
  color: color-mix(in srgb, var(--text) 76%, var(--muted));
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.dialer-bestatter-option > small {
  justify-self: start;
  padding: 3px 7px;
  color: var(--accent-cool);
  font-size: 0.7rem;
  font-weight: 900;
  border: 1px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
  border-radius: 999px;
}

.dialer-bestatter-options-empty {
  margin: 0;
  padding: 22px 14px;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
}

.dialer-bestatter-picker-help {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.dialer-bestatter-picker-error {
  color: #fecaca;
  font-size: 0.8rem;
  font-weight: 850;
}

.dialer-bestatter-combobox > input[aria-invalid="true"] {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

:root[data-theme="light"] .dialer-bestatter-picker-error {
  color: #b91c1c;
}

/* Wichtige Notfallangaben stehen im neuen Fall direkt zwischen Auswahl und Bereitschaft. */
.dialer-case-important-info {
  grid-column: 1 / -1;
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 2px solid color-mix(in srgb, #f59e0b 76%, var(--line));
  border-left-width: 6px;
  border-radius: 9px;
  background:
    linear-gradient(135deg, color-mix(in srgb, #f59e0b 14%, transparent), transparent 68%),
    color-mix(in srgb, var(--surface-soft) 93%, #1a1102 7%);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.18);
}

.dialer-case-important-info[hidden],
.dialer-case-important-info-grid[hidden],
.dialer-case-important-info [hidden] {
  display: none;
}

.dialer-case-important-info-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 9px;
  border-bottom: 1px solid color-mix(in srgb, #f59e0b 45%, var(--line));
}

.dialer-case-important-info-head > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #1c1302;
  font-size: 1rem;
  font-weight: 950;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.13);
}

.dialer-case-important-info-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dialer-case-important-info-head small,
.dialer-case-important-info-grid small {
  color: color-mix(in srgb, #fbbf24 82%, var(--muted));
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialer-case-important-info-head strong {
  color: var(--text);
  font-size: 1.08rem;
}

.dialer-case-important-info-head em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.dialer-case-important-info-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(200px, 0.85fr);
  gap: 8px;
}

.dialer-case-important-info-grid > div,
.dialer-case-important-info-grid > a {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 11px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, #f59e0b 34%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}

.dialer-case-important-info-grid > a:hover,
.dialer-case-important-info-grid > a:focus-visible {
  border-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 12%, var(--panel));
  outline: none;
}

.dialer-case-important-info-grid strong {
  color: var(--text);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.dialer-case-important-info-note {
  grid-column: 1 / -1;
}

.dialer-case-important-info-note p,
.dialer-case-important-info-empty {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.dialer-case-important-info-empty {
  padding: 9px 11px;
  color: color-mix(in srgb, #fbbf24 70%, var(--text));
  border: 1px dashed color-mix(in srgb, #f59e0b 55%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, #f59e0b 8%, transparent);
}

:root[data-theme="light"] .dialer-case-important-info {
  border-color: #a76000;
  background: linear-gradient(135deg, #fff0c7, #fffaf0 70%);
  box-shadow: 0 10px 24px rgba(96, 57, 0, 0.17);
}

:root[data-theme="light"] .dialer-case-important-info-head {
  border-bottom-color: #d49a3b;
}

:root[data-theme="light"] .dialer-case-important-info-head small,
:root[data-theme="light"] .dialer-case-important-info-grid small {
  color: #704300;
}

:root[data-theme="light"] .dialer-case-important-info-head strong,
:root[data-theme="light"] .dialer-case-important-info-grid strong,
:root[data-theme="light"] .dialer-case-important-info-note p {
  color: #172033;
}

:root[data-theme="light"] .dialer-case-important-info-head em {
  color: #5b4931;
}

:root[data-theme="light"] .dialer-case-important-info-grid > div,
:root[data-theme="light"] .dialer-case-important-info-grid > a {
  border-color: #c99139;
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .dialer-case-important-info-empty {
  color: #6b4100;
  border-color: #bd7c17;
  background: #fff4d8;
}

@media (max-width: 700px) {
  .dialer-case-important-info-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dialer-case-important-info-head em {
    grid-column: 2;
    text-align: left;
  }

  .dialer-case-important-info-grid {
    grid-template-columns: 1fr;
  }

  .dialer-case-important-info-note {
    grid-column: auto;
  }
}

:root[data-theme="light"] .dialer-bestatter-options {
  border-color: #4f89a8;
  background: #f8fbfd;
  box-shadow: 0 22px 48px rgba(30, 55, 75, 0.28);
}

:root[data-theme="light"] .dialer-bestatter-options-head {
  background: #eaf3f8;
}

:root[data-theme="light"] .dialer-bestatter-option {
  border-color: #b5cbd8;
  background: #ffffff;
}

:root[data-theme="light"] .dialer-bestatter-option:nth-child(even) {
  background: #edf5f8;
}

:root[data-theme="light"] .dialer-bestatter-option:hover,
:root[data-theme="light"] .dialer-bestatter-option:focus-visible,
:root[data-theme="light"] .dialer-bestatter-option.is-active {
  border-color: #377d9f;
  background: #dceef6;
}

@media (max-width: 700px) {
  .dialer-bestatter-option-meta {
    grid-template-columns: 1fr;
  }

  .dialer-bestatter-options {
    max-height: 48vh;
  }
}

/* Finale Dailer-Falltrennung: Statusfelder rechts, Faelle klar voneinander getrennt. */
.dialer-case-list {
  gap: 30px;
  padding-block: 8px 18px;
}

.dialer-call-card {
  margin-block: 3px;
  border-top-width: 3px;
  border-right-width: 3px;
  border-bottom-width: 3px;
  border-left-width: 8px;
  outline: 4px solid color-mix(in srgb, var(--surface) 88%, transparent);
  outline-offset: 4px;
  box-shadow: 0 14px 32px rgba(2, 8, 23, 0.3);
}

.dialer-call-card:not([open]) .dialer-call-front {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  gap: 12px 20px;
  align-items: stretch;
}

.dialer-call-card:not([open]) .dialer-call-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px;
  align-content: start;
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
}

.dialer-call-card:not([open]) .dialer-call-status {
  grid-column: 1;
  grid-row: 1;
}

.dialer-call-card:not([open]) .dialer-call-number {
  grid-column: 2;
  grid-row: 1;
}

.dialer-call-card:not([open]) .dialer-call-totenschein {
  grid-column: 1;
  grid-row: 2;
}

.dialer-call-card:not([open]) .dialer-call-transporter {
  grid-column: 2;
  grid-row: 2;
}

.dialer-call-card:not([open]) .dialer-call-status,
.dialer-call-card:not([open]) .dialer-call-number,
.dialer-call-card:not([open]) .dialer-call-totenschein,
.dialer-call-card:not([open]) .dialer-call-transporter {
  min-width: 0;
  min-height: 68px;
  align-content: center;
}

.dialer-call-card:not([open]) .dialer-status-select,
.dialer-call-card:not([open]) .dialer-totenschein-select,
.dialer-call-card:not([open]) .dialer-transporter-select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  font-size: 0.8rem;
}

:root[data-theme="light"] .dialer-call-card {
  outline-color: rgba(225, 232, 238, 0.96);
  box-shadow: 0 15px 30px rgba(30, 55, 75, 0.22);
}

@media (max-width: 1180px) {
  .dialer-call-card:not([open]) .dialer-call-front {
    grid-template-columns: 1fr;
  }

  .dialer-call-card:not([open]) .dialer-call-actions {
    grid-column: 1;
    padding-top: 12px;
    padding-left: 0;
    border-top: 2px solid color-mix(in srgb, var(--accent-cool) 42%, var(--line));
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .dialer-call-card:not([open]) .dialer-call-actions {
    grid-template-columns: 1fr;
  }

  .dialer-call-card:not([open]) .dialer-call-status,
  .dialer-call-card:not([open]) .dialer-call-number,
  .dialer-call-card:not([open]) .dialer-call-totenschein,
  .dialer-call-card:not([open]) .dialer-call-transporter {
    grid-column: 1;
    grid-row: auto;
  }
}

.dashboard-nav-item--admin:hover,
.dashboard-nav-item--admin:focus-visible,
:root[data-theme="light"] .dashboard-nav-item--admin:hover,
:root[data-theme="light"] .dashboard-nav-item--admin:focus-visible {
  color: #ffffff;
  border-color: #dc2626;
  background: linear-gradient(135deg, #881919, #c52222);
  box-shadow: inset 4px 0 0 #fca5a5, 0 8px 19px rgba(127, 29, 29, 0.34);
  --dialer-compact-layout-source: 1;
  transform: translateX(2px);
}
