:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d8dee8;
  --text: #18212f;
  --muted: #667085;
  --accent: #2663a6;
  --accent-dark: #174b82;
  --ok: #216e4e;
  --warn: #9a6700;
  --bad: #b42318;
  --radius: 6px;
  --type-note: #eab308;
  --type-note-soft: #fffef8;
  --type-story: #2f8f5b;
  --type-story-soft: #fcfffd;
  --type-epic: #7c3fb4;
  --type-epic-soft: #fefdff;
  --type-ticket: #c7352f;
  --type-ticket-soft: #fffdfd;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

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

button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button.active,
button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.topbar {
  display: grid;
  grid-template-columns: auto auto minmax(360px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 8px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-logo-button {
  grid-column: 1;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.header-logo-button:hover,
.header-logo-button:focus-visible {
  outline: 2px solid #c8d7ea;
  outline-offset: 3px;
}

.header-logo {
  width: auto;
  height: 50px;
  display: block;
  object-fit: contain;
}

.header-metrics {
  grid-column: 3;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}

.metric-card {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 1px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #e0e7f1;
  border-radius: var(--radius);
  background: #fbfdff;
}

.metric-card strong {
  color: var(--accent-dark);
  font-size: 15px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card.primary {
  border-color: #a9c8eb;
  background: linear-gradient(180deg, #f9fcff 0%, #edf6ff 100%);
}

.metric-card.focus {
  border-color: #f0d58c;
  background: linear-gradient(180deg, #fffdf5 0%, #fff7d8 100%);
}

.session {
  grid-column: 4;
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  padding-left: 12px;
  border-left: 1px solid #dbe5f1;
}

.user-chip {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-color: color-mix(in srgb, var(--user-color, var(--accent)) 60%, #fff);
  border-radius: 999px;
  background: var(--user-color, var(--accent));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
}

.user-chip-image,
.responsible-avatar,
.profile-photo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.user-chip:hover,
.user-chip:focus-visible,
.user-chip.active {
  border-color: var(--text);
}

.impersonation-status {
  max-width: 180px;
  padding: 4px 8px;
  border: 1px solid #d7e2ef;
  border-radius: 999px;
  background: #f7fbff;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impersonation-chip {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd8ea;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.impersonation-chip:hover,
.impersonation-chip:focus-visible,
.impersonation-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 105, 184, 0.12);
}

.impersonation-chip.active {
  background: var(--user-color, var(--accent));
  color: #fff;
}

.impersonation-chip svg {
  width: 18px;
  height: 18px;
}

.impersonation-chip-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.impersonation-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 132px;
  z-index: 22;
  width: min(340px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.16);
}

.impersonation-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f7;
}

.impersonation-panel-head strong {
  color: var(--accent-dark);
}

.impersonation-panel-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impersonation-panel input {
  width: 100%;
}

.impersonation-list {
  max-height: 320px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.impersonation-user-row {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
}

.impersonation-user-row:hover,
.impersonation-user-row:focus-visible,
.impersonation-user-row.active {
  border-color: #b9cff0;
  background: #f4f8ff;
}

.impersonation-user-avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--user-color, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.impersonation-user-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.impersonation-user-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.impersonation-user-text strong,
.impersonation-user-text small {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impersonation-user-text strong {
  color: var(--accent-dark);
  font-size: 13px;
}

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

.profile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 96px;
  z-index: 20;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.16);
}

.profile-panel h2 {
  margin: 0;
  font-size: 16px;
}

.profile-panel fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.profile-panel legend {
  padding: 0;
  font-weight: 700;
}

.profile-panel .profile-password {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.profile-photo-section {
  padding-top: 4px;
}

.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-photo-preview {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--user-color, var(--accent)) 45%, #fff);
  border-radius: 999px;
  background: var(--user-color, var(--accent));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.profile-photo-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-photo-actions p {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.password-field-label {
  gap: 6px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  height: 34px;
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  border-color: var(--line);
  background: #f8fafc;
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.profile-panel input[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

.color-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, 34px);
  gap: 10px;
}

.color-choice {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
}

.color-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-choice span {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: var(--choice-color);
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.16);
  cursor: pointer;
}

.color-choice input:checked + span {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(38, 99, 166, 0.24);
}

.color-choice input:checked + span::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  width: 7px;
  height: 13px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.admin-button {
  color: var(--accent-dark);
}

.admin-button:hover,
.admin-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.logout-button {
  color: var(--accent-dark);
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: var(--bad);
  color: var(--bad);
}

.icon-button.active,
.icon-button.active:hover,
.icon-button.active:focus-visible {
  border-color: var(--accent);
  color: #fff;
}

main {
  padding: 20px 24px;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.login-box {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.login-logo {
  width: min(100%, 360px);
  height: auto;
  justify-self: center;
  margin-bottom: 4px;
}

.login-box h2 {
  margin: 0 0 6px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font-weight: 400;
}

textarea {
  resize: vertical;
}

.message {
  min-height: 18px;
  margin: 0;
  color: var(--bad);
}

.toast-stack {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 5000;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  border: 1px solid #a9c7ef;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  color: var(--accent-dark);
  font-weight: 700;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-error {
  border-color: #f4b7b2;
  border-left-color: var(--bad);
  color: var(--bad);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.app-shell {
  position: relative;
  display: grid;
  gap: 16px;
}

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

.header-actions {
  grid-column: 2;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
  padding: 4px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #f8fbff;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.primary-actions {
  padding-right: 6px;
  border-right: 1px solid #d8e2ef;
}

.header-actions.admin-context-actions .primary-actions {
  padding-right: 0;
  border-right: 0;
}

.view-actions {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.action-separator {
  width: 1px;
  height: 24px;
  flex: 0 0 auto;
  margin: 0 3px;
  background: #d8e2ef;
}

.toolbar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.toolbar {
  display: grid;
  gap: 12px;
}

.action-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  border-color: #c9d6e5;
  border-radius: var(--radius);
  background: #fff;
  color: var(--accent-dark);
  font-weight: 600;
}

.action-button:hover,
.action-button:focus-visible {
  border-color: var(--accent);
  background: #f6faff;
  color: var(--accent-dark);
}

.action-button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.action-button-primary:hover,
.action-button-primary:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.action-icon-button {
  width: 34px;
  padding: 0;
}

.action-icon-button svg,
.view-toggle-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.view-toggle-button {
  min-width: 136px;
  white-space: nowrap;
}

.columns-button {
  color: var(--accent-dark);
}

.bulk-panel-button {
  color: var(--accent-dark);
}

.columns-menu,
.action-menu {
  position: relative;
  display: inline-flex;
}

.sort-button,
.group-button {
  color: var(--accent-dark);
}

.filter-button {
  color: var(--accent-dark);
}

.columns-button.active,
.columns-button.active:hover,
.columns-button.active:focus-visible,
.bulk-panel-button.active,
.bulk-panel-button.active:hover,
.bulk-panel-button.active:focus-visible,
.sort-button.active,
.sort-button.active:hover,
.sort-button.active:focus-visible,
.group-button.active,
.group-button.active:hover,
.group-button.active:focus-visible,
.filter-button.active,
.filter-button.active:hover,
.filter-button.active:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.toolbar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f7;
}

.toolbar-head h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 16px;
  line-height: 1.2;
}

.toolbar-details {
  display: grid;
  gap: 10px;
}

.toolbar-main {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(138px, 180px));
  align-items: end;
  gap: 8px;
}

.toolbar-main label {
  min-width: 0;
}

.toolbar-main .search-control {
  min-width: 0;
  width: 100%;
}

.toolbar-main .search-control input {
  width: 100%;
  max-width: none;
}

.view-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.saved-view-picker {
  position: relative;
}

.saved-view-button {
  display: inline-flex;
  width: 220px;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  color: #0f2f5f;
  font-weight: 600;
}

.saved-view-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-view-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.saved-view-button[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #dbeafe;
}

.icon-action-button {
  display: inline-grid;
  width: 36px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  color: var(--accent-dark);
}

.icon-action-button svg {
  width: 18px;
  height: 18px;
}

.detail-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.saved-view-panel {
  position: absolute;
  z-index: 35;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.16);
}

.saved-view-section + .saved-view-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}

.saved-view-section > span {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.saved-view-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 4px;
  border-radius: var(--radius);
}

.saved-view-row.active {
  background: #eff6ff;
}

.saved-view-choice {
  display: grid;
  width: 100%;
  min-height: 46px;
  justify-items: start;
  gap: 2px;
  border-color: transparent;
  background: transparent;
  padding: 7px 8px;
  text-align: left;
}

.saved-view-choice:hover,
.saved-view-row.active .saved-view-choice {
  border-color: transparent;
  background: #eff6ff;
}

.saved-view-choice strong {
  max-width: 100%;
  overflow: hidden;
  color: #0f3b78;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-view-choice span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-view-delete {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  align-self: center;
  place-items: center;
  border-color: transparent;
  background: transparent;
  color: #8a94a6;
  padding: 0;
}

.saved-view-delete:hover,
.saved-view-delete:focus-visible {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--bad);
}

.saved-view-delete svg {
  width: 17px;
  height: 17px;
}

.saved-view-empty {
  margin: 4px 8px 2px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .toolbar-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar-main {
    grid-template-columns: 1fr;
  }

  .view-controls {
    justify-content: flex-start;
  }

  .saved-view-button {
    width: min(260px, calc(100vw - 108px));
  }
}

.toolbar input {
  max-width: 360px;
}

.toolbar select {
  max-width: 220px;
}

.bulk-actions {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: auto minmax(340px, 1fr) auto;
  align-items: end;
  gap: 12px;
  min-width: 0;
}

.bulk-actions select,
.bulk-actions input {
  max-width: none;
  height: 34px;
  padding: 6px 9px;
}

.selection-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid #bfd3ea;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
}

.selection-status {
  min-width: 150px;
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 34px;
  padding-right: 14px;
  border-right: 1px solid #cfe0f3;
}

.selection-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.selection-status strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.selection-shortcut {
  height: 34px;
  padding: 6px 10px;
  border: 1px solid #bfd3ea;
  border-radius: var(--radius);
  background: #fff;
  color: var(--accent-dark);
  font-weight: 700;
}

.bulk-selection-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px;
}

.bulk-selection-tools button,
.bulk-actions button {
  height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.bulk-fields {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(180px, 260px);
  align-items: end;
  justify-content: start;
  gap: 8px;
}

.bulk-fields label {
  min-width: 0;
  display: block;
}

.bulk-apply {
  min-height: 34px;
  padding-inline: 16px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.bulk-apply:disabled {
  background: #eef2f7;
  border-color: var(--line);
  color: var(--muted);
}

.selection-shortcut:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
}

.bulk-check,
.inline-check {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.bulk-check input,
.inline-check input,
.card-select input {
  width: auto;
}

.filter-groups {
  display: grid;
  grid-template-columns: repeat(10, minmax(92px, 1fr));
  align-items: stretch;
  gap: 6px;
  max-width: 100%;
}

.date-filter {
  display: grid;
  gap: 8px;
  width: min(460px, calc(100vw - 32px));
  min-width: min(420px, calc(100vw - 32px));
  padding: 10px;
  border-top: 1px solid var(--line);
}

.date-filter fieldset {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.date-filter legend {
  padding: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 6px;
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.date-presets button,
.date-filter > button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.date-range label {
  min-width: 0;
}

.date-filter input {
  max-width: none;
}

.date-filter input[type="date"] {
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23174b82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 16px 16px;
}

.date-filter-menu summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.date-filter-menu summary span::before,
.date-range label::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background-color: var(--accent-dark);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.date-range label {
  position: relative;
}

.date-range label::before {
  position: absolute;
  left: 10px;
  bottom: 9px;
  pointer-events: none;
}

.action-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 370px;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.18);
}

.group-panel {
  width: 340px;
}

.action-popover header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--line);
}

.action-popover header strong {
  color: var(--accent-dark);
}

.action-popover header span {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-option-list,
.group-option-list {
  display: grid;
  gap: 4px;
}

.group-levels {
  display: grid;
  gap: 10px;
}

.group-levels label {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.group-levels label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.group-levels select {
  width: 100%;
  min-height: 34px;
}

.group-reset {
  min-height: 32px;
  justify-self: end;
  padding: 5px 10px;
  color: var(--accent-dark);
  font-weight: 600;
}

.sort-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border-radius: 6px;
}

.sort-option-row.is-active,
.group-option-list button.active {
  background: #f2f7ff;
}

.sort-option-row > button,
.group-option-list button {
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 600;
}

.sort-option-row > button:hover,
.group-option-list button:hover {
  background: #f5f8fc;
}

.direction-buttons {
  display: inline-flex;
  gap: 4px;
}

.direction-buttons button {
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
}

.direction-buttons button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-menu {
  position: relative;
  min-width: 0;
}

.filter-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  list-style: none;
}

.filter-menu[open] summary {
  border-color: var(--accent);
  background: #f6faff;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.date-filter-menu {
  min-width: 0;
}

@media (max-width: 1180px) {
  .filter-groups {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .filter-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.date-filter-menu .date-filter {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 25;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.16);
}

.toolbar-main .date-filter-menu:nth-last-child(-n+2) .date-filter {
  right: 0;
  left: auto;
}

@media (max-width: 520px) {
  .date-range {
    grid-template-columns: 1fr;
  }
}

.check-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 25;
  display: grid;
  gap: 3px;
  width: min(520px, calc(100vw - 32px));
  min-width: min(320px, calc(100vw - 32px));
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.16);
}

