:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --ink: #1f2328;
  --muted: #667085;
  --subtle: #8a94a6;
  --line: #d9dee7;
  --line-soft: #edf0f4;
  --danger: #e9543f;
  --danger-soft: #fff3f1;
  --attention: #bf5b00;
  --attention-soft: #fff7ed;
  --ok: #157a5b;
  --ok-soft: #eefaf5;
  --focus: #2563eb;
  --shadow: 0 12px 30px rgba(31, 35, 40, 0.08);
}

* {
  box-sizing: border-box;
}

/* ── Lucide icon sizes ───────────────────────────── */
.icon-xs { width: 12px; height: 12px; display: inline-block; flex-shrink: 0; vertical-align: middle; }
.icon-sm { width: 14px; height: 14px; display: inline-block; flex-shrink: 0; vertical-align: middle; }
.icon-md { width: 16px; height: 16px; display: inline-block; flex-shrink: 0; vertical-align: middle; }
.icon-lg { width: 20px; height: 20px; display: inline-block; flex-shrink: 0; vertical-align: middle; }
.icon-xl { width: 22px; height: 22px; display: inline-block; flex-shrink: 0; vertical-align: middle; }

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: #fff6f5;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 16px 12px;
  background: #fff6f5;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 0 8px;
  margin-bottom: 20px;
  color: var(--ink);
}

.sidebar-logo img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  mix-blend-mode: difference;
}

.sidebar-logo-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4f5b6b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.nav-item:hover:not(:disabled),
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.nav-item.is-active::before {
  position: absolute;
  left: -12px;
  width: 4px;
  height: 24px;
  border-radius: 0 2px 2px 0;
  background: var(--danger);
  content: "";
}

.nav-item:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.nav-item-label {
  flex: 1;
  text-align: left;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.18);
  margin: 6px 4px;
  flex-shrink: 0;
}

.nav-context-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-context-label {
  padding: 5px 12px 3px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Versorgung context bar ──────────────────── */
.versorgung-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  background: #fff;
  box-shadow: inset 0 -1px 0 var(--line-soft);
  flex-shrink: 0;
}

.vbar-back {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 6px 0 0;
  border-right: 1px solid var(--line-soft);
  height: 24px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.12s;
}
.vbar-back:hover { color: var(--ink); }

.vbar-context {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.vbar-unit {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vbar-detail {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #263449;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--muted);
}

.bottom-nav {
  display: none;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 3px;
  height: 100%;
  border: 0;
  background: transparent;
  color: #4f5b6b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 4px;
}

.bottom-nav-item.is-active {
  color: var(--danger);
}

.bottom-nav-item:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.app-shell.is-tablet-mode {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
}

.app-shell.is-tablet-mode .app-sidebar {
  display: none;
}

.app-shell.is-tablet-mode .app-workspace {
  padding-top: 0;
}

.app-shell.is-tablet-mode .app-frame {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.app-shell.is-tablet-mode .bottom-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: #fff6f5;
  border-top: 1px solid #e5b0a1;
  height: 64px;
}

.bottom-more-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 200;
}

.bottom-more-panel {
  position: fixed;
  bottom: 64px;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 201;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
}

.bottom-more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.bottom-more-item:hover {
  background: var(--surface-soft);
}

.app-workspace {
  display: flex;
  flex-direction: column;
  background: #fff6f5;
  padding-top: 4px;
  min-width: 0;
  min-height: 0;
}

.app-frame {
  display: flex;
  flex: 1;
  gap: 4px;
  padding: 4px;
  background: #ffc5b8;
  border: 1px solid #e5b0a1;
  border-radius: 12px 0 0 0;
  min-height: 0;
  overflow: hidden;
}

.app-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: none;
  border-radius: 10px;
  border: none;
  min-height: 0;
  overflow: hidden;
}

.shift-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.shift-bar-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.shift-bar-clock {
  color: var(--muted);
  flex-shrink: 0;
}

