@font-face {
  font-family: "Clarika";
  src: url("https://www.hesge.ch/heg/sites/heg/themes/custom/heg/css/webfonts/clarika/clarikageo-regular-webfont.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clarika";
  src: url("https://www.hesge.ch/heg/sites/heg/themes/custom/heg/css/webfonts/clarika/clarikageo-medium-webfont.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clarika";
  src: url("https://www.hesge.ch/heg/sites/heg/themes/custom/heg/css/webfonts/clarika/clarikageo-semibold-webfont.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clarika";
  src: url("https://www.hesge.ch/heg/sites/heg/themes/custom/heg/css/webfonts/clarika/clarikageo-bold-webfont.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f7f7;
  --surface: #ffffff;
  --surface-2: #f0f2f3;
  --line: #dadfe2;
  --line-strong: #cfd4d7;
  --text: #24272a;
  --muted: #5f6870;
  --accent: #002c46;
  --accent-strong: #002c46;
  --accent-soft: #e6eef3;
  --heg-red: #ff3127;
  --heg-red-strong: #d8251e;
  --warn: #b45309;
  --danger: #c02015;
  --info: #002c46;
  --shadow: 0 14px 36px rgba(0, 44, 70, 0.14);
  --text-xs: 0.72rem;
  --text-sm: 0.78rem;
  --text-md: 0.86rem;
  --title-sm: 1.08rem;
  --title-md: 1.45rem;
  --field-height: 36px;
  --field-height-compact: 32px;
  --textarea-height: 76px;
  --lov-font-size: 0.82rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Clarika, "Helvetica Neue", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(352px, 506px) minmax(420px, 1fr);
}

.login-panel {
  background: var(--surface);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
  position: relative;
}

.login-panel-content {
  width: min(100%, 390px);
}

.login-visual {
  min-height: 100vh;
  padding: 48px;
  color: white;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 49, 39, 0.26), transparent 26%),
    linear-gradient(135deg, rgba(0, 44, 70, 0.98), rgba(0, 44, 70, 0.86)),
    url("assets/learning-workshop.svg") center/cover no-repeat;
  display: flex;
  align-items: center;
}

.visual-copy {
  max-width: 680px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--heg-red);
  color: white;
  box-shadow: 0 8px 20px rgba(255, 49, 39, 0.28);
}

.brand-mark svg,
.icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.4rem, 2.95vw, 2.65rem);
  max-width: 540px;
}

.login-panel h1 {
  font-size: clamp(1.34rem, 1.85vw, 1.65rem);
  max-width: 340px;
  margin-bottom: 12px;
}

.login-panel p,
.visual-copy p {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.55;
}

.visual-copy p {
  max-width: 600px;
  color: rgba(255, 255, 255, 0.78);
}

.login-eyebrow,
.visual-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visual-kicker {
  color: rgba(255, 255, 255, 0.76);
}

.login-benefits {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.login-benefits span {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.login-benefits svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-dashboard-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.8fr);
  gap: 14px;
  max-width: 620px;
  margin-top: 32px;
}

.preview-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
}

.preview-card-wide {
  grid-row: span 2;
  min-height: 236px;
}

.preview-card span {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.preview-card strong {
  display: block;
  color: white;
  font-size: 1.18rem;
  line-height: 1.15;
}

.preview-card em {
  display: block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-style: normal;
  line-height: 1.35;
}

.preview-bars {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.preview-bars i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.86), rgba(157, 221, 214, 0.52));
}

.preview-bars i:nth-child(2) {
  width: 78%;
}

.preview-bars i:nth-child(3) {
  width: 58%;
}

.login-form {
  display: grid;
  gap: 12px;
  max-width: 390px;
}

.login-form .login-submit-btn.btn {
  width: fit-content;
  justify-self: start;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
}

.login-form .login-remember-option.check-option {
  width: fit-content;
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  gap: 10px;
}

.login-form .login-remember-option.check-option:hover,
.login-form .login-remember-option.check-option:focus-within {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.login-form .login-remember-option.check-option input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

.login-action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.login-forgot-password {
  width: fit-content;
  min-height: 34px;
  border: 0;
  padding: 0;
  color: var(--accent-strong);
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.login-forgot-password:hover,
.login-forgot-password:focus-visible {
  color: var(--heg-red);
  text-decoration: underline;
}

.forgot-password-row,
.reset-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  max-width: 390px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.field-block {
  display: grid;
  gap: 7px;
}

.field-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

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

.metadata-grid > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
}

.field-info-btn {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--info);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  display: none;
}