.check-list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.check-list-actions button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.check-list-actions button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
}

.check-list-actions span {
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.check-list-empty {
  margin: 4px 2px;
  color: var(--muted);
  font-size: 13px;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 4px;
  font-weight: 400;
}

.check-row:hover {
  background: #f3f6fa;
}

.check-row.is-selected {
  background: #eef5ff;
  color: var(--accent-dark);
}

.check-row input {
  width: auto;
}

.check-row span {
  min-width: 0;
  overflow: visible;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.filter-groups .filter-menu:nth-last-child(-n+5) .check-list {
  right: 0;
  left: auto;
}

@media (max-width: 1180px) {
  .filter-groups .filter-menu:nth-last-child(-n+5) .check-list {
    right: auto;
    left: 0;
  }

  .filter-groups .filter-menu:nth-child(n+9) .check-list {
    right: 0;
    left: auto;
  }
}

@media (max-width: 760px) {
  .filter-groups .filter-menu .check-list {
    right: auto;
    left: 0;
  }

  .filter-groups .filter-menu:nth-child(even) .check-list {
    right: 0;
    left: auto;
  }
}

.check-row strong {
  color: var(--muted);
  font-size: 12px;
}

.kanban-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 240px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.18);
}

.kanban-options header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--line);
}

.kanban-options header strong {
  color: var(--accent-dark);
}

