/* CRANIOREPORT LOGO GREEN PALETTE */

:root {
  --cr-logo-green: #7DC351;
  --cr-logo-green-hover: #70B746;
  --cr-logo-green-active: #5F9D3C;
  --cr-logo-green-dark: #477A2D;
  --cr-logo-green-muted: #79AE59;
  --cr-logo-green-border: #CDE9BC;
  --cr-logo-green-soft: #EAF6E2;
  --cr-logo-green-surface: #F5FAF1;
}

body {
      margin: 0;
      font-family: Arial, sans-serif;
      background: #f4f6f8;
      color: #1f2937;
    }

    header {
      padding: 18px 24px;
      background: white;
      border-bottom: 1px solid #d1d5db;
    }

    main {
      padding: 24px;
    }

    #controls {
      margin-bottom: 16px;
      padding: 16px;
      background: white;
      border-radius: 8px;
    }

    #patientBar {
      margin-bottom: 16px;
      padding: 16px;
      background: white;
      border-radius: 8px;
      display: grid;
      grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto auto;
      gap: 12px;
      align-items: end;
    }

    .fieldGroup {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .fieldGroup label {
      font-size: 13px;
      font-weight: bold;
      color: #4b5563;
    }

    .fieldGroup select,
    .patientButton {
      height: 40px;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      background: white;
      padding: 0 12px;
      font: inherit;
      box-sizing: border-box;
    }

    .patientButton {
      cursor: pointer;
      font-weight: bold;
    }

    .patientButton:hover {
      background: #f3f4f6;
    }

    #patientLoadStatus {
      grid-column: 1 / -1;
      font-size: 13px;
      color: #6b7280;
    }

    @media (max-width: 900px) {
      #patientBar {
        grid-template-columns: 1fr;
      }

      #patientLoadStatus {
        grid-column: 1;
      }
    }

    #viewer {
      width: 100%;
      height: 70vh;
      background: #e5e7eb;
      border-radius: 8px;
      overflow: hidden;
    }

    #status {
      margin-top: 10px;
    }
  #workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: stretch;
}

#analysisPanel {
  height: 70vh;
  padding: 20px;
  background: white;
  border-radius: 8px;
  overflow-y: auto;
  box-sizing: border-box;
}

#analysisPanel h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.analysisSection {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.analysisSection:last-child {
  border-bottom: none;
}

.analysisSection h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.landmarkButtons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.landmarkButton,
#saveLandmarksButton,
#alignSkullButton,
#showOriginalStlButton {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  font: inherit;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
}

.landmarkButton:hover:not(:disabled),
#saveLandmarksButton:hover:not(:disabled),
#alignSkullButton:hover:not(:disabled),
#showOriginalStlButton:hover:not(:disabled) {
  background: #f3f4f6;
}

.landmarkButton.active {
  border-color: #5F9D3C;
  background: #e7f1ec;
  color: #477A2D;
}

.landmarkButton.completed::after {
  content: " ✓";
  color: #477A2D;
}

#saveLandmarksButton,
#alignSkullButton,
#showOriginalStlButton {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  font: inherit;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  margin-bottom: 10px;
}

#alignSkullButton {
  border-color: #5F9D3C;
  background: #e7f1ec;
  color: #477A2D;
}

.landmarkButton:disabled,
#saveLandmarksButton:disabled,
#alignSkullButton:disabled,
#showOriginalStlButton:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#landmarkStatus {
  font-size: 13px;
  line-height: 1.4;
}

#startAnalysisButton {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid #5F9D3C;
  border-radius: 6px;
  background: #e7f1ec;
  color: #477A2D;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

#startAnalysisButton:hover:not(:disabled) {
  background: #d8e9e0;
}

#startAnalysisButton:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.analysisSubheading {
  margin: 18px 0 8px;
  font-size: 13px;
  color: #5F9D3C;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#analysisActionStatus {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #6b7280;
}

.reportButtons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#createReportButton,
#openReportButton {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #5F9D3C;
  border-radius: 6px;
  background: white;
  color: #477A2D;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

#createReportButton {
  background: #e7f1ec;
}

#createReportButton:hover:not(:disabled),
#openReportButton:hover:not(:disabled) {
  background: #d8e9e0;
}

#createReportButton:disabled,
#openReportButton:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#reportActionStatus {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #6b7280;
}

