/* Patientenübersicht in der gemeinsamen Shell; Editor- und Detaildialoge bleiben modal. */
#dashboard-shell[data-active-page="patients"] .workspace {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
#dashboard-shell[data-active-page="patients"] .topbar { flex: 0 0 auto; }
#dashboard-shell[data-patients-header-actions="true"] > .workspace > .topbar { display: none; }
#dashboard-shell[data-active-page="patients"] .workspace-content {
  box-sizing: border-box;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #082329;
}
#dashboard-shell[data-active-page="patients"] .workspace-content::before { display: none; }
#dashboard-shell #page-patients {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  padding: 0 0 12px;
  color: #ecf2f1;
  background: #082329;
}
#dashboard-shell #page-patients:not([hidden]) { display: flex; flex-direction: column; }
#dashboard-shell #page-patients .patients-page-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid #285057;
  border-radius: 10px;
  background: #0c2a30;
}
#dashboard-shell #page-patients .patients-page-header h1 {
  margin: 0;
  color: #e4bf74;
  font: 650 28px/1.4 system-ui, sans-serif;
  letter-spacing: -.5px;
}
#dashboard-shell #page-patients .patients-page-header p {
  margin: 0;
  color: #e1ebea;
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.35;
  text-align: left;
}
#dashboard-shell #page-patients .patients-hero-background,
#dashboard-shell #page-patients .patients-hero-foreground {
  position: absolute; right: 0; top: 0; height: 100%; pointer-events: none;
}
#dashboard-shell #page-patients .patients-hero-background {
  z-index: -2; width: 65%; object-fit: cover; object-position: right center;
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
#dashboard-shell #page-patients .patients-hero-foreground {
  z-index: -1; width: min(35%, 22rem); object-fit: contain; object-position: right center;
}
#dashboard-shell #page-patients .patients-page-header::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(12, 42, 48, .35); pointer-events: none;
}
#dashboard-shell #page-patients .data-panel {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #176068;
  border-radius: 12px;
  background: #06262c;
  box-shadow: none;
}
#dashboard-shell #page-patients #patient-table-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  min-height: 60px;
  padding: 8px 14px;
  border-bottom: 1px solid #176068;
  background: #0b3035;
}
#dashboard-shell #page-patients #patient-table-toolbar > #add-patient {
  width: auto;
  min-width: 0;
  min-height: 42px;
  margin-left: auto;
  white-space: normal;
}
#dashboard-shell #page-patients .search-field {
  flex: 1 1 18rem;
  max-width: 30rem;
  min-width: 0;
  min-height: 42px;
  border-color: #3c7779;
  color: #c7dcdd;
  background: #061f26;
}
#dashboard-shell #page-patients .search-field input { color: #ecf2f1; }
#dashboard-shell #page-patients .patient-table-wrap:not(.patient-card-wheel-active) { min-height: 0; overflow-x: auto; overflow-y: hidden; }
#dashboard-shell #page-patients .patient-table {
  --table-body-font-size: .9375rem;
  --table-heading-font-size: .9rem;
  width: 100%;
  min-width: 44rem;
}
#dashboard-shell #page-patients .medical-patient-table { min-width: 58rem; table-layout: fixed; }
#dashboard-shell #page-patients .patient-table th { padding: .6rem clamp(.45rem, .7vw, .75rem); }
#dashboard-shell #page-patients .patient-table td { padding: .45rem clamp(.45rem, .7vw, .75rem); }
#dashboard-shell #page-patients .patient-table th {
  color: #e2c275;
  background: #0b3538;
  border-bottom-color: #176068;
}
#dashboard-shell #page-patients .patient-table td {
  color: #d1e0de;
  background: #08282e;
  border-bottom-color: #176068;
}
#dashboard-shell #page-patients .patient-table tr:hover td { background: #123b40; }
#dashboard-shell #page-patients .patient-table .patient-name { color: #f1f5f4; }
#dashboard-shell #page-patients .medical-patient-table :is(th, td) { overflow-wrap: break-word; word-break: normal; }
#dashboard-shell #page-patients .medical-patient-table th {
  padding-inline: clamp(.25rem, .55vw, .55rem);
  font-size: clamp(.85rem, .8rem + .12vw, .9rem);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
