/* CRUD-02: shared JeMimba tokens and adapters for the existing renderers.
 * No sidebar, WordPress toolbar, public-site or business-state selectors.
 * .jm-crud is the opt-in root for reusable components and isolated previews.
 */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) {
  --jm-crud-navy: #103c68;
  --jm-crud-ink: #102c4f;
  --jm-crud-muted: #52677f;
  --jm-crud-orange: #f86608;
  --jm-crud-action: #c64b00;
  --jm-crud-action-hover: #a63e00;
  --jm-crud-orange-soft: #fff1e6;
  --jm-crud-canvas: #f4f7fb;
  --jm-crud-surface: #fff;
  --jm-crud-line: #d9e3ee;
  --jm-crud-soft: #eef3f8;
  --jm-crud-success: #21633f;
  --jm-crud-success-bg: #e7f6ec;
  --jm-crud-warning: #824900;
  --jm-crud-warning-bg: #fff3d9;
  --jm-crud-danger: #a12638;
  --jm-crud-danger-bg: #fff0f1;
  --jm-crud-info: #245785;
  --jm-crud-info-bg: #eaf2fc;
  --jm-crud-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --jm-crud-space-1: 4px;
  --jm-crud-space-2: 8px;
  --jm-crud-space-3: 12px;
  --jm-crud-space-4: 16px;
  --jm-crud-space-6: 24px;
  --jm-crud-space-8: 32px;
  --jm-crud-radius-sm: 8px;
  --jm-crud-radius: 12px;
  --jm-crud-shadow: 0 3px 14px rgb(16 44 79 / 4%);
  background: var(--jm-crud-canvas);
  color: var(--jm-crud-ink);
  font-family: var(--jm-crud-font);
  font-size: 15px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Bridge existing variable-driven components without replacing their markup. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.cv-references, .member-list-enhanced) {
  --ref-green: var(--jm-crud-navy);
  --ref-ink: var(--jm-crud-ink);
  --ref-line: var(--jm-crud-line);
  --member-green: var(--jm-crud-navy);
  --member-ink: var(--jm-crud-ink);
  --member-line: var(--jm-crud-line);
}
.jemimba-crud-admin #wpcontent { background: #f4f7fb; }
.jemimba-crud-admin #wpbody-content > .wrap { margin-top: 24px; }

:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(h1, h2, h3, h4) {
  color: var(--jm-crud-ink);
  font-family: var(--jm-crud-font);
  font-weight: 700;
  line-height: 1.25;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(h1) {
  font-size: clamp(26px, 2.6vw, 36px);
  letter-spacing: -.025em;
  margin-block: 8px 16px;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(h2) { font-size: 22px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(h3) { font-size: 17px; }
/* The existing dashboard includes a dark access card. Keep its title legible. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .didac-bo-access-card h2 { color: #fff; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.description, .muted, .jm-crud-muted, .jm-id, td small) {
  color: var(--jm-crud-muted);
  font-size: 13px;
  line-height: 1.5;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.eyebrow, .cv-ref-eyebrow, .didac-webapp-kicker, .jm-crud-eyebrow) {
  color: var(--jm-crud-action);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(a:not(.button, .didac-auth-primary, .didac-auth-secondary, .jm-crud-button)) { color: var(--jm-crud-navy); text-underline-offset: 3px; }

/* Surfaces: existing layout/grid rules and form visibility remain in charge. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.panel, .card, .didac-bo-panel, .didac-webapp-panel, .cv-ref-card, .cv-ref-editor, .jm-crud-card) {
  background: var(--jm-crud-surface);
  border: 1px solid var(--jm-crud-line);
  border-radius: var(--jm-crud-radius);
  box-shadow: var(--jm-crud-shadow);
  padding: var(--jm-crud-space-6);
  margin-bottom: var(--jm-crud-space-6);
  min-width: 0;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.didac-bo-hero) {
  border-color: var(--jm-crud-line);
  border-radius: var(--jm-crud-radius);
  box-shadow: none;
}
.jm-crud-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: var(--jm-crud-space-3, 12px); }
.jm-crud-toolbar > label { flex: 1 1 220px; }
.jm-crud-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--jm-crud-space-4, 16px); }

/* Tables: never restyle WordPress .form-table as a data listing. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.widefat:not(.form-table), .didac-bo-table, .didac-webapp-table, .cv-ref-table table, .jm-crud-table) {
  width: 100%;
  border: 1px solid var(--jm-crud-line);
  border-spacing: 0;
  border-collapse: separate;
  border-radius: var(--jm-crud-radius);
  background: var(--jm-crud-surface);
  box-shadow: none;
  color: var(--jm-crud-ink);
  font-size: 14px;
  line-height: 1.5;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.widefat:not(.form-table), .didac-bo-table, .didac-webapp-table, .cv-ref-table table, .jm-crud-table) :where(th, td) {
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--jm-crud-line);
  color: inherit;
  vertical-align: middle;
  border-radius: 0;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.widefat:not(.form-table), .didac-bo-table, .didac-webapp-table, .cv-ref-table table, .jm-crud-table) thead th {
  background: var(--jm-crud-soft);
  color: #425c79;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.widefat:not(.form-table), .didac-bo-table, .didac-webapp-table, .cv-ref-table table, .jm-crud-table) tbody :where(tr, td) { background: var(--jm-crud-surface); }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.widefat:not(.form-table), .didac-bo-table, .didac-webapp-table, .cv-ref-table table, .jm-crud-table) tbody tr:nth-child(even) > td { background: #f8fafd; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.widefat:not(.form-table), .didac-bo-table, .didac-webapp-table, .cv-ref-table table, .jm-crud-table) tbody tr:hover > td { background: #f0f5fc; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.widefat:not(.form-table), .didac-bo-table, .didac-webapp-table, .cv-ref-table table, .jm-crud-table) tbody tr:last-child > td { border-bottom: 0; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.jm-table, .cv-ref-table, .jm-crud-table-scroll) { max-width: 100%; overflow-x: auto; }

/* Inputs: exclude checkboxes, radios, hidden fields and editor internals. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(input[type=text], input[type=search], input[type=email], input[type=tel], input[type=url], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea):not(:where(.wp-editor-wrap *, .mce-container *, .tox *)) {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid #b9c9d9;
  border-radius: var(--jm-crud-radius-sm);
  background-color: var(--jm-crud-surface);
  color: var(--jm-crud-ink);
  font-family: var(--jm-crud-font);
  font-size: 14px;
  line-height: 1.5;
  padding: 9px 12px;
  box-shadow: none;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) select { padding-right: 30px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) textarea { min-height: 110px; resize: vertical; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(input, textarea)::placeholder { color: #64768b; opacity: 1; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(input[type=checkbox], input[type=radio]) { accent-color: var(--jm-crud-navy); }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(input[readonly], textarea[readonly], input:disabled, select:disabled, textarea:disabled) { background-color: var(--jm-crud-soft); color: var(--jm-crud-muted); }

/* Primary orange is darkened for white-text contrast; the brand orange remains
 * available for accents. Native rich-text editor toolbars keep their own style. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(button, input[type=submit], .button, .didac-auth-primary, .didac-auth-secondary, .cv-ref-open, .jm-crud-button):not(:where(.wp-editor-wrap *, .mce-container *, .tox *, .notice-dismiss, .handlediv, .toggle-row)) {
  box-sizing: border-box;
  min-height: 42px;
  border: 1px solid var(--jm-crud-navy);
  border-radius: var(--jm-crud-radius-sm);
  padding: 9px 16px;
  background: var(--jm-crud-navy);
  color: #fff;
  font-family: var(--jm-crud-font);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  text-decoration: none;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.button-primary, .didac-auth-primary, .cv-ref-open, .jm-crud-button--primary, .didac-bo-hero > .didac-bo-add-link) {
  background: var(--jm-crud-action);
  border-color: var(--jm-crud-action);
  color: #fff;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.button-primary, .didac-auth-primary, .cv-ref-open, .jm-crud-button--primary):hover { background: var(--jm-crud-action-hover); border-color: var(--jm-crud-action-hover); color: #fff; filter: none; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.button:not(.button-primary), .secondary, .didac-auth-secondary, .member-outline, .jm-crud-button--secondary) {
  background: var(--jm-crud-surface);
  border-color: #b4c6d9;
  color: var(--jm-crud-navy);
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.secondary, .didac-auth-secondary, .jm-crud-button--secondary):hover { background: var(--jm-crud-soft); filter: none; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.button-link, .button-link-delete) { background: transparent; border-color: transparent; color: var(--jm-crud-navy); padding-inline: 6px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.jm-crud-button--danger, .button-link-delete, .danger button) { color: var(--jm-crud-danger); border-color: #e5aeb7; background: var(--jm-crud-danger-bg); }

/* The inherited CRUD icons use !important. Keep these adapters narrowly scoped. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .cv-crud-actions :is(a, button, span).cv-crud-icon {
  min-width: 40px; width: 40px; min-height: 40px; height: 40px;
  background: var(--jm-crud-surface) !important;
  color: var(--jm-crud-navy) !important;
  border-color: #b4c6d9 !important;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .cv-crud-actions :is(a, button, span).cv-crud-icon--delete {
  color: var(--jm-crud-danger) !important;
  border-color: #e5aeb7 !important;
  background: var(--jm-crud-danger-bg) !important;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .cv-crud-actions .cv-crud-icon--disabled {
  color: var(--jm-crud-muted) !important;
  background: var(--jm-crud-soft) !important;
  border-color: var(--jm-crud-line) !important;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(button:disabled, input:disabled, .button:disabled, [aria-disabled=true], .cv-crud-icon--disabled) {
  cursor: not-allowed;
  opacity: .6;
  box-shadow: none;
}

/* Tabs reuse existing aria state; no new selection or routing logic. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.cv-ref-tabs, .nav-tab-wrapper, .jm-crud-tabs) {
  display: flex; flex-wrap: wrap; gap: 8px;
  border-bottom: 1px solid var(--jm-crud-line);
  margin-bottom: var(--jm-crud-space-6);
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.cv-ref-tabs, .nav-tab-wrapper, .jm-crud-tabs) > :where(a, button) {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 12px 16px; margin: 0;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: var(--jm-crud-muted);
  font-size: 14px; font-weight: 650; text-decoration: none; box-shadow: none;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.cv-ref-tabs, .nav-tab-wrapper, .jm-crud-tabs) > :is([aria-current]:not([aria-current=false]), [aria-selected=true], [aria-pressed=true], .nav-tab-active) {
  color: var(--jm-crud-action); border-bottom-color: var(--jm-crud-orange); background: transparent;
}

/* Neutral is deliberate when the old markup does not declare a semantic state. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.didac-bo-badge, .cv-ref-badge, .cv-references .badge, .jm-crud-badge) {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; padding: 4px 10px; border-radius: 999px;
  color: var(--jm-crud-muted); background: var(--jm-crud-soft);
  font-size: 12px; font-weight: 650; line-height: 1.5;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :is(.jm-crud-badge--success, .didac-bo-badge.is-active, .didac-bo-badge.is-allow, .didac-bo-badge.is-released) { color: var(--jm-crud-success); background: var(--jm-crud-success-bg); }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :is(.jm-crud-badge--warning, .didac-bo-badge.is-warning, .didac-bo-badge.is-pending, .didac-bo-badge.is-eligible) { color: var(--jm-crud-warning); background: var(--jm-crud-warning-bg); }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :is(.jm-crud-badge--danger, .didac-bo-badge.is-danger, .didac-bo-badge.is-suspended, .didac-bo-badge.is-deny, .didac-bo-badge.is-expired, .didac-bo-badge.is-disputed, .didac-bo-badge.is-failed, .didac-bo-badge.is-cancelled, .didac-bo-badge.is-reversed) { color: var(--jm-crud-danger); background: var(--jm-crud-danger-bg); }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-badge--info { color: var(--jm-crud-info); background: var(--jm-crud-info-bg); }

:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.didac-bo-pagination, .jm-crud-pagination) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.didac-bo-pagination, .jm-crud-pagination) > :where(a, button, .current) { min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--jm-crud-line); border-radius: 8px; background: #fff; color: var(--jm-crud-navy); text-decoration: none; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.didac-bo-pagination, .jm-crud-pagination) > :is(.current, [aria-current=page]) { background: var(--jm-crud-navy); color: #fff; border-color: var(--jm-crud-navy); }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :focus-visible { outline: 3px solid var(--jm-crud-navy); outline-offset: 3px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) [hidden] { display: none !important; }

@media (max-width: 782px) {
  :is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(.panel, .card, .didac-bo-panel, .didac-webapp-panel, .cv-ref-card, .cv-ref-editor, .jm-crud-card) { padding: var(--jm-crud-space-4); }
  .jm-crud-form-grid { grid-template-columns: 1fr; }
  :is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(input[type=text], input[type=search], input[type=email], input[type=number], select, textarea) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) :where(button, .button, .jm-crud-button) { transition: none; }
}

/* CRUD-03: shared list composition. Existing GET/POST forms keep their fields. */
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-header {
  position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px 24px;
  margin-bottom: 24px; min-width: 0;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-header > :not(.jm-crud-add) { grid-column: 1; margin-block: 0 8px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-header .jm-crud-add { grid-column: 2; grid-row: 1 / 5; margin-left: auto; display: inline-flex; align-items: center; justify-content: center; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-controls {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 18px;
  padding: 16px; background: #fff; border: 1px solid var(--jm-crud-line); border-radius: 12px;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-controls > label { display: grid; gap: 6px; min-width: 120px; font-size: 13px; font-weight: 600; flex: 1 1 145px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-controls :is(input[type=search],input[name=q],select) { width: 100%; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-controls > .jm-crud-search { flex: 3 1 240px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-controls > .jm-fields { flex: 1 1 100%; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-count { margin: 12px 0 18px; color: var(--jm-crud-muted); font-size: 13px; font-weight: 600; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-card { min-width: 0; margin-block: 18px 24px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-pagination {
  display: flex !important; flex-direction: row !important; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap; padding-block: 16px; margin: 0; width: 100%;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-pagination :is(button,a,span) { flex: 0 0 auto; margin: 0; width: auto; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-pagination :is(.jm-crud-page-info,#page) { padding-inline: 8px; color: var(--jm-crud-muted); font-size: 13px; border: 0; background: transparent; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-sort {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin: -6px; padding: 6px;
  background: transparent; color: inherit; border: 0; border-radius: 4px; font: inherit; text-align: left;
}
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) [aria-sort] .jm-crud-sort::after { content: '↕'; font-size: 14px; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) [aria-sort=ascending] .jm-crud-sort::after { content: '↑'; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) [aria-sort=descending] .jm-crud-sort::after { content: '↓'; }
:is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-data-table th:last-child { white-space: nowrap; }
@media (max-width: 782px) {
  :is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-list-controls > label { flex: 1 1 100%; }
  :is(.jemimba-crud-admin #wpbody-content, .didac-webapp-shell > .didac-webapp-content, .jm-crud) .jm-crud-pagination { justify-content: flex-start; }
}

@media(max-width:782px){:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-list-header{grid-template-columns:1fr}:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-list-header .jm-crud-add{grid-column:1;grid-row:auto;margin-left:0;justify-self:start}}

/* CRUD-04: full internal editors share structure, not business actions. */
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) :is(.jm-crud-page,[data-reference-editor]) { position:static; width:100%; max-width:1200px; margin-inline:auto; min-width:0; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-form { min-width:0; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-form-section { min-width:0; margin:0 0 20px; padding:20px; border:1px solid var(--jm-crud-line); border-radius:12px; background:#fff; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-form-section > legend { padding:0 8px; font-size:17px; font-weight:700; color:var(--jm-crud-navy); }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 24px; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-field-grid > label { display:flex; flex-direction:column; gap:8px; min-width:0; font-weight:600; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-field-grid > label:has(input[type=checkbox]) { flex-direction:row; align-items:center; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-field-grid :is(input:not([type=checkbox]),select,textarea) { width:100%; max-width:100%; box-sizing:border-box; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-field-wide { grid-column:1 / -1; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-form-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; border-top:1px solid var(--jm-crud-line); margin-top:12px; padding:20px 0 0; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-field-error { display:block; margin:6px 0 0; color:#a12424; font-size:13px; font-weight:500; grid-column:1 / -1; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-form [aria-invalid=true] { border-color:#b42318 !important; box-shadow:0 0 0 1px #b42318; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) [data-jm-server-error] { padding:12px 16px; background:#fff2f0; color:#a12424; border-left:3px solid #b42318; border-radius:6px; }
@media(max-width:782px) {
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-field-grid { grid-template-columns:1fr; }
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-form-section { padding:16px; }
}

:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .cv-references:has(>[data-reference-editor]) > :not([data-reference-editor]) { display:none !important; }

/* Shared record metadata and attachments, including long immutable references. */
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-facts { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:18px 24px; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-facts :is(div,dt,dd) { min-width:0;overflow-wrap:anywhere; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-facts dt { color:var(--jm-crud-muted);font-size:13px;margin-bottom:5px; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-facts dd { margin:0; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-media { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-media figure { margin:0;min-width:0; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-media img { max-width:100%;height:auto;border-radius:10px; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-summary { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:16px;margin-block:20px; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-detail-layout { display:grid;grid-template-columns:minmax(0,2fr) minmax(240px,1fr);gap:20px; }
@media(max-width:782px){:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-detail-layout { grid-template-columns:1fr; }}

:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-private-preview img { max-width:100%;height:auto; }
:is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-private-preview iframe { width:100%;min-height:60vh;border:0; }

/* Data tables keep readable columns; the surrounding panel owns scrolling. */
@media(max-width:782px) {
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) :is(.cv-ref-table,.jm-table,.jm-crud-table-scroll) > table:not(.form-table):not(.jm-detail) { min-width:var(--jm-crud-table-min-width,720px); }
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-data-table { table-layout:auto; }
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-data-table th { white-space:nowrap; }
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-data-table td { overflow-wrap:break-word;word-break:normal; }
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) .jm-crud-data-table :is(.jm-crud-badge,.cv-ref-status,.didac-bo-badge) { white-space:nowrap; }
  :is(.jemimba-crud-admin #wpbody-content,.didac-webapp-shell > .didac-webapp-content,.jm-crud) table[data-jm-crud-actions] :is(thead th,tbody td):last-child { position:sticky;right:0;z-index:1;box-shadow:-4px 0 6px #103c6810;min-width:120px; }
}

/* Owner removal confirmation shared by the list and the need detail. */
.jm-removal-dialog{box-sizing:border-box;width:min(560px,calc(100% - 24px));max-height:90dvh;overflow:auto;border:1px solid #cbd8e8;border-radius:16px;padding:24px;color:#123d64;background:#fff;box-shadow:0 20px 60px #0003}
.jm-removal-dialog::backdrop{background:#071d35aa}
.jm-removal-dialog h2{margin-top:0}
.jm-removal-dialog p{white-space:pre-line;overflow-wrap:anywhere;line-height:1.5}
.jm-removal-actions{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin-top:24px}
@media(max-width:600px){.jm-removal-dialog{padding:18px}.jm-removal-actions button{width:100%}}

.didac-webapp-shell .didac-webapp-content .jm-crud-button--danger{color:var(--jm-crud-danger);border-color:#e5aeb7;background:var(--jm-crud-danger-bg)}

/* Validation stays modal until the user returns to the field to correct. */
.jm-error-dialog{box-sizing:border-box;width:min(520px,calc(100% - 32px));max-height:90dvh;overflow:auto;border:1px solid #e5b3ad;border-top:4px solid #b42318;border-radius:14px;padding:24px;color:#123d64;background:#fff;box-shadow:0 20px 60px #0003}
.jm-error-dialog::backdrop{background:#071d3580}
.jm-error-dialog h2{margin:0 0 16px;font-size:22px}
.jm-error-dialog p{white-space:pre-line;overflow-wrap:anywhere;line-height:1.6}
.jm-error-actions{display:flex;justify-content:flex-end;margin-top:24px}
.jm-error-actions button{min-height:44px;padding:10px 18px}