#viewer.landmarkMode {
  cursor: crosshair;
}

.dataRow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 9px 0;
  font-size: 14px;
}

.dataRow span {
  color: #6b7280;
}

.dataRow strong {
  text-align: right;
  word-break: break-word;
}

.statusWaiting,
.statusValid,
.statusError {
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: bold;
}

.statusWaiting {
  background: #f3f4f6;
  color: #4b5563;
}

.statusValid {
  background: #EAF6E2;
  color: #477A2D;
}

.statusError {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 900px) {
  #workspace {
    grid-template-columns: 1fr;
  }

  #analysisPanel {
    height: auto;
  }
}
/* ==========================================================
   Dialog: Neuer Patient
   ========================================================== */

#patientDialogOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}

#patientDialogOverlay.visible {
  display: flex;
}

#patientDialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d6dde4;
  border-radius: 14px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.28),
    0 4px 12px rgba(15, 23, 42, 0.12);
}

.patientDialogHeader {
  padding: 22px 24px 16px;
  border-bottom: 1px solid #e3e8ed;
}

.patientDialogHeader h2 {
  margin: 0;
  color: #1555b6;
  font-size: 24px;
  line-height: 1.25;
}

.patientDialogHeader p {
  margin: 7px 0 0;
  color: #5c6670;
  font-size: 14px;
  line-height: 1.45;
}

#newPatientForm {
  padding: 22px 24px 24px;
}

.patientFormGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.patientFormField {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.patientFormField.fullWidth {
  grid-column: 1 / -1;
}

.patientFormField label {
  color: #27313a;
  font-size: 14px;
  font-weight: 700;
}

.patientFormField input,
.patientFormField textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bfc9d2;
  border-radius: 8px;
  background: #ffffff;
  color: #17212b;
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.patientFormField textarea {
  min-height: 92px;
  resize: vertical;
}

.patientFormField input:focus,
.patientFormField textarea:focus {
  border-color: #5F9D3C;
  box-shadow: 0 0 0 3px rgba(47, 143, 58, 0.14);
}

.patientFormField input.invalid {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}

.patientFormHint {
  color: #6b7580;
  font-size: 12px;
  line-height: 1.4;
}

#patientFormError {
  display: none;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid #f0b7b7;
  border-radius: 8px;
  background: #fff1f1;
  color: #a51e1e;
  font-size: 14px;
  line-height: 1.45;
}

#patientFormError.visible {
  display: block;
}

.patientDialogActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e3e8ed;
}

.patientDialogButton {
  min-width: 112px;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.patientDialogButton.secondary {
  border: 1px solid #b8c2cc;
  background: #ffffff;
  color: #34404b;
}

.patientDialogButton.primary {
  border: 1px solid #5F9D3C;
  background: #5F9D3C;
  color: #ffffff;
}

.patientDialogButton:hover:not(:disabled) {
  filter: brightness(0.97);
}

.patientDialogButton:disabled {
  cursor: wait;
  opacity: 0.65;
}

body.patientDialogOpen {
  overflow: hidden;
}

@media (max-width: 620px) {
  .patientFormGrid {
    grid-template-columns: 1fr;
  }

  .patientFormField.fullWidth {
    grid-column: auto;
  }

  .patientDialogActions {
    flex-direction: column-reverse;
  }

  .patientDialogButton {
    width: 100%;
  }
}

/* CRANIOREPORT UI PHASE 2: APP SHELL */

:root {

    --cr-primary:#7DC351;
    --cr-primary-dark:#5F9D3C;
    --cr-primary-light:#EAF7DF;
    --cr-primary-hover:#7DC351;

  --cranio-green-900: #477A2D;
  --cranio-green-800: #477A2D;
  --cranio-green-700: #5F9D3C;
  --cranio-green-600: #5F9D3C;
  --cranio-green-100: #e8f1ed;
  --cranio-green-050: #f4f8f6;

  --cranio-gray-950: #18211d;
  --cranio-gray-800: #34413b;
  --cranio-gray-700: #4c5a54;
  --cranio-gray-600: #68746f;
  --cranio-gray-500: #84908a;
  --cranio-gray-300: #cad2ce;
  --cranio-gray-200: #dde3e0;
  --cranio-gray-100: #edf1ef;
  --cranio-gray-050: #f6f8f7;

  --cranio-surface: #ffffff;
  --cranio-background: #f2f5f3;
  --cranio-shadow:
    0 1px 2px rgba(24, 33, 29, 0.05),
    0 8px 28px rgba(24, 33, 29, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 1180px;
  background: var(--cranio-background);
  color: var(--cranio-gray-950);
  font-family:
    Inter,
    "Segoe UI",
    Arial,
    sans-serif;
}

/* Kopfbereich */

#appHeader {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--cranio-gray-200);
  box-sizing: border-box;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brandMark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--cranio-green-800);
  color: white;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 7px 18px rgba(45, 95, 76, 0.18);
}