.field-info-btn:hover,
.field-info-btn:focus {
  background: #e7efff;
  border-color: var(--info);
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.list-toolbar input {
  max-width: 420px;
}

.filter-box {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-box input {
  max-width: none;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.filter-count {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.btn-small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.list-toolbar .button-row,
.export-row .button-row {
  align-items: center;
}

.export-hint {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.btn-icon.active {
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--accent-strong);
}

.list-toolbar select,
.export-row select {
  width: auto;
  min-width: 108px;
}

.list-toolbar select[data-list-format],
.export-row select[data-list-format] {
  min-width: 76px;
  min-height: 29px;
  padding: 0 8px;
  font-size: var(--lov-font-size);
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}

.section-subtitle {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b5c0c9;
  border-radius: 10px;
  min-height: var(--field-height);
  padding: 7px 10px;
  color: var(--text);
  background: white;
  outline: 0;
  font-size: var(--text-md);
}

select {
  font-size: var(--lov-font-size);
  font-weight: 400;
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] {
  color: var(--muted);
  background: var(--surface-2);
  -webkit-text-fill-color: var(--muted);
  cursor: not-allowed;
}

.global-scope-filter select:disabled {
  border-style: dashed;
}

textarea {
  resize: vertical;
  min-height: var(--textarea-height);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  outline: 0;
}

input:user-invalid,
select:user-invalid,
textarea:user-invalid,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: none;
}

input:user-invalid:focus,
select:user-invalid:focus,
textarea:user-invalid:focus,
input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 1px var(--danger);
}

.button-row,
.toolbar,
.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--text);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.7em;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:hover {
  filter: brightness(0.96);
  box-shadow: 0 4px 12px rgba(20, 31, 35, 0.08);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  filter: none;
}

.btn-primary {
  background: var(--heg-red);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.btn-send {
  background: #0f5f8f;
}

.btn-send:hover,
.btn-send:focus-visible {
  background: #0a466b;
}

.btn-generate {
  background: #b45309;
}

.btn-generate:hover,
.btn-generate:focus-visible {
  background: #8a3f07;
}

.btn-danger {
  background: #8f1410;
  border: 1px solid #72100d;
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 27px;
  min-height: 27px;
  padding: 0;
  line-height: 1;
  flex: 0 0 auto;
}

.btn-icon .icon {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
}

.btn-icon .icon svg {
  display: block;
  margin: auto;
  width: 13px;
  height: 13px;
}

.table-wrap td:last-child {
  white-space: nowrap;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: -8px 0 14px rgba(20, 31, 35, 0.04);
}

.table-wrap td:last-child {
  padding-right: 14px;
}

.table-wrap th:last-child {
  z-index: 2;
  background: #fbfcfc;
}

.table-wrap td:last-child .button-row {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
  width: max-content;
  min-width: 0;
  margin-left: auto;
}

.table-wrap td:last-child .btn-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  min-height: 20px;
  border-radius: 5px;
}

.table-wrap td:last-child .btn-icon .icon {
  width: 10px;
  height: 10px;
}

.table-wrap td:last-child .btn-icon .icon svg {
  width: 10px;
  height: 10px;
}

.audit-cell {
  font-size: 0.76em;
  line-height: 1.2;
}

.audit-cell p {
  margin-top: 2px;
}

.audit-cell .muted {
  font-size: 1em;
}

.link-button {
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 850;
  text-align: left;
}

.link-button:hover,
.link-button:focus {
  text-decoration: underline;
}

.demo-users {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.demo-user {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.demo-user strong {
  display: block;
  font-size: 0.92rem;
}

.demo-user span {
  color: var(--muted);
  font-size: 0.76rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.app-shell.chat-open {
  grid-template-columns: 244px minmax(0, 1fr) 360px;
}

.sidebar {
  background: var(--accent);
  color: white;
  padding: 14px 12px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar .brand-subtitle {
  color: rgba(255, 255, 255, 0.62);
}

.nav {
  display: grid;
  gap: 9px;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-group-label {
  margin: 8px 9px 2px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.nav button {
  width: 100%;
  min-height: 27px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  padding: 0 8px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  font-size: 0.76rem;
  line-height: 1.08;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-left: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.84rem;
}

.sidebar-user-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sidebar-user-line strong {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 400;
}

.sidebar-role-tag {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 850;
}

.sidebar-footer #logout {
  justify-self: start;
  width: fit-content;
}

.build-number {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.72rem;
}

.login-build-number {
  position: absolute;
  left: 52px;
  bottom: 8px;
  color: var(--muted);
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  min-height: 76px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px 8px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(610px, 760px);
  grid-template-areas:
    "heading tools"
    "scope scope";
  align-items: center;
  gap: 8px 14px;
}

.topbar-no-scope {
  min-height: auto;
  grid-template-areas: "heading tools";
  padding-bottom: 10px;
}

.page-heading {
  grid-area: heading;
  min-width: 0;
}

.page-heading h2 {
  margin-bottom: 3px;
}

.page-heading .muted {
  max-width: 620px;
}

.topbar-tools {
  grid-area: tools;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.topbar-tools .btn-icon {
  width: 32px;
  min-height: 32px;
}

.scope-bar {
  grid-area: scope;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(420px, 1.4fr);
  gap: 8px;
  align-items: end;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.global-scope-summary {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-self: end;
}

.global-scope-summary span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.global-scope-summary strong {
  min-height: var(--field-height-compact);
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: var(--lov-font-size);
  font-weight: 400;
}

.scope-controls {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.8fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.global-search {
  position: relative;
  align-self: center;
}

.global-search input {
  min-height: var(--field-height-compact);
  height: var(--field-height-compact);
  padding: 0 12px;
  border-radius: 6px;
  font-size: 0.8em;
}

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

.global-scope-filter {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-self: end;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.global-scope-filter span {
  line-height: 1;
}

.global-scope-filter select {
  min-height: var(--field-height-compact);
  height: var(--field-height-compact);
  width: 100%;
  padding: 0 9px;
  border-radius: 6px;
  font-size: var(--lov-font-size);
  font-weight: 400;
  text-transform: none;
}

.scope-reset {
  min-height: var(--field-height-compact);
  height: var(--field-height-compact);
  padding: 0 12px;
}

.global-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.global-search-results.open {
  display: grid;
}

.global-search-results button {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
  background: white;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.global-search-results button:hover,
.global-search-results button:focus {
  background: var(--surface-2);
}

.global-search-results span,
.global-search-results small,
.global-search-empty {
  color: var(--muted);
  font-size: 0.76rem;
}

.global-search-empty {
  padding: 12px;
}

.topbar-actions {
  align-items: center;
  align-self: center;
}

.chat-panel {
  display: none;
  min-width: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-left: 1px solid var(--line);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.app-shell.chat-open .chat-panel {
  display: grid;
}

.chat-panel header {
  min-height: 72px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-panel header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-panel #chat-close .icon {
  transform: rotate(45deg);
}

.chat-messages {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message-block {
  max-width: 92%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-message-block.user {
  align-self: flex-end;
  align-items: flex-end;
  position: relative;
  margin-bottom: 4px;
}

.chat-message-block.assistant {
  align-self: flex-start;
}

.chat-message {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-md);
  line-height: 1.45;
}

.chat-message-text {
  white-space: pre-line;
}

.chat-message-actions {
  position: static;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
  min-height: 20px;
  padding: 1px 2px 0;
}

.chat-message-block.user:hover .chat-message-actions,
.chat-message-block.user:focus-within .chat-message-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-message-actions .btn {
  min-height: 18px;
  width: 18px;
  padding: 0;
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(20, 31, 35, 0.08);
}

.chat-message-actions .icon {
  width: 11px;
  height: 11px;
}

.chat-message-block.user .chat-message-actions .btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}

.chat-message-block.user .chat-message-actions .btn:hover {
  color: var(--accent-strong);
  background: var(--surface-2);
}

.assistant-action-card {
  max-width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #f4fbf9;
  display: grid;
  gap: 8px;
}

.assistant-action-card span {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 800;
}

.assistant-action-card small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.btn-small {
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.chat-message.user {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  padding: 8px 11px;
  line-height: 1.32;
}

.chat-message.user .chat-message-text {
  white-space: normal;
}

.chat-thinking {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 92%;
}

.thinking-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: chat-spin 0.8s linear infinite;
}

@keyframes chat-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-form {
  padding: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.chat-form textarea {
  min-height: 86px;
  font-size: var(--text-md);
  resize: vertical;
}

.topbar h2 {
  font-size: var(--title-sm);
}

.content {
  padding: 20px 22px 32px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(20, 31, 35, 0.03);
  align-self: start;
  overflow: hidden;
}

.section-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.section-header p,
.muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-md);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.section-body {
  padding: 14px;
}

.dashboard-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dashboard-controls label,
.form-grid label,
.field-block {
  display: grid;
  gap: 6px;
  align-content: start;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.action-item:hover,
.action-item:focus {
  border-color: rgba(15, 118, 110, 0.42);
  background: #f8fbfa;
}

.action-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.priority-badge.high {
  background: #fee4e2;
  color: var(--danger);
}

.priority-badge.medium {
  background: #fff3dc;
  color: var(--warn);
}

.priority-badge.low {
  background: #f3f4f6;
  color: #4b5563;
}

.priority-badge.ok {
  background: #e8f7ee;
  color: #177245;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  font-size: 2rem;
  margin-top: 4px;
}

.stat small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.kpi-card {
  min-height: 176px;
  height: 176px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f7f7 100%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.kpi-card:hover,
.kpi-card:focus {
  border-color: rgba(0, 44, 70, 0.36);
  box-shadow: 0 8px 22px rgba(0, 44, 70, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.kpi-card.warn {
  border-color: #f6d492;
  background: #fffaf0;
}

.kpi-card.risk {
  border-color: #f0b4ad;
  background: #fff7f6;
}

.kpi-card.good {
  border-top: 4px solid #177245;
}

.kpi-card.warn {
  border-top: 4px solid var(--warn);
}

.kpi-card.risk {
  border-top: 4px solid var(--danger);
}

.kpi-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px;
  align-items: start;
}

.kpi-card header span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi-card header strong {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.2;
}

.kpi-info {
  width: 20px;
  min-height: 20px;
  border-radius: 50%;
  background: #eef4f5;
  color: var(--accent-strong);
  border: 1px solid var(--line);
  cursor: help;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.kpi-info:hover,
.kpi-info:focus {
  background: #dff1ef;
  outline: none;
}

.kpi-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.kpi-main strong {
  font-size: 1.85rem;
  line-height: 1;
  flex: 0 0 auto;
}

.kpi-main small,
.kpi-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
}

.kpi-label-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
}

.kpi-label-action:hover,
.kpi-label-action:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  outline: none;
}

.kpi-visual {
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.kpi-visual-donut {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.kpi-donut {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.kpi-donut span {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 900;
}

.kpi-legend {
  display: grid;
  gap: 3px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}

.kpi-legend span {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.kpi-legend em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.kpi-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kpi-legend strong {
  color: var(--text);
}

.kpi-bars {
  display: grid;
  gap: 5px;
  max-height: 100%;
  overflow: hidden;
}

.kpi-bars div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.kpi-bars span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-bars strong {
  color: var(--text);
}

.kpi-bars i,
.kpi-gauge i {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: #e5ecee;
  overflow: hidden;
}

.kpi-bars b,
.kpi-gauge b {
  display: block;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2451a6);
}

.kpi-gauge {
  display: grid;
  gap: 8px;
  align-items: center;
}

.kpi-gauge-hint {
  color: var(--muted);
  font-weight: 750;
  font-size: 0.72rem;
  line-height: 1.25;
}

.pie-wrap {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.pie-chart {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.pie-chart span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.pie-legend {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pie-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 0.76rem;
}

.pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pie-legend span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.68fr);
  gap: 14px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.intervention-schedule-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.name-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.setup-form {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  column-gap: 12px;
  row-gap: 10px;
}

.setup-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.setup-panel summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 850;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.setup-panel summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--muted);
  transition: transform 0.16s ease;
}

.setup-panel[open] summary::before {
  transform: rotate(90deg);
}

.setup-help-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.setup-help-action p {
  margin: 3px 0 0;
}

.setup-panel-body {
  padding: 12px;
}

.setup-form input,
.setup-form select {
  min-height: 38px;
}

.setup-form > label:not(.full):not(.check-option) {
  min-height: 64px;
  align-content: space-between;
}

.setup-form textarea {
  min-height: var(--textarea-height);
}

.setup-form .section-subtitle {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.setup-form .check-option {
  min-height: 38px;
  align-items: center;
}

.password-policy-grid {
  display: grid;
  grid-template-columns: minmax(112px, 0.6fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.segmented-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.password-policy-grid label,
.llm-grid label {
  min-height: 0;
}

.password-policy-grid .check-option {
  min-height: 38px;
  height: 38px;
}

.llm-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.52fr) minmax(240px, 1fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: end;
}

.llm-grid .model-field select {
  width: 100%;
  max-width: none;
}

.full {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
}

.mail-link {
  color: var(--muted);
  text-decoration: none;
}

.mail-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: var(--text-md);
  line-height: 1.35;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #fbfdfd;
}

th {
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: 0;
  background: #fbfcfc;
  font-weight: 850;
}

.table-wrap td strong {
  font-weight: 720;
}

.table-filter-header {
  display: grid;
  gap: 5px;
  min-width: 96px;
}

.date-sort-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.table-sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
}
.table-sort-pill > span:first-child { min-width: 0; overflow-wrap: anywhere; }

.table-sort-pill:hover,
.table-sort-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sort-indicator { flex: 0 0 auto; font-size: 1rem; }
@media (pointer: coarse) { .table-sort-pill { min-height: 44px; } }

.table-filter-header select {
  min-height: var(--field-height-compact);
  height: var(--field-height-compact);
  padding: 0 9px;
  text-transform: none;
  font-size: var(--lov-font-size);
  font-weight: 400;
}

.line-preview {
  display: block;
  white-space: pre-line;
  max-height: 4.4em;
  overflow: hidden;
}

.bulk-action-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  box-shadow: 0 8px 18px rgba(20, 31, 35, 0.08);
}

.bulk-action-bar.hidden {
  display: none;
}

.bulk-count {
  padding: 0 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.bulk-icon,
.bulk-clear {
  min-height: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.bulk-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  padding: 0;
}

.bulk-icon .icon,
.bulk-icon .icon svg {
  width: 14px;
  height: 14px;
}

.bulk-icon.danger {
  color: white;
  background: #8f1410;
}

.bulk-icon.send {
  color: white;
  background: #0f5f8f;
}

.bulk-icon.generate {
  color: white;
  background: #b45309;
}

.bulk-clear {
  padding: 0 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.email-queue-table {
  table-layout: fixed;
  min-width: 1040px;
}

.email-queue-table .email-col-select {
  width: 3%;
}

.email-queue-table .email-col-status {
  width: 7%;
}

.email-queue-table .email-col-message {
  width: 51%;
}

.email-queue-table .email-col-due {
  width: 8%;
}

.email-queue-table .email-col-audit {
  width: 7%;
}

.email-queue-table .email-col-actions {
  width: 4%;
}

.email-queue-table .table-filter-header {
  min-width: 0;
}

.reminder-list-table {
  table-layout: fixed;
  min-width: 1180px;
}

.reminder-list-table .reminder-col-select {
  width: 42px;
}

.reminder-list-table .reminder-col-program {
  width: 110px;
}

.reminder-list-table .reminder-col-cohort {
  width: 72px;
}

.reminder-list-table .reminder-col-recipients {
  width: 150px;
}

.reminder-list-table .reminder-col-model {
  width: 170px;
}

.reminder-list-table .reminder-col-sessions {
  width: 330px;
}

.reminder-list-table .reminder-col-due {
  width: 96px;
}

.reminder-list-table .reminder-col-status {
  width: 86px;
}

.reminder-list-table .reminder-col-sent {
  width: 120px;
}

.reminder-list-table .reminder-col-actions {
  width: 104px;
}

.reminder-list-table .table-filter-header {
  min-width: 0;
}

.reminder-list-table td {
  vertical-align: top;
}

.reminder-list-table .context-value,
.reminder-list-table td > span:not(.tag) {
  overflow-wrap: anywhere;
}

.reminder-list-table .button-row {
  gap: 4px;
  justify-content: flex-end;
}

.programs-table {
  table-layout: fixed;
  min-width: 980px;
}

.programs-table .program-col-select {
  width: 42px;
}

.programs-table .program-col-name {
  width: 420px;
}

.programs-table .program-col-domain {
  width: 130px;
}

.programs-table .program-col-status {
  width: 70px;
}

.programs-table .program-col-small {
  width: 66px;
}

.programs-table .program-col-count {
  width: 90px;
}

.programs-table .program-col-participants {
  width: 86px;
}

.programs-table .program-col-date {
  width: 118px;
}

.programs-table .program-col-actions {
  width: 126px;
}

.programs-table td:nth-child(2),
.programs-table td:nth-child(2) p {
  overflow-wrap: anywhere;
}

.programs-table .table-filter-header {
  min-width: 0;
}

.cohorts-table {
  table-layout: fixed;
  min-width: 1294px;
}

.cohorts-table .table-filter-header {
  min-width: 0;
}

.cohort-col-select {
  width: 32px;
}

.cohort-col-name {
  width: 112px;
}

.cohort-col-program {
  width: 150px;
}

.cohort-col-date {
  width: 120px;
}

.cohort-col-status {
  width: 90px;
}

.cohort-col-state {
  width: 80px;
}

.cohort-col-count {
  width: 120px;
}

.cohort-col-count.participants {
  width: 160px;
}

.cohort-col-actions {
  width: 166px;
}

.cohorts-table th.select-cell,
.cohorts-table td.select-cell {
  padding-left: 4px;
  padding-right: 4px;
}

.interventions-table {
  table-layout: fixed;
  min-width: 1180px;
}

.intervention-col-select {
  width: 42px;
}

.intervention-col-program {
  width: 145px;
}

.intervention-col-session {
  width: 54px;
}

.intervention-col-module {
  width: 105px;
}

.intervention-col-title {
  width: 62px;
}

.intervention-col-type {
  width: 90px;
}

.intervention-col-participant {
  width: 82px;
}

.intervention-col-date {
  width: 90px;
}

.intervention-col-confirmation {
  width: 108px;
}

.intervention-col-speakers {
  width: 145px;
}

.intervention-col-actions {
  width: 150px;
}

.interventions-table .table-filter-header {
  min-width: 0;
}

.interventions-table td:nth-child(2),
.interventions-table td:nth-child(3),
.interventions-table td:nth-child(5),
.interventions-table td:nth-child(7),
.interventions-table td:nth-child(8),
.interventions-table td:nth-child(9) {
  overflow-wrap: anywhere;
}

.interventions-table td:nth-child(11) .tag {
  max-width: 100%;
}

.interventions-table td:nth-child(11) .tag-list {
  align-items: flex-start;
}

.teachers-table {
  table-layout: fixed;
  min-width: 1050px;
}

.teacher-col-select {
  width: 42px;
}

.teacher-col-name {
  width: 195px;
}

.teacher-col-role {
  width: 120px;
}

.teacher-col-programs {
  width: 260px;
}

.teacher-col-notes {
  width: 126px;
}

.teacher-col-status {
  width: 120px;
}

.teacher-col-date {
  width: 120px;
}

.teacher-col-actions {
  width: 136px;
}

.teacher-programs-cell,
.teacher-notes-cell {
  overflow-wrap: anywhere;
}

.teacher-programs-cell .program-access-tag {
  max-width: 100%;
  min-height: 0;
  padding: 4px 8px;
  line-height: 1.25;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.email-queue-table td:nth-child(3),
.email-queue-table td:nth-child(3) p {
  min-width: 0;
}

.email-queue-table td:nth-child(3) {
  min-width: 0;
}

.select-cell {
  text-align: center;
  vertical-align: middle;
}

input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: initial;
  border-radius: initial;
  background: initial;
  accent-color: var(--accent);
  box-shadow: none;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: none;
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

tr:last-child td {
  border-bottom: 0;
}

.tag-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interventions-table .speaker-name-tag {
  display: inline-block;
  max-width: 100%;
  min-height: 0;
  height: auto;
  padding: 4px 8px;
  line-height: 1.25;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.reminder-session-tags {
  align-items: flex-start;
}

.reminder-session-tag {
  max-width: 100%;
  min-height: 0;
  height: auto;
  padding: 4px 8px;
  line-height: 1.25;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.program-access-tag {
  width: fit-content;
  max-width: min(100%, 760px);
}

.tag.neutral {
  background: #f3f4f6;
  color: #374151;
}

.tag-button {
  cursor: pointer;
}

.tag-button:hover,
.tag-button:focus-visible {
  filter: brightness(0.96);
  text-decoration: underline;
  outline: none;
}

.fit-tag {
  width: fit-content;
  max-width: 100%;
}

.recipient-count-field {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.field-stack .recipient-count-field {
  min-height: 24px;
  margin-top: -6px;
}

.context-value {
  color: var(--text);
  font-weight: 650;
}

.scope-indicator {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.technical-id-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 96px;
}

.technical-id-wrap .technical-id {
  max-width: 76px;
}

.id-column {
  width: 86px;
  max-width: 86px;
}

.id-copy-btn {
  opacity: 0;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

tr:hover .id-copy-btn,
.id-copy-btn:focus-visible {
  opacity: 1;
}

.id-copy-btn .icon,
.id-copy-btn .icon svg {
  width: 12px;
  height: 12px;
}

.id-column {
  width: 96px;
}

.field-error {
  display: block;
  margin-top: 5px;
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 750;
}

.readonly-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.readonly-panel > div {
  display: grid;
  gap: 4px;
}

.profile-page {
  display: grid;
  gap: 12px;
  align-items: start;
}

.profile-section .section-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-access-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
}

.profile-access-grid .readonly-panel {
  min-height: 74px;
  align-content: start;
}

.profile-security-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.profile-security-row p {
  margin: 7px 0 0;
}

.profile-actions {
  display: grid;
  gap: 10px;
  padding: 0 2px;
}

.profile-actions .button-row {
  justify-content: flex-start;
}

.is-invalid {
  border-color: rgba(192, 32, 21, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(192, 32, 21, 0.08) !important;
}

.email-recipient-row {
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.speaker-picker-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.speaker-picker-control {
  display: grid;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.speaker-picker-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.speaker-picker-control input {
  min-height: 28px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.speaker-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.speaker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  padding: 0 4px 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.speaker-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-chip button {
  width: auto;
  height: 18px;
  min-height: 18px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent-strong);
}

.speaker-chip button .icon {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
}

.template-chip button .icon {
  display: none;
}

.speaker-empty {
  color: var(--muted);
  font-size: 0.82rem;
  align-self: center;
}

.speaker-results {
  display: grid;
  gap: 4px;
  max-height: 160px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.speaker-result {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1.15fr);
  gap: 14px;
  align-items: start;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.speaker-result:hover,
.speaker-result:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.speaker-result-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.speaker-result strong {
  font-size: 0.84rem;
}

.speaker-result-main span,
.speaker-result-notes,
.speaker-no-result {
  color: var(--muted);
  font-size: 0.76rem;
}

.speaker-result-notes {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.speaker-no-result {
  padding: 10px;
}

.tag.good {
  background: #e6f4ee;
  color: #177245;
}

.tag.warn {
  background: #fff3dc;
  color: var(--warn);
}

.tag.danger {
  background: #fee4e2;
  color: var(--danger);
}

.tag.info {
  background: #e7efff;
  color: var(--info);
}

.tag.color-0 {
  background: #e7efff;
  color: #2451a6;
}

.tag.color-1 {
  background: #e8f7ee;
  color: #177245;
}

.tag.color-2 {
  background: #fff3dc;
  color: #b45309;
}

.tag.color-3 {
  background: #f1e8ff;
  color: #6d28d9;
}

.tag.color-4 {
  background: #fee4e2;
  color: #b42318;
}

.tag.color-5 {
  background: #e6f7fb;
  color: #0e7490;
}

.tag.color-6 {
  background: #f3f4f6;
  color: #374151;
}

.tag.color-7 {
  background: #ecfdf5;
  color: #047857;
}

.tag.role-administrateur {
  background: #e7efff;
  color: #2451a6;
}

.tag.role-directeur {
  background: #e8f7ee;
  color: #177245;
}

.tag.role-assistant {
  background: #fff3dc;
  color: #b45309;
}

.tag.role-professeur {
  background: #f1e8ff;
  color: #6d28d9;
}

.tag.role-intervenant {
  background: #fee4e2;
  color: #b42318;
}

.field-help-overlay,
.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 24, 38, 0.36);
  backdrop-filter: blur(3px);
}

.stacked-dialog-overlay {
  z-index: 2400;
}

.field-help-card,
.app-dialog {
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border: 1px solid rgba(0, 44, 70, 0.1);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 24, 38, 0.24);
}

.danger-dialog {
  border-color: rgba(192, 32, 21, 0.28);
}

.danger-dialog header {
  background: #fff7f6;
}

.danger-dialog header strong {
  color: var(--danger);
}

.field-help-card header,
.app-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 0;
  border-bottom: 0;
}

.field-help-card header > strong,
.app-dialog header > div > strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.app-dialog header > div {
  min-width: 0;
}

.app-dialog header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.field-help-card p {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  line-height: 1.5;
}

.app-dialog-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.app-dialog:not(.wide-dialog):not(.kpi-dialog) > .app-dialog-body {
  padding: 24px;
}

.app-dialog:not(.wide-dialog) .dialog-footer-gap {
  display: none;
}

.app-dialog .dialog-actions {
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0;
}

.app-dialog .dialog-actions .btn,
.detail-panel .button-row > .btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  white-space: normal;
}

.app-dialog .btn-primary,
.detail-panel .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.app-dialog .btn-primary:hover,
.detail-panel .btn-primary:hover {
  background: #004263;
}

.dialog-heading-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
}

.dialog-heading-icon .icon,
.dialog-heading-icon .icon svg {
  width: 24px;
  height: 24px;
}

.feedback-overlay {
  background: rgba(0, 24, 38, 0.36);
  backdrop-filter: blur(3px);
}

.feedback-dialog {
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 20px;
  border-color: rgba(0, 44, 70, 0.1);
  box-shadow: 0 24px 80px rgba(0, 24, 38, 0.24);
}

.feedback-dialog header {
  padding: 24px 24px 0;
  border: 0;
  align-items: flex-start;
}

.feedback-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feedback-symbol > svg,
.feedback-symbol .icon,
.feedback-symbol .icon svg {
  width: 24px;
  height: 24px;
}

.feedback-warning .feedback-symbol {
  color: #92400e;
  background: #fff4df;
}

.feedback-dialog .field-help-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
}

.feedback-dialog .field-help-close:hover {
  background: var(--surface-2);
}

.feedback-content {
  padding: 20px 24px 0;
}

.feedback-content h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.feedback-content p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  padding: 24px;
}

.feedback-actions .btn {
  min-width: 120px;
  min-height: 44px;
  border-radius: 10px;
  padding: 10px 20px;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-size: 0.9rem;
}

.feedback-actions .btn:hover {
  background: #004263;
}

.wide-dialog {
  width: min(1080px, 100%);
  max-height: min(940px, calc(100vh - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wide-dialog header {
  flex: 0 0 auto;
}

.wide-dialog .app-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wide-dialog .app-dialog-body > .dialog-actions:last-child,
.wide-dialog .app-dialog-body > .dialog-actions.full:last-child {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  margin: 18px -18px -18px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  justify-content: flex-end;
}

.dialog-sticky-spacer {
  height: 104px;
  pointer-events: none;
}

.dialog-footer-gap {
  min-height: 24px;
  pointer-events: none;
}

.manual-reminder-dialog .app-dialog-body {
  scroll-padding-bottom: 128px;
}

.manual-reminder-dialog .app-dialog-body > .dialog-actions.full:last-child {
  margin-top: 0;
}

.email-send-preview-dialog {
  width: min(1040px, calc(100vw - 48px));
}

.email-send-preview-dialog .app-dialog-body.form-grid {
  padding: 18px 22px 0;
  gap: 12px 14px;
  scroll-padding-bottom: 112px;
}

.email-send-preview-dialog .readonly-field {
  display: block;
  width: 100%;
  min-height: var(--field-height);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.35;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.email-send-preview-dialog .email-preview-body {
  height: min(260px, 32vh);
  min-height: 160px;
  overflow: auto;
  overscroll-behavior: contain;
}

.email-send-preview-dialog .email-preview-body pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.45;
}

.email-send-preview-dialog .email-preview-message-field {
  min-height: 0;
}

.email-send-preview-dialog .app-dialog-body > .dialog-actions.full:last-child {
  margin: 0;
  padding: 14px 22px;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.email-send-preview-dialog .result-dialog-actions {
  justify-content: flex-end;
}

.similar-participant-list {
  display: grid;
  gap: 10px;
  max-height: min(360px, 46vh);
  overflow: auto;
}

.similar-participant-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.similar-participant-card p {
  margin: 4px 0 0;
}

.similar-participant-score {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 128px;
  text-align: right;
}

.similar-participant-score small {
  color: var(--muted);
}

.generation-dialog .app-dialog-body {
  padding-bottom: 0;
}

.generation-dialog .dialog-actions {
  justify-content: flex-end;
  margin-bottom: 0 !important;
}

.detail-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 24, 38, 0.36);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
}

.detail-panel {
  width: min(520px, calc(100vw - 24px));
  height: 100%;
  background: var(--surface);
  box-shadow: -20px 0 40px rgba(20, 31, 35, 0.18);
  display: flex;
  flex-direction: column;
  border-radius: 20px 0 0 20px;
  overflow: hidden;
}

.detail-panel header {
  flex: 0 0 auto;
  padding: 24px;
  border-bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-panel-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.detail-panel-body > section,
.detail-panel-body > details {
  align-self: start;
}

.detail-panel section {
  display: grid;
  gap: 8px;
}

.detail-panel h4 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 850;
}

.detail-link-list {
  display: grid;
  gap: 8px;
}

.detail-link {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.detail-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.detail-link span {
  font-weight: 800;
}

.detail-link small {
  color: var(--muted);
  font-size: 0.76rem;
}

.detail-session-link {
  gap: 6px;
}

.detail-session-teachers,
.detail-session-participants {
  margin-top: 2px;
}

.detail-teacher-tag,
.detail-participant-tag {
  max-width: 100%;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.detail-grid dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.mcp-client-params {
  display: grid;
  gap: 10px;
  margin: 0;
}

.mcp-client-params div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
}

.mcp-client-params div.primary {
  background: #fff;
  border-color: rgba(15, 118, 110, 0.34);
}

.mcp-client-params dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  grid-column: 2;
}

.mcp-client-params dd {
  margin: 4px 0 0;
  font-weight: 700;
  grid-column: 2;
}

.mcp-client-params code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.mcp-copy-btn {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.mcp-copy-btn:hover,
.mcp-copy-btn:focus-visible {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.36);
  background: var(--accent-soft);
}

.mcp-copy-btn .icon,
.mcp-copy-btn .icon svg {
  width: 15px;
  height: 15px;
}

.mcp-advanced {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.mcp-advanced summary {
  cursor: pointer;
  font-weight: 850;
  font-size: 0.82rem;
}

.mcp-advanced p {
  margin: 8px 0 10px;
}

.detail-grid .detail-link {
  padding: 0;
  border: 0;
  background: transparent;
}

.detail-grid .detail-link:hover {
  color: var(--accent);
}

.detail-panel pre {
  white-space: pre-wrap;
  margin: 0;
  font: inherit;
  color: var(--text);
}

.generation-dialog {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.generation-dialog header {
  flex: 0 0 auto;
}

.generation-dialog .app-dialog-body {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.kpi-dialog {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
}

.kpi-dialog .app-dialog-body {
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  overscroll-behavior: contain;
}

.kpi-dialog .app-dialog-body p {
  margin: 0;
  color: var(--text);
  line-height: 1.52;
}

.kpi-dialog .app-dialog-body ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  line-height: 1.45;
}

.reminder-generation-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.reminder-generation-list + .dialog-actions {
  justify-content: flex-end;
  position: static;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.result-dialog-actions {
  align-self: stretch;
  justify-content: flex-end;
}

.technical-id {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}

.generation-dialog .reminder-generation-list {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 18px;
  overscroll-behavior: contain;
}

.reminder-generation-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.reminder-generation-item p {
  margin: 4px 0 10px;
}

.reminder-generation-item ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.45;
}

.section-header-filter {
  min-width: 150px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.section-header-filter select {
  margin-top: 5px;
  min-height: 36px;
}

.inline-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.inline-action:hover,
.inline-action:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  outline: none;
}

.choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
}

.choice-card input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.setup-inline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.setup-inline-actions .muted {
  margin: 0;
}

.form-actions {
  justify-content: flex-start;
}

.app-dialog-body > .dialog-actions.form-actions {
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.field-help-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.field-help-close:hover {
  background: var(--surface-2);
}

@media (max-width: 600px) {
  .app-dialog-overlay,
  .field-help-overlay { padding: 12px; }
  .app-dialog,
  .field-help-card { max-height: calc(100dvh - 24px); border-radius: 16px; }
  .app-dialog header,
  .field-help-card header { padding: 20px 18px 0; }
  .app-dialog:not(.wide-dialog):not(.kpi-dialog) > .app-dialog-body { padding: 20px 18px; }
  .app-dialog .dialog-actions .btn { flex: 1 1 140px; }
  .feedback-actions { padding: 20px 18px; }
  .feedback-content { padding: 18px 18px 0; }
}

.stack {
  display: grid;
  gap: 10px;
}

.item-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.item-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item-row strong {
  overflow-wrap: anywhere;
}

.agenda-list {
  display: grid;
  gap: 10px;
}

.agenda-module-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid #2f6f73;
  border-radius: 8px;
  background: #f7faf9;
}

.agenda-module-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #102629;
}

.agenda-module-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.agenda-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.agenda-context {
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.agenda-link,
.agenda-title-link,
.agenda-subtitle-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.agenda-link {
  color: var(--accent-strong);
  font-weight: 850;
}

.agenda-title-link {
  display: block;
  color: var(--text);
  font-weight: 850;
  line-height: 1.25;
}

.agenda-subtitle-link {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.agenda-link:hover,
.agenda-link:focus-visible,
.agenda-title-link:hover,
.agenda-title-link:focus-visible,
.agenda-subtitle-link:hover,
.agenda-subtitle-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  outline: none;
}

.report-agenda .agenda-item {
  cursor: pointer;
}

.report-agenda .agenda-item:hover {
  border-color: #2f6f73;
  background: #f4faf9;
}

.session-calendar-dialog {
  width: min(980px, calc(100vw - 32px));
}

.session-calendar-dialog-body {
  background: #f3f5f6;
}

.session-calendar-document {
  display: grid;
  gap: 26px;
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 38px 52px 48px;
  background: white;
  color: #050505;
  font-family: "Century Gothic", Avenir, "Aptos", system-ui, sans-serif;
}

.session-calendar-document-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 78px;
}

.calendar-institution {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: none;
  padding-left: 18px;
  border-left: 2px solid #7b7f82;
  color: #333;
  font-size: 0.96rem;
  line-height: 1.26;
  overflow-wrap: normal;
  word-break: normal;
}

.calendar-institution strong {
  font-weight: 850;
}

.session-calendar-document-title {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}

.session-calendar-document-title h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: 0;
}

.session-calendar-document-title p {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.18;
  font-weight: 400;
}

.session-calendar-list {
  display: grid;
  gap: 22px;
}

.session-calendar-module {
  display: grid;
  border: 1px solid #1b1f22;
  background: white;
}

.session-calendar-module h2 {
  margin: 0;
  padding: 11px 12px 12px;
  background: #003852;
  color: white;
  font-size: 1.45rem;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: 0;
}

.session-calendar-module-body {
  display: grid;
  gap: 12px;
  min-height: 78px;
  padding: 28px 12px 30px;
  color: #050505;
  font-size: 1.28rem;
  line-height: 1.35;
}

.session-calendar-module-body p {
  margin: 0;
}

.session-calendar-disclaimer {
  margin-top: 26px;
  padding-top: 12px;
  border-top: 1px solid #1b1f22;
  color: #050505;
  font-size: 0.86rem;
  line-height: 1.24;
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.context-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.context-panel .muted {
  display: block;
  margin-bottom: 4px;
}

.date-pill {
  min-height: 58px;
  padding: 8px 6px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #102629;
  color: white;
  text-align: center;
  font-weight: 900;
  cursor: pointer;
}

.date-pill:hover,
.date-pill:focus-visible {
  background: #17373b;
  outline: 3px solid var(--accent-soft);
}

.date-pill span {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.day-cell {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 9px;
}

.day-cell strong {
  display: block;
  margin-bottom: 6px;
}

.day-event {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 7px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.module-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.compact-picker {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.check-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  min-height: 44px;
  color: var(--text);
  background: #fbfcfc;
  font-size: 0.82rem;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.form-grid label.check-option,
.field-block label.check-option,
.module-picker label.check-option,
.password-policy-grid label.check-option {
  display: flex;
  align-content: center;
}

.check-option input[type="checkbox"] {
  flex: 0 0 20px;
}

.check-option:has(input:checked) {
  border-color: var(--line);
  background: var(--accent-soft);
}

.check-option:hover {
  border-color: var(--line);
  background: #f7fbfa;
}

.check-option span {
  min-width: 0;
  text-align: left;
}

.check-option .checkbox-copy {
  display: grid;
  gap: 5px;
}

.check-option .domain-choice-tags {
  gap: 4px;
  margin-top: 1px;
}

.check-option .domain-choice-tags .tag {
  min-height: 18px;
  padding: 0 6px;
  font-size: 0.64rem;
}

.check-option strong {
  font-size: 0.84rem;
}

.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.table-empty {
  display: grid;
  gap: 6px;
  padding: 24px;
}

.table-empty strong {
  color: var(--text);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  background: #10191c;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hide {
  display: none !important;
}

@media (max-width: 1440px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .app-shell.chat-open {
    grid-template-columns: 232px minmax(0, 1fr) 340px;
  }

  .sidebar {
    padding: 12px 10px;
    gap: 10px;
  }

  .sidebar .brand {
    margin-bottom: 12px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 0.92rem;
  }

  .brand-subtitle,
  .nav button,
  .sidebar-footer {
    font-size: 0.76rem;
  }

  .nav {
    gap: 8px;
  }

  .nav button {
    min-height: 27px;
    padding: 0 8px;
  }

  .main {
    padding: 8px;
  }

  .topbar,
  .section,
  .section-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .table-wrap th,
  .table-wrap td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .table-filter-header {
    min-width: 102px;
  }

  .table-filter-header select {
    max-width: 132px;
  }

  .date-sort-header {
    min-width: 0;
  }
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 101px minmax(0, 1fr);
  }

  .app-shell.chat-open {
    grid-template-columns: 101px minmax(0, 360px);
  }

  .sidebar {
    padding: 16px 10px;
    align-items: center;
    gap: 14px;
  }

  .sidebar .brand div:not(.brand-mark),
  .nav span,
  .nav-group-label,
  .sidebar-footer {
    display: none;
  }

  .nav button {
    justify-content: center;
    padding: 0;
  }

  .nav,
  .nav-group {
    gap: 4px;
  }

  .stats,
  .kpi-grid,
  .dashboard-controls,
  .scope-bar,
  .password-policy-grid,
  .llm-grid,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "heading"
      "tools"
      "scope";
  }

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

  .scope-controls {
    grid-column: 1 / -1;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.chat-open {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 28px 28px 52px;
  }

  .login-build-number {
    left: 28px;
    bottom: 18px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    overflow-y: visible;
    display: block;
    padding: 10px;
  }

  .sidebar .brand {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(6, 1fr);
    overflow-x: auto;
  }

  .nav-group {
    display: contents;
  }

  .nav button {
    min-width: 44px;
  }

  .topbar {
    height: auto;
    padding: 16px;
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .topbar-tools,
  .scope-bar,
  .scope-controls {
    grid-template-columns: 1fr;
  }

  .topbar-tools .btn-icon {
    width: 32px;
    min-height: 32px;
    justify-self: start;
  }

  .global-scope-summary strong {
    white-space: normal;
  }

  .scope-reset {
    width: fit-content;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-header .btn {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
  }

  .chat-panel {
    position: fixed;
    inset: 0;
    z-index: 30;
  }

  .content {
    padding: 16px;
  }

  .stats,
  .kpi-grid,
  .dashboard-controls,
  .grid-3,
  .form-grid,
  .intervention-schedule-row,
  .name-row,
  .password-pair,
  .password-policy-grid,
  .llm-grid,
  .demo-users,
  .module-picker,
  .profile-access-grid,
  .profile-security-row {
    grid-template-columns: 1fr;
  }

  .profile-security-row .btn {
    width: fit-content;
  }

  .agenda-item {
    grid-template-columns: 1fr;
  }

  .session-calendar-document {
    padding: 28px 18px 34px;
  }

  .session-calendar-document-title h1 {
    font-size: 1.7rem;
  }

  .session-calendar-document-title p,
  .session-calendar-module h2,
  .session-calendar-module-body {
    font-size: 1.08rem;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 10px 0;
    background: white;
    overflow: hidden;
  }

  .table-wrap td {
    border-bottom: 1px solid var(--line);
  }

  .table-wrap td:last-child {
    position: static;
    box-shadow: none;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body.printing-session-calendar {
    background: white;
  }

  body.printing-session-calendar .app-shell {
    display: none !important;
  }

  body.printing-session-calendar .app-dialog-overlay {
    position: static;
    inset: auto;
    display: block;
    padding: 0;
    background: white;
  }

  body.printing-session-calendar .app-dialog,
  body.printing-session-calendar .wide-dialog,
  body.printing-session-calendar .session-calendar-dialog {
    width: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.printing-session-calendar .app-dialog > header {
    display: none !important;
  }

  body.printing-session-calendar .app-dialog-body {
    overflow: visible;
    padding: 0;
    background: white;
  }

  body.printing-session-calendar .field-help-close,
  body.printing-session-calendar .dialog-actions {
    display: none !important;
  }

  body.printing-session-calendar .session-calendar-document {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: none;
  }

  body.printing-session-calendar .session-calendar-module {
    break-inside: avoid;
    box-shadow: none;
  }

  body.printing-session-calendar .session-calendar-list {
    gap: 10px;
  }
}

/* Search and utility actions share one consistent toolbar. */
.topbar-tools { grid-template-columns:minmax(180px,1fr) auto; align-items:center; }
.topbar-tool-actions { display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:nowrap; }
.topbar-tool-actions > .btn { flex-shrink:0; }
@media(max-width:700px) { .topbar-tools { grid-template-columns:minmax(0,1fr); } .topbar-tool-actions { justify-content:flex-end; } }