#dashboard-shell #page-patients .medical-patient-table th:nth-child(1) { width: 12%; }
#dashboard-shell #page-patients .medical-patient-table th:nth-child(2) { width: 14%; }
#dashboard-shell #page-patients .medical-patient-table th:nth-child(3) { width: 12%; }
#dashboard-shell #page-patients .medical-patient-table th:nth-child(4) { width: 16%; }
#dashboard-shell #page-patients .medical-patient-table th:nth-child(5) { width: 20%; }
#dashboard-shell #page-patients .medical-patient-table th:nth-child(6) { width: 26%; }
#dashboard-shell #page-patients .patient-table td.row-actions { display: table-cell; white-space: normal; text-align: right; }
#dashboard-shell #page-patients .patient-row-action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
#dashboard-shell #page-patients .patient-table .row-actions button { display: grid; flex: 0 0 36px; width: 36px; height: 36px; margin: 0; }
#dashboard-shell #page-patients .patient-table .row-actions button.patient-edit-button {
  flex: 0 1 auto; width: auto; min-width: 0; min-height: 36px; height: auto;
  padding: 6px 12px; white-space: normal;
}
#dashboard-shell #page-patients #patient-empty-state { padding: clamp(1rem, 4dvh, 2rem) 1rem; }
#dashboard-shell #page-patients #patient-empty-state h2 { color: #f1f5f4; }
#dashboard-shell #page-patients #patient-empty-state p { color: #c7dcdd; }
#dashboard-shell #page-patients #patient-pagination {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 6px 0 0;
  padding: 4px;
  border: 0;
  color: #9dbfbd;
  background: transparent;
}
@media (max-width: 680px) {
  #dashboard-shell[data-active-page="patients"] .workspace-content {
    overflow: hidden;
  }
  #dashboard-shell #page-patients:not([hidden]) {
    height: 100%;
    min-height: 0;
    padding: 0 0 8px;
  }
  #dashboard-shell #page-patients .patients-page-header {
    margin-bottom: 12px;
  }
  #dashboard-shell #page-patients .patients-page-header p { font-size: 12px; }
  #dashboard-shell #page-patients .data-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
  }
  #dashboard-shell #page-patients #patient-table-toolbar { gap: 8px; padding: 10px; }
  #dashboard-shell #page-patients #patient-table-toolbar > #add-patient { width: 100%; margin: 0; }
  #dashboard-shell #page-patients .search-field { flex-basis: 100%; max-width: none; }
  #dashboard-shell #page-patients .patient-table-wrap { min-height: 0; overflow-y: hidden; }
  #dashboard-shell #page-patients .patient-table-wrap.patient-card-wheel-active { overflow: clip; }
  #dashboard-shell #page-patients #patient-pagination { margin-top: 4px; }
}
#dashboard-shell[data-active-page="patients"] .workspace-content.list-page-needs-scroll { overflow: auto; }
#dashboard-shell[data-active-page="patients"] .workspace-content.list-page-needs-scroll #page-patients:not([hidden]) { height: auto; min-height: 100%; }
#dashboard-shell[data-active-page="patients"] .workspace-content.list-page-needs-scroll .data-panel { flex: 0 0 auto; }
@media (max-width: 680px) {
  #dashboard-shell[data-active-page="patients"] .workspace-content.list-page-needs-scroll .data-panel { display: flex; }
  #dashboard-shell[data-active-page="patients"] .workspace-content.list-page-needs-scroll .patient-table-wrap { overflow-y: visible; }
  #dashboard-shell[data-active-page="patients"] .workspace-content.list-page-needs-scroll .patient-table-wrap.patient-card-wheel-active { height: 12rem; overflow: clip; }
}