.brandText {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
}

.brandText > strong {
  color: var(--cranio-gray-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brandText > span {
  color: var(--cranio-gray-950);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.brandAccent {
  color: var(--cranio-green-700);
}

.headerContext {
  display: flex;
  align-items: center;
  gap: 28px;
}

.headerContextItem,
.headerUserText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.headerContextItem {
  padding-right: 28px;
  border-right: 1px solid var(--cranio-gray-200);
  text-align: right;
}

.headerContextItem span,
.headerUserText span {
  color: var(--cranio-gray-500);
  font-size: 11px;
}

.headerContextItem strong,
.headerUserText strong {
  color: var(--cranio-gray-800);
  font-size: 13px;
}

.headerUser {
  display: flex;
  align-items: center;
  gap: 10px;
}

.headerUserAvatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #bfd1c9;
  border-radius: 50%;
  background: var(--cranio-green-100);
  color: var(--cranio-green-900);
  font-size: 12px;
  font-weight: 800;
}

/* Hauptaufteilung */

#appShell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

#appSidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  padding: 24px 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--cranio-surface);
  border-right: 1px solid var(--cranio-gray-200);
  box-sizing: border-box;
}

.primaryNavigation {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.navigationHeading {
  padding: 0 12px 10px;
  color: var(--cranio-gray-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.navigationItem {
  width: 100%;
  min-height: 45px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--cranio-gray-700);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
}

.navigationItem:hover:not(:disabled) {
  border-color: var(--cranio-gray-200);
  background: var(--cranio-gray-050);
  color: var(--cranio-green-900);
}

.navigationItem.active {
  border-color: #c8dbd2;
  background: var(--cranio-green-100);
  color: var(--cranio-green-900);
}

.navigationSymbol {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--cranio-gray-100);
  color: var(--cranio-gray-600);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.navigationItem.active .navigationSymbol {
  background: var(--cranio-green-700);
  color: white;
}

.navigationButton {
  appearance: none;
}

.navigationButton:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sidebarStatus {
  margin: 18px 5px 0;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--cranio-gray-200);
  border-radius: 9px;
  background: var(--cranio-gray-050);
}

.sidebarStatusDot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #5F9D3C;
  box-shadow: 0 0 0 3px rgba(61, 145, 107, 0.13);
}

.sidebarStatus div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebarStatus strong {
  color: var(--cranio-gray-800);
  font-size: 11px;
}

.sidebarStatus span {
  color: var(--cranio-gray-500);
  font-size: 9px;
  line-height: 1.35;
}

#appContent {
  min-width: 0;
  padding: 28px 30px 38px;
  box-sizing: border-box;
}

/* Seitentitel */

.pageIntroduction {
  max-width: 1480px;
  margin: 0 auto 20px;
  padding: 3px 2px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.pageIntroduction h1 {
  margin: 4px 0 6px;
  color: var(--cranio-gray-950);
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.pageIntroduction p {
  margin: 0;
  color: var(--cranio-gray-600);
  font-size: 13px;
}

.pageEyebrow {
  color: var(--cranio-green-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pageIntroductionStatus {
  min-width: 235px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--cranio-gray-200);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.76);
  text-align: right;
}

.pageIntroductionStatus span {
  color: var(--cranio-gray-500);
  font-size: 10px;
}

.pageIntroductionStatus strong {
  color: var(--cranio-green-900);
  font-size: 12px;
}

/* Bestehenden Arbeitsbereich in das neue Design integrieren */

#patientBar,
#controls,
#workspace {
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
}

#patientBar,
#controls,
#analysisPanel {
  border: 1px solid var(--cranio-gray-200);
  box-shadow: var(--cranio-shadow);
}

#patientBar {
  margin-bottom: 14px;
  border-radius: 11px;
}