.kanban-options header span {
  color: var(--muted);
  font-size: 12px;
}

.column-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.check-option {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-weight: 400;
  line-height: 1.2;
}

.check-option:hover {
  background: #f5f8fc;
}

.check-option input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.content {
  min-height: 360px;
  min-width: 0;
  overflow: hidden;
}

.item-list,
.backlog-list {
  display: grid;
  gap: 10px;
}

.grouped-list {
  display: grid;
  gap: 14px;
}

.nested-groups {
  gap: 8px;
}

.item-group {
  display: grid;
  gap: 8px;
}

.item-group.group-level-2 {
  padding-left: 12px;
  border-left: 3px solid #e5edf8;
}

.item-group.group-level-2 > .group-head {
  padding: 6px 8px;
  background: #f9fbff;
}

.item-group > header,
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.group-head {
  cursor: pointer;
}

.group-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.group-toggle {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.group-toggle::before {
  content: "-";
}

.group-head[aria-expanded="false"] .group-toggle::before {
  content: "+";
}

.group-card-toggle[aria-expanded="false"] .group-toggle::before {
  content: "+";
}

.item-group > header strong,
.group-head strong {
  color: var(--accent-dark);
}

.item-group > header > span:last-child,
.group-head > span:last-child {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 12px;
}

.group-title {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
}

.group-title > span,
.group-level-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group-title strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-group-head {
  position: relative;
  display: grid;
  align-items: start;
  justify-content: stretch;
  justify-items: stretch;
  background:
    linear-gradient(90deg, var(--type-tint, #f8fbff) 0 72px, #fff 72px 100%);
  border-color: #b8c8dd;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding-left: 16px;
  text-align: left;
  overflow: hidden;
}

.relation-group-head::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--type-color, #b8c8dd);
}

.relation-group-head > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  justify-self: stretch;
}

.relation-group-head p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.relation-group-head button {
  flex: 0 0 auto;
}

.relation-group-card {
  cursor: pointer;
  padding-right: 52px;
}

.group-card-head {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
}

.group-card-toggle {
  width: 26px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: #fff;
}

.group-card-toggle .group-toggle {
  border-color: transparent;
}

.group-count-badge {
  border-color: #c8d7ea;
  background: #f5f9ff;
  color: var(--accent-dark);
  font-weight: 700;
}

button.group-count-badge {
  cursor: pointer;
}

button.group-count-badge:disabled {
  cursor: default;
  opacity: 0.72;
}

.group-filter-count-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  z-index: 2;
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid #c8d7ea;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
  transform: translateY(-50%);
}

.relation-attachments-popover {
  position: fixed;
  z-index: 100;
  width: min(430px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.2);
  overflow: auto;
}

.item-attachments-popover,
.item-comments-popover {
  position: fixed;
  z-index: 100;
  width: min(620px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.2);
  overflow: auto;
}

.responsible-picker-popover,
.card-choice-popover {
  position: fixed;
  z-index: 100;
  width: min(420px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.2);
  overflow: auto;
}

.relation-attachments-popover header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf1f7;
}

.responsible-picker-popover header,
.card-choice-popover header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf1f7;
}

.item-attachments-popover header,
.item-comments-popover > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf1f7;
}

.relation-attachments-popover header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-attachments-popover header strong,
.item-comments-popover > header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.responsible-picker-popover header strong,
.card-choice-popover header strong {
  color: var(--accent-dark);
}

.responsible-picker-popover header span,
.card-choice-popover header span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.responsible-picker-list,
.card-choice-list {
  display: grid;
  gap: 4px;
}

.responsible-picker-list button,
.card-choice-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.responsible-picker-list button:hover,
.responsible-picker-list button:focus-visible,
.responsible-picker-list button.is-current,
.card-choice-list button:hover,
.card-choice-list button:focus-visible,
.card-choice-list button.is-current {
  border-color: #bfd5f2;
  background: #f6faff;
}

.responsible-picker-list button.is-current,
.card-choice-list button.is-current {
  box-shadow: inset 3px 0 0 var(--accent);
}

