.cadre-mobile-back { display: none; }
.cadre-page, .cadre-profile-drawer {
  --cadre-ink: #102740;
  --cadre-line: #d7e2ed;
  --cadre-muted: #48627e;
  --cadre-accent: #195daf;
  --cadre-tint: #edf3f8;
  color: var(--cadre-ink);
}
.cadre-page { min-width: 0; }
.cadre-heading h2 { margin: 0; }
.cadre-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 var(--pn-gap);
}
.cadre-stats dd { margin: 0; }
.cadre-report { overflow: hidden; }
.cadre-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 15px; }
.cadre-filters :is(input, select, button) {
  min-height: 35px;
  padding: 0 10px;
  border: 1px solid #c6d8eb;
  border-radius: 6px;
  background: #fff;
  color: var(--cadre-ink);
  font: inherit;
  font-size: 13px;
}
.cadre-filters input { flex: 1 1 180px; min-width: 0; max-width: 240px; }
.cadre-filters input::placeholder { color: var(--cadre-muted); }
.cadre-filters select { min-width: 118px; max-width: 100%; }
.cadre-filters button { color: var(--cadre-accent); }
.cadre-filters button:disabled { color: #687d95; opacity: .68; cursor: default; }
.cadre-filters button:not(:disabled):hover { background: #edf5ff; }
.cadre-page :is(button, input, select, a, .cadre-table-scroll):focus-visible { outline: 2px solid var(--cadre-accent); outline-offset: -2px; }

.cadre-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cadre-table :is(th, td) {
  padding: 11px 13px;
  border-top: 1px solid var(--pn-line);
  text-align: left;
  line-height: 1.4;
  white-space: nowrap;
}
.cadre-table thead th { background: #e2effb; color: #344e6a; font-weight: 600; }
.cadre-table tbody tr { cursor: pointer; }
.cadre-table tbody tr:nth-child(even) { background: #f8fafc; }
.cadre-table tbody tr:is(:hover, :focus-within) { background: #edf5ff; }
.cadre-name { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; color: var(--cadre-accent); font-weight: 650; text-align: left; }
.cadre-name > .icon { opacity: .8; }
.cadre-page .cadre-name:focus-visible { outline-offset: 2px; }
.cadre-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.cadre-empty { margin: 0; padding: 34px 12px; color: var(--cadre-muted); text-align: center; }

.drawer.cadre-profile-drawer {
  --cadre-drawer-margin: clamp(10px, 2vw, 20px);
  align-self: flex-start;
  width: min(560px, calc(100% - 2 * var(--cadre-drawer-margin)));
  height: auto;
  max-height: calc(100% - 2 * var(--cadre-drawer-margin));
  margin: var(--cadre-drawer-margin);
  overflow: hidden;
  border: 1px solid var(--cadre-line);
  border-radius: 16px;
  background: var(--cadre-tint);
  box-shadow: 0 16px 45px #091c3e44;
}
.cadre-profile-drawer .drawer-header { flex: none; align-items: center; padding: 18px 20px; border-color: var(--cadre-line); }
.cadre-profile-drawer .drawer-header > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.cadre-profile-drawer .drawer-header h2 { margin: 0 0 5px; font-size: 23px; }
.cadre-profile-drawer .drawer-header p { color: var(--cadre-muted); font-size: 13px; }
.cadre-profile-drawer .drawer-content {
  --cadre-section-title-height: 45px;
  min-height: 0;
  padding: 0;
  overscroll-behavior: contain;
  scroll-padding-block-start: var(--cadre-section-title-height);
}
.cadre-profile-pane { padding: 16px 18px; }
.cadre-profile-drawer .drawer-close { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--cadre-tint); }
.cadre-profile-drawer .drawer-close:hover { background: #deebf9; }
.cadre-drawer-actions { display: flex; flex: none; align-items: center; gap: 8px; white-space: nowrap; }
.cadre-edit-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #195daf;
  font-weight: 600;
}
.cadre-edit-button:hover { background: #edf5ff; }
.cadre-save-button { border-color: #195daf; background: #195daf; color: #fff; }
.cadre-save-button:hover { background: #124d95; }
.cadre-edit-button:disabled { opacity: .65; }
.cadre-saved { color: #356844; }
.cadre-edit-error { margin: 0 0 8px; color: #a92831; }
.cadre-editor :is(input, textarea) {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #d4dfed;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.cadre-editor textarea { resize: vertical; }

.cadre-detail { display: grid; gap: 10px; }
.cadre-detail-section { border: 1px solid var(--cadre-line); border-radius: 10px; background: #fff; }
.cadre-detail-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--cadre-section-title-height);
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.cadre-detail-section > summary::-webkit-details-marker { display: none; }
.cadre-detail-section[open] > summary {
  position: sticky;
  top: 0;
  z-index: 1;
  border-radius: 9px 9px 0 0;
  background: #f5f8fc;
}
.cadre-detail-section > summary:is(:hover, :focus-visible) { background: #edf5ff; }
.cadre-detail-section > summary:focus-visible { outline: 2px solid #195daf; outline-offset: -2px; }
.cadre-detail-section > summary > .icon { color: var(--muted); }
.cadre-detail-section[open] > summary > .icon { transform: rotate(90deg); }
.cadre-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
}
.cadre-detail-section > .cadre-detail-grid { padding: 14px; border-top: 1px solid var(--cadre-line); }
.cadre-detail-grid > div { min-width: 0; }
.cadre-detail-grid dt { color: var(--cadre-muted); font-size: 12px; }
.cadre-detail-grid dd { margin: 3px 0 0; color: var(--cadre-ink); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cadre-detail-grid dd.is-empty { color: var(--muted); }
.cadre-detail-wide { grid-column: 1 / -1; }
.cadre-detail-subgroup { padding: 12px; border-radius: 7px; background: #f4f8fd; }
.cadre-detail-subgroup > dt { margin-bottom: 10px; color: var(--ink); font-weight: 600; }

@media (max-width: 640px) {
  .cadre-mobile-back { display: inline-flex; }
  .cadre-mobile-back > .icon { transform: rotate(180deg); }
  .cadre-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cadre-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .cadre-filters input { width: 100%; max-width: none; grid-column: 1 / -1; }
  .cadre-filters select { min-width: 0; }
  .cadre-table :is(th, td) { padding-inline: 10px; }
  .cadre-profile-drawer .drawer-header { padding: 14px; }
  .cadre-profile-drawer .drawer-header h2 { font-size: 21px; }
  .cadre-profile-pane { padding: 12px; }
  .cadre-drawer-actions { gap: 6px; }
  .cadre-drawer-actions .cadre-edit-button { padding-inline: 10px; }
}