#controls {
  margin-bottom: 14px;
  border-radius: 11px;
}

#viewer {
  border: 1px solid var(--cranio-gray-200);
  border-radius: 11px;
  box-shadow: var(--cranio-shadow);
}

#analysisPanel {
  border-radius: 11px;
}

#patientBar select,
#patientBar button,
#controls input {
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

#patientBar select:focus,
#controls input:focus {
  outline: none;
  border-color: var(--cranio-green-600);
  box-shadow: 0 0 0 3px rgba(79, 135, 111, 0.13);
}

.patientButton {
  border-color: var(--cranio-gray-300);
  color: var(--cranio-gray-800);
}

#newPatientButton {
  border-color: var(--cranio-green-700);
  background: var(--cranio-green-700);
  color: white;
}

#newPatientButton:hover {
  background: var(--cranio-green-800);
}

#newExaminationButton:not(:disabled) {
  border-color: #bad0c6;
  background: var(--cranio-green-050);
  color: var(--cranio-green-900);
}

.analysisSection h3 {
  color: var(--cranio-green-900);
}

/* Kleine Bildschirme innerhalb der Pilot-PCs */

@media (max-width: 1250px) {
  body {
    min-width: 1000px;
  }

  #appShell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  #appContent {
    padding-left: 20px;
    padding-right: 20px;
  }

  #workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* CRANIOREPORT UI PHASE 3: PATIENT AND WORKFLOW */

/* Patientenkarte */

#patientBar {
  padding: 0;
  display: grid;
  grid-template-columns:
    minmax(260px, 1.45fr)
    minmax(220px, 0.85fr)
    minmax(170px, auto)
    minmax(190px, auto);
  gap: 14px;
  align-items: end;
  overflow: hidden;
  background: var(--cranio-surface);
}

.patientBarHeader {
  grid-column: 1 / -1;
  padding: 20px 22px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background:
    linear-gradient(
      135deg,
      #ffffff 0%,
      var(--cranio-green-050) 100%
    );
  border-bottom: 1px solid var(--cranio-gray-200);
}

.patientBarHeader h2,
.workflowHeader h2 {
  margin: 4px 0 5px;
  color: var(--cranio-gray-950);
  font-size: 18px;
  letter-spacing: -0.015em;
}

.patientBarHeader p {
  max-width: 680px;
  margin: 0;
  color: var(--cranio-gray-600);
  font-size: 12px;
  line-height: 1.5;
}

.sectionEyebrow {
  color: var(--cranio-green-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.patientBarBadge {
  min-width: 220px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #cbdcd4;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
}

.patientBarBadge > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--cranio-green-700);
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.patientBarBadge div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.patientBarBadge strong {
  color: var(--cranio-gray-800);
  font-size: 11px;
}

.patientBarBadge small {
  color: var(--cranio-gray-500);
  font-size: 9px;
}

#patientBar > .fieldGroup,
#patientBar > .patientButton {
  margin-bottom: 18px;
}

#patientBar > .fieldGroup:first-of-type {
  margin-left: 20px;
}

#patientBar > .patientButton:last-of-type {
  margin-right: 20px;
}

#patientBar .fieldGroup {
  gap: 7px;
}

#patientBar .fieldGroup label {
  color: var(--cranio-gray-700);
  font-size: 11px;
  letter-spacing: 0.02em;
}

#patientBar select {
  height: 46px;
  border-color: var(--cranio-gray-300);
  border-radius: 8px;
  background-color: white;
  color: var(--cranio-gray-900);
  font-size: 13px;
  font-weight: 600;
}

#patientBar select:hover:not(:disabled) {
  border-color: var(--cranio-green-600);
}

#patientBar .patientButton {
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  font-size: 12px;
}

.buttonSymbol {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.patientPrimaryAction .buttonSymbol {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.patientSecondaryAction .buttonSymbol {
  background: var(--cranio-green-100);
  color: var(--cranio-green-900);
}

#patientLoadStatus {
  margin: -2px 20px 17px;
  padding: 9px 11px;
  grid-column: 1 / -1;
  border-radius: 7px;
  background: var(--cranio-gray-050);
  color: var(--cranio-gray-600);
  font-size: 10px;
}

/* Workflow */

#examinationWorkflow {
  max-width: 1480px;
  margin: 0 auto 14px;
  padding: 17px 18px 18px;
  border: 1px solid var(--cranio-gray-200);
  border-radius: 11px;
  background: var(--cranio-surface);
  box-shadow: var(--cranio-shadow);
  box-sizing: border-box;
}

