/*
 * Ordina Modern UI
 * Visuelle Designschicht fuer die bestehende mobile-first Anwendung.
 * Fachlogik, Rechte und Datenfluesse bleiben bewusst unangetastet.
 */

:root {
  /* Drei Ebenen: getoenter Grund, leicht helleres Navigationsband, weisse
     Arbeitsflaechen. So bleiben die Flaechen weiss, ohne als grosse weisse
     Wand zu verschwimmen. */
  --bg: #e9eef7;
  --surface: #ffffff;
  --surface-soft: #eff3fa;
  --nav-band: #f4f7fc;
  --nav-band-inset: 12px;
  --text: #172033;
  --text-soft: #4d5b6d;
  --line: #dde5f0;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --brand-red: #c23f38;
  --brand-red-soft: #fff0ee;
  --orange: #b6470d;
  --orange-soft: #fff0e6;
  --green: #0f7345;
  --green-soft: #e8f7ef;
  --purple: #7452c8;
  --purple-soft: #f0ebff;
  --teal: #2563eb;
  --teal-soft: #eaf1ff;
  --red: #c93636;
  --red-soft: #feebeb;
  --focus-ring: var(--blue);
  --shadow-sm: 0 1px 2px rgb(18 30 52 / 6%), 0 10px 26px rgb(18 30 52 / 6%);
  --shadow-md: 0 14px 40px rgb(18 30 52 / 12%);
  --record-row-shadow: 0 1px 3px rgb(18 30 52 / 5%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar-width: 264px;
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  min-height: 100%;
  background: #e9eef7;
}

body {
  min-height: 100vh;
  background: var(--bg);
  letter-spacing: -0.006em;
}

::selection {
  color: #fff;
  background: #c23f38;
}

h1 {
  font-size: clamp(1.72rem, 3vw, 2.35rem);
  font-weight: 760;
  letter-spacing: -0.045em;
}

h2 {
  font-size: 1.12rem;
  font-weight: 730;
  letter-spacing: -0.025em;
}

h3,
strong {
  letter-spacing: -0.012em;
}

button,
a,
input,
select,
textarea {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.app-shell {
  isolation: isolate;
}

/* Navigation */
.sidebar {
  /* Klebt auf derselben Hoehe wie die Kopfleiste, damit das gemeinsame Band
     auch beim Scrollen buendig bleibt. */
  top: var(--nav-band-inset);
  margin: var(--nav-band-inset) 0 var(--nav-band-inset) var(--nav-band-inset);
  height: calc(100vh - 2 * var(--nav-band-inset));
  padding: 22px 14px 16px;
  overflow: hidden;
  color: #172033;
  background: var(--nav-band);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 24px 0 0 24px;
  box-shadow: var(--shadow-sm);
}

.brand {
  margin: 0 6px 25px;
}

.practice-brand {
  gap: 8px;
  padding: 12px 11px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
}

.sidebar-practice-logo {
  width: 164px;
}

/* Die gesperrte Wortmarke muss in die Markenkarte passen; Umbruch und
   Wortbruch sind die sicheren Rückfälle, falls eine Ersatzschrift breiter
   baut als die eingebundene Avenir Next. */
.brand-product {
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  column-gap: 5px;
  row-gap: 2px;
  justify-content: space-between;
  overflow-wrap: anywhere;
  color: #526078;
}

.brand-product strong {
  color: var(--brand-red);
  font-size: .65rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.brand-product small {
  color: #4d5b6d;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.side-nav {
  gap: 6px;
}

.nav-item {
  min-height: 48px;
  padding: 10px 12px;
  color: #526078;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: .9rem;
}

.nav-item:hover {
  color: #172033;
  background: #f3f6fb;
}

.nav-item.is-active {
  color: #1d55ce;
  background: #eaf1ff;
  border-color: transparent;
  box-shadow: none;
}

.nav-item > [data-icon] {
  width: 29px;
  height: 29px;
  border-radius: 10px;
  background: #e6ecf6;
}

.nav-item.is-active > [data-icon] {
  background: rgb(37 99 235 / 12%);
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-count {
  color: #526078;
  background: #edf1f7;
}

.nav-item.is-active .nav-count {
  color: #fff;
  background: var(--blue);
}

.sidebar-create {
  min-height: 50px;
  margin-top: 20px;
  border-color: transparent;
  background: #c23f38;
  color: #fff;
  box-shadow: 0 5px 12px rgb(194 63 56 / 20%);
}

.sidebar-create:hover {
  background: #a93531;
  transform: translateY(-1px);
}

.sidebar-user {
  border-top-color: var(--line);
}

.sidebar-user-copy strong {
  color: #172033;
}

.sidebar-user small {
  color: #4d5b6d;
}

.sidebar .avatar {
  color: #1d55ce;
  background: #eaf1ff;
}

.sidebar-logout {
  color: #526078;
}

.sidebar-logout:hover {
  color: #172033;
  background: #f3f6fb;
}

/* Kopfbereich und Grundlayout */
/* Kopfleiste und Seitenleiste bilden ein gemeinsames Band: gleiche Oberkante,
   gleicher Aussenabstand, gespiegelte Rundung und eine nahtlose
   Beruehrungskante. Die Flaeche ist deckend, damit kein Helligkeitsunterschied
   zur Seitenleiste entsteht. */
.topbar {
  top: var(--nav-band-inset);
  height: 78px;
  margin-right: var(--nav-band-inset);
  padding-inline: max(38px, calc((100% - 1000px) / 2));
  background: var(--nav-band);
  backdrop-filter: none;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 24px 0 0;
}

/* Deckt den Streifen ueber der klebenden Kopfleiste ab, damit beim Scrollen
   daneben kein Inhalt durchlaeuft. */
.app-column::before {
  content: "";
  position: sticky;
  top: 0;
  z-index: 16;
  display: block;
  height: var(--nav-band-inset);
  background: var(--bg);
}

.topbar-context {
  gap: 2px;
}

.topbar-context strong {
  color: #172033;
  font-size: .92rem;
}

.topbar-context small {
  font-size: .76rem;
}

.topbar-actions {
  height: 52px;
  gap: 3px;
  flex-wrap: nowrap;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 6px 18px rgb(18 30 52 / 6%);
}

.topbar .icon-button,
.topbar .avatar-button {
  position: relative;
  width: 44px;
  height: 44px;
  min-height: 44px;
  color: #4d5b6d;
  background: transparent;
  border: 0;
  border-radius: 13px;
  box-shadow: none;
}

.topbar .icon-button:hover,
.topbar .avatar-button:hover {
  color: var(--blue);
  background: #eaf1ff;
  transform: none;
}

.topbar .avatar-button {
  color: #1d55ce;
  background: #eaf1ff;
  border-radius: 50%;
}

.topbar .notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  margin: 0;
  pointer-events: none;
  border: 2px solid #fff;
  background: var(--red);
}

.main-content {
  max-width: 1320px;
  padding: 32px 42px 72px;
}

.page-header {
  position: relative;
  align-items: center;
  min-height: 148px;
  margin-bottom: 18px;
  padding: 28px 30px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.page-header > div {
  position: relative;
  z-index: 1;
}

.page-header > div:first-child {
  min-width: 0;
  max-width: 100%;
}

.page-header h1 {
  margin-bottom: 7px;
  color: #172033;
  overflow-wrap: anywhere;
}

.page-header p {
  max-width: 62ch;
  color: #4d5b6d;
  font-size: .92rem;
  overflow-wrap: anywhere;
}

/* Der dunklere Markenton haelt auch dort AA-Kontrast, wo die Zeile ohne weisse
   Karte direkt auf dem getoenten Grund steht - etwa im Kopf des Teamchats. */
.eyebrow {
  margin-bottom: 7px;
  color: #a93531;
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.primary-button {
  min-height: 46px;
  padding-inline: 17px;
  color: #fff;
  background: #c23f38;
  border-color: #c23f38;
  border-radius: 13px;
  box-shadow: 0 5px 12px rgb(194 63 56 / 20%);
  font-weight: 720;
}

.primary-button:hover {
  background: #a93531;
  box-shadow: 0 6px 14px rgb(194 63 56 / 26%);
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button,
.chip-button {
  border-radius: 12px;
}

.secondary-button {
  border-color: var(--line);
  box-shadow: 0 4px 12px rgb(18 30 52 / 4%);
}

.secondary-button:hover {
  border-color: rgb(37 99 235 / 32%);
  background: #f7f9fd;
  transform: translateY(-1px);
}

/* Tages-Dashboard */
.summary-strip {
  gap: 12px;
  overflow: visible;
  margin-bottom: 18px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.summary-item {
  position: relative;
  min-height: 92px;
  gap: 14px;
  padding: 17px 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

/* Die Kennzahlen sind die einzige Flaeche, die bewusst Farbe traegt: sehr zart
   in ihrer Statusfarbe, damit die Zeile auf einen Blick lesbar bleibt. Die
   Arbeitsflaechen darunter bleiben weiss. */
.summary-item:has(.tone-info) {
  background: #f2f7ff;
  border-color: #d6e3f8;
}

.summary-item:has(.tone-urgent) {
  background: #fff6ef;
  border-color: #f2ddcc;
}

.summary-item:has(.tone-success) {
  background: #f1faf5;
  border-color: #d5e9dd;
}

.summary-item:hover {
  background: color-mix(in srgb, var(--blue-soft) 38%, rgb(255 255 255 / 94%));
  border-color: color-mix(in srgb, var(--blue) 28%, rgb(210 223 227 / 88%));
  box-shadow:
    0 12px 28px rgb(18 30 52 / 8%),
    inset 0 0 0 1px color-mix(in srgb, var(--blue) 12%, transparent);
}

.summary-item:active {
  background: color-mix(in srgb, var(--blue-soft) 56%, rgb(255 255 255 / 94%));
}

.summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.summary-copy strong {
  color: #172033;
  font-size: 1.55rem;
  font-weight: 760;
  letter-spacing: -.04em;
}

.summary-copy small {
  margin-top: 1px;
  font-size: .75rem;
}

.today-focus-card {
  padding: 15px 17px 0;
  border: 4px solid #d94f42;
  border-radius: 20px;
}

.today-focus-task {
  background: #fffaf6;
  border-color: #f0d8c9;
  box-shadow: 0 5px 16px rgb(18 30 52 / 4%);
}

/* Dunkler Akzent wie beim Überfälligkeitsstatus: hält AA-Kontrast auf der
   leicht getönten Fokusfläche. */
.today-focus-task .eyebrow {
  color: #a3471a;
}

.today-focus-notice-heading {
  color: #4d5b6d;
}

.dashboard-grid {
  gap: 18px;
}

.today-focus-card,
.today-tasks-card {
  min-width: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.today-focus-card {
  padding-bottom: 0;
  border: 4px solid #d94f42;
}

.today-primary-column {
  gap: 18px;
}

.section-heading {
  margin-bottom: 13px;
}

.section-heading h2 {
  color: #172033;
}

.task-list,
.device-list,
.activity-list,
.message-list,
.handover-list,
.maintenance-list {
  background: var(--surface-soft);
}

.task-row,
.device-row,
.activity-row,
.message-row,
.handover-row,
.today-next-row {
  border-color: var(--line);
}

.task-row {
  margin-inline: 0;
  padding: 12px 10px;
  border-radius: var(--record-row-radius);
}

.task-row:hover,
.device-row:hover,
.message-row:hover,
.handover-row:hover {
  background: #f3f6fb;
}

.task-status-mark {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.task-title-button strong,
.today-next-title {
  font-weight: 700;
}

.count-badge,
.status-badge,
.type-badge {
  padding: 4px 9px;
  font-weight: 720;
}

.info-card,
.empty-card,
.settings-card,
.room-highlight {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.compact-help-mark {
  background: transparent;
  border-color: var(--line);
}

.compact-help-popover {
  background: rgb(255 255 255 / 98%);
  border-color: var(--line);
}

/* Aufgaben und Verwaltung */
.device-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.filter-bar {
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.chip-button {
  border-color: transparent;
  background: transparent;
}

.chip-button.is-active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 6px 14px rgb(37 99 235 / 22%);
}

.settings-grid {
  gap: 16px;
}

.settings-card,
.room-highlight,
.info-card {
  background: #fff;
  border-radius: 19px;
}

.settings-card {
  padding: 20px;
}

.storage-meter > span {
  background: var(--blue);
}

/* Teamkommunikation */
.team-page .team-communication-shell {
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
}

.team-section-pane {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #f7f9fc;
  border-right-color: var(--line);
  box-shadow: 0 10px 26px rgb(18 30 52 / 6%);
}

.team-section-navigation {
  min-height: 0;
}

.team-section-button {
  border-radius: 0;
}

.team-section-button:hover {
  background: #f3f6fb;
}

.team-section-button.is-active {
  background: #eaf1ff;
  box-shadow: inset 0 0 0 1px rgb(37 99 235 / 10%);
}

.team-section-button[data-team-section="announcements"].is-active {
  background: #fff0ed;
  box-shadow: inset 0 0 0 1px rgb(201 69 59 / 10%);
}

.team-section-icon,
.team-thread-avatar {
  color: var(--blue);
  background: #eaf1ff;
}

.team-section-button.is-active .team-section-icon {
  background: #2563eb;
}

.team-section-button[data-team-section="announcements"].is-active .team-section-icon {
  background: #c23f38;
}

.team-section-copy span,
.team-section-meta {
  color: #536273;
}

.team-section-meta .unread-count {
  background: #ad352f;
}

.team-detail-pane,
.team-detail-pane .message-feed.chat-wallpaper,
.handover-board {
  background-color: #eef2f8;
}

.team-detail-pane {
  overflow-anchor: none;
}

.team-detail-pane .message-feed.chat-wallpaper {
  overflow-anchor: none;
  scrollbar-gutter: stable;
}

.team-thread-header {
  min-height: 58px;
  background: rgb(255 255 255 / 97%);
}

.chat-search-toolbar {
  background: rgb(255 255 255 / 97%);
  border-bottom-color: var(--line);
}

.chat-search-field {
  background: #f3f6fb;
  border-color: var(--line);
}

.chat-search-field:focus-within {
  color: #1d55ce;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 13%);
}

.chat-search-clear:hover,
.chat-search-toggle[aria-expanded="true"] {
  color: #1d55ce;
  background: #eaf1ff;
}

.chat-search-highlight {
  background: #fff0a8;
  border-bottom-color: #d8bd52;
}

.team-detail-pane .date-divider {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 3px 10px rgb(18 30 52 / 6%);
}

.team-detail-pane .chat-bubble {
  border-color: var(--line);
  border-radius: 7px 16px 16px 16px;
  box-shadow: 0 4px 12px rgb(18 30 52 / 5%);
}

.team-detail-pane .chat-message.is-own .chat-bubble {
  border-color: #c3d7f7;
  border-radius: 16px 7px 16px 16px;
  background: #dcebff;
}

.team-detail-pane .message-read-details-trigger,
.team-detail-pane .message-read-details-trigger .read-ticks {
  color: #1d55ce;
}

.team-detail-pane .message-read-details-trigger:hover,
.team-detail-pane .message-read-details-trigger:focus-visible,
.team-detail-pane .message-read-details-trigger[aria-expanded="true"] {
  color: #174299;
  background: rgb(255 255 255 / 58%);
}

.team-detail-pane .chat-message.is-announcement {
  width: min(86%, 720px);
  max-width: min(86%, 720px);
}

.team-detail-pane .chat-message.is-announcement .chat-bubble {
  width: 100%;
  border-color: #d8d9ee;
  background: #f3f2ff;
}

.team-detail-pane .chat-message.is-announcement.is-own .chat-bubble {
  border-color: #c8d9e5;
  background: #eef0fb;
}

.team-detail-pane .chat-author,
.team-detail-pane .chat-reply-preview strong {
  color: #1d55ce;
}

.team-detail-pane .message-composer {
  position: relative;
  z-index: 3;
  overflow-anchor: none;
  background: transparent;
}

.team-detail-pane .composer-row {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 6px 18px rgb(18 30 52 / 8%);
}

.message-confirmation {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.message-confirmation button,
.message-confirmation > span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.message-confirmation button {
  padding: 0 10px;
  color: #1d55ce;
  border: 0;
  border-radius: 10px;
  background: #eaf1ff;
  cursor: pointer;
  font: inherit;
  font-size: .75rem;
  font-weight: 750;
}

.message-confirmation.is-confirmed button {
  color: #fff;
  background: #2563eb;
}

.message-confirmation > span {
  color: #4d5b6d;
  font-size: .73rem;
  font-weight: 700;
}

.message-confirmation [data-icon] {
  width: 16px;
  height: 16px;
}

.handover-overview,
.handover-toolbar,
.handover-entry {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.user-admin-avatar {
  color: #1d55ce;
  background: #eaf1ff;
  border-radius: 15px;
}

/* Dialoge und Formulare */
#taskDialog,
#faultDecisionDialog {
  --dialog-accent: #a93431;
  --dialog-secondary: #536273;
  --dialog-meta: #536273;
}

.app-dialog {
  background: rgb(255 255 255 / 98%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgb(18 30 52 / 22%);
}

.app-dialog::backdrop {
  background: rgb(16 24 40 / 55%);
}

.dialog-header,
.dialog-footer {
  background: #fff;
}

.dialog-header {
  border-bottom-color: var(--line);
}

.dialog-footer {
  border-top-color: var(--line);
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 12px;
  background-color: #f8fafd;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c9d3e4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 10%);
}

.type-option {
  min-height: 82px;
  background: #f8fafd;
  border-color: var(--line);
  border-radius: 15px;
}

.type-option:hover {
  border-color: rgb(37 99 235 / 30%);
  transform: translateY(-1px);
}

.type-option:has(input:checked) {
  color: #1d55ce;
  background: #eaf1ff;
  border-color: rgb(37 99 235 / 45%);
  box-shadow: 0 7px 16px rgb(37 99 235 / 9%);
}

.upload-field {
  background: #f8fafd;
  border-color: var(--line);
  border-radius: 16px;
}

.assistant-tools {
  background: #f2eff8;
  border-color: #ded6ec;
}

.scanner-viewport {
  background: #101828;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 7%);
}

.toast {
  background: #1c2536;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgb(18 30 52 / 28%);
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 220px;
  }

  .sidebar-practice-logo {
    width: 150px;
  }

  .brand-product {
    display: grid !important;
    gap: 2px;
  }

  .main-content {
    padding-inline: 28px;
  }


}

@media (min-width: 721px) and (max-width: 1050px) {
  .team-page .team-communication-shell {
    height: calc(100dvh - 182px - var(--nav-band-inset));
  }

  .team-section-pane,
  .team-detail-pane {
    max-height: calc(100dvh - 182px - var(--nav-band-inset));
  }
}

/* Der Teamchat fuellt die Resthoehe; das tiefer sitzende Band gehoert dazu. */
@media (min-width: 1051px) {
  .main-content:has(> .team-page) {
    height: calc(100dvh - 78px - var(--nav-band-inset));
  }
}

@media (max-width: 720px) {
  /* Ohne Seitenleiste gibt es kein gemeinsames Band: die Kopfleiste sitzt
     wieder buendig am oberen Rand ueber die volle Breite. */
  :root {
    --nav-band-inset: 0px;
  }

  .topbar {
    height: calc(68px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0;
    background: var(--nav-band);
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .app-column::before {
    display: none;
  }

  .mobile-practice-logo {
    width: 104px;
  }

  .topbar-actions {
    height: 52px;
    gap: 1px;
    padding: 3px;
    border-radius: 15px;
  }

  .topbar .icon-button {
    background: transparent;
  }

  .topbar .avatar-button {
    background: #eaf1ff;
  }

  .main-content {
    padding: 16px 13px calc(100px + env(safe-area-inset-bottom));
  }

  .team-page .team-communication-shell {
    height: calc(100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin-right: -5px;
    margin-left: -5px;
  }

  .team-section-pane,
  .team-detail-pane {
    max-height: calc(100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .page-header {
    min-height: 0;
    align-items: flex-start;
    gap: 17px;
    margin-bottom: 13px;
    padding: 21px 19px;
    border-radius: 21px;
  }

  .page-header h1 {
    font-size: 1.7rem;
  }

  .page-header p {
    font-size: .84rem;
  }

  .page-header .page-actions {
    width: auto;
    margin-left: auto;
  }

  .page-header .page-actions > button {
    min-width: 46px;
    min-height: 46px;
  }

  .summary-strip {
    gap: 8px;
  }

  .summary-item {
    min-height: 90px;
    gap: 7px;
    padding: 12px 9px;
    border-radius: 16px;
  }

  .summary-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .summary-copy strong {
    font-size: 1.28rem;
  }

  .summary-copy small {
    font-size: .67rem;
    line-height: 1.18;
  }

  .dashboard-grid {
    gap: 13px;
  }

  .today-primary-column {
    gap: 13px;
  }

  .today-focus-card,
  .today-tasks-card {
    padding: 16px;
  }

  .today-focus-card {
    padding-bottom: 0;
  }

  .today-focus-notices {
    margin-inline: -16px;
  }


  .bottom-nav {
    inset: auto 8px calc(7px + env(safe-area-inset-bottom)) 8px;
    padding: 6px;
    overflow: visible;
    background: rgb(255 255 255 / 97%);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(18 30 52 / 10%);
  }

  .mobile-nav-item {
    min-height: 52px;
    color: #4f5f73;
    border-radius: 14px;
  }

  .mobile-nav-item.is-active {
    color: #1d55ce;
    background: #eaf1ff;
  }

  .mobile-nav-item small {
    color: inherit;
    font-size: .64rem;
  }

  .mobile-nav-item.mobile-create {
    width: 56px;
    height: 56px;
    justify-self: center;
    margin-top: -18px;
    color: #fff;
    background: #c23f38;
    border: 4px solid var(--bg);
    border-radius: 18px;
    box-shadow: 0 10px 23px rgb(194 63 56 / 28%);
  }

  .mobile-nav-item.mobile-create small {
    display: block;
  }

  .filter-bar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .app-dialog {
    border-radius: 22px 22px 0 0;
  }

  .team-communication-shell {
    border-radius: 20px;
  }
}

/* Ruhige Räumeübersicht nach der freigegebenen 1:1-Referenz. */
.rooms-overview-page {
  --rooms-overview-list-surface: #eef2f8;
  --rooms-overview-row-shadow: 0 4px 12px rgb(18 30 52 / 5%);
}

.rooms-overview-header {
  min-height: 0;
  padding: 20px;
  overflow: visible;
  background: #fff;
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgb(18 30 52 / 6%);
}

.rooms-overview-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.08;
}

.rooms-overview-header p {
  margin-top: 7px;
  font-size: .75rem;
}

.rooms-overview-scan {
  color: #1d55ce;
  background: #eaf1ff;
  border-color: #cddcf7;
  box-shadow: none;
}

.rooms-overview-scan:hover {
  border-color: rgb(37 99 235 / 32%);
  background: #dde9fd;
  box-shadow: none;
}

.rooms-overview-row {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--rooms-overview-row-shadow);
}

.rooms-overview-row:hover {
  border-color: rgb(37 99 235 / 28%);
  box-shadow: 0 8px 18px rgb(18 30 52 / 8%);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .rooms-overview-header {
    padding: 14px 12px 13px;
    border-radius: 16px;
  }

  .rooms-overview-header h1 {
    font-size: 1.42rem;
  }

  .rooms-overview-header p {
    margin-top: 5px;
    font-size: .69rem;
  }

  .rooms-overview-header .page-actions {
    position: static;
    width: auto;
    margin-left: auto;
  }

  .rooms-overview-scan {
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .rooms-overview-scan .button-label {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .rooms-overview-row:hover {
    box-shadow: var(--rooms-overview-row-shadow);
    transform: none;
  }
}

/* Ruhige Raumdetailfläche: dezente Tiefe ohne zusätzliche Laufzeitvariante. */
.room-detail-page {
  --room-list-surface: #eef2f8;
  --room-row-shadow: 0 2px 8px rgb(18 30 52 / 5%);
}

.room-detail-page .room-detail-header {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.room-detail-page .room-record-row {
  border-color: var(--line);
}

.room-detail-page .room-detail-tab:not([aria-selected="true"]),
.room-detail-page .room-detail-header .ghost-button,
.room-detail-page .room-record-copy small,
.room-detail-page .room-record-side,
.room-detail-page .room-record-chevron,
.room-detail-page .room-devices-heading p {
  color: #536273;
}

.room-detail-page .room-urgent-summary,
.room-detail-page .status-badge.urgent {
  color: #96390f;
}

.room-detail-page .status-badge.info {
  color: #1d55ce;
}

.room-detail-page .status-badge.critical {
  color: #a32f2f;
}

.room-detail-page .status-badge.success {
  color: #125f40;
}

.room-detail-page .status-badge.progress,
.room-detail-page .status-badge.technician {
  color: #5d4388;
}

/* Keep the inventory hierarchy readable on the light modern surfaces. */
.inventory-page .page-header > div:first-child > .ghost-button,
.inventory-page .page-header > div:first-child > .eyebrow,
.inventory-page .page-header > div:first-child > p,
.inventory-page .inventory-pane-header p,
.inventory-page .inventory-record-copy small,
.inventory-page .inventory-detail-header .eyebrow,
.inventory-page .inventory-detail-header p,
.inventory-page .inventory-admin-copy small,
.inventory-page .inventory-mobile-back,
.inventory-page .inventory-tab {
  color: #405064;
}

.inventory-page .inventory-admin-row .ghost-button {
  color: #44536b;
}

.task-row .task-meta,
.task-row .task-side {
  color: #4d5b6d;
}

@media (max-width: 390px) {
  .page-header:where(:not(.rooms-overview-header):not(.role-page-header)) {
    display: grid;
  }

  .page-header:where(:not(.rooms-overview-header):not(.role-page-header)) .page-actions {
    position: absolute;
    top: 15px;
    right: 15px;
  }

  .page-header:where(:not(.rooms-overview-header):not(.role-page-header)) .page-actions .button-label {
    display: none;
  }

  .page-header:where(:not(.rooms-overview-header):not(.role-page-header)) .page-actions .primary-button {
    width: 46px;
    padding: 0;
  }

  .page-header:where(:not(.rooms-overview-header):not(.role-page-header)) > div:first-child {
    min-width: 0;
    max-width: 100%;
    padding-right: 48px;
  }

  .summary-icon {
    display: grid;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

.external-service-note {
  color: #536273;
  background: #eef3fe;
  border-color: rgb(37 99 235 / 20%);
  border-radius: 13px;
}

.external-service-note > [data-icon] { color: var(--blue); }

.fault-decision-option {
  background: #fff;
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: 0 5px 14px rgb(18 30 52 / 6%);
}

.fault-decision-option:hover {
  background: #fff;
  border-color: rgb(37 99 235 / 30%);
}

.fault-decision-option.is-primary {
  background: #eef7f2;
  border-color: rgb(24 116 79 / 22%);
}

.external-visit-section {
  background: #f8fafd;
  border-color: var(--line);
  border-radius: 18px;
}

.external-visit-card {
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgb(104 76 160 / 5%) 9px 13px),
    #fff;
  border-color: rgb(104 76 160 / 25%);
  border-left-color: #7658a7;
  border-radius: 15px;
  box-shadow: 0 7px 18px rgb(18 30 52 / 6%);
}

.external-visit-empty {
  background: #fff;
  border-color: var(--line);
  border-radius: 15px;
}

/* Kalender: moderne visuelle Ebene */
.calendar-panel {
  background: rgb(255 255 255 / 88%);
  border-color: rgb(210 223 227 / 88%);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.calendar-mode-button {
  color: #536273;
  background: #f3f6fb;
  border-color: var(--line);
  border-radius: 12px;
}

.calendar-mode-button:hover { color: var(--blue); background: #eef3fe; border-color: rgb(37 99 235 / 28%); }
.calendar-mode-button.is-active,
.calendar-mode-button[aria-selected="true"] {
  color: #fff;
  background: #2563eb;
  border-color: #1d55ce;
  box-shadow: 0 8px 18px rgb(37 99 235 / 18%);
}

.calendar-anchor-button {
  color: var(--blue);
  background: #eef3fe;
  border-color: #d4dff5;
  border-radius: 13px;
}

.calendar-room-filter {
  background-color: rgb(255 255 255 / 92%);
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgb(18 30 52 / 4%);
}

.calendar-mobile-day {
  color: #536273;
  background: #f3f6fb;
  border-color: var(--line);
  border-radius: 11px;
}

.calendar-mobile-day.has-items { box-shadow: inset 0 -3px 0 var(--brand-red); }
.calendar-mobile-day.is-active {
  color: #fff;
  background: #2563eb;
  border-color: #1d55ce;
  box-shadow: 0 7px 16px rgb(37 99 235 / 16%);
}

.calendar-day { background: var(--surface-soft); border-color: var(--line); border-radius: 16px; }
.calendar-day-header { background: #fff; border-color: var(--line); }
.calendar-day.is-today .calendar-day-header { color: var(--blue); background: #eaf1ff; }
.calendar-today-badge { color: #1d55ce; border-color: rgb(37 99 235 / 22%); }
.calendar-day-empty { color: #536273; background: rgb(255 255 255 / 48%); border-color: var(--line); border-radius: 11px; }
.calendar-task,
.calendar-agenda-item {
  background: #fff;
  border-color: var(--line);
  border-left-color: var(--blue);
  border-radius: 13px;
  box-shadow: 0 5px 14px rgb(18 30 52 / 6%);
}

.calendar-task:hover,
.calendar-agenda-item:hover { background: #fff; border-color: rgb(37 99 235 / 25%); box-shadow: 0 9px 22px rgb(18 30 52 / 9%); transform: translateY(-1px); }
.calendar-task.is-external-visit,
.calendar-agenda-item.is-external-visit {
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, rgb(104 76 160 / 6%) 8px 12px),
    #fff;
  border-color: rgb(104 76 160 / 28%);
  border-left-color: #7658a7;
}
.calendar-task[data-type="maintenance"] { border-left-color: var(--purple); }
.calendar-task[data-type="hygiene"] { border-left-color: var(--teal); }
.calendar-task.is-progress,
.calendar-agenda-item.is-progress { border-left-color: var(--purple); }
.calendar-task.is-overdue,
.calendar-agenda-item.is-overdue { border-left-color: var(--orange); }
.calendar-task.is-completed,
.calendar-agenda-item.is-completed { border-left-color: var(--green); }
.calendar-task-time,
.calendar-task-details p,
.calendar-task-status { color: #536273; }
.is-overdue .calendar-task-status { color: #a3471a; }
.calendar-task-kind { color: #1d55ce; background: #eaf1ff; }
.calendar-task-kind[data-calendar-task-kind="technician"],
.calendar-task-kind[data-calendar-task-kind="maintenance"] { color: #684ca0; background: #eee9f8; }
.calendar-task-kind[data-calendar-task-kind="hygiene"] { color: #1d55ce; background: #eaf1ff; }
.calendar-task-kind[data-calendar-task-kind="fault"] { color: #a3471a; background: #fff0e7; }
.calendar-series-badge,
.external-visit-badge { color: #684ca0; background: #eee9f8; }
.calendar-task-status { background: #eef2f8; }
.calendar-month-weekdays { background: #eef2f8; border-color: var(--line); }
.calendar-month-grid { border-color: var(--line); }
.calendar-month-day { background: #fff; border-color: var(--line); }
.calendar-month-day.is-outside { background: var(--surface-soft); }
.calendar-month-day.is-today { background: #eaf1ff; }
.calendar-month-day.is-selected { background: #eaf1ff; }
.calendar-month-day-select[aria-pressed="true"] {
  background: #2563eb;
  box-shadow: 0 6px 13px rgb(37 99 235 / 15%);
}
.calendar-agenda-group h2 { color: #172033; }
.calendar-month-mobile-agenda {
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: 15px;
}
.calendar-empty {
  color: #536273;
  background: #f8fafd;
  border-color: var(--line);
  border-radius: 18px;
}

@media print {
  .calendar-panel,
  .calendar-day,
  .calendar-day-header,
  .calendar-task,
  .calendar-month-weekdays,
  .calendar-month-grid,
  .calendar-month-day,
  .calendar-agenda-item,
  .calendar-empty {
    color: #111;
    background: #fff;
    border-color: #999;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
}

/* Kalender Variante 3: gleiche ruhige Designsprache wie Master–Detail */
.calendar-shell {
  background: #fff;
  border-color: var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.calendar-heading,
.calendar-controls {
  border-color: var(--line);
}

.calendar-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.calendar-view-tabs {
  background: #eef2f8;
  border-color: var(--line);
}

.calendar-mode-button {
  color: #526078;
  background: transparent;
  border-color: transparent;
  border-radius: 9px;
}

.calendar-mode-button:hover {
  color: #1d55ce;
  background: #fff;
  border-color: var(--line);
}

.calendar-mode-button.is-active,
.calendar-mode-button[aria-selected="true"] {
  color: #1d55ce;
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.calendar-room-filter {
  background-color: #f3f6fb;
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.calendar-room-filter:hover,
.calendar-room-filter:focus {
  background-color: #fff;
  border-color: rgb(37 99 235 / 34%);
}

.calendar-print-button {
  color: #526078;
  background: #fff;
}

.calendar-anchor-button {
  color: #1d55ce;
  background: #eef3fe;
  border-color: #d4dff5;
  border-radius: 10px;
}

.calendar-week-grid,
.calendar-agenda,
.calendar-month-agenda,
.calendar-secondary {
  border-color: var(--line);
}

.calendar-day {
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: 0;
}

.calendar-day-header {
  background: #fff;
  border-color: var(--line);
}

.calendar-task,
.calendar-agenda-item {
  background: #fff;
  border-radius: 9px;
  box-shadow: none;
}

.calendar-task:hover,
.calendar-agenda-item:hover {
  background: #fff;
  border-color: rgb(37 99 235 / 25%);
  box-shadow: 0 4px 12px rgb(18 30 52 / 7%);
  transform: translateY(-1px);
}

.calendar-list-row,
.calendar-secondary-item {
  background: transparent;
  box-shadow: none;
}

.calendar-list-time,
.calendar-secondary-details p {
  color: #526078;
}

.calendar-list-toggle:hover,
.calendar-secondary-item:hover {
  background: #f8fafd;
}

.calendar-agenda-group > header,
.calendar-month-agenda {
  background: var(--surface-soft);
}

.calendar-month-preview {
  color: #1d55ce;
  background: #eaf1ff;
}

.calendar-month-preview[data-kind="technician"],
.calendar-month-preview[data-kind="maintenance"],
.calendar-agenda-section-label {
  color: #684ca0;
  background: #eee9f8;
}

.calendar-month-preview[data-kind="hygiene"] {
  color: #1d55ce;
  background: #eaf1ff;
}

@media print {
  .calendar-shell,
  .calendar-panel,
  .calendar-week-grid,
  .calendar-agenda,
  .calendar-month-agenda,
  .calendar-secondary,
  .calendar-list-row,
  .calendar-secondary-item {
    color: #111;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
}

/* Moderne Ergänzungen für die klare Navigation und Einstellungen */
.nav-group + .nav-group {
  border-top-color: var(--line);
}

.nav-group-label {
  color: #4d5b6d;
}

.settings-menu-pane,
.settings-panel-header,
.settings-panel-content > .settings-card {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.task-area-header {
  background: #fff;
  border-color: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.task-view-switch {
  background: #eef2f8;
  border-color: var(--line);
}

.task-view-button {
  color: #526078;
}

.task-view-button.is-active,
.task-view-button[aria-pressed="true"] {
  color: #1d55ce;
  background: #fff;
}

.task-more-filters,
.task-master-shell {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.task-extra-filter-list button[aria-pressed="true"] {
  color: #1d55ce;
  background: #eaf1ff;
}

.task-more-filter-toggle:hover,
.task-more-filter-toggle[aria-expanded="true"] {
  color: #1d55ce;
  background: #fff;
  border-color: var(--line);
}

.task-area-filter {
  color: #4d5b6d;
  background: #fff;
  border-color: var(--line);
}

.task-search-field input {
  background: #f3f6fb;
  border-color: var(--line);
}

.task-extra-filter-list button {
  border-color: var(--line);
}

.task-master-nav {
  background: #fff;
  border-color: var(--line);
}

.task-master-copy small {
  color: #526078;
}

.task-master-button[aria-pressed="true"] {
  background: #fff;
}

.task-master-detail,
.task-master-detail-heading {
  background: #fff;
  border-color: var(--line);
}

.task-status-pills,
.task-others-toggle {
  border-color: var(--line);
}

.task-status-pills {
  background: #f3f6fb;
}

.task-status-pill:not([aria-selected="true"]) .task-status-count {
  color: #526078;
  background: #fff;
}

.task-status-pill:not([aria-selected="true"]) {
  color: #526078;
}

.task-status-pill[data-task-status="open"][aria-selected="true"] {
  background: #2563eb;
}

.task-status-pill[data-task-status="open"][aria-selected="true"] .task-status-count {
  color: #2563eb;
}

.task-status-pill[data-task-status="done"][aria-selected="true"] {
  background: #278060;
}

.task-status-pill[data-task-status="done"][aria-selected="true"] .task-status-count {
  color: #278060;
}

.task-others-toggle {
  background: #fff;
}

.task-others-toggle:hover:not(:disabled),
.task-others-toggle[aria-pressed="true"] {
  color: #1d55ce;
  background: #eaf1ff;
}

.task-master-detail .task-row {
  margin-inline: 0;
  border-radius: var(--record-row-radius);
}

.settings-menu-button.is-active,
.settings-menu-button[aria-pressed="true"] {
  color: #1d55ce;
  background: #eaf1ff;
}

@media (min-width: 721px) and (max-width: 1100px) {
  :root {
    --sidebar-width: 104px;
    --nav-band-inset: 8px;
  }

  .sidebar {
    padding: 14px 8px 11px;
  }

  .practice-brand {
    padding: 8px 4px;
  }

  .brand-product {
    display: flex !important;
  }

  .nav-item {
    padding: 6px 3px;
    font-size: .68rem;
  }

  .nav-item > [data-icon] {
    width: 26px;
    height: 26px;
  }

  .sidebar-create {
    padding: 6px 2px;
    font-size: .66rem;
  }

  .main-content {
    padding-inline: 24px;
  }
}

@media (max-width: 720px) {
  .mobile-nav-item small {
    font-size: .68rem;
  }

  .mobile-nav-item.mobile-create {
    width: 60px;
    height: 60px;
    gap: 0;
    margin-top: -16px;
    padding: 4px 2px;
  }

  .mobile-nav-item.mobile-create small {
    display: block;
    color: inherit;
    font-size: .62rem;
    line-height: 1;
  }
}