.shift-bar-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.shift-bar-unit {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-bar-detail {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.shift-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.secondary-button.icon-only {
  padding: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.app-main .screen {
  max-width: none;
  margin: 0;
}

.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(430px, calc(100vw - 56px));
  pointer-events: none;
}

.drawer-backdrop {
  grid-column: 1 / -1;
  grid-row: 1;
  background: rgba(31, 35, 40, 0.18);
  pointer-events: auto;
}

.shift-drawer {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: #f5f8fa;
  box-shadow: -18px 0 42px rgba(31, 35, 40, 0.16);
  pointer-events: auto;
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0.72;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.drawer-search {
  width: 100%;
}

.care-card-grid.drawer-care-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.journey-shell {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.journey-topbar {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  border: 0;
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}

.brand img {
  width: 26px;
  height: 26px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
  max-width: 760px;
  justify-self: center;
  width: 100%;
}

.step {
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.step:hover:not(:disabled) {
  background: #fff;
  border-color: var(--line-soft);
}

.step strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
}

.step span {
  font-size: 12px;
  line-height: 1.25;
}

.step.is-active {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.05);
}

.step.is-done {
  color: #596273;
}

.step:disabled {
  color: var(--subtle);
  cursor: not-allowed;
  opacity: 0.55;
}

.user-pill {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #263449;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.journey-main {
  min-height: 0;
  overflow: auto;
  padding: 24px;
}

.screen {
  max-width: 1440px;
  margin: 0 auto;
}

@keyframes screen-slide-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
.screen-overview.is-entering {
  animation: screen-slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-head,
.context-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

/* ── Unified screen topbar ── */
.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 24px;
  background: #fff;
  box-shadow: inset 0 -1px 0 var(--line-soft);
  flex-shrink: 0;
  z-index: 2;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.topbar-title-stack {
  display: grid;
  gap: 1px;
}

.topbar-title {
  font-size: 19px;
  font-weight: 850;
  margin: 0;
  color: var(--ink);
}

.topbar-kicker {
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  margin: 0;
}

.topbar-meta {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.search-field {
  display: grid;
  gap: 6px;
  width: min(360px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.search-field input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-field input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.care-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}

.care-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(31, 35, 40, 0.06);
}

.care-card.has-current {
  border-color: rgba(233, 84, 63, 0.45);
  box-shadow: 0 10px 28px rgba(233, 84, 63, 0.08);
}

.care-card__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
}

.care-card__head div {
  display: grid;
  gap: 5px;
}

.care-card__head strong {
  font-size: 15px;
  line-height: 1.25;
}

.care-card__head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.shift-slots {
  display: grid;
  gap: 8px;
}

.shift-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.shift-cell:hover {
  background: #f8fafc;
  border-color: #cbd3df;
}

.shift-cell span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shift-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shift-cell strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.shift-cell em {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
}

.shift-cell.is-current {
  background: #f7fbff;
  border-color: rgba(233, 84, 63, 0.5);
  box-shadow: inset 3px 0 0 var(--danger);
}

.shift-cell.is-current em {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.shift-cell.is-open {
  background: #fafafa;
  color: var(--subtle);
  cursor: not-allowed;
}

.shift-cell.is-open strong {
  color: var(--subtle);
}

.shift-cell.is-open em {
  border-color: var(--line-soft);
  background: #f3f4f6;
  color: var(--subtle);
}

.empty-row {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.context-header {
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.context-header h1 {
  font-size: 22px;
}

.context-meta {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

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

.date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.primary-button,
.secondary-button {
  border-radius: 9px;
  font-weight: 850;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.primary-button {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid #cf4633;
  background: var(--danger);
  color: #fff;
}

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button.compact {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.screen-overview {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 0;
  background: #fff;
  overflow: hidden;
}

.patient-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 4px;
  overflow-x: auto;
}

.patient-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  padding: 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.patient-tabs button:hover {
  background: rgba(31, 35, 40, 0.04);
  color: var(--ink);
}

.patient-tabs button span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8c4d4;
  flex-shrink: 0;
}

.patient-tabs button[data-status="warning"] span { background: #d97706; }
.patient-tabs button[data-status="high"] span { background: #d97706; }
.patient-tabs button[data-status="low"] span { background: #2563eb; }
.patient-tabs button[data-status="critical"] span { background: var(--danger); }

.patient-tabs button.is-active {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(31, 35, 40, 0.09);
}

.overview-grid {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  height: 100%;
  min-height: 0;
  padding: 12px;
  box-sizing: border-box;
  background: #fff;
}

.value-list-shell {
  width: fit-content;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.value-list {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  overflow: auto;
}

.overview-detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f5f8fa;
  box-shadow: 0 4px 8px rgba(1, 29, 58, 0.08);
  overflow: hidden;
}

.status-card {
  display: grid;
  grid-template-columns: 1fr 12px;
  grid-template-rows: auto 1fr auto;
  gap: 2px 8px;
  min-height: 72px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

/* top row: icon + label */
.sc-top {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: center; gap: 5px;
}
.sc-label {
  color: var(--muted); font-size: 11px; font-weight: 500;
}
.sc-icon.cat-vital,
.sc-icon.cat-balance,
.sc-icon.cat-wellbeing,
.sc-icon.cat-task     { color: var(--muted); }

/* value */
.sc-value {
  grid-column: 1; grid-row: 2;
  font-size: 16px; line-height: 1.15; align-self: center;
}
.sc-unit { font-size: 11px; font-weight: 400; color: var(--muted); }

/* status badge */
.sc-status {
  grid-column: 1; grid-row: 3;
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; font-style: normal;
}
.sc-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.sc-status--normal  { color: #157a5b; }
.sc-status--normal  .sc-dot { background: #157a5b; }
.sc-status--done    { color: #157a5b; }
.sc-status--done    .sc-dot { background: #157a5b; }
.sc-status--warning { color: #bf5b00; }
.sc-status--warning .sc-dot { background: #d97706; }
.sc-status--high    { color: #bf5b00; }
.sc-status--high    .sc-dot { background: #d97706; }
.sc-status--low     { color: #1d4ed8; }
.sc-status--low     .sc-dot { background: #2563eb; }
.sc-status--critical{ color: #e9543f; }
.sc-status--critical .sc-dot { background: #e9543f; }
.sc-status--pending { color: #667085; }
.sc-status--pending .sc-dot { background: #98a2b3; }
.sc-status--planned { color: #667085; }
.sc-status--planned .sc-dot { background: #98a2b3; }
.sc-status--info    { color: var(--muted); }
.sc-status--info    .sc-dot { background: var(--subtle); }

/* gauge */
.sc-gauge {
  grid-column: 2; grid-row: 1 / -1;
  display: flex; justify-content: center; align-self: stretch;
  padding: 2px 0;
}
.sc-gauge-track {
  position: relative; width: 5px; flex: 0 0 5px;
  background: #e9edf3; border-radius: 3px;
}
.sc-gauge-fill {
  position: absolute; bottom: 0; left: 0; width: 100%;
  border-radius: 3px; transition: height 0.3s ease;
}
.sc-gauge-thumb {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.22); z-index: 1;
}

.status-card.is-active {
  border-color: var(--focus);
}
.status-card.status-critical { border-color: #f2b7ad; }

.trend-panel {
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  align-content: start;
  gap: 16px;
  padding: 22px 24px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.trend-panel:has(.balance-goal-banner) {
  grid-template-rows: max-content max-content minmax(0, 1fr);
}

.panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  height: max-content;
  min-height: 0;
}

.panel-title > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.range-switch {
  display: inline-flex;
  flex: 0 0 auto;
  width: max-content;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.range-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.range-switch button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
}

.trend-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.trend-chart {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 220px;
  box-sizing: border-box;
  padding: 18px 18px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.trend-chart canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
}

.chart-thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-thresholds > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.threshold-line {
  display: inline-block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}
.threshold-line--low  { background: #2563eb; opacity: 0.45; }
.threshold-line--high { background: #e9543f; opacity: 0.45; }

.history-panel {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 4px;
  padding: 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: transparent;
}

.history-panel h2 {
  padding: 16px 16px 4px;
  margin-bottom: 4px;
}

.panel-eyebrow {
  padding: 16px 16px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.history-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 8px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
}

.history-item span {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.history-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.history-item strong {
  grid-column: -2 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 14px;
  text-align: right;
}

.history-item strong.is-alert {
  color: var(--danger);
}

.history-alert-arrow {
  color: var(--danger);
  font-size: 13px;
  line-height: 1;
}

.screen-simple {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.screen-unassigned {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 4px;
  background: #ffc5b8;
  overflow: hidden;
}

.unassigned-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 8px 16px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  flex-shrink: 0;
}

.unassigned-head h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.unassigned-context {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 2px;
}

.takeover-board {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  flex: 1;
}

.takeover-searchbar {
  flex-shrink: 0;
  padding: 12px;
  border: 1px solid #ced5de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
}

.takeover-searchbar .search-field {
  max-width: none;
}

.shift-board-list {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  flex: 1;
  padding: 0 0 12px;
  overflow: auto;
}

.shift-takeover-section {
  display: flex;
  flex-direction: column;
  width: min(100%, 980px);
  margin: 0 auto;
  min-width: 0;
  border: 1px solid #ced5de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
  overflow: hidden;
}

.takeover-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.takeover-section-head div {
  display: grid;
  gap: 3px;
}

.shift-takeover-section h2 {
  font-size: 15px;
  line-height: 1.2;
}

.takeover-section-head span {
  color: var(--muted);
  font-size: 13px;
}

.takeover-section-head em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.takeover-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 12px;
}

.takeover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
}

.takeover-row.is-open {
  background: #f8fafc;
  opacity: 0.7;
}

.takeover-card-main {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.takeover-card-main > div:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.takeover-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.takeover-row strong {
  font-size: 14px;
  line-height: 1.25;
}

.takeover-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.takeover-row small {
  overflow: hidden;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.takeover-card-action {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.takeover-card-action span {
  font-weight: 750;
}

.simple-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(280px, 0.65fr);
  gap: 16px;
}

.simple-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 8px rgba(1, 29, 58, 0.08);
}

.simple-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.panel-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-row-head h2 {
  margin-bottom: 4px;
}

.muted-panel {
  background: #f8fafc;
}

.patient-plan-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.patient-plan-tab {
  display: grid;
  gap: 3px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.patient-plan-tab strong {
  font-size: 13px;
}

.patient-plan-tab span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-plan-tab:hover,
.patient-plan-tab.is-active {
  border-color: var(--brand);
  background: #f1f8ff;
}

.settings-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-mini-list span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.plan-row,
.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.plan-row span,
.setting-row {
  color: var(--ink);
  font-weight: 750;
}

.plan-row strong,
.plan-row em {
  font-size: 13px;
}

.plan-row em {
  color: var(--muted);
  font-style: normal;
}

.status-text {
  color: var(--muted);
  font-weight: 850;
}

/* ── Settings screen layout ── */
.screen-settings {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

/* settings-head → uses .screen-topbar now */

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Prototype panel ── */
.proto-panel {
  flex-shrink: 0;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  overflow: hidden;
}

.proto-panel-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.proto-panel-hd svg {
  color: #b45309;
}

.proto-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(253, 230, 138, 0.5);
}

.proto-row:last-child {
  border-bottom: 0;
}

.proto-row-info {
  flex: 0 0 200px;
  display: grid;
  gap: 2px;
}

.proto-row-name {
  font-size: 13px;
  font-weight: 750;
  color: #78350f;
}

.proto-row-val {
  font-size: 12px;
  color: #a16207;
}

.proto-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.proto-controls label {
  display: grid;
  gap: 4px;
}

.proto-controls label > span {
  font-size: 11px;
  font-weight: 800;
  color: #92400e;
}

.proto-controls select,
.proto-controls input[type="time"] {
  height: 32px;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  padding: 0 10px;
}

.proto-controls input:disabled {
  background: #fef9c3;
  color: #a16207;
}

.prototype-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
}

.prototype-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

/* ── Settings sections ── */
.settings-stack {
  flex-shrink: 0;
  display: grid;
  gap: 12px;
}

.settings-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(1,29,58,0.05);
}

.settings-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.settings-section h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Section icon badge in header */
.s-section-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.s-section-icon.cat-vital     { color: #e9543f; background: rgba(233,84,63,0.12); }
.s-section-icon.cat-wellbeing  { color: #7c3aed; background: rgba(124,58,237,0.12); }
.s-section-icon.cat-balance    { color: #2563eb; background: rgba(37,99,235,0.12); }
.s-section-icon.cat-task       { color: #157a5b; background: rgba(21,122,91,0.12); }

/* ── Card grid ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line-soft);
}

/* Vital section: fixed 5 cols, all cards identical width */
.settings-section[data-cat="vital"] .settings-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* Compact stacked card (vital items) */
.s-card {
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
}

/* Wide horizontal card (bp, feedback, balance, task) */
.s-card.s-card--wide {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 11px 16px;
}

.s-card--wide .s-card-body {
  display: grid;
  gap: 4px;
}

.s-card--wide .chip-row {
  margin-top: 2px;
}

/* Icon badge (only used in section headers now) */
.s-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Blood pressure two-line compact */
.s-card-bp-compact {
  display: grid;
  gap: 1px;
}

.s-card-bp-compact span {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.s-card-bp-compact b {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 3px;
}

.s-card-icon.cat-vital     { color: #e9543f; background: rgba(233,84,63,0.10); }
.s-card-icon.cat-wellbeing  { color: #7c3aed; background: rgba(124,58,237,0.10); }
.s-card-icon.cat-balance    { color: #2563eb; background: rgba(37,99,235,0.10); }
.s-card-icon.cat-task       { color: #157a5b; background: rgba(21,122,91,0.10); }

/* Card content */
.s-card-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.3;
}

.s-card-range {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.s-card-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* Blood pressure two-values */
.s-card-bp-vals {
  display: flex;
  gap: 14px;
}

.s-card-bp-vals > span {
  display: grid;
  gap: 0px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.s-card-bp-vals b {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.definition-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

/* === Messblatt (Sheet) === */

.screen-sheet {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* sheet-bar → uses .screen-topbar now */
.sheet-bar { /* kept for legacy selectors below */ }

.sheet-title {
  font-size: 17px;
  font-weight: 850;
  margin: 0;
}

.sheet-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-now-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hide-done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
}

.hide-done-toggle input[type="checkbox"] {
  display: none;
}

.toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.2s;
}

.hide-done-toggle input:checked ~ .toggle-track {
  background: var(--danger);
}

.hide-done-toggle input:checked ~ .toggle-track .toggle-thumb {
  left: 18px;
}

.sheet-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.sheet-grid,
.sheet-notime-grid {
  display: grid;
  grid-template-columns: 72px repeat(var(--col-count), minmax(210px, 1fr));
  min-width: max-content;
  width: 100%;
  background: #fff;
}

.sheet-grid {
  min-height: 100%;
}

.sheet-notime-grid {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 22px rgba(31, 35, 40, 0.04);
  overflow-x: auto;
}

.sheet-head-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.sheet-patient-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 750;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.sheet-add-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
}
.sheet-add-btn:hover { background: var(--surface-soft); }

.sheet-time-label {
  padding: 12px 6px 4px;
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  align-self: start;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  white-space: nowrap;
  overflow: visible;
}
.sheet-time-label.is-now {
  color: #2f6cf6;
  font-weight: 850;
  background: #eff6ff;
  align-self: stretch;
}
.sheet-cell.is-now {
  background: #eff6ff;
}
.sheet-time-label.is-past {
  color: var(--muted);
}
.sheet-time-label.is-notime {
  font-style: italic;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-top: 0;
  white-space: normal;
  line-height: 1.3;
}

.sheet-time-label,
.sheet-cell {
  border-top: 1px solid var(--line);
}

.sheet-cell {
  padding: 8px 8px 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-left: 1px solid var(--line-soft);
}

.sheet-cell-empty {
  display: block;
  min-height: 10px;
}

.sheet-filler-label,
.sheet-filler-cell {
  align-self: stretch;
}

.sheet-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 13px;
  transition: border-color 0.1s;
}
.sheet-entry:hover { border-color: var(--danger); }
.sheet-entry.is-done {
  opacity: 0.45;
}
.sheet-entry.is-overdue {
  border-color: rgba(233, 84, 63, 0.4);
  border-left-width: 3px;
}

.sheet-entry.is-elevated {
  border-color: rgba(191, 91, 0, 0.36);
  border-left-width: 3px;
  background: var(--attention-soft);
}

.sheet-entry-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sheet-entry-label {
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-entry-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

.sheet-entry-value {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sheet-entry-status.is-overdue {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--danger);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sheet-task-entry { border-style: solid; }

.sheet-freq-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  background: rgba(47, 108, 246, 0.1);
  color: #2f6cf6;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Sheet Entry Modal ──────────────────────────── */

.sheet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 57, 84, 0.42);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sheet-modal {
  background: #ebf0f5;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(1, 29, 58, 0.08);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-modal-inner {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px;
}

.sheet-modal-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  gap: 24px;
  min-width: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(1, 29, 58, 0.08);
}

.sheet-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 0;
  flex-shrink: 0;
}

.sheet-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.sheet-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sheet-modal-close:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.sheet-modal-fields {
  display: grid;
  gap: 24px;
  width: 100%;
  min-width: 0;
}

.sheet-modal-fields.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.sheet-modal-field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.sheet-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #d8dcff;
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  min-height: 80px;
  transition: border-color 0.15s;
}

.sheet-modal-input-wrap:focus-within {
  border-color: #8eddb9;
}

.sheet-modal-unit-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: #f0f5fa;
  border: 1px solid #ced5de;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 10px;
}

.sheet-modal-input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}

.sheet-modal-range {
  font-size: 13px;
  color: #717c8c;
}

.sheet-modal-range::before {
  content: "ø ";
}

.sheet-modal-add-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #ced5de;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f5f8fa 100%);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
}

.sheet-modal-add-note-btn:hover {
  background: var(--surface-soft);
}

.sheet-modal-note-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.sheet-modal-note-input {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.sheet-modal-note-input:focus {
  border-color: var(--danger);
}

.sheet-modal-numpad {
  display: none;
  width: 200px;
  flex-shrink: 0;
  background: #f8f9fa;
  border-left: 1px solid var(--line);
  padding: 16px 12px;
  align-items: center;
  justify-content: center;
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.numpad-key {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: 14px;
  border: 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s;
}

.numpad-key:active {
  background: #e9ecef;
}

.numpad-key.is-delete {
  background: rgba(233, 84, 63, 0.08);
  color: var(--danger);
  font-size: 18px;
}

.sheet-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 0;
  flex-shrink: 0;
  gap: 12px;
}

.sheet-modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sheet-modal-mini-chart {
  position: relative;
  width: 100%;
  height: 152px;
  padding: 16px 8px 34px;
  border-radius: 12px;
  background: #f5f8fa;
  overflow: hidden;
}

.mini-chart-row {
  position: absolute;
  left: 14px;
  right: 16px;
  top: calc(8px + (var(--row) * 24px));
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-chart-row span {
  width: 28px;
  text-align: right;
  color: #717c8c;
  font-size: 13px;
  line-height: 1.4;
}

.mini-chart-row i {
  flex: 1;
  height: 1px;
  background: #e6eaf0;
}

.sheet-modal-mini-chart svg {
  position: absolute;
  left: 48px;
  right: 20px;
  top: 16px;
  width: calc(100% - 68px);
  height: 99px;
  overflow: visible;
}

.mini-chart-x-axis {
  position: absolute;
  left: 48px;
  right: 20px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mini-chart-x-axis span {
  color: #717c8c;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.mini-chart-line {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
  animation: modalChartDraw 520ms cubic-bezier(.2, .8, .2, 1) forwards;
}

.mini-chart-line-primary { stroke: #667aff; }
.mini-chart-line-secondary { stroke: #76d7ae; }

.mini-chart-dot {
  fill: #fff;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: modalChartDotIn 280ms ease-out forwards;
  animation-delay: 220ms;
}

.mini-chart-dot.mini-chart-line-primary { stroke: #667aff; }
.mini-chart-dot.mini-chart-line-secondary { stroke: #76d7ae; }

.sheet-modal-mini-chart.is-live-update .mini-chart-line,
.sheet-modal-mini-chart.is-live-update .mini-chart-dot {
  animation: none;
  opacity: 1;
  stroke-dashoffset: 0;
}

@keyframes modalChartDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes modalChartDotIn {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mini-chart-line,
  .mini-chart-dot {
    animation: none;
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

/* ── Sheet modal type variants ──────────────────── */

/* Wellbeing + task modals: no numpad, narrower */
.sheet-modal--wellbeing,
.sheet-modal--task { max-width: 420px; }

/* Scale option list */
.sheet-modal-scale {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-modal-scale-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
  width: 100%;
}

.sheet-modal-scale-option:hover {
  background: var(--surface-soft);
}

.sheet-modal-scale-option.is-selected {
  border-color: var(--focus);
  background: #eff6ff;
}

.scale-option-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f3f5;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.sheet-modal-scale-option.is-selected .scale-option-num {
  background: var(--focus);
  color: #fff;
}

.scale-option-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

/* Task confirmation */
.sheet-modal-task-form {
  align-items: stretch;
}

.sheet-modal-task-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 24px;
  background: rgba(21, 122, 91, 0.08);
  color: #157a5b;
  border: 1.5px solid rgba(21, 122, 91, 0.2);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  width: 100%;
  transition: background 0.12s;
}

.sheet-modal-task-btn:hover {
  background: rgba(21, 122, 91, 0.14);
}

.sheet-modal-task-done-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
}

.sheet-modal-task-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #157a5b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-modal-task-done-label {
  font-size: 17px;
  font-weight: 700;
  color: #157a5b;
}

.sheet-modal-balance-direction {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f8fa;
}

.sheet-modal-balance-direction button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.sheet-modal-balance-direction button.is-selected {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
}

.sheet-modal-balance-parameters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.balance-param-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.balance-param-chip:hover {
  background: var(--surface-soft);
}

.balance-param-chip.is-selected {
  border-color: var(--focus);
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.12);
}

.balance-param-chip strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.balance-param-chip span {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.sheet-modal-balance-context {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.sheet-modal-balance-context strong {
  color: var(--ink);
  font-size: 15px;
}

.sheet-modal-balance-context span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.sheet-modal-balance-context--intake {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.16);
}

.sheet-modal-balance-context--output {
  background: rgba(21, 122, 91, 0.06);
  border-color: rgba(21, 122, 91, 0.16);
}

.sheet-modal-sign-row {
  display: flex;
  gap: 8px;
}

.sign-btn {
  flex: 1;
  height: 52px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.sign-btn.is-active {
  border-color: var(--focus);
  color: var(--focus);
  background: #eff6ff;
  font-weight: 700;
}

.sheet-modal-sign-badge {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-right: 4px;
  line-height: 1;
}


/* Landscape: ≤1199px width OR any touch device */
@media (max-width: 1199px) and (orientation: landscape),
       (pointer: coarse) and (orientation: landscape) {
  .sheet-modal {
    max-height: 100vh;
    border-radius: 16px;
    align-self: center;
    margin: 16px;
    max-width: 900px;
  }

  .sheet-modal-overlay {
    align-items: center;
    padding: 16px;
  }

  .sheet-modal-inner {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    padding: 0;
  }

  .sheet-modal-form {
    padding: 20px 24px;
    overflow-y: auto;
  }

  .sheet-modal-numpad {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 260px;
    flex-shrink: 0;
    padding: 20px 16px;
    border-left: 1px solid var(--line);
    background: #f8f9fa;
  }

  .numpad-key {
    height: 68px;
    font-size: 28px;
  }
}

/* Portrait: ≤1199px width OR any touch device */
@media (max-width: 1199px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait) {
  .sheet-modal {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
    align-self: flex-end;
    margin: 0;
  }

  .sheet-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .sheet-modal-numpad {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 16px 24px 20px;
  }

  .sheet-modal-inner {
    flex-direction: column;
  }
}

/* ── Plan Modal ──────────────────────────────────── */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 35, 40, 0.3);
}

.plan-modal {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(31, 35, 40, 0.22);
  overflow: hidden;
  animation: modal-in 150ms ease-out;
}

@keyframes modal-in {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.plan-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.plan-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-modal-title h2 {
  font-size: 18px;
}

.modal-title-icon {
  font-size: 20px;
  color: var(--muted);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--surface-soft);
}

.plan-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  overflow-y: auto;
}

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

.modal-form-block h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

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

.form-field label {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #718096;
  border-bottom: 2px solid #718096;
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.select-wrap select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 46px;
  border: 1px solid #ced5de;
  border-radius: 10px;
  padding: 0 44px 0 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.select-wrap select:hover {
  border-color: #b6c0cc;
  background: #fff;
}

.select-wrap select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 36px 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.input-icon-wrap input::placeholder {
  color: var(--subtle);
}

.input-icon-wrap input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-trailing-icon {
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.input-plain {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.input-plain:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.compact-field {
  max-width: 220px;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.segmented-control.modal-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.modal-segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.modal-segmented label.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
}

.modal-segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.interval-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 6px;
}

.interval-inputs span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
}

.form-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f7fafc;
}

.form-section strong {
  font-size: 14px;
  display: block;
  margin-bottom: 3px;
}

.form-section p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.preview-section {
  background: #f5f8fa;
}

.preview-section p {
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
  margin: 0;
}

.preview-section span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.danger-outline-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(233, 84, 63, 0.4);
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.text-button:hover {
  color: var(--muted);
}

/* ── Planung ─────────────────────────────── */

.screen-planning {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.planning-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1fr) minmax(320px, 0.72fr);
  gap: 4px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.planning-left {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  border: 1px solid #ced5de;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
  min-height: 0;
}

.planning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  flex-shrink: 0;
}

.planning-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.planning-for-label {
  font-size: 15px;
  font-weight: 750;
  color: var(--ink);
  white-space: nowrap;
}

.planning-patient-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.planning-patient-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #718096;
  border-bottom: 2px solid #718096;
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.planning-patient-dropdown {
  appearance: none;
  -webkit-appearance: none;
  min-width: 184px;
  max-width: min(280px, 34vw);
  height: 36px;
  border: 1px solid #ced5de;
  border-radius: 9px;
  padding: 0 40px 0 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.planning-patient-dropdown:hover {
  border-color: #b6c0cc;
  background: #fff;
}

.planning-patient-dropdown:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.dropdown-chevron {
  display: none;
}

.planning-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Planning header responsive ─────────────── */

/* Step 1 (≤ 1100px): buttons icon-only */
@media (max-width: 1100px) {
  .planning-header-actions .btn-label { display: none; }
  .planning-header-actions .secondary-button.compact { padding: 0 9px; }
}

/* Step 2 (≤ 860px): hide "Planung für" label */
@media (max-width: 860px) {
  .planning-for-label { display: none; }
}

.measures-list {
  flex: 1;
  width: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  align-items: center;
}

.measure-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  width: 100%;
  max-width: 720px;
  user-select: none;
}

.measure-card:hover {
  border-color: #b0bccf;
  background: #fafbfc;
}

.measure-card.is-selected {
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--focus);
}

.measure-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.measure-card-edit {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.measure-icon.cat-vital    { color: #e9543f; background: rgba(233,  84,  63, 0.10); }
.measure-icon.cat-balance  { color: #2563eb; background: rgba( 37,  99, 235, 0.10); }
.measure-icon.cat-wellbeing{ color: #7c3aed; background: rgba(124,  58, 237, 0.10); }
.measure-icon.cat-task     { color: #157a5b; background: rgba( 21, 122,  91, 0.10); }

.measure-card-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.measure-card-info strong {
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
}

.measure-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meta-chip .meta-icon {
  font-size: 11px;
  opacity: 0.65;
}

.meta-chip--freq {
  color: var(--focus);
}

/* Tagesvorschau */

.planning-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  align-self: stretch;
  padding: 1px 0;
  border: 1px solid #ced5de;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(1, 29, 58, 0.08);
  min-height: 0;
}

.daypreview-title {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  padding: 16px 20px 14px;
  font-size: 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  margin: 0;
  flex-shrink: 0;
}

.daypreview-slots {
  flex: 1;
  width: 100%;
  padding: 4px 0 8px;
  min-height: 0;
  overflow: auto;
}

.day-slot {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.day-slot:last-child {
  border-bottom: 0;
}


.day-slot-line {
  flex: 1;
  height: 1px;
  background: var(--line-soft);
  align-self: center;
}

.day-slot-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding-top: 4px;
}

.day-slot-items {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  gap: 5px;
}

.day-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  width: max-content;
  max-width: 100%;
  box-shadow: 0px 1px 1px rgba(1, 29, 58, 0.08);
}

.day-item.cat-vital     { box-shadow: inset 2px 0 0 #e9543f, 0px 1px 1px rgba(1,29,58,0.08); }
.day-item.cat-balance   { box-shadow: inset 2px 0 0 #2563eb, 0px 1px 1px rgba(1,29,58,0.08); }
.day-item.cat-wellbeing { box-shadow: inset 2px 0 0 #7c3aed, 0px 1px 1px rgba(1,29,58,0.08); }
.day-item.cat-task      { box-shadow: inset 2px 0 0 #157a5b, 0px 1px 1px rgba(1,29,58,0.08); }

.day-item-icon.cat-vital     { color: #e9543f; }
.day-item-icon.cat-balance   { color: #2563eb; }
.day-item-icon.cat-wellbeing { color: #7c3aed; }
.day-item-icon.cat-task      { color: #157a5b; }

.day-item.is-dimmed {
  opacity: 0.45;
}

@media (min-width: 1440px) {
  .planning-layout {
    grid-template-columns: minmax(520px, 1fr) minmax(340px, 0.76fr);
  }

  .measure-card {
    max-width: 720px;
  }
}

@media (min-width: 1680px) {
  .planning-layout {
    grid-template-columns: minmax(560px, 1fr) minmax(360px, 0.8fr);
  }
}

@media (max-width: 1080px) {
  .journey-topbar {
    grid-template-columns: 160px minmax(0, 1fr) 44px;
    padding: 0 16px;
  }

  .step span {
    display: none;
  }

  /* ── Overview: switch to scrollable flow layout ── */
  .screen-overview {
    height: 100%;
    overflow: hidden;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    padding: 0 16px 28px;
    gap: 12px;
  }

  /* Cards: horizontal scroll row */
  .value-list-shell {
    overflow-x: auto;
    overflow-y: hidden;
    height: max-content;
  }

  .value-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: max-content;
    align-content: unset;
    margin-top: 8px;
    padding-bottom: 2px;
  }

  .status-card {
    flex: 0 0 152px;
    min-height: 96px;
  }

  /* Detail shell: single column, scrollable */
  .overview-detail-shell {
    align-content: start;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: 100%;
    overflow-y: auto;
    min-height: 0;
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* Trend panel fills width, chart has fixed height */
  .trend-panel {
    height: auto;
    grid-template-rows: max-content auto;
    overflow: visible;
    border-radius: 12px;
    padding: 18px 18px 16px;
  }

  .trend-chart-wrap {
    height: auto;
    min-height: 0;
  }

  .trend-chart {
    flex: 0 0 auto;
    height: 230px;
    min-height: 0;
  }

  /* History: flows naturally below chart */
  .history-panel {
    height: auto;
    overflow: visible;
    padding: 12px 0 0;
    gap: 6px;
  }

  .history-item {
    margin: 0;
    border-radius: 10px;
  }

  .sheet-grid {
    grid-template-columns: 60px repeat(var(--col-count), minmax(180px, 1fr));
  }

  .care-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .journey-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .journey-topbar {
    grid-template-columns: 1fr 40px;
    gap: 12px;
    padding: 12px;
  }

  .stepper {
    grid-column: 1 / -1;
    order: 3;
  }

  .journey-main {
    padding: 14px;
  }

  .page-head,
  .context-header {
    align-items: stretch;
    flex-direction: column;
  }

  .shift-cell {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 1199px) {
  .overview-detail-shell {
    grid-template-columns: 1fr;
  }

  .history-panel .panel-eyebrow,
  .history-panel h2 {
    grid-column: 1 / -1;
  }

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

  .app-sidebar {
    display: none;
  }

  .app-workspace {
    padding-top: 0;
  }

  .app-frame {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .bottom-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #fff6f5;
    border-top: 1px solid #e5b0a1;
    height: 64px;
  }
}

/* ── Plan modal: simplified preview block ──────────── */
.plan-modal-preview {
  background: #f5f8fa;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-modal-preview-label {
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-modal-preview p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.plan-modal-preview-times {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.field-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

/* ── Unassigned / Schicht wählen screen ─────────────── */

/* Layer 1: white header + tabs */
/* Layer 2: light-gray content area with white cards   */

.screen-unassigned {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg);   /* light gray — card layer */
}

/* White header block ─────────────────────────────── */
.unassigned-top {
  flex-shrink: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  /* subtle inset shadow instead of border so line sits flush */
  box-shadow: inset 0 -1px 0 var(--line-soft), 0 2px 6px rgba(1,29,58,0.04);
  z-index: 1;
}

.unassigned-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
}

.unassigned-title-block h1 {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 850;
  color: var(--ink);
  line-height: 1.2;
}

.unassigned-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.unassigned-search { flex: 0 0 240px; }

/* Unassigned topbar: shadow lives on unassigned-top wrapper, not here */
.unassigned-topbar {
  box-shadow: none;
  padding-top: 14px;
  padding-bottom: 14px;
}

/* Shift tab bar sits flush at the bottom of the white block */
.shift-tab-bar {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-top: 1px solid var(--line-soft);
}

.shift-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px 13px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;    /* overlaps the inset shadow line */
  border-radius: 0;
  color: var(--muted);
  font: inherit;
  transition: color 0.12s, border-color 0.12s;
}
.shift-tab:hover { color: var(--ink); }
.shift-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--focus);
}

.shift-tab-title { font-size: 13px; font-weight: 750; }
.shift-tab-time  { font-size: 11px; font-weight: 500; opacity: 0.65; }

.shift-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  transition: background 0.12s, color 0.12s;
}
.shift-tab.is-active .shift-tab-count {
  background: var(--focus);
  color: #fff;
}

/* Card grid — layer 2 */
.unassigned-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-content: start;
  background: var(--bg);
}

/* Unit card */
.unit-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(1,29,58,0.06);
  transition: box-shadow 0.15s;
}
.unit-card:hover { box-shadow: 0 3px 10px rgba(1,29,58,0.10); }
.unit-card--open { opacity: 0.48; pointer-events: none; }
.unit-card--mine {
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08), 0 1px 4px rgba(1,29,58,0.06);
}

.unit-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.unit-card-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.unit-card-name { flex: 1; min-width: 0; }
.unit-card-name strong {
  display: block;
  font-size: 14px; font-weight: 750;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unit-card-name span { font-size: 12px; color: var(--muted); font-weight: 500; }

.unit-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.unit-status-dot--critical { background: var(--danger); }
.unit-status-dot--warning  { background: #d97706; }

.unit-card-patients {
  margin: 0;
  font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.unit-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.unit-assignee {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  min-width: 0; overflow: hidden;
}
.unit-assignee span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-assignee--open { color: var(--subtle); }

.assignee-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 10px; font-weight: 750;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 1080px) {
  .unassigned-grid { grid-template-columns: repeat(2, 1fr); }
  .unassigned-head { flex-wrap: wrap; }
  .unassigned-search { flex: 1 1 100%; }
}
@media (max-width: 600px) {
  .unassigned-grid { grid-template-columns: 1fr; padding: 12px; }
  .unassigned-head { padding: 16px 16px 14px; }
  .shift-tab-bar { padding: 0 12px; }
}

/* ── Versorgungen Screen ─────────────────────── */
.screen-versorgungen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg);
}

.vscreen-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.vscreen-title-block { flex: 1; min-width: 0; }
.vscreen-title {
  font-size: 22px; font-weight: 800;
  color: var(--ink); margin: 0 0 2px;
  line-height: 1.2;
}
.vscreen-sub {
  font-size: 13px; color: var(--muted); font-weight: 500; margin: 0;
}
.vscreen-search {
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  position: relative;
  gap: 0;
  width: 260px;
}
.vscreen-search svg {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}
.vscreen-search input {
  padding-left: 34px !important;
  width: 100%;
}

.vscreen-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.vscreen-filter-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--muted); letter-spacing: 0.05em;
  margin-right: 4px; white-space: nowrap;
}
.selection-mode-tab {
  padding: 6px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.selection-mode-tab:hover { background: var(--bg); color: var(--ink); }
.selection-mode-tab.is-active { background: var(--ink); color: #fff; }
.vscreen-time-control {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}
.vscreen-time-control button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.vscreen-time-control button:hover { background: var(--bg); color: var(--ink); }
.vscreen-time-control span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 58px;
  line-height: 1.05;
}
.vscreen-time-control small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.vscreen-time-control strong { color: var(--ink); font-size: 13px; }
.vscreen-activate { padding: 7px 12px; font-size: 12px; flex-shrink: 0; }
.vscreen-count {
  margin-left: auto;
  font-size: 12px; font-weight: 600; color: var(--muted);
  white-space: nowrap;
}

.vscreen-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-content: start;
}

/* Versorgung card */
.vcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(1,29,58,0.05);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.08s;
  text-align: left;
}
.vcard:hover {
  box-shadow: 0 4px 16px rgba(1,29,58,0.10);
  border-color: var(--line);
}
.vcard:active { transform: scale(0.988); }
.vcard--mine {
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.07), 0 1px 3px rgba(1,29,58,0.05);
}
.vcard--mine:hover {
  border-color: rgba(37,99,235,0.55);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12), 0 4px 16px rgba(1,29,58,0.10);
}

.vcard-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.vcard-icon-wrap {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.vcard--mine .vcard-icon-wrap {
  background: rgba(37,99,235,0.09);
  color: #2563eb;
}
.vcard-title-block { flex: 1; min-width: 0; }
.vcard-name {
  display: block;
  font-size: 14px; font-weight: 750;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vcard-type { font-size: 12px; color: var(--muted); font-weight: 500; }

.vcard-head-right {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  flex-wrap: wrap; justify-content: flex-end;
}
.vcard-status-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  white-space: nowrap;
}
.vcard-status-badge--critical { background: rgba(233,84,63,0.12); color: var(--danger); }
.vcard-status-badge--warning  { background: rgba(217,119,6,0.12);  color: #d97706; }
.vcard-shift-pill {
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line-soft);
  padding: 2px 7px; border-radius: 10px;
  white-space: nowrap;
}

.vcard-patients {
  margin: 0;
  font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.vcard-footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.vcard-assignee {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0; overflow: hidden;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.vcard-assignee span:last-child {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vcard-assignee--open { color: var(--subtle); }
.vcard-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--muted);
  font-size: 9px; font-weight: 750;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.vcard-mine-tag {
  font-size: 10px; font-weight: 700; color: #2563eb; white-space: nowrap;
}
.vcard-chevron { color: var(--subtle); flex-shrink: 0; }

.patient-selection-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 32px;
}
.patient-selection-current {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(1,29,58,0.05);
}
.patient-selection-current-head {
  display: flex;
  flex: 0 0 112px;
  flex-direction: column;
  gap: 3px;
}
.patient-selection-current-head strong { color: var(--ink); font-size: 12px; }
.patient-selection-current-head span { color: var(--muted); font-size: 11px; }
.patient-selection-current-items {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.patient-selection-empty { color: var(--muted); font-size: 12px; }
.selected-patient-tile {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(1,29,58,0.04);
}
.selected-patient-tile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-patient-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(37,99,235,0.28);
  border-radius: 50%;
  background: rgba(37,99,235,0.06);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.selected-patient-tile[hidden],
.selected-patient-more[hidden] {
  display: none;
}
.patient-selection-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 220px));
  gap: 10px;
}
.patient-selection-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(1,29,58,0.04);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.patient-selection-row:hover {
  border-color: var(--line);
  box-shadow: 0 3px 10px rgba(1,29,58,0.07);
}
.patient-selection-row.is-selected {
  border-color: rgba(37,99,235,0.42);
  background: rgba(37,99,235,0.045);
}
.patient-selection-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.patient-selection-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: transparent;
  flex-shrink: 0;
}
.patient-selection-row.is-selected .patient-selection-check {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.patient-selection-row strong { color: var(--ink); font-size: 13px; }

@media (max-width: 1080px) {
  .vscreen-grid { grid-template-columns: repeat(2, 1fr); }
  .vscreen-head { flex-wrap: wrap; }
  .vscreen-search { flex: 1 1 100%; }
}
@media (max-width: 600px) {
  .vscreen-grid { grid-template-columns: 1fr; padding: 12px; }
  .vscreen-head { padding: 16px 16px 14px; }
  .vscreen-filters { padding: 8px 12px; }
  .patient-selection-content { padding: 12px; }
  .patient-selection-current { gap: 8px; }
  .patient-selection-current-head { flex-basis: 82px; }
}

/* ── Flüssigkeitsbilanz Tagesziel-Banner ─────── */
.balance-goal-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  align-self: start;
  height: max-content;
  max-height: max-content;
  padding: 10px 20px;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  flex-shrink: 0;
}
.bgb-label {
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.bgb-progress-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bgb-bar-wrap {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #dbeafe;
  overflow: hidden;
}
.bgb-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.bgb-pct {
  font-size: 12px;
  font-weight: 800;
  color: #1d4ed8;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}
.bgb-value {
  font-size: 13px;
  font-weight: 800;
  color: #1e40af;
  white-space: nowrap;
  flex-shrink: 0;
}
.bgb-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}
.bgb-edit-btn:hover { background: #eff6ff; border-color: #93c5fd; }

/* ── Tagesziel Modal ─────────────────────────── */
.goal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 10, 60, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}
.goal-modal {
  background: #fff;
  border-radius: 20px;
  width: min(460px, 92vw);
  padding: 32px;
  display: grid;
  gap: 24px;
  box-shadow: 0 24px 64px rgba(1, 10, 60, 0.2);
}
.goal-modal-title {
  font-size: 20px;
  font-weight: 850;
  color: var(--ink);
  margin: 0 0 4px;
}
.goal-modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.goal-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  padding: 0 20px;
  background: #f8faff;
  transition: border-color 0.15s;
}
.goal-modal-input-wrap:focus-within { border-color: #2563eb; background: #fff; }
.goal-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 40px;
  font-weight: 800;
  color: var(--ink);
  padding: 18px 0;
  text-align: center;
  outline: none;
  min-width: 0;
  -moz-appearance: textfield;
}
.goal-modal-input::-webkit-outer-spin-button,
.goal-modal-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.goal-modal-unit {
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.goal-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Sheet Add Popover ───────────────────── */
.add-popover-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
}
.add-popover {
  position: fixed;
  z-index: 201;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(1,29,58,0.16), 0 2px 8px rgba(1,29,58,0.07);
  padding: 6px 0;
  width: 260px;
  max-height: 76vh;
  overflow-y: auto;
  animation: popover-in 0.16s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes popover-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.add-popover-section {
  overflow: hidden;
  margin-bottom: 4px;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--line-soft);
  margin-left: 8px;
  margin-right: 8px;
  border-radius: 0;
}
.add-popover-section:last-child { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }

.add-popover-cat {
  display: block;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 6px 12px 4px;
  color: var(--muted);
}
.add-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 12px;
  border-radius: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  text-align: left;
  gap: 10px;
  transition: background 0.1s;
}
.add-popover-item:hover { background: var(--bg); }
.add-popover-unit {
  font-size: 11px; font-weight: 500;
  color: var(--subtle); white-space: nowrap;
  flex-shrink: 0;
}