.workflowHeader {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.workflowHeader h2 {
  margin-bottom: 0;
}

.workflowHint {
  color: var(--cranio-gray-500);
  font-size: 10px;
}

.workflowSteps {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 7px;
}

.workflowStep {
  position: relative;
  min-height: 66px;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--cranio-gray-200);
  border-radius: 8px;
  background: var(--cranio-gray-050);
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.workflowStep:hover {
  z-index: 2;
  border-color: #b7cdc3;
  background: var(--cranio-green-050);
  box-shadow: 0 5px 15px rgba(35, 77, 62, 0.08);
  transform: translateY(-1px);
}

.workflowStep:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -8px;
  width: 8px;
  height: 1px;
  background: var(--cranio-gray-300);
}

.workflowNumber {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cranio-gray-300);
  border-radius: 50%;
  background: white;
  color: var(--cranio-gray-600);
  font-size: 10px;
  font-weight: 800;
}

.workflowStep:first-child .workflowNumber {
  border-color: var(--cranio-green-700);
  background: var(--cranio-green-700);
  color: white;
}

.workflowText {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workflowText strong {
  overflow: hidden;
  color: var(--cranio-gray-800);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflowText small {
  overflow: hidden;
  color: var(--cranio-gray-500);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  #patientBar {
    grid-template-columns:
      minmax(230px, 1.3fr)
      minmax(190px, 0.8fr)
      minmax(145px, auto)
      minmax(165px, auto);
  }

  .workflowSteps {
    grid-template-columns: repeat(3, 1fr);
  }

  .workflowStep:nth-child(3)::after,
  .workflowStep:last-child::after {
    display: none;
  }
}

/* CRANIOREPORT UI PHASE 3B: DYNAMIC WORKFLOW STATUS */

.workflowStep {
  cursor: pointer;
}

.workflowStep .workflowNumber {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

/* Noch nicht verfügbar */

.workflowStep.locked {
  opacity: 0.48;
  cursor: default;
  pointer-events: none;
}

.workflowStep.locked:hover {
  transform: none;
  border-color: var(--cranio-gray-200);
  background: var(--cranio-gray-050);
  box-shadow: none;
}

/* Abgeschlossener Schritt */

.workflowStep.completed {
  border-color: #CDE9BC;
  background: #f1f8f4;
}

.workflowStep.completed .workflowNumber {
  border-color: var(--cranio-green-700);
  background: var(--cranio-green-700);
  color: white;
  font-size: 12px;
}

.workflowStep.completed .workflowText strong {
  color: var(--cranio-green-900);
}

.workflowStep.completed .workflowText small {
  color: var(--cranio-green-700);
}

/* Aktuell auszuführender Schritt */

.workflowStep.active {
  border-color: var(--cranio-green-700);
  background:
    linear-gradient(
      135deg,
      var(--cranio-green-100) 0%,
      #f7fbf9 100%
    );
  box-shadow:
    0 0 0 2px rgba(61, 115, 94, 0.08),
    0 7px 18px rgba(35, 77, 62, 0.09);
}

.workflowStep.active .workflowNumber {
  border-color: var(--cranio-green-800);
  background: var(--cranio-green-800);
  color: white;
  transform: scale(1.04);
}

.workflowStep.active .workflowText strong {
  color: var(--cranio-green-900);
}

.workflowStep.active .workflowText small {
  color: var(--cranio-green-700);
  font-weight: 600;
}

/* Die frühere feste Hervorhebung des ersten Schrittes aufheben */

.workflowStep:first-child:not(.active):not(.completed)
.workflowNumber {
  border-color: var(--cranio-gray-300);
  background: white;
  color: var(--cranio-gray-600);
}

/* CRANIOREPORT UI: REPORT ASSESSMENT */

.reportAssessmentFields {
  margin-bottom: 12px;
  display: grid;
  gap: 11px;
}

.reportAssessmentField {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reportAssessmentField label {
  color: var(--cranio-gray-700);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.reportAssessmentField label span {
  color: var(--cranio-gray-500);
  font-weight: 400;
}

#reportRecommendationSelect,
#reportAdditionalNote {
  width: 100%;
  border: 1px solid var(--cranio-gray-300);
  border-radius: 7px;
  background: white;
  color: var(--cranio-gray-800);
  font: inherit;
  font-size: 11px;
  box-sizing: border-box;
}

#reportRecommendationSelect {
  min-height: 40px;
  padding: 0 9px;
}

#reportAdditionalNote {
  min-height: 68px;
  padding: 9px;
  resize: vertical;
  line-height: 1.45;
}

#reportRecommendationSelect:focus,
#reportAdditionalNote:focus {
  outline: none;
  border-color: var(--cranio-green-600);
  box-shadow:
    0 0 0 3px rgba(79, 135, 111, 0.13);
}

