:root {
  --ki-navy-950: #123f54;
  --ki-navy-900: #15536c;
  --ki-navy-800: #176783;
  --ki-blue-700: #244f9f;
  --ki-blue-600: #2f60bd;
  --ki-cyan-600: #079ed2;
  --ki-cyan-500: #18b6e8;
  --ki-cyan-100: #e8f8fd;
  --ki-mint-600: #168762;
  --ki-mint-100: #e8f7f1;
  --ki-amber-600: #b46b0b;
  --ki-amber-100: #fff5df;
  --ki-red-600: #c03d4f;
  --ki-red-100: #fff0f2;
  --ki-ink: #172637;
  --ki-muted: #637487;
  --ki-line: #dbe4eb;
  --ki-line-strong: #c5d2dc;
  --ki-canvas: #f4f7f9;
  --ki-surface: #ffffff;
  --ki-surface-soft: #f9fbfc;
  --ki-sidebar: 274px;
  --ki-topbar: 78px;
  --ki-contextbar: 50px;
  --ki-radius: 14px;
  --ki-shadow: 0 8px 28px rgba(17, 44, 64, .07);
  --brand-blue: var(--ki-blue-700);
  --brand-blue-dark: #193e84;
  --brand-cyan: var(--ki-cyan-600);
  --brand-cyan-soft: var(--ki-cyan-100);
  --ink: var(--ki-ink);
  --muted: var(--ki-muted);
  --line: var(--ki-line);
}

html {
  background: var(--ki-canvas);
  scroll-behavior: smooth;
}

body.ki-interface {
  min-width: 320px;
  color: var(--ki-ink);
  background:
    radial-gradient(circle at 88% 0, rgba(8, 164, 223, .08), transparent 28rem),
    var(--ki-canvas);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.42;
}

.ki-interface *,
.ki-interface *::before,
.ki-interface *::after {
  box-sizing: border-box;
}

.ki-interface :focus-visible {
  outline: 3px solid rgba(7, 158, 210, .28);
  outline-offset: 2px;
}

.ki-skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 1000;
  padding: 9px 14px;
  color: #fff;
  border-radius: 9px;
  background: var(--ki-navy-900);
  transform: translate(-50%, -150%);
  transition: transform .16s ease;
}

.ki-skip-link:focus {
  transform: translate(-50%, 0);
}

/* App frame */
.ki-app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--ki-sidebar) minmax(0, 1fr);
}