.responsible-picker-list button > span:last-child,
.card-choice-list button > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-choice-visual {
  width: 40px;
  min-width: 40px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.card-choice-list strong,
.card-choice-list small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-choice-list strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.card-choice-list small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.responsible-picker-avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--chip-color, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.responsible-picker-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-choice-code,
.card-choice-color {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
}

.card-choice-code {
  width: 36px;
  border: 1px solid #bdd4f0;
  background: #eef6ff;
  color: #17406f;
  font-size: 9px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-choice-code.is-reference {
  font-size: 8px;
}

.card-choice-color {
  border: 1px solid #b8c8dd;
  background: #eef5ff;
}

.card-choice-color.status-a-qualifier {
  border-color: #f0d58c;
  background: #fff8e1;
}

.card-choice-color.status-a-recetter {
  border-color: #f0c36a;
  background: #fff7df;
}

.card-choice-color.status-backlog {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.card-choice-color.status-nouveau {
  border-color: #b8c8dd;
  background: #eef5ff;
}

.card-choice-color.status-a-faire {
  border-color: #93c5fd;
  background: #eff6ff;
}

.card-choice-color.status-en-cours {
  border-color: #67e8f9;
  background: #ecfeff;
}

.card-choice-color.priority-normale,
.card-choice-color.urgency-normale,
.card-choice-color.category-documentation {
  border-color: #93c5fd;
  background: #2563eb;
}

.card-choice-color.status-bloque,
.card-choice-color.status-recette-ko {
  border-color: #f2a0a0;
  background: #fff1f1;
}

.card-choice-color.priority-critique,
.card-choice-color.urgency-bloquante,
.card-choice-color.category-bug {
  border-color: #f2a0a0;
  background: #dc2626;
}

.card-choice-color.status-fait {
  border-color: #a7d8bb;
  background: #edf8f2;
}

.card-choice-color.status-integre {
  border-color: #5eead4;
  background: #ccfbf1;
}

.card-choice-color.status-abandonne {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.card-choice-color.priority-basse,
.card-choice-color.urgency-faible,
.card-choice-color.category-technique {
  border-color: #cbd5e1;
  background: #64748b;
}

.card-choice-color.priority-haute,
.card-choice-color.urgency-forte {
  border-color: #f0a645;
  background: #f97316;
}

.card-choice-color.category-evolution {
  border-color: #c4b5fd;
  background: #7c3aed;
}

.card-choice-color.category-question {
  border-color: #a7d8c0;
  background: #16a34a;
}

.card-choice-color.category-recette {
  border-color: #f0d58c;
  background: #f59e0b;
}

.relation-attachments-popover header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.item-attachments-popover header span,
.item-comments-popover > header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.item-attachments-sections,
.item-attachments-section,
.item-attachments-list {
  display: grid;
  gap: 8px;
}

.item-attachments-section + .item-attachments-section {
  padding-top: 8px;
  border-top: 1px solid #edf1f7;
}

.item-attachments-section h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
}

.item-comment-attachment-row {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.item-comment-attachment-prefix {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.item-comment-attachment-prefix > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.item-comment-summary {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #fbfdff;
}

.item-comment-summary header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-comment-author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.item-comment-author > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-comment-summary p {
  margin: 0;
  color: var(--text);
  line-height: 1.35;
  white-space: pre-wrap;
}

.item-comment-summary p.is-empty {
  color: var(--muted);
  font-style: italic;
}

.item-comment-summary-attachments {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.relation-attachments-list {
  display: grid;
  gap: 6px;
}

.relation-attachments-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px;
  text-align: left;
}

.relation-attachments-list button:hover,
.relation-attachments-list button:focus-visible {
  border-color: var(--accent);
  background: #f6faff;
}

.relation-attachments-list strong,
.relation-attachments-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-attachments-list strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.relation-attachments-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.relation-attachments-list small.badge {
  min-height: 20px;
  padding: 1px 6px;
  font-size: 11px;
}

.relation-attachments-list p {
  margin: 0;
  padding: 8px;
  color: var(--muted);
}

.item-group.has-relation-head > .item-list {
  padding-left: 12px;
  border-left: 3px solid #d8e6f6;
}

.item-group.is-collapsed > .item-list {
  display: none;
}

.item-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 14px 14px 18px;
  background: var(--type-tint, var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.item-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--type-color, var(--line));
}

.type-note {
  --type-color: var(--type-note);
  --type-tint: var(--type-note-soft);
}

.type-story {
  --type-color: var(--type-story);
  --type-tint: var(--type-story-soft);
}

.type-epic {
  --type-color: var(--type-epic);
  --type-tint: var(--type-epic-soft);
}

.type-ticket {
  --type-color: var(--type-ticket);
  --type-tint: var(--type-ticket-soft);
}

.item-card.is-dragging {
  opacity: 0.55;
}

.list-card {
  padding: 10px;
  gap: 8px;
  font-size: 12px;
}

.list-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.list-card-titleline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-card-titleline .item-title {
  min-width: 0;
}

.list-card-controls {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.list-card .item-title {
  font-size: 13px;
  line-height: 1.18;
}

.list-card .item-title button {
  display: block;
  max-width: 100%;
}

.list-card .meta {
  gap: 4px;
  font-size: 11px;
}

.list-card .badge {
  min-height: 20px;
  padding: 1px 6px;
  font-size: 11px;
}

.list-card .quick-chip {
  min-height: 24px;
  font-size: 11px;
}

.list-card .responsible-dot,
.list-card .responsible-quick,
.list-card .priority-quick {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.list-card p {
  margin: 4px 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.card-model-text {
  margin: 4px 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--card-lines, 4);
}

.card-model-text.is-context {
  padding: 6px 8px;
  border: 1px solid #e0e7f1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  line-height: 1.35;
}

.card-model-fields {
  min-width: 0;
}

.kanban .item-card .card-model-fields {
  overflow: visible;
}

.user-reference-chip {
  gap: 5px;
}

.responsible-dot.tiny {
  width: 18px;
  height: 18px;
  font-size: 9px;
}

.item-type-badge.type-note {
  border-color: color-mix(in srgb, var(--type-note) 45%, #fff);
  background: color-mix(in srgb, var(--type-note) 12%, #fff);
  color: #7a5a00;
}

.item-type-badge.type-story {
  border-color: color-mix(in srgb, var(--type-story) 45%, #fff);
  background: color-mix(in srgb, var(--type-story) 10%, #fff);
  color: #216e4e;
}

.item-type-badge.type-epic {
  border-color: color-mix(in srgb, var(--type-epic) 45%, #fff);
  background: color-mix(in srgb, var(--type-epic) 10%, #fff);
  color: #5b2b83;
}

.item-type-badge.type-ticket {
  border-color: color-mix(in srgb, var(--type-ticket) 45%, #fff);
  background: color-mix(in srgb, var(--type-ticket) 10%, #fff);
  color: #9f201c;
}

.effort-badge,
.date-chip,
.score-chip,
.relation-reference-chip {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.empty-state {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.card-select {
  flex: 0 0 auto;
  padding-top: 3px;
}

.item-title {
  margin: 0;
  font-size: 16px;
  min-width: 0;
}

.item-title button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-badge {
  border-color: #bcd5f5;
  background: #eef6ff;
  color: #17406f;
}

.reference-logo-chip {
  gap: 5px;
}

.reference-logo-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-logo-bubble {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #bdd0e7;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-dark);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.reference-logo-bubble img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.reference-logo-only-chip {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 2px;
  justify-content: center;
}

.reference-logo-only-chip .reference-logo-bubble {
  width: 20px;
  height: 20px;
}

.category-badge {
  border-color: #d8c8f0;
  background: #fbf7ff;
  color: #5b2b83;
}

.category-bug {
  border-color: #f2a0a0;
  background: #fff1f1;
  color: #b42318;
}

.category-question {
  border-color: #a7d8c0;
  background: #f0fdf4;
  color: #216e4e;
}

.category-documentation {
  border-color: #bfd0e7;
  background: #f6faff;
  color: #174b82;
}

.category-technique {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.category-recette {
  border-color: #f0d58c;
  background: #fff8e1;
  color: #9a6700;
}

.urgency-badge {
  border-color: #d1d5db;
  background: #f8fafc;
  color: #334155;
}

.urgency-forte {
  border-color: #f0a645;
  background: #fff7ed;
  color: #b45309;
}

.urgency-bloquante {
  border-color: #f2a0a0;
  background: #fff1f1;
  color: #b42318;
}

.urgency-faible {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.badge.status {
  border-color: #b8c8dd;
  background: #eef5ff;
}

.badge.done {
  border-color: #b8dec9;
  background: #edf8f2;
  color: var(--ok);
}

.badge.warn {
  border-color: #f0d58c;
  background: #fff8e1;
  color: var(--warn);
}

.badge.bad {
  border-color: #f4b7b2;
  background: #fff0ef;
  color: var(--bad);
}

.quick-chip {
  display: inline-grid;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 10px;
  border: 1px solid #b8c8dd;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.quick-chip > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.quick-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
}

.chip-picker:hover,
.chip-picker:focus-visible,
.priority-quick:hover,
.priority-quick:focus-visible {
  filter: brightness(0.98);
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

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

.user-input-field input {
  min-width: 0;
  width: 100%;
}

.user-input-badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--user-color, var(--accent)) 62%, #fff);
  border-radius: 999px;
  background: var(--user-color, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.user-input-badge.is-empty {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.user-input-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.responsible-dot,
.responsible-quick {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--chip-color, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.responsible-quick {
  position: relative;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.responsible-quick:hover,
.responsible-quick:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--chip-color, var(--accent)) 55%, #fff);
  outline-offset: 2px;
}

.priority-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid #7ea9d6;
  border-radius: 999px;
  background: #eaf4ff;
  color: #145da0;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
}

.priority-mark > span {
  display: block;
  line-height: 1;
  transform: translateY(-0.5px);
}

.priority-quick {
  padding: 0;
  cursor: pointer;
}

.priority-mark.is-basse {
  border-color: #6b7280;
  background: #6b7280;
  color: #fff;
}

.priority-mark.is-haute {
  border-color: #f0a645;
  background: #fff3df;
  color: #b45309;
}

.priority-mark.is-critique {
  border-color: #f2a0a0;
  background: #fff1f1;
  color: #b42318;
}

.admin-board {
  display: grid;
  gap: 14px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.admin-tabs button {
  min-height: 34px;
  padding: 6px 12px;
  border-color: transparent;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 700;
}

.admin-tabs button.active {
  border-color: #bfd0e7;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 35, 70, 0.08);
}

.admin-info {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d8e6f6;
  border-radius: var(--radius);
  background: #f7fbff;
}

.admin-info strong {
  color: var(--accent-dark);
  font-size: 16px;
}

.admin-info p {
  margin: 0;
  color: #46576d;
}

.admin-info span {
  font-weight: 700;
  color: var(--text);
}

.admin-logs-card {
  gap: 14px;
}

.admin-logs-toolbar,
.admin-logs-actions,
.admin-logs-summary,
.admin-log-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-logs-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
}

.admin-logs-filters {
  flex-wrap: wrap;
}

.admin-logs-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-logs-summary {
  flex-wrap: wrap;
}

.admin-logs-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #d9e4f2;
  border-radius: 6px;
  background: #f7fbff;
  color: #42536a;
}

.admin-log-purge {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) minmax(100px, 140px) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #f0c8c3;
  border-radius: 6px;
  background: #fff8f7;
}

.admin-log-purge > div {
  display: grid;
  gap: 3px;
}

.admin-log-purge strong {
  color: var(--bad);
}

.admin-log-purge span,
.success-message {
  color: #52647a;
}

.admin-log-purge label {
  display: grid;
  gap: 4px;
  color: #334155;
  font-weight: 700;
}

.success-message {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #b8dec3;
  border-radius: 6px;
  background: #f2fbf4;
}

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

.admin-log-row {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.admin-log-head {
  flex-wrap: wrap;
}

.admin-log-head strong {
  color: var(--text);
}

.admin-log-head time {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.admin-log-row p {
  margin: 0;
  color: #3e4f65;
  overflow-wrap: anywhere;
}

.system-status-card {
  gap: 14px;
}

.system-status-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.system-status-toolbar > div {
  display: grid;
  gap: 3px;
}

.system-status-actions {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.system-status-toolbar strong {
  color: var(--text);
}

.system-status-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.system-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.system-status-tile {
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 12px;
  border: 1px solid #d9e4f2;
  border-radius: 6px;
  background: #f8fbff;
}

.system-status-tile span {
  color: #52647a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.system-status-tile strong {
  color: var(--text);
  font-size: 18px;
}

.system-status-tile p {
  margin: 0;
  color: #3e4f65;
  overflow-wrap: anywhere;
}

.system-volume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.system-volume-grid span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #52647a;
}

.system-volume-grid strong {
  color: var(--text);
  font-size: 18px;
}

.admin-card,
.admin-user-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-card h2 {
  margin: 0;
  font-size: 18px;
}

.card-model-admin {
  gap: 14px;
}

.card-model-admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.card-model-admin-actions .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.card-model-fixed-note {
  padding: 10px 12px;
  border: 1px solid #e0e7f1;
  border-radius: var(--radius);
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
}

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

.card-model-column {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dce5f2;
  border-radius: var(--radius);
  background: #fbfdff;
}

.card-model-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5edf7;
}

.card-model-column > header strong {
  color: var(--accent-dark);
  font-size: 15px;
}

.card-model-column > header span {
  color: var(--muted);
  font-size: 12px;
}

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

.card-model-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e1e9f4;
  border-radius: var(--radius);
  background: #fff;
}

.card-model-row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.card-model-move-actions {
  display: inline-flex;
  gap: 4px;
}

.card-model-move-actions .square-icon-button {
  width: 28px;
  height: 28px;
}

.card-model-move-actions .square-icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.card-model-field-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.card-model-field-text strong,
.card-model-field-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-model-field-text strong {
  color: var(--text);
}

.card-model-field-text small {
  color: var(--muted);
  font-size: 12px;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-dark);
  font-weight: 700;
}

.card-model-lines {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.card-model-lines input {
  width: 70px;
}

.card-model-display-mode {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.card-model-display-mode select {
  min-width: 120px;
  height: 30px;
}

.admin-users {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(560px, 1fr));
  align-items: start;
  gap: 12px;
}

.admin-users-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-users-headline span {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #cfd9e8;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.admin-user-search {
  display: grid;
  max-width: 520px;
}

.admin-user-card {
  align-content: start;
}

.admin-user-card .admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-user-card .admin-grid .mobile-field {
  grid-column: 1 / -1;
}

.admin-user-card .admin-grid button {
  justify-self: start;
}

.admin-user-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-user-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--user-color, var(--accent)) 50%, #fff);
  border-radius: 50%;
  background: var(--user-color, var(--accent));
  color: #fff;
  font-weight: 800;
}

.admin-user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-user-title strong,
.admin-user-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-title strong {
  color: var(--accent-dark);
}

.admin-user-title span,
.admin-user-photo-message {
  color: #5b6b80;
  font-size: 12px;
}

.admin-user-photo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-photo-message {
  grid-column: 2 / -1;
  min-height: 15px;
}

.admin-user-safety-note {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #f0d58a;
  border-radius: 6px;
  background: #fff8db;
  color: #715100;
  font-size: 12px;
  font-weight: 700;
}

.admin-users-headline > div,
.admin-users-headline-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.admin-user-filter-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #dce7f4;
  border-radius: var(--radius);
  background: #f8fbff;
}

.admin-user-filter-panel .filter-menu {
  min-width: 0;
}

.admin-user-filter-panel .check-list {
  min-width: 240px;
}

.admin-user-filter-panel label {
  display: grid;
  gap: 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.admin-user-filter-panel select {
  min-width: 0;
}

.admin-users.is-list-view,
.admin-users.is-card-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-user-group {
  display: grid;
  gap: 8px;
}

.admin-user-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #dce7f4;
  border-radius: var(--radius);
  background: #f8fbff;
}

.admin-user-group > header strong {
  color: var(--accent-dark);
}

.admin-user-group > header span {
  min-width: 26px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd8e9;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.admin-user-list,
.admin-user-cards {
  display: grid;
  gap: 8px;
}

.admin-user-cards {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-user-row,
.admin-user-summary-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d8e2ef;
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.admin-user-row:hover,
.admin-user-row:focus-visible,
.admin-user-summary-card:hover,
.admin-user-summary-card:focus-visible {
  border-color: var(--accent);
  background: #f8fbff;
  outline: none;
}

.admin-user-summary-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.admin-user-summary-detail {
  min-height: 18px;
  margin: 0;
  overflow: hidden;
  color: #46576d;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.admin-user-scope-chip {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid #c7d8ee;
  border-radius: 999px;
  background: #f3f8ff;
  color: #123b67;
  font-size: 12px;
  font-weight: 700;
}

.admin-user-scope-chip.is-empty {
  padding: 3px 8px;
  color: #5b6b80;
}

.admin-user-scope-part {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
}

.admin-user-scope-part + .admin-user-scope-part {
  border-left: 1px solid #c9d9ee;
}

.admin-user-scope-part > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-scope-project {
  color: #35516f;
}

.admin-user-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-user-summary-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid #d4e1f0;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-summary-card {
  min-height: 138px;
  align-content: start;
}

.admin-user-dialog {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #ccd8e7;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.admin-user-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.admin-user-dialog-shell {
  position: relative;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 48px);
  padding: 18px;
  overflow: auto;
  background: #f8fbff;
}

.admin-user-dialog-title {
  display: grid;
  gap: 2px;
  padding-right: 44px;
}

.admin-user-dialog-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.admin-user-dialog-title span {
  color: var(--muted);
  font-size: 13px;
}

.admin-user-dialog .dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.admin-user-editor-card {
  box-shadow: none;
}

.assignment-editor {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: #f8fbff;
}

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

.assignment-editor-head div {
  display: grid;
  gap: 2px;
}

.assignment-editor-head strong {
  color: var(--accent-dark);
}

.assignment-editor-head span {
  color: #5b6b80;
  font-size: 12px;
}

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

.assignment-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  background: #fff;
}

.assignment-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assignment-row-head strong {
  color: var(--accent-dark);
  font-size: 13px;
}

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

.assignment-grid label {
  min-width: 0;
}

.assignment-grid select {
  width: 100%;
  min-width: 0;
}

.assignment-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.assignment-permissions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
}

.assignment-permissions legend {
  padding: 0 6px;
  color: #5b6b80;
  font-size: 12px;
  font-weight: 800;
}

.assignment-permission {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: #10213b;
  font-size: 12px;
  font-weight: 600;
}

.assignment-permission input {
  width: 14px;
  height: 14px;
}

.assignment-permission.is-disabled {
  color: #94a3b8;
}

.assignment-permission.is-disabled input {
  cursor: not-allowed;
}

.mobile-field {
  min-width: 0;
}

.mobile-input-group {
  display: grid;
  grid-template-columns: 34px 88px minmax(130px, 1fr);
  align-items: center;
  gap: 6px;
}

.mobile-flag {
  display: inline-block;
  width: 27px;
  height: 18px;
  border: 1px solid #b8c6d8;
  border-radius: 3px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.mobile-input-group select,
.mobile-input-group input {
  min-width: 0;
}

.mobile-input-group select {
  padding-right: 6px;
  text-align: center;
  text-align-last: center;
}

@media (max-width: 760px) {
  .card-model-columns {
    grid-template-columns: 1fr;
  }

  .admin-users {
    grid-template-columns: 1fr;
  }

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

  .assignment-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .mobile-input-group {
    grid-template-columns: 34px 88px minmax(0, 1fr);
  }
}

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

.reference-create-form {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.reference-row {
  padding: 10px;
  border: 1px solid #e1e9f4;
  border-radius: var(--radius);
  background: #fbfdff;
}

.reference-row-with-logo {
  align-items: start;
}

.reference-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.reference-actions .inline-check {
  min-height: 34px;
  margin-right: auto;
  padding: 0 10px;
  border: 1px solid #dce7f4;
  border-radius: var(--radius);
  background: #fff;
  color: #18365f;
}

.reference-actions button {
  min-width: 160px;
}

.reference-logo-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e6edf6;
}

.reference-logo-preview {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #bdd0e7;
  border-radius: 50%;
  background: #eef5ff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.reference-logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.reference-logo-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.reference-logo-main strong {
  color: var(--accent-dark);
}

.reference-logo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reference-logo-message {
  min-height: 15px;
  color: #5b6b80;
  font-size: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: end;
  gap: 10px;
}

.reference-admin-card-instances .admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.reference-admin-card-instances .admin-grid label {
  min-width: 0;
}

.reference-admin-card-instances .admin-grid select,
.reference-admin-card-instances .admin-grid input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
}

.admin-grid .span-all {
  grid-column: 1 / -1;
}

.admin-grid textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
}

.admin-grid button,
.password-row button {
  align-self: end;
}

.password-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.password-row strong {
  flex: 1 1 100%;
  color: var(--accent-dark);
}

.password-row label {
  min-width: min(260px, 100%);
}

.user-link-code-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, auto) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.user-link-code-row strong {
  color: var(--accent-dark);
}

.user-link-code-row code {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.92rem;
  text-align: center;
}

.user-link-code-row span {
  grid-column: 1 / 3;
  color: var(--muted);
  font-size: 0.9rem;
}

.user-link-code-row button {
  grid-column: 3;
  grid-row: 1 / 3;
}

.admin-color-field input[type="color"] {
  width: 44px;
  min-width: 44px;
  height: 34px;
  padding: 3px;
  border-radius: 8px;
  cursor: pointer;
}

button.danger {
  border-color: #f4b7b2;
  color: var(--bad);
}

.kanban {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.kanban-column {
  flex: 0 0 232px;
  width: 232px;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.kanban-column.is-collapsed {
  flex-basis: 44px;
  width: 44px;
  min-height: 180px;
  justify-items: center;
  padding: 8px 6px;
}

.kanban-column.is-drop-target {
  border-color: var(--accent);
  background: #f5f8ff;
}

.kanban-column-toggle {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.kanban-column-toggle:hover .kanban-column-title {
  color: var(--accent);
}

.kanban-column-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-column-count {
  flex: 0 0 auto;
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kanban-column-body {
  display: grid;
  gap: 8px;
}

.kanban-column.is-collapsed .kanban-column-toggle {
  min-height: 160px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.kanban-column.is-collapsed .kanban-column-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.kanban-column.is-collapsed .kanban-column-body {
  display: none;
}

.kanban .item-card {
  width: 100%;
  min-width: 0;
  padding: 10px;
  gap: 8px;
  font-size: 12px;
  overflow: hidden;
}

.kanban-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.kanban-card-head.group-card-head {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
}

.kanban .item-title {
  font-size: 13px;
  line-height: 1.18;
  min-width: 0;
}

.kanban .item-title button {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.kanban .meta {
  display: flex;
  min-width: 0;
  gap: 4px;
  font-size: 11px;
  overflow: hidden;
}

.kanban .badge {
  min-height: 20px;
  min-width: 0;
  padding: 1px 6px;
  font-size: 11px;
}

.kanban .context-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban .quick-chip {
  min-height: 24px;
  font-size: 11px;
}

.kanban .responsible-dot,
.kanban .responsible-quick,
.kanban .priority-quick {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.kanban .item-card p {
  margin: 4px 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.kanban .item-card .card-model-text,
.list-card .card-model-text {
  -webkit-line-clamp: var(--card-lines, 4);
}

.kanban .item-card .card-model-text.is-context,
.list-card .card-model-text.is-context {
  display: block;
  max-height: calc((var(--card-lines, 4) * 1.35em) + 16px);
  -webkit-line-clamp: initial;
}

.list-card .kanban-card-head {
  grid-template-columns: auto minmax(120px, 1fr) auto auto;
}

.list-card .kanban-card-head.group-card-head {
  grid-template-columns: auto auto minmax(120px, 1fr) auto auto;
}

.kanban-card-head .status-quick {
  justify-self: center;
  width: max-content;
  max-width: 100%;
}

.quick-chip.status-quick,
.badge.status-quick {
  width: auto;
  min-width: 0;
  max-width: 180px;
  justify-content: center;
  padding-right: 10px;
  padding-left: 10px;
  text-align: center;
  text-align-last: center;
}

.badge.status-quick {
  padding-right: 10px;
}

.quick-chip.status-nouveau,
.badge.status-nouveau {
  border-color: #b8c8dd;
  background: #eef5ff;
  color: #174b82;
}

.quick-chip.status-a-qualifier,
.badge.status-a-qualifier {
  border-color: #f0d58c;
  background: #fff8e1;
  color: #9a6700;
}

.quick-chip.status-backlog,
.badge.status-backlog {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #5b21b6;
}

.quick-chip.status-a-faire,
.badge.status-a-faire {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.quick-chip.status-en-cours,
.badge.status-en-cours {
  border-color: #67e8f9;
  background: #ecfeff;
  color: #0e7490;
}

.quick-chip.status-bloque,
.quick-chip.status-recette-ko,
.badge.status-bloque,
.badge.status-recette-ko {
  border-color: #f2a0a0;
  background: #fff1f1;
  color: #b42318;
}

.quick-chip.status-a-recetter,
.badge.status-a-recetter {
  border-color: #f0c36a;
  background: #fff7df;
  color: #92400e;
}

.quick-chip.status-fait,
.badge.status-fait {
  border-color: #a7d8bb;
  background: #edf8f2;
  color: #216e4e;
}

.quick-chip.status-integre,
.badge.status-integre {
  border-color: #5eead4;
  background: #ccfbf1;
  color: #0f766e;
}

.quick-chip.status-abandonne,
.badge.status-abandonne {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

dialog {
  width: min(920px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.35);
}

#detail-dialog {
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

#detail-dialog.is-positioned {
  position: fixed;
  inset: auto;
  margin: 0;
}

.item-form,
.detail-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.detail-panel {
  position: relative;
  height: 100%;
  max-height: inherit;
  overflow: auto;
}

.item-form > header,
.detail-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.detail-drag-handle {
  cursor: move;
  user-select: none;
  touch-action: none;
}

#detail-dialog.is-moving,
#detail-dialog.is-resizing {
  user-select: none;
}

.detail-resize-handle {
  position: sticky;
  right: 0;
  bottom: 0;
  justify-self: end;
  align-self: end;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: -10px -10px -8px 0;
  padding: 0;
  border: 0;
  background:
    linear-gradient(135deg, transparent 0 48%, #9fb2ca 49% 55%, transparent 56%),
    linear-gradient(135deg, transparent 0 66%, #9fb2ca 67% 73%, transparent 74%);
  cursor: nwse-resize;
}

.detail-resize-handle:hover,
.detail-resize-handle:focus-visible {
  outline: 2px solid #c8d7ea;
  outline-offset: 2px;
}

.item-form h2,
.detail-panel h2,
.detail-panel h3 {
  margin: 0;
}

#detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(74px, auto);
  gap: 8px;
  margin: 8px 0 0;
  padding-right: 50px;
}

.detail-meta-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 28px;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid #d8e3f1;
  border-radius: 12px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.detail-meta-chip span {
  white-space: nowrap;
}

.detail-meta-chip strong {
  min-width: 0;
  color: var(--accent-dark);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-meta-score {
  grid-template-columns: auto auto;
}

.detail-meta-score strong {
  overflow: visible;
}

@media (max-width: 900px) {
  #detail-meta {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.square-icon-button {
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  border-color: #c9d6e5;
  background: #fff;
  color: var(--accent-dark);
}

.square-icon-button svg {
  width: 18px;
  height: 18px;
}

.square-icon-button.danger-icon {
  border-color: #f4b7b2;
  color: var(--bad);
}

.description-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pending-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -4px;
}

.pending-attachment {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 9px;
  border: 1px solid #c9d6e5;
  border-radius: 999px;
  background: #f8fbff;
  color: #0f2f5f;
  font-size: 12px;
}

.pending-attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-attachment button {
  display: inline-grid;
  width: 18px;
  height: 18px;
  min-height: 18px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e8eef6;
  color: #475467;
  font-size: 12px;
  line-height: 1;
}

.pending-attachment button:hover,
.pending-attachment button:focus-visible {
  background: #fff1f1;
  color: var(--bad);
}

.detail-body {
  white-space: pre-wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.detail-note-attachments {
  display: grid;
  gap: 10px;
  margin-top: -4px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.detail-note-attachments[hidden] {
  display: none;
}

.detail-attachment-section {
  display: grid;
  gap: 6px;
}

.detail-attachment-section h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 14px;
}

.detail-attachment-list {
  display: grid;
  gap: 6px;
}

.comment-attachment-summary {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.comment-attachment-prefix {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.comment-attachment-prefix > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-edit-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #f8fbff;
}

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

.detail-edit-grid .span-2 {
  grid-column: span 2;
}

.detail-edit-grid .span-4 {
  grid-column: 1 / -1;
}

.detail-edit-form textarea {
  min-height: 110px;
}

.context-field {
  min-width: 0;
}

.context-readable {
  min-height: 110px;
  max-height: 150px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #d5e0ee;
  border-radius: 7px;
  background: #fff;
}

.context-readable-grid {
  display: grid;
  gap: 8px;
  margin: 0;
}

.context-readable-grid > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f8;
}

.context-readable-grid > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.context-readable-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.context-readable-grid dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.context-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.context-field textarea[hidden],
.context-readable[hidden] {
  display: none;
}

.detail-edit-form footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.detail-edit-form .message {
  flex: 1;
}

.detail-panel.is-attachment-dragover,
.inline-form textarea.is-attachment-dragover,
#item-body.is-attachment-dragover {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  background: #eef7fb;
}

.comment,
.history-entry {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin: 8px 0;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 8px;
}

.comment-author-badge {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--user-color, var(--accent)) 60%, #fff);
  border-radius: 999px;
  background: var(--user-color, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.comment-author-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.comment-date {
  color: var(--muted);
  font-size: 13px;
}

.comment-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #d5dfec;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.comment-visibility-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.comment-visibility-badge.is-internal {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.comment-visibility-badge.is-client {
  border: 1px solid #b7dfc6;
  background: #f0fdf4;
  color: #166534;
}

.comment-visibility-control {
  display: inline-flex;
  align-items: center;
}

.comment-visibility-control select {
  width: auto;
  min-width: 86px;
  height: 24px;
  padding: 1px 22px 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.comment-attachment-button {
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
}

.comment-attachment-button svg {
  width: 16px;
  height: 16px;
}

.comment p {
  margin: 0;
}

.comment-compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.comment-compose .pending-attachments {
  margin: 0;
}

.history-entry {
  display: grid;
  gap: 4px;
}

.history-entry p {
  margin: 0;
}

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

.relation-grid > div,
.context-grid > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.relation-grid span,
.context-grid dt {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.context-grid {
  margin: 0;
}

.context-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.relation-open-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--accent-dark);
}

.relation-open-icon svg {
  width: 17px;
  height: 17px;
}

.relation-link {
  width: 100%;
  margin-top: 4px;
  text-align: left;
  background: #fff;
}

.relation-link span {
  color: var(--text);
}

.relation-empty {
  display: block;
  margin-top: 4px;
}

.comment-attachments {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.attachment-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin: 8px 0;
}

.attachment-pill.is-compact {
  padding: 6px 8px;
  margin: 4px 0;
}

.attachment-thumb {
  width: 44px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  flex: 0 0 auto;
}

.attachment-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.attachment-main strong,
.attachment-main .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.attachment-action-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  text-decoration: none;
}

.attachment-action-button svg {
  width: 16px;
  height: 16px;
}

.attachment-action-button:hover,
.attachment-action-button:focus-visible {
  border-color: var(--accent);
  background: #eef5ff;
  color: var(--accent);
}

.attachment-action-button.is-danger {
  border-color: #f2b4ad;
  color: var(--bad);
}

.attachment-action-button.is-danger:hover,
.attachment-action-button.is-danger:focus-visible {
  border-color: var(--bad);
  background: #fff0ef;
  color: var(--bad);
}

.file-type-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid #b8c8dd;
  border-radius: 8px;
  background: #eef5ff;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}

.file-type-icon.is-img {
  border-color: #b8dec9;
  background: #edf8f2;
  color: var(--ok);
}

.file-type-icon.is-pdf {
  border-color: #f4b7b2;
  background: #fff0ef;
  color: var(--bad);
}

.file-type-icon.is-doc,
.file-type-icon.is-xml {
  border-color: #b8c8dd;
  background: #eef5ff;
}

.file-type-icon.is-xls {
  border-color: #b8dec9;
  background: #edf8f2;
  color: var(--ok);
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.button-link:hover {
  border-color: var(--accent);
}

.attachment-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.attachment-preview > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.attachment-preview h2,
.attachment-preview p {
  margin: 0;
}

.attachment-preview-body {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  overflow: auto;
}

.attachment-preview-body img,
.attachment-preview-body iframe {
  width: 100%;
  max-height: 70vh;
  border: 0;
}

.attachment-preview-body img {
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.attachment-preview-body iframe {
  min-height: 70vh;
}

.attachment-text-preview {
  width: 100%;
  min-height: 360px;
  max-height: 70vh;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #fff;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.attachment-text-preview.is-code {
  font-family: Consolas, "Courier New", monospace;
}

.attachment-preview-message,
.attachment-preview-fallback {
  max-width: 560px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.attachment-preview-fallback {
  display: grid;
  gap: 8px;
}

.attachment-preview-fallback p,
.attachment-preview-fallback span {
  margin: 0;
}

.attachment-preview-fallback p {
  color: var(--text);
  font-weight: 700;
}

.inline-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 1180px) {
  .header-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .item-head {
    align-items: stretch;
    flex-direction: column;
  }

  .header-logo {
    height: 48px;
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }

  .header-metrics {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-left: 0;
    border-left: 0;
  }

  .session {
    grid-column: 3;
    justify-self: end;
  }

  .view-actions {
    margin-left: 2px;
  }

  .form-grid,
  .detail-edit-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2,
  .detail-edit-grid .span-2,
  .detail-edit-grid .span-4 {
    grid-column: 1 / -1;
  }

  .selection-panel,
  .bulk-actions,
  .bulk-fields {
    grid-template-columns: 1fr;
  }

  .selection-status {
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid #cfe0f3;
  }

}

@media (max-width: 560px) {
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .primary-actions {
    padding-right: 0;
    border-right: 0;
  }

  .view-actions {
    width: 100%;
    padding-left: 0;
    border-left: 0;
  }

  .view-toggle-button {
    flex: 1;
  }

  .header-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-log-purge {
    grid-template-columns: 1fr;
  }
}