#reportRecommendationSelect:disabled,
#reportAdditionalNote:disabled {
  background: var(--cranio-gray-050);
  cursor: not-allowed;
  opacity: 0.62;
}

.reportAssessmentHint {
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid #d5e3dc;
  border-radius: 7px;
  background: var(--cranio-green-050);
  color: var(--cranio-gray-600);
  font-size: 9px;
  line-height: 1.45;
}


/* CRANIOREPORT UI: MODULAR EXAMINATION DIALOG */

#modularExaminationDialogOverlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  box-sizing: border-box;
}

#modularExaminationDialogOverlay.visible {
  display: flex;
}

#modularExaminationDialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--cranio-gray-300);
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.28),
    0 4px 12px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
}

body.modularExaminationDialogOpen {
  overflow: hidden;
}

.modularExaminationTypeFieldset {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.modularExaminationTypeFieldset legend {
  margin-bottom: 9px;
  color: var(--cranio-gray-700);
  font-size: 13px;
  font-weight: 700;
}

.modularExaminationTypeOption {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 9px;
  padding: 13px;
  border: 1px solid var(--cranio-gray-300);
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.modularExaminationTypeOption:hover {
  border-color: var(--cranio-green-600);
  background: var(--cranio-green-050);
}

.modularExaminationTypeOption:has(
  input:checked
) {
  border-color: var(--cranio-green-600);
  background: var(--cranio-green-050);
  box-shadow:
    0 0 0 3px rgba(79, 135, 111, 0.12);
}

.modularExaminationTypeOption:has(
  input:disabled
) {
  cursor: not-allowed;
  opacity: 0.46;
}

.modularExaminationTypeOption input {
  margin-top: 3px;
  accent-color: var(--cranio-green-600);
}

.modularExaminationTypeOption span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modularExaminationTypeOption strong {
  color: var(--cranio-gray-800);
  font-size: 14px;
}

.modularExaminationTypeOption small {
  color: var(--cranio-gray-500);
  font-size: 12px;
  line-height: 1.4;
}

.modularExaminationDateField {
  margin-bottom: 16px;
}

#modularExaminationDate {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--cranio-gray-300);
  border-radius: 7px;
  background: #ffffff;
  color: var(--cranio-gray-800);
  font: inherit;
  box-sizing: border-box;
}

#modularExaminationDate:focus {
  outline: none;
  border-color: var(--cranio-green-600);
  box-shadow:
    0 0 0 3px rgba(79, 135, 111, 0.13);
}

#modularExaminationDate.invalid {
  border-color: #b91c1c;
}

#modularExaminationFormError {
  min-height: 18px;
  margin-bottom: 10px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.4;
}

/* CRANIOREPORT UI: EXAMINATION DIALOG POSITION FIX */

#modularExaminationDialogOverlay {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 10000 !important;

  display: none !important;
  align-items: center !important;
  justify-content: center !important;

  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 24px !important;

  overflow: auto !important;
  background: rgba(15, 23, 42, 0.55) !important;
  box-sizing: border-box !important;
}

#modularExaminationDialogOverlay.visible {
  display: flex !important;
}

#modularExaminationDialog {
  position: relative !important;

  width: min(560px, calc(100vw - 48px)) !important;
  max-width: 560px !important;
  max-height: calc(100vh - 48px) !important;

  margin: auto !important;
  padding: 26px !important;

  overflow-y: auto !important;

  border: 1px solid #d6ded9 !important;
  border-radius: 14px !important;

  background: #ffffff !important;

  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.32),
    0 4px 14px rgba(15, 23, 42, 0.15) !important;

  box-sizing: border-box !important;
}

body.modularExaminationDialogOpen {
  overflow: hidden !important;
}

/* CRANIOREPORT UI: SIMPLE EXAMINATION DIALOG */

.cranioExaminationOverlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 20000 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 24px !important;
  background: rgba(15, 23, 42, 0.55) !important;
  box-sizing: border-box !important;
}

.cranioExaminationOverlay.visible {
  display: flex !important;
}

.cranioExaminationDialog {
  width: min(560px, calc(100vw - 48px)) !important;
  max-height: calc(100vh - 48px) !important;
  margin: auto !important;
  padding: 26px !important;
  overflow-y: auto !important;
  border: 1px solid #d6ded9 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.32),
    0 4px 14px rgba(15, 23, 42, 0.15) !important;
  box-sizing: border-box !important;
}

body.cranioExaminationDialogOpen {
  overflow: hidden !important;
}

.cranioExaminationTypes {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.cranioExaminationTypes legend {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
}

.cranioExaminationType {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 9px;
  padding: 13px;
  border: 1px solid #d6ded9;
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
}

.cranioExaminationType:has(
  input:checked
) {
  border-color: #5F9D3C;
  background: #f1f7f4;
  box-shadow:
    0 0 0 3px rgba(79, 135, 111, 0.12);
}

.cranioExaminationType:has(
  input:disabled
) {
  cursor: not-allowed;
  opacity: 0.45;
}

.cranioExaminationType input {
  margin-top: 3px;
  accent-color: #5F9D3C;
}

.cranioExaminationType span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cranioExaminationType strong {
  font-size: 14px;
}

.cranioExaminationType small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

#cranioExaminationDate {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #d6ded9;
  border-radius: 7px;
  box-sizing: border-box;
}

#cranioExaminationDate.invalid {
  border-color: #b91c1c;
}

#cranioExaminationError {
  min-height: 18px;
  margin: 10px 0;
  color: #b91c1c;
  font-size: 12px;
}

/* CRANIOREPORT UI: ANALYSIS MODE MODULE */

.cranioAnalysisModeModule {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #d6ded9;
  border-radius: 10px;
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f8fbf9 100%
    );
  box-sizing: border-box;
}

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

.cranioAnalysisModeEyebrow {
  display: block;
  margin-bottom: 2px;
  color: #5F9D3C;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cranioAnalysisModeHeader h3 {
  margin: 0;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.25;
}

.cranioAnalysisModeBadge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #CDE9BC;
  border-radius: 999px;
  background: #edf7f2;
  color: #5F9D3C;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.cranioAnalysisModeBadge.maximum {
  border-color: #d6b25e;
  background: #fff7dd;
  color: #755b13;
}

.cranioAnalysisModeChoices {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}

.cranioAnalysisModeChoice {
  display: grid;
  grid-template-columns:
    auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid #d6ded9;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.cranioAnalysisModeChoice:hover {
  border-color: #7DC351;
  background: #f7fbf9;
}

.cranioAnalysisModeChoice:has(
  input:checked
) {
  border-color: #5F9D3C;
  background: #f1f7f4;
  box-shadow:
    0 0 0 3px
    rgba(79, 135, 111, 0.1);
}

.cranioAnalysisModeChoice input {
  margin: 3px 0 0;
  accent-color: #5F9D3C;
}

.cranioAnalysisModeChoiceText {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.cranioAnalysisModeChoiceText strong {
  color: #26342d;
  font-size: 13px;
}

.cranioAnalysisModeChoiceText small {
  color: #66736c;
  font-size: 11px;
  line-height: 1.35;
}

.cranioAnalysisModeChoiceTag {
  padding: 3px 6px;
  border-radius: 5px;
  background: #edf2ef;
  color: #506159;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.cranioAnalysisManualOption {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px dashed #c7d2cc;
  border-radius: 8px;
  background: #fbfcfb;
  cursor: pointer;
}

.cranioAnalysisManualOption:has(
  input:disabled
) {
  cursor: not-allowed;
  opacity: 0.48;
}

.cranioAnalysisManualOption input {
  margin: 3px 0 0;
  accent-color: #5F9D3C;
}

.cranioAnalysisManualOption span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cranioAnalysisManualOption strong {
  color: #35443c;
  font-size: 12px;
}

.cranioAnalysisManualOption small {
  color: #728078;
  font-size: 10px;
  line-height: 1.35;
}

.cranioAnalysisModeStatus {
  margin-top: 9px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #eef3f0;
  color: #526158;
  font-size: 10px;
  line-height: 1.4;
}

.visuallyHidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* CRANIOREPORT UI: ADMINISTRATION PHASE 3.1 */

.cranioAdministrationButton {
  border-color: #c4d1ca;
  background: #f5f8f6;
  color: #477A2D;
}

.cranioAdministrationOverlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 25000 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 24px !important;
  overflow: auto !important;
  background: rgba(15, 23, 42, 0.58) !important;
  box-sizing: border-box !important;
}