.ki-interface .ki-sidebar {
  width: var(--ki-sidebar);
  padding: 14px 12px 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  color: #e9f2f7;
  border-right: 1px solid rgba(255, 255, 255, .06);
  background:
    radial-gradient(circle at 10% 0, rgba(130, 225, 250, .26), transparent 22rem),
    linear-gradient(180deg, #17627d, #15475e);
  box-shadow: 8px 0 26px rgba(18, 63, 84, .12);
}

.ki-brand-card {
  min-width: 0;
  height: auto;
  padding: 7px 6px 13px;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
  background: transparent;
}

.ki-brand-card img {
  width: 43px;
  height: 43px;
  padding: 3px;
  object-fit: contain;
  border-radius: 11px;
  background: #fff;
}

.ki-brand-card strong,
.ki-brand-card span {
  position: static;
  display: block;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ki-brand-card strong {
  font-size: 13px;
  letter-spacing: -.01em;
}

.ki-brand-card span {
  margin-top: 2px;
  color: #8eddf7;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}

.ki-sidebar-collapse,
.ki-mobile-menu,
.ki-icon-action {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.ki-sidebar-collapse {
  width: 30px;
  height: 30px;
  font-size: 20px;
}

.ki-sidebar-collapse:hover {
  background: rgba(255, 255, 255, .15);
}

.ki-nav-search {
  padding: 0 4px;
}

.ki-nav-search label,
.ki-command-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.ki-nav-search > div,
.ki-command-search > div:first-of-type {
  min-height: 40px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 11px;
  background: rgba(255, 255, 255, .07);
}

.ki-nav-search input,
.ki-command-search input {
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.ki-nav-search input {
  color: #fff;
}

.ki-nav-search input::placeholder {
  color: #a9bac6;
}

.ki-nav-search kbd,
.ki-command-search kbd {
  padding: 2px 5px;
  color: #9fb2c0;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 5px;
  background: rgba(0, 0, 0, .13);
  font: 700 9px/1.4 inherit;
}

.ki-interface .ki-nav-list {
  padding: 0 3px 16px;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.ki-nav-group {
  --ki-nav-section-accent: #4fc3e7;
  margin: 0 0 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .095);
  border-radius: 12px;
  background: rgba(5, 25, 39, .2);
  box-shadow: 0 6px 16px rgba(2, 14, 23, .1);
}

.ki-nav-group[data-ki-nav-group="work"] { --ki-nav-section-accent: #63d4ef; }
.ki-nav-group[data-ki-nav-group="planning"] { --ki-nav-section-accent: #78a8ff; }
.ki-nav-group[data-ki-nav-group="customers"] { --ki-nav-section-accent: #b8a1ff; }
.ki-nav-group[data-ki-nav-group="training"] { --ki-nav-section-accent: #60d7a5; }
.ki-nav-group[data-ki-nav-group="employees"] { --ki-nav-section-accent: #55d1c9; }
.ki-nav-group[data-ki-nav-group="fleet"] { --ki-nav-section-accent: #f4b96b; }
.ki-nav-group[data-ki-nav-group="finance"] { --ki-nav-section-accent: #69d19a; }
.ki-nav-group[data-ki-nav-group="communication"] { --ki-nav-section-accent: #f08dc2; }
.ki-nav-group[data-ki-nav-group="quality"] { --ki-nav-section-accent: #f1cf6b; }
.ki-nav-group[data-ki-nav-group="management"] { --ki-nav-section-accent: #ad96f3; }
.ki-nav-group[data-ki-nav-group="system"] { --ki-nav-section-accent: #a8bac6; }

.ki-nav-group > summary {
  min-height: 42px;
  padding: 9px 9px 9px 11px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #f0f7fa;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .035));
  box-shadow: inset 4px 0 0 var(--ki-nav-section-accent), inset 0 -1px 0 rgba(255, 255, 255, .08);
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.ki-nav-group > summary::-webkit-details-marker {
  display: none;
}

.ki-nav-group > summary:hover,
.ki-nav-group.contains-active > summary {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .065));
}

.ki-nav-group > summary::after {
  content: "⌄";
  grid-column: 3;
  grid-row: 1;
  color: var(--ki-nav-section-accent);
  font-size: 12px;
  transform: rotate(-90deg);
  transition: transform .15s ease;
}

.ki-nav-group[open] > summary::after {
  transform: rotate(0);
}

.ki-nav-group > summary > span {
  grid-column: 1;
  grid-row: 1;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--ki-nav-section-accent);
  border: 1px solid color-mix(in srgb, var(--ki-nav-section-accent) 42%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--ki-nav-section-accent) 12%, transparent);
  text-align: center;
}

.ki-nav-group > summary > strong {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .075em;
}

.ki-nav-group > summary > small {
  grid-column: 3;
  grid-row: 1;
  margin-right: 16px;
  min-width: 20px;
  padding: 2px 6px;
  color: #e3eef3;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(0, 0, 0, .16);
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
}

.ki-nav-group > div {
  position: relative;
  margin: 5px 7px 7px 15px;
  padding: 3px 0 2px 10px;
  display: grid;
  gap: 3px;
  border-left: 1px solid color-mix(in srgb, var(--ki-nav-section-accent) 32%, transparent);
}

.ki-interface .ki-nav-list .nav-item,
.ki-interface .ki-nav-list .ki-module-item {
  min-height: 36px;
  padding: 6px 8px;
  gap: 9px;
  color: #cbd7dd;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}

.ki-interface .ki-nav-list .ki-module-item {
  width: 100%;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ki-interface .ki-nav-list .nav-item span,
.ki-interface .ki-nav-list .ki-module-item span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #83bdd1;
  border-radius: 7px;
  background: rgba(255, 255, 255, .045);
  font-size: 12px;
  font-weight: 850;
}

.ki-interface .ki-nav-list .nav-item b,
.ki-interface .ki-nav-list .ki-module-item b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ki-interface .ki-nav-list .nav-item:hover,
.ki-interface .ki-nav-list .ki-module-item:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .07);
  transform: translateX(2px);
}

.ki-interface .ki-nav-list .nav-item.active,
.ki-interface .ki-nav-list .ki-module-item.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(7, 158, 210, .95), rgba(47, 96, 189, .78));
  box-shadow: 0 8px 18px rgba(7, 18, 28, .2);
}

.ki-interface .ki-nav-list .nav-item.active span,
.ki-interface .ki-nav-list .ki-module-item.active span {
  color: #fff;
  background: rgba(255, 255, 255, .16);
}

.ki-filter-hidden {
  display: none !important;
}

.ki-sidebar-footer {
  padding: 11px 5px 2px;
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.ki-system-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.ki-system-state strong,
.ki-system-state small {
  display: block;
}

.ki-system-state strong {
  color: #e9f4f7;
  font-size: 11px;
}

.ki-system-state small {
  color: #829baa;
  font-size: 9px;
}

.ki-interface .ki-workspace {
  grid-column: 2;
  min-width: 0;
  overflow: clip;
}

/* Header and context strip */
.ki-interface .ki-topbar {
  height: var(--ki-topbar);
  padding: 10px 18px;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(260px, 540px) auto;
  gap: 18px;
  border-bottom: 1px solid var(--ki-line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 15px rgba(17, 44, 64, .045);
  backdrop-filter: blur(13px);
}

.ki-mobile-nav-row {
  display: none;
}

.ki-page-identity {
  min-width: 0;
}

.ki-page-identity .eyebrow {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--ki-muted);
  font-size: 9px;
  letter-spacing: .08em;
}

.ki-page-identity .eyebrow span {
  color: var(--ki-cyan-600);
}

.ki-page-identity .eyebrow b {
  color: #b0bdc8;
}

.ki-page-identity .eyebrow em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.ki-interface .ki-topbar h1 {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ki-ink);
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: 780;
}

.ki-command-search {
  min-width: 0;
  position: relative;
}

.ki-command-search > div:first-of-type {
  height: 43px;
  color: #789;
  border-color: var(--ki-line);
  background: var(--ki-surface-soft);
}

.ki-command-search input {
  color: var(--ki-ink);
  font-size: 12px;
}

.ki-command-search input::placeholder {
  color: #8a99a8;
}

.ki-command-search kbd {
  color: #66788a;
  border-color: #d0dbe3;
  background: #fff;
}

.ki-command-results {
  width: 100%;
  max-height: min(430px, 70vh);
  padding: 7px;
  position: absolute;
  top: calc(100% + 7px);
  z-index: 200;
  overflow: auto;
  border: 1px solid var(--ki-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(17, 44, 64, .18);
}

.ki-command-results > button {
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: var(--ki-ink);
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.ki-command-results > button:hover {
  background: var(--ki-cyan-100);
}

.ki-command-results > button > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--ki-blue-700);
  border-radius: 8px;
  background: #edf2fb;
  font-weight: 850;
}

.ki-command-results strong,
.ki-command-results small {
  display: block;
}

.ki-command-results small {
  color: var(--ki-muted);
  font-size: 10px;
}

.ki-command-results > button > b {
  color: var(--ki-blue-700);
  font-size: 10px;
}

.ki-command-empty {
  padding: 18px;
  color: var(--ki-muted);
  text-align: center;
}

.ki-interface .ki-topbar-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 7px;
}

/* Der Arbeitsbereich ist wegen der linken Navigation schmaler als das Browserfenster.
   Deshalb verdichten wir den Kopf bereits vor den klassischen Tablet-Breakpoints. */
@media (min-width: 761px) and (max-width: 1600px) {
  .ki-interface .ki-topbar {
    grid-template-columns: minmax(150px, .68fr) minmax(210px, 1fr) auto;
    gap: 9px;
  }

  .ki-interface .ki-topbar-actions {
    gap: 4px;
  }

  .ki-interface .user-button div,
  .ki-interface .language-switch > span {
    display: none;
  }

  .ki-interface .language-switch {
    padding-inline: 6px;
  }

  .ki-interface .language-switch select {
    min-width: 70px;
  }

  .ki-interface .sync-state {
    width: 12px;
    gap: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }
}

.ki-interface .global-history-controls {
  border-color: var(--ki-line);
  border-radius: 10px;
  background: var(--ki-surface-soft);
}

.ki-interface .global-history-button {
  min-width: 38px;
  height: 36px;
}

.ki-interface .global-history-button small {
  display: none;
}

.ki-icon-action {
  width: 36px;
  height: 36px;
  color: var(--ki-blue-700);
  border-color: var(--ki-line);
  background: #fff;
  font-weight: 900;
}

.ki-icon-action:hover {
  color: #fff;
  border-color: var(--ki-blue-700);
  background: var(--ki-blue-700);
}

.ki-interface .language-switch {
  min-height: 36px;
  padding: 3px 5px 3px 8px;
  border-radius: 10px;
}

.ki-interface .language-switch > span {
  display: none;
}

.ki-interface .language-switch select {
  min-width: 74px;
  font-size: 11px;
}

.ki-interface .sync-state {
  gap: 5px;
  font-size: 10px;
}

.ki-interface .sync-state span {
  box-shadow: 0 0 0 4px rgba(35, 174, 126, .11);
}

.ki-interface .environment-switch {
  display: inline-flex;
  min-height: 36px;
  padding: 3px;
  border: 1px solid var(--ki-line);
  border-radius: 11px;
  background: var(--ki-surface-soft);
}

.ki-interface .environment-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--ki-muted);
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.ki-interface .environment-switch a:hover,
.ki-interface .environment-switch a:focus-visible {
  color: var(--ki-blue-700);
  outline: 2px solid #2f80ed;
  outline-offset: 1px;
}

.ki-interface .environment-switch a.active,
.ki-interface .environment-switch a[aria-current="page"] {
  color: #fff;
  background: var(--ki-blue-700);
  box-shadow: 0 2px 7px rgba(16, 42, 67, .18);
}

.ki-interface .environment-switch[data-mode="published"] {
  border-color: #76b99f;
  background: #edf9f4;
}

@media (max-width: 760px) {
  .ki-interface .environment-switch {
    min-height: 38px;
  }
}

.ki-interface .user-button {
  max-width: 154px;
  padding: 3px 6px 3px 3px;
  border: 1px solid transparent;
  border-radius: 11px;
}

.ki-interface .user-button:hover {
  border-color: var(--ki-line);
  background: var(--ki-surface-soft);
}

.ki-interface .user-button > span {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, var(--ki-blue-600), var(--ki-navy-800));
}

.ki-interface .user-button div {
  min-width: 0;
}

.ki-interface .user-button strong,
.ki-interface .user-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ki-interface .app-version-badge {
  top: auto;
  right: 9px;
  bottom: 7px;
  z-index: 71;
  padding: 3px 6px;
  color: #81909f;
  border: 1px solid #dde5eb;
  border-radius: 6px;
  background: rgba(255, 255, 255, .9);
  font-size: 8px;
}

.ki-contextbar {
  min-height: var(--ki-contextbar);
  padding: 7px 18px;
  position: sticky;
  top: var(--ki-topbar);
  z-index: 52;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--ki-line);
  background: rgba(250, 252, 253, .95);
  backdrop-filter: blur(11px);
}

.ki-context-date strong,
.ki-context-date span {
  display: block;
  white-space: nowrap;
}

.ki-context-date strong {
  color: var(--ki-ink);
  font-size: 11px;
}

.ki-context-date span {
  color: var(--ki-muted);
  font-size: 9px;
}

.ki-context-actions {
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: auto hidden;
  scrollbar-width: none;
}

.ki-context-actions::-webkit-scrollbar {
  display: none;
}

.ki-context-actions button {
  min-height: 32px;
  padding: 5px 10px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
  color: #28445b;
  border: 1px solid var(--ki-line);
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.ki-context-actions button:hover {
  color: var(--ki-blue-700);
  border-color: #a9c6d8;
  background: var(--ki-cyan-100);
}

.ki-context-actions button span {
  color: var(--ki-cyan-600);
  font-size: 13px;
}

.ki-context-status {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ki-muted);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.ki-context-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ki-mint-600);
}

/* Functional content - same logic, calmer visual hierarchy */
.ki-interface main {
  min-width: 0;
  padding: 18px clamp(14px, 1.7vw, 26px) 34px;
}

.ki-interface .page-section {
  gap: 15px;
}

.ki-interface .card,
.ki-interface .metric {
  border-color: var(--ki-line);
  border-radius: var(--ki-radius);
  box-shadow: var(--ki-shadow);
}

.ki-interface .card {
  overflow: clip;
}

.ki-interface .card-header {
  min-height: 53px;
  padding: 11px 15px;
  border-color: #e4ebf0;
  background: linear-gradient(180deg, #fff, #fcfdfe);
}

.ki-interface .card-header h2 {
  color: var(--ki-ink);
  font-size: 14px;
  font-weight: 780;
}

.ki-interface .card-header p {
  color: var(--ki-muted);
  font-size: 10px;
}

.ki-interface .metrics {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.ki-interface .metric {
  min-height: 72px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.ki-interface .metric::after {
  content: "";
  width: 72px;
  height: 72px;
  position: absolute;
  right: -24px;
  bottom: -31px;
  border-radius: 50%;
  background: rgba(47, 96, 189, .06);
}

.ki-interface .metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.ki-interface .metric strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.ki-interface .metric span {
  font-size: 10px;
}

.ki-interface .dashboard-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr);
  gap: 13px;
}

.ki-interface .button,
.ki-interface .icon-button {
  min-height: 37px;
  border-color: var(--ki-line-strong);
  border-radius: 9px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 760;
}

.ki-interface .button:hover,
.ki-interface .icon-button:hover {
  color: var(--ki-blue-700);
  border-color: #9cb2c2;
  background: #f5f9fc;
}

.ki-interface .button.primary {
  color: #fff;
  border-color: var(--ki-blue-700);
  background: linear-gradient(135deg, var(--ki-blue-700), var(--ki-blue-600));
  box-shadow: 0 5px 13px rgba(47, 96, 189, .18);
}

.ki-interface .button.primary:hover {
  color: #fff;
  background: var(--ki-navy-800);
}

.ki-interface .button.cyan {
  color: #fff;
  border-color: var(--ki-cyan-600);
  background: var(--ki-cyan-600);
}

.ki-interface .button.danger {
  color: var(--ki-red-600);
  border-color: #f0cbd1;
  background: #fff;
}

.ki-interface input,
.ki-interface select,
.ki-interface textarea {
  color: var(--ki-ink);
}

.ki-interface .field-inline label,
.ki-interface .form-field label {
  color: #5f7182;
  font-size: 9px;
  letter-spacing: .055em;
}

.ki-interface .field-inline select,
.ki-interface .field-inline input,
.ki-interface .form-field input,
.ki-interface .form-field select,
.ki-interface .form-field textarea {
  min-height: 39px;
  border-color: var(--ki-line-strong);
  border-radius: 9px;
  background: #fff;
}

.ki-interface .field-inline select:focus,
.ki-interface .field-inline input:focus,
.ki-interface .form-field input:focus,
.ki-interface .form-field select:focus,
.ki-interface .form-field textarea:focus {
  border-color: var(--ki-cyan-600);
  box-shadow: 0 0 0 3px rgba(7, 158, 210, .12);
}

.ki-interface .data-table {
  color: var(--ki-ink);
  font-size: 11px;
}

.ki-interface .data-table th {
  padding: 10px 11px;
  color: #5f7182;
  border-color: var(--ki-line);
  background: #f5f8fa;
  font-size: 9px;
}

.ki-interface .data-table td {
  padding: 10px 11px;
  border-color: #e6edf1;
}

.ki-interface .data-table tbody tr:hover td {
  background: #f6fbfd;
}

.ki-interface .table-scroll {
  scrollbar-width: thin;
  scrollbar-color: #b9c8d3 #eff3f6;
}

.ki-interface .pill,
.ki-interface .status-pill,
.ki-interface .badge {
  border-radius: 999px;
  font-weight: 780;
}

.ki-interface .planner-toolbar,
.ki-interface .settings-tabs {
  top: calc(var(--ki-topbar) + var(--ki-contextbar));
  border-color: var(--ki-line);
  border-radius: 12px;
  background: rgba(247, 250, 252, .96);
  box-shadow: 0 5px 16px rgba(17, 44, 64, .06);
}

.ki-interface .ui-personal-sticky {
  top: calc(var(--ui-sticky-offset, 78px) + var(--ki-contextbar)) !important;
}

/* Urlaubsfilter und Ansichtsreiter teilen den gemessenen Fixierungsstapel. */
.ki-interface .vacation-page > :is(.vacation-toolbar, .vacation-view-tabs) {
  top: calc(var(--ui-sticky-offset, var(--ki-topbar)) + var(--ki-contextbar));
  background: var(--ki-surface);
}

@media (max-width: 1179px) {
  .ki-interface .vacation-page > :is(.vacation-toolbar, .vacation-view-tabs):not(.ui-personal-sticky) {
    top: auto;
  }
}

.ki-interface .settings-page-shell {
  height: calc(100dvh - var(--ki-topbar) - var(--ki-contextbar) - 46px);
}

.ki-interface .settings-page-shell > .settings-tabs {
  top: 0;
}

.ki-interface .settings-subsection {
  border-color: var(--ki-line);
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(17, 44, 64, .045);
}

.ki-interface .settings-subsection-heading {
  background: linear-gradient(135deg, #f4f9fb, #edf6f8);
}

.ki-interface .settings-subsection-heading h3 {
  color: var(--ki-navy-800);
}

.ki-interface .appointment-conflict-summary > summary {
  color: #982f3d;
  border-color: #efc7cd;
  background: var(--ki-red-100);
}

.ki-interface .appointment-conflict-clear {
  color: #126a4c;
  border-color: #bfe4d5;
  background: var(--ki-mint-100);
}

.ki-interface .planner-shell,
.ki-interface .appointment-shell,
.ki-interface .vacation-page,
.ki-interface .lecturer-planning-page,
.ki-interface .fleet-page {
  min-width: 0;
}

.ki-interface .planner-table,
.ki-interface .appointment-calendar,
.ki-interface .vacation-scroll,
.ki-interface .lecturer-calendar {
  border-color: var(--ki-line);
  box-shadow: inset 0 1px 0 #fff;
}

.ki-interface .vacation-tabs {
  top: calc(var(--ki-topbar) + var(--ki-contextbar));
}

.ki-interface .vacation-timeline-card {
  border-radius: var(--ki-radius);
}

.ki-interface .vacation-scroll {
  max-height: calc(100dvh - 300px);
}

/* Preserve group/course/category colors, improve their contrast only */
.ki-interface [style*="--group-color"],
.ki-interface [style*="--course-color"],
.ki-interface [style*="--category-color"] {
  border-color: color-mix(in srgb, var(--group-color, var(--course-color, var(--category-color, #5b7080))) 54%, #d7e1e8);
}

/* Dialogs */
.ki-interface .drawer {
  width: min(570px, calc(100vw - 24px));
  border-left: 1px solid var(--ki-line);
  box-shadow: -18px 0 50px rgba(7, 29, 43, .2);
}

.ki-interface .drawer.person-drawer {
  width: min(920px, calc(100vw - 24px));
}

.ki-interface .drawer-header {
  padding: 18px 20px;
  border-color: var(--ki-line);
  background: linear-gradient(135deg, #f8fbfc, #fff);
}

.ki-interface .drawer-header h2 {
  font-size: 20px;
}

.ki-interface .drawer-body {
  padding: 17px 20px 100px;
}

.ki-interface .drawer-footer {
  border-color: var(--ki-line);
  box-shadow: 0 -8px 24px rgba(17, 44, 64, .07);
}

.ki-interface .modal {
  border: 1px solid var(--ki-line);
  border-radius: 16px;
  box-shadow: 0 24px 75px rgba(7, 29, 43, .26);
}

.ki-interface .modal h2 {
  color: var(--ki-ink);
  font-size: 19px;
}

.ki-interface .modal p {
  color: var(--ki-muted);
  font-size: 11px;
}

.ki-interface .modal:not(.modal-pdf-designer) > form > .modal-actions {
  border-color: var(--ki-line);
  box-shadow: 0 -10px 28px rgba(17, 44, 64, .07);
}

/* Personal quick-work panel */
.ki-work-panel {
  width: min(440px, calc(100vw - 22px));
  padding: 18px;
  position: fixed;
  top: 11px;
  right: 11px;
  bottom: 11px;
  z-index: 310;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  color: var(--ki-ink);
  border: 1px solid var(--ki-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(7, 29, 43, .3);
  transform: translateX(calc(100% + 34px));
  transition: transform .2s ease;
}

.ki-work-panel-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(7, 29, 43, .3);
  backdrop-filter: blur(2px);
}

.ki-work-panel-open .ki-work-panel {
  transform: translateX(0);
}

.ki-work-panel > header {
  padding-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--ki-line);
}

.ki-work-panel > header small {
  color: var(--ki-cyan-600);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ki-work-panel > header h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.ki-work-panel > header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ki-line);
  border-radius: 9px;
  background: var(--ki-surface-soft);
  font-size: 20px;
}

.ki-work-panel > section {
  min-height: 0;
  overflow: auto;
}

.ki-work-panel section h3 {
  margin: 15px 0 7px;
  color: var(--ki-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.ki-work-panel section > button {
  width: 100%;
  min-height: 62px;
  margin-bottom: 7px;
  padding: 9px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--ki-ink);
  border: 1px solid var(--ki-line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.ki-work-panel section > button:hover {
  border-color: #a9c8d7;
  background: var(--ki-cyan-100);
}

.ki-work-panel section > button > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ki-blue-700);
  border-radius: 10px;
  background: #edf2fb;
  font-weight: 900;
}

.ki-work-panel section strong,
.ki-work-panel section small {
  display: block;
}

.ki-work-panel section small {
  margin-top: 2px;
  color: var(--ki-muted);
  font-size: 10px;
}

.ki-work-panel section > button > b {
  color: var(--ki-blue-700);
  font-size: 18px;
}

.ki-work-panel > footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ki-mobile-backdrop {
  display: none;
}

/* Collapsed desktop sidebar */
.ki-sidebar-collapsed {
  --ki-sidebar: 80px;
}

.ki-sidebar-collapsed .ki-brand-card {
  grid-template-columns: 43px;
  justify-content: center;
}

.ki-sidebar-collapsed .ki-brand-card > div,
.ki-sidebar-collapsed .ki-nav-search,
.ki-sidebar-collapsed .ki-nav-group > summary strong,
.ki-sidebar-collapsed .ki-nav-group > summary small,
.ki-sidebar-collapsed .ki-sidebar-footer .ki-system-state div {
  display: none;
}

.ki-sidebar-collapsed .ki-sidebar-collapse {
  position: absolute;
  top: 63px;
  left: 51px;
  z-index: 2;
  background: var(--ki-navy-800);
}

.ki-sidebar-collapsed .ki-nav-group > summary {
  grid-template-columns: 1fr;
  justify-items: center;
}

.ki-sidebar-collapsed .ki-nav-group > summary::after {
  display: none;
}

.ki-sidebar-collapsed .ki-nav-group > summary > span {
  grid-column: 1;
}

.ki-sidebar-collapsed .ki-nav-group > div {
  display: grid;
}

.ki-sidebar-collapsed .ki-interface .nav-item,
.ki-sidebar-collapsed .ki-nav-list .nav-item,
.ki-sidebar-collapsed .ki-nav-list .ki-module-item {
  justify-content: center;
  padding: 7px;
  font-size: 0;
}

.ki-sidebar-collapsed .ki-nav-list .nav-item span,
.ki-sidebar-collapsed .ki-nav-list .ki-module-item span {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.ki-sidebar-collapsed .ki-sidebar-footer {
  justify-items: center;
}

/* Large but not maximized windows */
@media (max-width: 1280px) {
  .ki-interface .ki-topbar {
    grid-template-columns: minmax(170px, auto) minmax(210px, 1fr) auto;
    gap: 10px;
    padding-inline: 13px;
  }

  .ki-interface .ki-topbar-actions {
    gap: 4px;
  }

  .ki-interface .sync-state b,
  .ki-interface .user-button div,
  .ki-context-status {
    display: none;
  }

  .ki-interface .user-button {
    padding: 0;
  }

  .ki-interface .metrics {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 1150px) {
  :root {
    --ki-sidebar: 80px;
  }

  .ki-interface .ki-sidebar {
    padding-inline: 8px;
  }

  .ki-brand-card {
    grid-template-columns: 43px;
    justify-content: center;
  }

  .ki-brand-card > div,
  .ki-sidebar-collapse,
  .ki-nav-search,
  .ki-nav-group > summary strong,
  .ki-nav-group > summary small,
  .ki-sidebar-footer .ki-system-state div {
    display: none;
  }

  .ki-nav-group > summary {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .ki-nav-group > summary::after {
    display: none;
  }

  .ki-interface .ki-nav-list .nav-item,
  .ki-interface .ki-nav-list .ki-module-item {
    justify-content: center;
    padding: 7px;
    font-size: 0;
  }

  .ki-interface .ki-nav-list .nav-item span {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .ki-interface .ki-topbar {
    grid-template-columns: minmax(170px, .7fr) minmax(200px, 1fr) auto;
  }

  .ki-interface .language-switch,
  .ki-interface #customize-current-view {
    display: none;
  }

  .ki-interface .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) and (max-width: 1150px) {
  .ki-interface .appointment-toolbar {
    grid-template-columns: minmax(390px, 1.2fr) minmax(270px, .8fr);
    grid-template-areas:
      "navigation settings"
      "actions instructor";
    gap: 7px 10px;
  }

  .ki-interface .appointment-toolbar-settings {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .ki-interface .appointment-toolbar > #appointment-instructor-picker {
    min-width: 0;
  }
}

/* Tablet and phone */
@media (max-width: 760px) {
  :root {
    --ki-topbar: 68px;
    --ki-contextbar: 48px;
  }

  .ki-app-shell {
    display: block;
  }

  .ki-interface .ki-sidebar {
    width: min(310px, calc(100vw - 44px));
    padding: 14px 12px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    z-index: 320;
    transform: translateX(-105%);
    transition: transform .18s ease;
  }

  .ki-mobile-nav-open .ki-sidebar {
    transform: translateX(0);
  }

  .ki-mobile-nav-open .ki-mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 310;
    border: 0;
    background: rgba(7, 29, 43, .44);
  }

  .ki-brand-card {
    grid-template-columns: 43px minmax(0, 1fr) 30px;
    justify-content: stretch;
  }

  .ki-sidebar-collapse {
    display: block;
  }

  .ki-brand-card > div,
  .ki-nav-search,
  .ki-nav-group > summary strong,
  .ki-nav-group > summary small,
  .ki-sidebar-footer .ki-system-state div {
    display: block;
  }

  .ki-nav-group > summary {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    justify-items: stretch;
  }

  .ki-nav-group > summary::after {
    display: block;
  }

  .ki-interface .ki-nav-list .nav-item {
    justify-content: flex-start;
    padding: 8px 10px;
    font-size: 12px;
  }

  .ki-interface .ki-nav-list .nav-item b,
  .ki-interface .ki-nav-list .ki-module-item b {
    display: block;
  }

  .ki-interface .ki-workspace {
    width: 100%;
  }

  .ki-interface .ki-topbar {
    height: auto;
    min-height: 68px;
    padding: 8px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .ki-mobile-nav-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px 34px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
  }

  .ki-mobile-nav-row img {
    width: 34px;
    height: 34px;
    padding: 2px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
  }

  .ki-mobile-nav-row span {
    overflow: hidden;
    color: var(--ki-blue-700);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 850;
  }

  .ki-mobile-menu {
    width: 38px;
    height: 38px;
    color: var(--ki-navy-800);
    border-color: var(--ki-line);
    background: var(--ki-surface-soft);
  }

  .ki-page-identity,
  .ki-command-search,
  .ki-interface .global-history-controls,
  .ki-interface .language-switch,
  .ki-interface .sync-state {
    display: none;
  }

  .ki-interface .ki-topbar-actions {
    display: flex;
  }

  .ki-interface .ki-topbar-actions > .ki-icon-action:first-of-type {
    display: none;
  }

  .ki-contextbar {
    top: var(--ki-topbar);
    padding: 7px 10px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .ki-context-status {
    display: none;
  }

  .ki-context-actions {
    justify-content: flex-end;
  }

  .ki-context-actions button {
    padding-inline: 8px;
    font-size: 0;
  }

  .ki-context-actions button span {
    font-size: 15px;
  }

  .ki-interface main {
    padding: 12px 9px 28px;
  }

  .ki-interface .metrics {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .ki-interface .metric {
    min-height: 64px;
    padding: 10px;
  }

  .ki-interface .metric-icon {
    width: 34px;
    height: 34px;
  }

  .ki-interface .metric strong {
    font-size: 18px;
  }

  .ki-interface .toolbar {
    align-items: stretch;
  }

  .ki-interface .toolbar > .field-inline,
  .ki-interface .toolbar > .people-search {
    width: 100%;
    min-width: 0;
  }

  .ki-interface .settings-page-shell {
    height: calc(100dvh - 130px);
  }

  .ki-interface .planner-toolbar,
  .ki-interface .settings-tabs,
  .ki-interface .vacation-tabs {
    top: calc(var(--ki-topbar) + var(--ki-contextbar));
  }

  .ki-interface .ui-personal-sticky {
    top: calc(var(--ui-sticky-offset, var(--ki-topbar)) + var(--ki-contextbar)) !important;
  }

  .ki-interface .modal {
    width: calc(100vw - 14px);
    max-height: calc(100dvh - 14px);
    padding: 14px;
  }

  .ki-interface .modal.modal-wide,
  .ki-interface .modal.modal-day-planner,
  .ki-interface .modal.modal-course-overview.modal-wide {
    width: calc(100vw - 10px);
    height: calc(100dvh - 10px);
    max-height: none;
  }

  .ki-interface .drawer,
  .ki-interface .drawer.person-drawer {
    width: calc(100vw - 8px);
  }

  .ki-work-panel {
    width: calc(100vw - 12px);
    top: 6px;
    right: 6px;
    bottom: 6px;
  }
}

/* Rechtegeprüfter VBZ KI-Assistent */
.ki-assistant-page {
  --assistant-blue: #24429a;
  --assistant-cyan: #0799cf;
  --assistant-ink: #15233b;
  gap: 12px;
}

.ki-assistant-trustbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #d7e4ee;
  border-radius: 12px;
  background: #f7fbfe;
  color: #40546a;
  font-size: 12px;
}

.ki-assistant-trustbar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2ebf2;
}

.ki-assistant-trustbar b { color: #087d61; }
.ki-assistant-trustbar .mode { margin-left: auto; color: var(--assistant-blue); }
.ki-assistant-trustbar .mode b { color: var(--assistant-blue); }

.ki-assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: 12px;
  min-height: min(680px, calc(100vh - 250px));
}

.ki-assistant-chat,
.ki-assistant-access {
  border: 1px solid #dbe4ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(27, 48, 75, .06);
}

.ki-assistant-chat {
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto auto;
  min-width: 0;
  overflow: hidden;
}

.ki-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(7, 153, 207, .07), transparent 32%),
    linear-gradient(#fbfdff, #f7fafc);
}

.ki-assistant-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-self: flex-start;
  width: min(820px, 92%);
}

.ki-assistant-message.user { align-self: flex-end; grid-template-columns: minmax(0, 1fr) 34px; }
.ki-assistant-message.user .ki-assistant-avatar { grid-column: 2; grid-row: 1; background: #dfe7ff; color: #263e95; font-size: 9px; }
.ki-assistant-message.user > div:last-child { grid-column: 1; grid-row: 1; background: #eef2ff; border-color: #d9e1ff; }

.ki-assistant-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--assistant-cyan), var(--assistant-blue));
  color: #fff;
  font-weight: 800;
}

.ki-assistant-message > div:last-child {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #dde7ef;
  border-radius: 4px 14px 14px 14px;
  background: #fff;
}

.ki-assistant-message header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--assistant-ink);
  font-size: 12px;
}

.ki-assistant-message header small { color: #738196; font-weight: 500; }
.ki-assistant-message p { margin: 0; color: #25354b; font-size: 13px; line-height: 1.55; }
.ki-assistant-message aside { margin-top: 9px; padding: 7px 9px; border-radius: 8px; background: #fff8e7; color: #76560f; font-size: 11px; }

.ki-assistant-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #edf1f5;
}

.ki-assistant-sources strong { width: 100%; color: #5f6d80; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.ki-assistant-sources a,
.ki-assistant-sources span { padding: 4px 7px; border-radius: 7px; background: #edf7fb; color: #17627e; font-size: 10.5px; text-decoration: none; }
.ki-assistant-sources a:hover { text-decoration: underline; }

.ki-assistant-thinking {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 2px solid #b8c8d7;
  border-top-color: var(--assistant-blue);
  border-radius: 50%;
  animation: ki-assistant-spin .8s linear infinite;
}
@keyframes ki-assistant-spin { to { transform: rotate(360deg); } }

.ki-assistant-prompts {
  display: flex;
  gap: 6px;
  padding: 9px 14px 0;
  overflow-x: auto;
  border-top: 1px solid #eef2f5;
  background: #fff;
}

.ki-assistant-prompts button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #d8e3ed;
  border-radius: 999px;
  background: #f7fafc;
  color: #334963;
  font-size: 11px;
}

.ki-assistant-prompts button:hover { border-color: #9eb8d2; background: #eef6fb; }

.ki-assistant-composer { padding: 10px 14px 13px; background: #fff; }
.ki-assistant-composer > label { display: block; margin-bottom: 5px; color: #536477; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ki-assistant-composer > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.ki-assistant-composer textarea { width: 100%; min-height: 66px; max-height: 160px; resize: vertical; padding: 10px 12px; border: 1px solid #cbd9e5; border-radius: 10px; color: #17253a; font: inherit; line-height: 1.4; }
.ki-assistant-composer textarea:focus { outline: 3px solid rgba(7, 153, 207, .14); border-color: var(--assistant-cyan); }
.ki-assistant-composer button { min-width: 108px; border-radius: 10px; }
.ki-assistant-composer > small { display: block; margin-top: 6px; color: #718095; font-size: 10.5px; }

.ki-assistant-access {
  padding: 14px;
  overflow: auto;
}

.ki-assistant-access > header { padding: 4px 3px 12px; border-bottom: 1px solid #e9eef3; }
.ki-assistant-access > header span { color: #07805f; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ki-assistant-access h3 { margin: 3px 0 0; color: var(--assistant-ink); font-size: 16px; }
.ki-assistant-access h4 { margin: 0 0 8px; color: #405268; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ki-assistant-access section,
.ki-assistant-access details { margin-top: 12px; padding: 11px; border: 1px solid #e2e9ef; border-radius: 11px; background: #fbfdfe; }
.ki-assistant-access details summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; color: #4d5f73; font-size: 12px; font-weight: 700; }
.ki-assistant-access details summary b { display: grid; place-items: center; min-width: 22px; height: 20px; border-radius: 99px; background: #e8edf2; font-size: 10px; }
.ki-assistant-access .allowed,
.ki-assistant-access .denied { display: flex; flex-direction: column; gap: 5px; }
.ki-assistant-access .allowed span,
.ki-assistant-access .denied span { padding: 5px 7px; border-radius: 7px; font-size: 11px; }
.ki-assistant-access .allowed span { background: #eaf8f2; color: #126a52; }
.ki-assistant-access .denied { margin-top: 9px; }
.ki-assistant-access .denied span { background: #f1f4f6; color: #718093; }
.ki-assistant-info p { margin: 0; color: #5a6b7f; font-size: 11.5px; line-height: 1.5; }
.ki-assistant-info p strong { color: #263d94; }
.ki-assistant-info.legal { background: #fffaf0; border-color: #f0dfb3; }

@media (max-width: 1050px) {
  .ki-assistant-layout { grid-template-columns: 1fr; }
  .ki-assistant-access { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ki-assistant-access > header { grid-column: 1 / -1; }
  .ki-assistant-access section,
  .ki-assistant-access details { margin-top: 0; }
}

@media (max-width: 680px) {
  .ki-assistant-trustbar .mode { margin-left: 0; }
  .ki-assistant-layout { min-height: auto; }
  .ki-assistant-chat { grid-template-rows: minmax(360px, 62vh) auto auto; }
  .ki-assistant-message { width: 98%; }
  .ki-assistant-access { grid-template-columns: 1fr; }
  .ki-assistant-access > header { grid-column: auto; }
  .ki-assistant-composer > div { grid-template-columns: 1fr; }
  .ki-assistant-composer button { min-height: 42px; }
}

/* Globaler KI-Assistent als rechte, aufklappbare Seitenleiste */
:root { --ki-assistant-drawer-width: clamp(360px, 31vw, 460px); }

.ki-assistant-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 345;
  display: grid;
  grid-template-columns: 28px auto;
  align-items: center;
  gap: 7px;
  min-width: 62px;
  height: 54px;
  padding: 6px 12px 6px 7px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(140deg, #06a7d8, #29449c 72%);
  box-shadow: 0 12px 32px rgba(20, 55, 112, .3);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.ki-assistant-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(20, 55, 112, .36); }
.ki-assistant-launcher span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: rgba(255,255,255,.18); font-size: 17px; }
.ki-assistant-launcher b { font-size: 12px; letter-spacing: .04em; }
.ki-assistant-drawer-open .ki-assistant-launcher { opacity: 0; pointer-events: none; transform: translateX(18px); }

/* Die Anzeige wird je Benutzer gesteuert. "Im Fenster" ist der sichere
   Standard: kein schwebender Knopf über Arbeitsinhalten, sondern ein
   eigener Aufruf in der Aktionsleiste des geöffneten Dialogs. */
body.ki-assistant-mode-integrated .ki-assistant-launcher,
body.ki-assistant-mode-hidden .ki-assistant-launcher,
body.ki-assistant-mode-hidden .modal-assistant-button,
body.ki-assistant-mode-hidden .ki-assistant-drawer,
body.ki-assistant-mode-hidden .ki-assistant-drawer-backdrop {
  display: none !important;
}

body.ki-assistant-mode-floating .modal-assistant-button {
  display: none !important;
}

/* Arbeitsdialoge haben Vorrang: Der globale KI-Startknopf bleibt außerhalb
   des Dialog-Layers und kann dadurch keine Aktionsleiste mehr überdecken. */
body:has(.modal.open) .ki-assistant-launcher {
  z-index: 99;
  transform: none;
}

.modal-actions:has(.modal-assistant-button) {
  flex-wrap: wrap;
}

.modal-assistant-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: #fff;
  border-color: #1e70a7;
  background: linear-gradient(140deg, #079fd1, #2d459b);
}

.modal-assistant-button:hover {
  color: #fff;
  border-color: #185e91;
  background: linear-gradient(140deg, #078ebc, #263d8c);
}

.modal-assistant-button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .18);
}

.modal-assistant-button b {
  font-size: 11px;
  white-space: nowrap;
}

.ki-assistant-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 350;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  width: var(--ki-assistant-drawer-width);
  color: #18283e;
  border-left: 1px solid #cddbe6;
  background: #fff;
  box-shadow: -16px 0 42px rgba(21, 45, 77, .16);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}

.ki-assistant-drawer-open .ki-assistant-drawer {
  transform: translateX(0);
  visibility: visible;
  transition: transform .2s ease;
}

.ki-assistant-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 12px 14px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0, rgba(73, 200, 235, .38), transparent 13rem),
    linear-gradient(135deg, #17627d, #254696);
}

.ki-assistant-drawer-header > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ki-assistant-drawer-header > div > span { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16); font-size: 20px; }
.ki-assistant-drawer-header small { display: block; color: #d7f4fc; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ki-assistant-drawer-header h2 { margin: 1px 0 0; color: #fff; font-size: 17px; }
.ki-assistant-drawer-header > button { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; color: #fff; background: rgba(255,255,255,.08); font-size: 22px; cursor: pointer; }
.ki-assistant-drawer-header > button:hover { background: rgba(255,255,255,.18); }

.ki-assistant-drawer-identity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e0e8ee;
  background: #f6fafc;
  color: #506176;
  font-size: 10.5px;
}
.ki-assistant-drawer-identity span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ki-assistant-drawer-identity span::first-letter { color: #128064; }
.ki-assistant-drawer-identity button { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #ccdbe6; border-radius: 7px; color: #2c478f; background: #fff; font-size: 10px; cursor: pointer; }
.ki-assistant-drawer-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ki-assistant-drawer-tools label { display: flex; align-items: center; gap: 5px; color: #53667b; font-size: 9.5px; font-weight: 750; }
.ki-assistant-drawer-tools label > span { overflow: visible; color: inherit; }
.ki-assistant-drawer-tools select { min-height: 29px; max-width: 112px; padding: 4px 24px 4px 7px; border: 1px solid #ccdbe6; border-radius: 7px; color: #294060; background: #fff; font: inherit; font-size: 10px; }

.ki-assistant-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-bottom: 1px solid #dde7ee;
  background: #fff;
}
.ki-assistant-tabs :is(button,a) {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #506176;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.ki-assistant-tabs :is(button,a):hover { background: #f0f6fa; }
.ki-assistant-tabs :is(button,a).active { color: #244797; border-color: #c6d7ea; background: #eef4ff; }
.ki-assistant-tabs :is(button,a) span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 3px; place-items: center; border-radius: 999px; color: #fff; background: #2d4a9e; font-size: 9px; }
.ki-assistant-tabs :is(button,a):last-child { margin-left: auto; padding-inline: 8px; font-size: 17px; }
.ki-assistant-tabs.page-tabs { width: fit-content; max-width: 100%; border: 1px solid #d9e4ec; border-radius: 11px; }
.ki-assistant-tabs.page-tabs button:last-child { margin-left: 0; font-size: 11px; }

.ki-assistant-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  background: #f7fafc;
}
.ki-assistant-history-card {
  position: relative;
  display: grid;
  width: 100%;
  text-align: left;
  color: #24364d;
  border: 1px solid #d8e3eb;
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
}
.ki-assistant-history-card:hover,
.ki-assistant-history-card.active { border-color: #819bd0; box-shadow: 0 5px 14px rgba(34, 66, 125, .1); }
.ki-assistant-history-open {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 11px 42px 11px 12px;
  text-align: left;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.ki-assistant-history-open > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ki-assistant-history-card strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ki-assistant-history-card time { flex: 0 0 auto; color: #77869a; font-size: 9px; }
.ki-assistant-history-card small { overflow: hidden; color: #65758a; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.ki-assistant-history-card b { color: #2e4b97; font-size: 9.5px; }
.ki-assistant-history-delete {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 27px;
  height: 27px;
  padding: 0;
  transform: translateY(-50%);
  color: #a33a45;
  font-size: 19px;
  line-height: 1;
  border: 1px solid #f0c8cd;
  border-radius: 8px;
  background: #fff7f8;
  cursor: pointer;
}
.ki-assistant-history-delete:hover { color: #fff; border-color: #bd3946; background: #bd3946; }
.ki-assistant-history-empty { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 210px; padding: 24px; text-align: center; color: #65758a; }
.ki-assistant-history-empty strong { color: #24364d; }
.ki-assistant-history-empty button { padding: 8px 12px; border: 0; border-radius: 8px; color: #fff; background: #2e4b9d; cursor: pointer; }
.ki-assistant-history.page-history { min-height: 420px; border-radius: 12px; }

.assistant-admin-settings { display: grid; gap: 18px; }
.assistant-admin-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #d7e3eb;
  border-radius: 13px;
  background: #f7fafc;
}
.assistant-admin-setting-row > div { display: grid; gap: 5px; }
.assistant-admin-setting-row strong { color: #20334c; }
.assistant-admin-setting-row span { color: #64758a; font-size: 12px; line-height: 1.5; }
.assistant-admin-setting-row > button { flex: 0 0 auto; }
.assistant-display-setting { display: grid; flex: 0 0 min(300px, 42%); gap: 5px; color: #53667b; font-size: 10px; font-weight: 750; }
.assistant-display-setting select { min-height: 39px; padding: 7px 32px 7px 10px; border: 1px solid #c8d8e4; border-radius: 9px; color: #243a55; background: #fff; font: inherit; font-size: 12px; }
@media (max-width: 680px) {
  .assistant-admin-setting-row { align-items: stretch; flex-direction: column; }
  .assistant-display-setting { flex-basis: auto; }
}

.ki-assistant-drawer-messages {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
  padding: 13px;
  overflow: auto;
  background:
    radial-gradient(circle at 92% 0, rgba(7, 158, 210, .07), transparent 17rem),
    #f7fafc;
}
.ki-assistant-drawer .ki-assistant-message { width: 96%; grid-template-columns: 30px minmax(0, 1fr); gap: 7px; }
.ki-assistant-drawer .ki-assistant-message.user { grid-template-columns: minmax(0, 1fr) 30px; }
.ki-assistant-drawer .ki-assistant-avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 10px; }
.ki-assistant-drawer .ki-assistant-message > div:last-child { padding: 9px 10px; }
.ki-assistant-drawer .ki-assistant-message p { font-size: 12.25px; line-height: 1.5; }
.ki-assistant-drawer .ki-assistant-sources a,
.ki-assistant-drawer .ki-assistant-sources span { font-size: 9.5px; }

.ki-assistant-drawer-prompts {
  display: flex;
  gap: 5px;
  padding: 7px 11px 0;
  overflow-x: auto;
  border-top: 1px solid #e7edf2;
  background: #fff;
}
.ki-assistant-drawer-prompts button { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #d6e1e9; border-radius: 999px; color: #40546b; background: #f8fafc; font-size: 10px; cursor: pointer; }

.ki-assistant-drawer-composer { padding: 8px 11px 11px; background: #fff; }
.ki-assistant-drawer-composer label { display: block; margin-bottom: 4px; color: #53667b; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ki-assistant-drawer-composer > div { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 6px; }
.ki-assistant-drawer-composer textarea { width: 100%; min-height: 58px; max-height: 130px; resize: vertical; padding: 9px 10px; border: 1px solid #c9d8e4; border-radius: 10px; color: #17263b; font: inherit; font-size: 12px; }
.ki-assistant-drawer-composer textarea:focus { outline: 3px solid rgba(7, 158, 210, .14); border-color: #079ed2; }
.ki-assistant-drawer-composer button { border: 0; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #079ed2, #29489d); font-size: 18px; cursor: pointer; }
.ki-assistant-drawer-composer button:disabled { opacity: .5; cursor: wait; }
.ki-assistant-drawer-composer small { display: block; margin-top: 4px; color: #758398; font-size: 9.5px; }

.ki-assistant-drawer-backdrop { display: none; }

@media (min-width: 1380px) {
  body.ki-assistant-drawer-open .ki-app-shell {
    grid-template-columns: var(--ki-sidebar) minmax(0, 1fr) var(--ki-assistant-drawer-width);
  }
}

/* Plus KI und Arbeitsdialog bilden auf Desktop eine gemeinsame, kollisionsfreie
   Arbeitsfläche. Der Dialog wird in den freien Bereich verschoben, nie überlagert. */
@media (min-width: 1000px) {
  body.ki-assistant-mode-integrated.ki-assistant-drawer-open:has(.modal.open) .ki-assistant-drawer {
    top: 14px;
    right: 14px;
    bottom: 14px;
    height: auto;
    width: min(390px, 34vw);
    border: 1px solid #cddbe6;
    border-radius: 15px;
    box-shadow: -10px 12px 36px rgba(21, 45, 77, .18);
    overflow: hidden;
  }

  body.ki-assistant-mode-integrated.ki-assistant-drawer-open:has(.modal.open) .modal.open {
    left: calc((100vw - min(390px, 34vw) - 28px) / 2);
    max-width: calc(100vw - min(390px, 34vw) - 56px) !important;
  }
}

@media (max-width: 820px) {
  :root { --ki-assistant-drawer-width: min(420px, 94vw); }
  .ki-assistant-drawer-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 349; display: block; border: 0; background: rgba(9, 31, 47, .42); }
  .ki-assistant-launcher { right: 12px; bottom: 12px; }
  .ki-assistant-drawer-identity { align-items: flex-start; flex-direction: column; }
  .ki-assistant-drawer-tools { width: 100%; justify-content: space-between; }
}

@media (max-width: 450px) {
  .ki-interface .metrics {
    grid-template-columns: 1fr;
  }

  .ki-interface .metric {
    min-height: 58px;
  }

  .ki-context-date span {
    max-width: 114px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ki-interface .data-table {
    font-size: 10px;
  }

  .ki-work-panel > footer {
    grid-template-columns: 1fr;
  }
}

/* KI_2.42.2 · connected operating platform */
.ki-platform-page,
.ki-os-dashboard {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.ki-platform-hero,
.ki-os-welcome {
  min-height: 122px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  position: relative;
  color: #173447;
  border: 1px solid #c8e1eb;
  border-radius: 17px;
  background:
    radial-gradient(circle at 88% 16%, rgba(60, 184, 219, .18), transparent 20rem),
    linear-gradient(135deg, #effafe, #f7fbff 52%, #eef3ff);
  box-shadow: 0 10px 28px rgba(25, 84, 108, .08);
}

.ki-platform-hero::after,
.ki-os-welcome::after {
  content: "";
  width: 170px;
  height: 170px;
  position: absolute;
  right: 7%;
  bottom: -125px;
  border: 25px solid rgba(12, 155, 201, .08);
  border-radius: 50%;
  pointer-events: none;
}

.ki-platform-hero > div:first-child,
.ki-os-welcome > div:first-child {
  max-width: 780px;
  position: relative;
  z-index: 1;
}

.ki-platform-hero > div:first-child > span,
.ki-os-welcome > div:first-child > span,
.ki-platform-card > header > div > span,
.ki-work-queue > header > div > span,
.ki-process-overview > header > div > span {
  color: #1680a4;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ki-platform-hero h2,
.ki-os-welcome h2 {
  margin: 4px 0 6px;
  color: #16374b;
  font-size: clamp(22px, 2.1vw, 31px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.ki-platform-hero p,
.ki-os-welcome p {
  max-width: 780px;
  margin: 0;
  color: #557183;
  font-size: 12px;
  line-height: 1.55;
}

.ki-platform-hero-actions,
.ki-os-welcome > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.ki-platform-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.ki-platform-metric {
  min-height: 84px;
  padding: 15px 17px;
  display: grid;
  align-content: center;
  gap: 2px;
  position: relative;
  overflow: hidden;
  border: 1px solid #d5e2e9;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(31, 63, 81, .05);
}

.ki-platform-metric::before {
  content: "";
  width: 4px;
  position: absolute;
  inset: 0 auto 0 0;
  background: #3a91ae;
}

.ki-platform-metric.ok::before { background: #278761; }
.ki-platform-metric.warning::before { background: #d59228; }
.ki-platform-metric.danger::before { background: #ca495a; }

.ki-platform-metric strong {
  color: #17384c;
  font-size: 23px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ki-platform-metric span {
  color: #526d7e;
  font-size: 11px;
  font-weight: 780;
}

.ki-platform-metric small {
  color: #8194a1;
  font-size: 9px;
}

.ki-role-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ki-role-filter button {
  min-height: 34px;
  padding: 6px 8px 6px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #536e80;
  border: 1px solid #cfdae1;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 780;
}

.ki-role-filter button span {
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  color: #688091;
  border-radius: 999px;
  background: #edf3f6;
  font-size: 9px;
}

.ki-role-filter button.active {
  color: #fff;
  border-color: #247b99;
  background: #247b99;
}

.ki-role-filter button.active span {
  color: #1e6179;
  background: #fff;
}

.ki-work-queue,
.ki-process-overview,
.ki-platform-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e2e8;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(31, 63, 81, .05);
}

.ki-work-queue > header,
.ki-process-overview > header,
.ki-platform-card > header {
  min-height: 60px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e2e9ee;
  background: linear-gradient(180deg, #fff, #fbfdfe);
}

.ki-work-queue > header h3,
.ki-process-overview > header h3,
.ki-platform-card > header h3 {
  margin: 2px 0 0;
  color: #1a394c;
  font-size: 15px;
}

.ki-work-queue > header > small {
  color: #6f8594;
  font-size: 10px;
}

.ki-work-table {
  min-width: 0;
  overflow-x: auto;
}

.ki-work-table-head,
.ki-work-table article {
  min-width: 970px;
  display: grid;
  grid-template-columns: 86px minmax(235px, 1.25fr) 135px 105px minmax(220px, 1fr) 88px;
  gap: 12px;
  align-items: center;
}

.ki-work-table-head {
  min-height: 35px;
  padding: 6px 13px;
  color: #718593;
  border-bottom: 1px solid #e1e8ed;
  background: #f3f7f9;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ki-work-table article {
  min-height: 76px;
  padding: 10px 13px;
  border-bottom: 1px solid #e6ecef;
  border-left: 4px solid #7d98a7;
}

.ki-work-table article:last-child { border-bottom: 0; }
.ki-work-table article.priority-blocker { border-left-color: #c94556; background: #fffafb; }
.ki-work-table article.priority-hoch { border-left-color: #d89227; }

.ki-work-table article > div,
.ki-work-table article > span {
  min-width: 0;
}

.ki-work-table article strong,
.ki-work-table article small,
.ki-work-table article span b {
  display: block;
}

.ki-work-table article strong {
  overflow: hidden;
  color: #17374a;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.ki-work-table article small {
  margin-top: 3px;
  color: #718594;
  font-size: 9px;
  line-height: 1.35;
}

.ki-work-table article > span:not(.ki-priority) {
  color: #526c7c;
  font-size: 10px;
  font-weight: 700;
}

.ki-work-table article p {
  margin: 0;
  color: #425f70;
  font-size: 10px;
  line-height: 1.4;
}

.ki-work-table article > button {
  min-height: 31px;
  color: #176b8a;
  border: 1px solid #b7d0dc;
  border-radius: 8px;
  background: #f4fbfd;
  font-size: 9px;
  font-weight: 820;
}

.ki-priority {
  width: fit-content;
  padding: 4px 7px;
  color: #526b7b;
  border-radius: 999px;
  background: #edf2f5;
  font-size: 9px;
  font-weight: 850;
}

.priority-blocker .ki-priority { color: #9e2d3c; background: #ffe9ec; }
.priority-hoch .ki-priority { color: #905b0c; background: #fff2d9; }

.ki-process-overview > div {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 9px;
}

.ki-process-overview > div > :is(button,a),
.ki-communication-grid > button,
.ki-finance-links > button {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #1d3c4f;
  border: 1px solid #d7e2e8;
  border-radius: 11px;
  background: #fbfdfe;
  text-align: left;
}

.ki-process-overview > div > :is(button,a):hover,
.ki-communication-grid > button:hover,
.ki-finance-links > button:hover {
  border-color: #87b8ca;
  background: #f3fbfe;
}

.ki-process-overview > div > :is(button,a) > span,
.ki-communication-grid > button > span,
.ki-finance-links > button > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 9px;
  background: #2d84a4;
  font-size: 12px;
  font-weight: 900;
}

.ki-process-overview :is(button,a) strong,
.ki-process-overview :is(button,a) small,
.ki-communication-grid button strong,
.ki-communication-grid button small,
.ki-finance-links button strong,
.ki-finance-links button small {
  display: block;
}

.ki-process-overview :is(button,a) strong,
.ki-communication-grid button strong,
.ki-finance-links button strong {
  font-size: 11px;
}

.ki-process-overview :is(button,a) small,
.ki-communication-grid button small,
.ki-finance-links button small {
  margin-top: 3px;
  color: #6c8290;
  font-size: 9px;
  line-height: 1.4;
}

.ki-process-overview :is(button,a) > b,
.ki-communication-grid button > b,
.ki-finance-links button > b {
  color: #3a86a1;
}

.ki-process-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  overflow: hidden;
  border: 1px solid #d3e0e7;
  border-radius: 13px;
  background: #fff;
}

.ki-process-strip span {
  min-height: 48px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
  color: #587282;
  border-right: 1px solid #dee7ec;
  font-size: 10px;
  font-weight: 760;
}

.ki-process-strip span:last-child { border-right: 0; }
.ki-process-strip span::after { content: "›"; margin-left: auto; color: #9aabb5; }
.ki-process-strip span:last-child::after { display: none; }

.ki-process-strip span b {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #256f8a;
  border-radius: 50%;
  background: #e9f6fa;
  font-size: 9px;
}

.ki-crm-board {
  min-width: 0;
  padding-bottom: 6px;
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 9px;
  overflow-x: auto;
}

.ki-crm-column {
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #d5e1e7;
  border-radius: 13px;
  background: #f4f7f9;
}

.ki-crm-column > header {
  min-height: 60px;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #dce5ea;
  background: #fff;
}

.ki-crm-column > header strong,
.ki-crm-column > header small { display: block; }
.ki-crm-column > header strong { color: #1b3d50; font-size: 11px; }
.ki-crm-column > header small { margin-top: 2px; color: #748894; font-size: 8px; }

.ki-crm-column > header > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #256f8a;
  border-radius: 50%;
  background: #e7f5f9;
  font-size: 9px;
  font-weight: 850;
}

.ki-crm-column > div {
  padding: 7px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.ki-lead-card {
  padding: 10px;
  border: 1px solid #dae3e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(32, 67, 86, .04);
}

.ki-lead-card > header {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.ki-lead-card > header > span {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: #377d99;
  font-size: 10px;
  font-weight: 850;
}

.ki-lead-card strong,
.ki-lead-card small { display: block; }
.ki-lead-card strong { overflow: hidden; color: #17384b; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.ki-lead-card small { margin-top: 2px; overflow: hidden; color: #748795; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }

.ki-lead-card dl {
  margin: 9px 0;
  display: grid;
  gap: 4px;
}

.ki-lead-card dl > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 5px;
}

.ki-lead-card dt { color: #83939e; font-size: 8px; }
.ki-lead-card dd { margin: 0; overflow: hidden; color: #536b79; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-weight: 700; }

.ki-lead-card footer {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.ki-lead-card footer button,
.ki-knowledge-groups article header button {
  min-height: 26px;
  padding: 4px 7px;
  color: #26728d;
  border: 1px solid #c5dae3;
  border-radius: 7px;
  background: #f5fbfd;
  font-size: 8px;
  font-weight: 800;
}

.ki-empty-compact {
  margin: 0;
  padding: 18px 10px;
  color: #7a8e9b;
  font-size: 10px;
  text-align: center;
}

.ki-platform-two-column,
.ki-portal-layout,
.ki-control-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ki-capability-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ki-capability-grid article {
  min-height: 62px;
  padding: 10px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid #dce5ea;
  border-radius: 10px;
  background: #fbfdfe;
}

.ki-capability-grid article > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #26748f;
  border-radius: 8px;
  background: #e9f7fb;
  font-weight: 850;
}

.ki-capability-grid strong,
.ki-capability-grid small { display: block; }
.ki-capability-grid strong { font-size: 10px; }
.ki-capability-grid small { margin-top: 3px; color: #6e8290; font-size: 8px; line-height: 1.35; }

.ki-inline-search {
  min-width: 190px;
  min-height: 36px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid #ccdae2;
  border-radius: 9px;
  background: #fff;
}

.ki-inline-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.ki-portal-people,
.ki-inventory-list {
  max-height: 520px;
  overflow-y: auto;
}

.ki-portal-people > button,
.ki-inventory-list > button {
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: #1d3b4d;
  border: 0;
  border-bottom: 1px solid #e2e9ed;
  background: #fff;
  text-align: left;
}

.ki-inventory-list > button { grid-template-columns: 32px minmax(0, 1fr) minmax(130px, .65fr) auto; }
.ki-portal-people > button:hover,
.ki-inventory-list > button:hover { background: #f4fafc; }
.ki-portal-people > button > span,
.ki-inventory-list > button > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 9px;
  background: #3c819b;
  font-size: 10px;
  font-weight: 850;
}

.ki-inventory-list > button > span.status-maintenance { background: #c88724; }
.ki-inventory-list > button > span.status-blocked { background: #c34354; }
.ki-inventory-list > button > span.status-assigned { background: #335ba0; }

.ki-portal-people strong,
.ki-portal-people small,
.ki-inventory-list strong,
.ki-inventory-list small { display: block; }
.ki-portal-people strong,
.ki-inventory-list strong { font-size: 10px; }
.ki-portal-people small,
.ki-inventory-list small { margin-top: 2px; color: #718592; font-size: 8px; }

.ki-finance-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  overflow: hidden;
  border: 1px solid #d3e0e7;
  border-radius: 13px;
  background: #fff;
}

.ki-finance-flow article {
  min-height: 92px;
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 4px;
  position: relative;
  border-right: 1px solid #dde6eb;
}

.ki-finance-flow article:last-child { border-right: 0; }
.ki-finance-flow article::after { content: "→"; position: absolute; top: 34px; right: -7px; z-index: 2; color: #9eb0bb; background: #fff; }
.ki-finance-flow article:last-child::after { display: none; }
.ki-finance-flow article > span { color: #2281a1; font-size: 9px; font-weight: 850; }
.ki-finance-flow article strong { color: #1a3b4e; font-size: 11px; }
.ki-finance-flow article small { color: #738793; font-size: 8px; line-height: 1.4; }

.ki-finance-links {
  padding: 10px;
  display: grid;
  gap: 7px;
}

.ki-check-list {
  margin: 0;
  padding: 12px 16px 16px;
  display: grid;
  gap: 10px;
  list-style: none;
}

.ki-check-list li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: #4b6879;
  font-size: 10px;
}

.ki-check-list li span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #187052;
  border-radius: 50%;
  background: #e6f6ef;
  font-weight: 900;
}

.ki-communication-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.ki-handoff-card > div {
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ki-handoff-card p {
  max-width: 760px;
  margin: 0;
  color: #526e7e;
  font-size: 11px;
  line-height: 1.5;
}

.ki-knowledge-toolbar {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d5e1e7;
  border-radius: 12px;
  background: #fff;
}

.ki-knowledge-toolbar .ki-inline-search { flex: 1; max-width: 560px; }
.ki-knowledge-toolbar > span { color: #708591; font-size: 9px; font-weight: 750; }

.ki-knowledge-groups {
  display: grid;
  gap: 8px;
}

.ki-knowledge-groups > details {
  overflow: hidden;
  border: 1px solid #d5e1e7;
  border-radius: 12px;
  background: #fff;
}

.ki-knowledge-groups > details > summary {
  min-height: 52px;
  padding: 9px 13px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  list-style: none;
}

.ki-knowledge-groups > details > summary::-webkit-details-marker { display: none; }
.ki-knowledge-groups > details > summary > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: #337f9a;
  font-size: 10px;
  font-weight: 850;
}
.ki-knowledge-groups > details > summary strong { font-size: 11px; }
.ki-knowledge-groups > details > summary small { color: #708592; font-size: 9px; }
.ki-knowledge-groups > details[open] > summary { border-bottom: 1px solid #dfe7eb; background: #f7fbfc; }

.ki-knowledge-groups > details > div {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ki-knowledge-groups article {
  padding: 13px;
  border: 1px solid #dce5e9;
  border-radius: 10px;
  background: #fff;
}

.ki-knowledge-groups article header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ki-knowledge-groups article h3 { margin: 0; color: #19394c; font-size: 12px; }
.ki-knowledge-groups article header p,
.ki-knowledge-groups article > p { margin: 4px 0 0; color: #647b89; font-size: 9px; line-height: 1.55; }
.ki-knowledge-groups article > p { margin-top: 10px; color: #405e70; font-size: 10px; }

.ki-knowledge-groups article footer {
  margin-top: 10px;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #e2e9ed;
  font-size: 8px;
}

.ki-knowledge-groups article footer a { color: #177697; font-weight: 800; }
.ki-knowledge-groups article footer span { color: #81929d; }

.ki-room-list {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ki-room-list article {
  min-height: 58px;
  padding: 9px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #dce5e9;
  border-radius: 10px;
  background: #fbfdfe;
}

.ki-room-list article > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: #397f99;
  font-size: 10px;
  font-weight: 850;
}

.ki-room-list strong,
.ki-room-list small { display: block; }
.ki-room-list strong { font-size: 10px; }
.ki-room-list small { margin-top: 2px; color: #748793; font-size: 8px; }

.ki-facility-control {
  display: grid;
  gap: 5px;
  min-width: min(160px, 100%);
  color: #34576b;
  font-size: 11px;
  font-weight: 750;
}

.ki-facility-control select {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #b8ccd8;
  border-radius: 8px;
  background-color: #fff;
  color: #17384b;
  font: inherit;
}

.ki-facility-control select:focus-visible {
  outline: 2px solid #2d7095;
  outline-offset: 2px;
}

.ki-facility-filters,
.ki-facility-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ki-facility-filters { padding: 12px 16px; }
.ki-facility-room-filter:empty { display: none; }
.ki-facility-results { display: grid; gap: 12px; }

.ki-facility-record {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 11px 16px;
  overflow-wrap: anywhere;
}

.ki-facility-record + .ki-facility-record { border-top: 1px solid #e2e9ee; }
.ki-facility-record > div:first-child { flex: 1 1 160px; }
.ki-facility-record strong, .ki-facility-record small { display: block; }
.ki-facility-record small { margin-top: 3px; color: #476476; }
.ki-facility-form-error { margin: 12px 0 0; color: #a03544; font-weight: 750; }

.ki-automation-list {
  display: grid;
  gap: 9px;
}

.ki-automation-list > article {
  padding: 14px;
  border: 1px solid #d6e1e7;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 63, 81, .04);
}

.ki-automation-list > article.inactive { opacity: .68; }

.ki-automation-list > article > header,
.ki-automation-list > article > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ki-automation-list h3 { display: inline; margin: 0 0 0 8px; color: #193a4d; font-size: 13px; }
.ki-rule-state { padding: 3px 7px; color: #1a7857; border-radius: 999px; background: #e5f5ee; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.ki-automation-list .inactive .ki-rule-state { color: #687b87; background: #edf1f3; }

.ki-rule-flow {
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr) auto);
  align-items: stretch;
  gap: 8px;
}

.ki-rule-flow > div {
  min-height: 68px;
  padding: 9px 11px;
  border: 1px solid #dce5ea;
  border-radius: 9px;
  background: #f8fbfc;
}

.ki-rule-flow > div > span { color: #2180a0; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.ki-rule-flow p { margin: 4px 0 0; color: #476475; font-size: 9px; line-height: 1.45; }
.ki-rule-flow > b { display: grid; place-items: center; color: #90a6b3; }

.ki-automation-list > article > footer {
  padding-top: 9px;
  border-top: 1px solid #e2e9ed;
}

.ki-automation-list > article > footer span { color: #6d8391; font-size: 8px; font-weight: 700; }
.ki-automation-list > article > footer button { min-height: 28px; color: #23718c; border: 1px solid #bed6e0; border-radius: 7px; background: #f5fbfd; font-size: 8px; font-weight: 800; }

.ki-switch { display: inline-flex; cursor: pointer; }
.ki-switch input { position: absolute; opacity: 0; }
.ki-switch span { width: 40px; height: 22px; padding: 3px; display: block; border-radius: 999px; background: #aebdc5; transition: background .15s ease; }
.ki-switch span::before { content: ""; width: 16px; height: 16px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .15s ease; }
.ki-switch input:checked + span { background: #278461; }
.ki-switch input:checked + span::before { transform: translateX(18px); }

.ki-reliability-list {
  display: grid;
}

.ki-reliability-list article {
  min-height: 55px;
  padding: 9px 13px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #e3e9ed;
}

.ki-reliability-list article:last-child { border-bottom: 0; }
.ki-reliability-list article > span { width: 27px; height: 27px; display: grid; place-items: center; color: #1c7557; border-radius: 50%; background: #e6f6ef; font-weight: 900; }
.ki-reliability-list article.warning > span { color: #8a590d; background: #fff1d7; }
.ki-reliability-list article.planned > span { color: #516e80; background: #eaf0f3; }
.ki-reliability-list strong,
.ki-reliability-list small { display: block; }
.ki-reliability-list strong { font-size: 10px; }
.ki-reliability-list small { margin-top: 2px; color: #718592; font-size: 8px; }

.ki-control-queues {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ki-control-queues :is(button,a) {
  min-height: 80px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  color: #1b3c4f;
  border: 1px solid #d9e3e8;
  border-radius: 10px;
  background: #fbfdfe;
  text-align: left;
}

.ki-control-queues :is(button,a) strong { grid-column: 1; font-size: 23px; line-height: 1; }
.ki-control-queues :is(button,a) span { grid-column: 1; margin-top: 4px; color: #657c8a; font-size: 9px; font-weight: 750; }
.ki-control-queues :is(button,a) b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #31809c; }

.ki-ai-policy {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.ki-ai-policy article {
  min-height: 90px;
  padding: 11px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-content: start;
  gap: 4px 8px;
  border: 1px solid #dce5e9;
  border-radius: 10px;
  background: #fbfdfe;
}

.ki-ai-policy article > span { width: 28px; height: 28px; display: grid; grid-row: 1 / span 2; place-items: center; color: #fff; border-radius: 8px; background: #337f9a; font-size: 9px; font-weight: 900; }
.ki-ai-policy strong { font-size: 10px; }
.ki-ai-policy small { color: #6e8390; font-size: 8px; line-height: 1.4; }

.ki-platform-loading,
.ki-platform-error {
  min-height: 220px;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #536e7e;
  border: 1px solid #d5e2e8;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.ki-platform-loading span {
  width: 32px;
  height: 32px;
  border: 4px solid #d8e9ef;
  border-top-color: #27809e;
  border-radius: 50%;
  animation: ki-platform-spin .7s linear infinite;
}

@keyframes ki-platform-spin { to { transform: rotate(360deg); } }
.ki-platform-error.compact { min-height: 90px; margin-bottom: 12px; }
.ki-platform-error strong { color: #9c3342; }
.ki-platform-error p { margin: 0; font-size: 11px; }

.ki-platform-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: #18384b;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 25px 75px rgba(20, 61, 81, .28);
}

.ki-platform-dialog::backdrop { background: rgba(25, 52, 68, .48); backdrop-filter: blur(3px); }
.ki-platform-dialog form { min-height: 0; max-height: calc(100dvh - 24px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ki-platform-dialog form > header,
.ki-platform-dialog form > footer { padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ki-platform-dialog form > header { color: #1b4054; border-bottom: 1px solid #dce5ea; background: #f4fafc; }
.ki-platform-dialog form > header span { color: #27809e; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.ki-platform-dialog form > header h2 { margin: 2px 0 0; font-size: 18px; }
.ki-platform-dialog form > header button { width: 32px; height: 32px; color: #506c7c; border: 1px solid #cbd9e1; border-radius: 8px; background: #fff; font-size: 20px; }
.ki-platform-dialog form > footer { border-top: 1px solid #dce5ea; background: #fff; }
.ki-dialog-body { min-height: 0; padding: 17px; overflow-y: auto; }
.ki-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ki-dialog-grid label { display: grid; gap: 5px; color: #536e7e; font-size: 9px; font-weight: 800; }
.ki-dialog-grid label.wide { grid-column: 1 / -1; }
.ki-dialog-grid input,
.ki-dialog-grid select,
.ki-dialog-grid textarea { width: 100%; min-height: 40px; padding: 8px 10px; color: #17384b; border: 1px solid #cbd9e1; border-radius: 9px; background: #fff; font: inherit; font-size: 11px; resize: vertical; }
.ki-dialog-grid textarea { min-height: 74px; }
.ki-dialog-grid .ki-check-field { display: flex; align-items: center; gap: 8px; }
.ki-dialog-grid .ki-check-field input { width: 17px; min-height: 17px; }
.ki-dialog-danger-link { margin-top: 14px; min-height: 32px; color: #a03544; border: 1px solid #edc8ce; border-radius: 8px; background: #fff7f8; font-size: 9px; font-weight: 800; }

.ki-platform-toast-region {
  position: fixed;
  top: calc(var(--topbar-height, 82px) + 12px);
  right: 18px;
  bottom: auto;
  z-index: 1200;
  display: grid;
  justify-items: end;
  gap: 7px;
  width: min(360px, calc(100vw - 36px));
  max-width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.ki-platform-toast {
  width: fit-content;
  min-width: min(220px, 100%);
  max-width: 100%;
  padding: 9px 11px;
  color: #fff;
  overflow-wrap: anywhere;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(35,120,87,.84);
  box-shadow: 0 8px 22px rgba(24,32,51,.16);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.35;
}

.ki-platform-toast.error { background: rgba(173,56,72,.9); }

body.ki-density-compact .ki-platform-page,
body.ki-density-compact .ki-os-dashboard { gap: 10px; }
body.ki-density-compact .ki-platform-hero,
body.ki-density-compact .ki-os-welcome { min-height: 98px; padding: 15px 18px; }
body.ki-density-compact .ki-platform-metric { min-height: 66px; padding: 10px 14px; }
body.ki-density-compact .ki-work-table article { min-height: 61px; padding-block: 7px; }
body.ki-density-compact .ki-process-overview > div { padding: 8px; }

@media (max-width: 1240px) {
  .ki-process-overview > div,
  .ki-ai-policy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ki-communication-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ki-finance-flow { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .ki-finance-flow article:nth-child(3) { border-right: 0; }
}

@media (max-width: 900px) {
  .ki-platform-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ki-platform-two-column,
  .ki-portal-layout,
  .ki-control-grid { grid-template-columns: 1fr; }
  .ki-process-strip { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .ki-process-strip span:nth-child(3) { border-right: 0; }
  .ki-platform-hero,
  .ki-os-welcome { align-items: flex-start; flex-direction: column; }
  .ki-platform-hero-actions,
  .ki-os-welcome > div:last-child { width: 100%; justify-content: flex-start; }
  .inventory-columns { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .ki-platform-hero,
  .ki-os-welcome { min-height: 0; padding: 16px; }
  .ki-platform-hero h2,
  .ki-os-welcome h2 { font-size: 21px; }
  .ki-platform-metrics { grid-template-columns: 1fr 1fr; }
  .ki-platform-metric { min-height: 70px; }
  .ki-platform-metric strong { font-size: 19px; }
  .ki-process-overview > div,
  .ki-communication-grid,
  .ki-ai-policy,
  .ki-capability-grid,
  .ki-knowledge-groups > details > div,
  .ki-room-list { grid-template-columns: 1fr; }
  .ki-process-strip { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .ki-process-strip span:nth-child(3) { border-right: 1px solid #dee7ec; }
  .ki-process-strip span:nth-child(2n) { border-right: 0; }
  .ki-finance-flow { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .ki-finance-flow article:nth-child(3) { border-right: 1px solid #dde6eb; }
  .ki-finance-flow article:nth-child(2n) { border-right: 0; }
  .ki-dialog-grid { grid-template-columns: 1fr; }
  .ki-dialog-grid label.wide { grid-column: 1; }
  .ki-inventory-list > button { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .ki-inventory-list > button > div:nth-of-type(2) { grid-column: 2; }
  .ki-handoff-card > div { align-items: stretch; flex-direction: column; }
}

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

/* 2.51.2: workflow-first density and responsive hierarchy */
:root {
  --ki-sidebar: 254px;
  --ki-topbar: 72px;
  --ki-contextbar: 44px;
}

.ki-nav-group > summary {
  grid-template-columns: 24px minmax(0, 1fr) 14px;
  gap: 7px;
}

.ki-nav-group > summary > strong {
  font-size: 11.5px;
  letter-spacing: .01em;
  text-transform: none;
}

.ki-nav-group > summary > small {
  display: none;
}

.ki-nav-group > summary::after {
  grid-column: 3;
}

.ki-interface main {
  padding-top: 14px;
}

.ki-interface .field-inline label,
.ki-interface .form-field label {
  color: #506577;
  font-size: 10px;
  letter-spacing: .025em;
}

body[data-ki-page="appointments"] .ki-contextbar {
  display: none;
}

body[data-ki-page="appointments"] main {
  padding: 0 12px 24px;
}

body[data-ki-page="appointments"] .appointment-page {
  gap: 0;
}

body[data-ki-page="appointments"] .appointment-page > .ui-personal-sticky {
  top: var(--ui-sticky-offset, var(--ki-topbar, 72px)) !important;
  margin-block: 0 !important;
}

body[data-ki-page="appointments"] .appointment-toolbar {
  top: var(--ui-sticky-offset, var(--ki-topbar, 72px)) !important;
  padding: 5px 7px;
  gap: 5px 8px;
  border-radius: 0 0 8px 8px;
}

body[data-ki-page="appointments"] .appointment-toolbar-actions .button {
  min-height: 30px;
  padding: 4px 10px;
}

body[data-ki-page="appointments"] .appointment-pinned {
  box-shadow: 0 3px 10px rgba(17, 44, 64, .045);
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) {
  box-shadow: none;
}

body[data-ki-page="appointments"] .appointment-pin-heading {
  min-height: 34px;
  padding: 5px 9px;
  grid-template-columns: 14px auto minmax(0, 1fr) auto;
  gap: 8px;
}

body[data-ki-page="appointments"] .appointment-pin-heading::before {
  grid-column: 1;
}

body[data-ki-page="appointments"] .appointment-pin-heading > div:first-of-type {
  grid-column: 2;
}

body[data-ki-page="appointments"] .appointment-pin-heading > div:first-of-type > small {
  display: none;
}

body[data-ki-page="appointments"] .appointment-pin-collapsed-summary {
  grid-column: 3;
}

body[data-ki-page="appointments"] .appointment-pin-heading > span {
  grid-column: 4;
  padding: 3px 7px;
}

/* Im zugeklappten Zustand bleiben fixierte Fahrschüler als kompakte
   Vollbreitenkarten sichtbar. Die normale vierteilige Kopfzeile darf die
   Karten nicht in eine schmale rechte Spalte drücken. */
body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-pin-heading {
  grid-template-columns: 14px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-pin-heading::before {
  grid-column: 1;
  grid-row: 1;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-pin-heading > div:first-of-type {
  grid-column: 2;
  grid-row: 1;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-pin-heading > span {
  grid-column: 3;
  grid-row: 1;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-pin-collapsed-summary {
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: stretch;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-collapsed-cards {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 5px;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-collapsed-cards .appointment-pinned-student {
  padding: 5px;
  gap: 3px;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-collapsed-cards .appointment-pinned-student > header {
  padding-bottom: 3px;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-collapsed-cards .person-link {
  min-height: 0;
  padding-block: 0;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-collapsed-cards .appointment-requirement-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100px, 100%), 1fr));
  gap: 2px;
}

body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-collapsed-cards .appointment-requirement-chip {
  min-width: 0;
  width: auto;
  padding-inline: 2px;
  gap: 1px;
  grid-template-columns: 3px auto minmax(0, 1fr) 12px;
}

body[data-ki-page="appointments"] .appointment-pin-body {
  padding: 7px 9px 9px;
  gap: 7px;
}

body[data-ki-page="appointments"] .appointment-pin-controls label > span,
body[data-ki-page="appointments"] .appointment-view-toggle > span,
body[data-ki-page="appointments"] .training-unit-control > span,
body[data-ki-page="appointments"] .appointment-toolbar-settings .appointment-view-toggle > span,
body[data-ki-page="appointments"] .appointment-instructor-picker > summary span {
  color: #53697b;
  font-size: 9.5px;
  letter-spacing: .025em;
}

body[data-ki-page="appointments"] .appointment-conflict-summary > summary,
body[data-ki-page="appointments"] .appointment-conflict-clear {
  min-height: 34px;
  padding-block: 5px;
}

@media (max-width: 1280px) {
  :root { --ki-sidebar: 246px; }
  .ki-nav-group > summary > strong { font-size: 11px; }
}

@media (max-width: 1150px) {
  :root { --ki-sidebar: 80px; }
  body[data-ki-page="appointments"] main { padding-inline: 9px; }
}

@media (max-width: 760px) {
  :root {
    --ki-topbar: 68px;
    --ki-contextbar: 48px;
  }

  body[data-ki-page="appointments"] .appointment-pin-heading {
    grid-template-columns: 14px minmax(0, 1fr) auto;
  }

  body[data-ki-page="appointments"] .appointment-pin-collapsed-summary {
    display: block !important;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  body[data-ki-page="appointments"] .appointment-pin-heading > span {
    grid-column: 3;
  }
}

@media (max-width: 520px) {
  body[data-ki-page="appointments"] .appointment-pinned:not([open]) .appointment-collapsed-cards .appointment-requirement-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ki-interface a.nav-item,.ki-interface a.ki-module-item,.ki-assistant-tabs a,.ki-process-overview a,.ki-control-queues a,a[data-ki-native-page],a[data-ki-module-open]{text-decoration:none;font:inherit;cursor:pointer}