.cranioAdministrationOverlay.visible {
  display: flex !important;
}

.cranioAdministrationDialog {
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 26px;
  overflow-y: auto;
  border: 1px solid #d6ded9;
  border-radius: 15px;
  background: #ffffff;
  box-shadow:
    0 26px 80px rgba(15, 23, 42, 0.34),
    0 5px 16px rgba(15, 23, 42, 0.16);
  box-sizing: border-box;
}

body.cranioAdministrationOpen {
  overflow: hidden !important;
}

.cranioAdministrationHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.cranioAdministrationHeader h2 {
  margin: 3px 0 5px;
  color: #1f2f27;
  font-size: 24px;
}

.cranioAdministrationHeader p {
  margin: 0;
  color: #68766e;
  font-size: 13px;
  line-height: 1.5;
}

.cranioAdministrationEyebrow {
  color: #5F9D3C;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cranioAdministrationClose {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #d6ded9;
  border-radius: 50%;
  background: #ffffff;
  color: #526158;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cranioAdministrationNotice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid #CDE9BC;
  border-radius: 9px;
  background: #edf7f2;
  color: #5F9D3C;
}

.cranioAdministrationNotice strong {
  font-size: 13px;
}

.cranioAdministrationNotice span {
  font-size: 11px;
  line-height: 1.45;
}

.cranioAdministrationSection {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #dce4df;
  border-radius: 10px;
  background: #fbfcfb;
}

.cranioAdministrationSection h3 {
  margin: 0 0 5px;
  color: #28372f;
  font-size: 15px;
}

.cranioAdministrationSection p {
  margin: 0;
  color: #718078;
  font-size: 11px;
}

.cranioAdministrationSectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.cranioUserCard {
  display: grid;
  grid-template-columns:
    auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #d5dfda;
  border-radius: 9px;
  background: #ffffff;
}

.cranioUserAvatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #5F9D3C;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.cranioUserInformation {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.cranioUserInformation strong {
  color: #26342d;
  font-size: 14px;
}

.cranioUserInformation span {
  color: #718078;
  font-size: 11px;
}

.cranioUserRole {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.cranioUserRole.admin {
  background: #edf7f2;
  color: #5F9D3C;
}

.cranioUserStatus {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #315b8a;
  font-size: 10px;
  font-weight: 800;
}

.cranioAdministrationSteps {
  margin: 11px 0 0;
  padding-left: 20px;
  color: #536259;
  font-size: 12px;
  line-height: 1.75;
}

@media (max-width: 720px) {
  .cranioAdministrationSectionHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .cranioUserCard {
    grid-template-columns:
      auto minmax(0, 1fr);
  }

  .cranioUserRole,
  .cranioUserStatus {
    justify-self: start;
    margin-left: 54px;
  }
}

/* CRANIOREPORT UI: ADMINISTRATION HEADER BUTTON */

.cranioAdministrationHeaderButton {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;

  width: auto !important;
  min-width: 0 !important;
  min-height: 38px !important;

  margin: 0 12px 0 0 !important;
  padding: 8px 12px !important;

  border: 1px solid #d4ded8 !important;
  border-radius: 9px !important;

  background: #ffffff !important;
  color: #477A2D !important;

  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;

  box-shadow: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.cranioAdministrationHeaderButton:hover {
  border-color: #7DC351 !important;
  background: #f3f8f5 !important;
  color: #5F9D3C !important;
}

.cranioAdministrationHeaderButton .buttonSymbol {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 18px !important;
  height: 18px !important;

  border-radius: 50% !important;
  background: #edf5f1 !important;
  color: #5F9D3C !important;

  font-size: 11px !important;
}

@media (max-width: 900px) {
  .cranioAdministrationHeaderButton span:last-child {
    display: none !important;
  }

  .cranioAdministrationHeaderButton {
    width: 38px !important;
    padding: 8px !important;
  }
}
