/* CPOOL SURGICAL V42
 * Screenshot-driven corrections only.
 *
 * Philosophy preserved from V40/V41:
 * - #cpool-main-yield remains the single 960px canonical axis;
 * - navbar geometry is untouched;
 * - no new global min-height, no generic page redesign;
 * - neutralize only the old V26 nested 32px shrink that was still winning
 *   by specificity on the verified subsections;
 * - Dashboard remains the vertical reference for PRIMARY Clienti/Modelli;
 * - classification checkbox is fixed only inside the rules form.
 */

:root {
  --cpool-v42-primary-top: 28px;
}

/* ---------------------------------------------------------
   1. V26 OUTLIER
   V26 applies calc(100% - 32px) INSIDE the already-960px main shell.
   That creates the screenshoted second axis (+16px per side).
   Keep V26 typography/back-link rhythm, remove only the nested shrink.
   --------------------------------------------------------- */
html body:is(
  [data-cpool-controller="cpool_clients"],
  [data-cpool-controller="cpool_client_imports"],
  [data-cpool-controller="cpool_client_identifiers"],
  [data-cpool-controller="cpool_collection_assignments"],
  [data-cpool-controller="cpool_collection_templates"],
  [data-cpool-controller="cpool_collection_batches"],
  [data-cpool-controller="cpool_collection_responses"],
  [data-cpool-controller="cpool_dynamic_templates"],
  [data-cpool-controller="cpool_bulk_dynamic_documents"],
  [data-cpool-controller="cpool_archive_uploads"],
  [data-cpool-controller="cpool_archive_documents"],
  [data-cpool-controller="cpool_classification_rules"]
) #cpool-main-yield > :is(
  .cpool-v2-page,
  .cpool-page,
  .cpool-v25-standalone-page,
  .cpool-paperless-page
) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ---------------------------------------------------------
   2. PRIMARY SECTIONS CAUGHT BY V26
   Clienti index and Modelli index are primary sections, not subsections.
   V26 was also forcing 36px top there while Dashboard uses 28px.
   Nothing else in those pages is changed.
   --------------------------------------------------------- */
html body[data-cpool-controller="cpool_clients"][data-cpool-action="index"]
  #cpool-main-yield > .cpool-clients-index-v10-3,
html body[data-cpool-controller="cpool_dynamic_templates"][data-cpool-action="index"]
  #cpool-main-yield > .cpool-models-page {
  padding-top: var(--cpool-v42-primary-top) !important;
}

/* ---------------------------------------------------------
   3. CLASSIFICATION RULE ACTIVE CHECKBOX
   Generic control rules were inflating this native checkbox.
   Scope is intentionally limited to this one control.
   --------------------------------------------------------- */
html body[data-cpool-controller="cpool_classification_rules"]
  #cpool-main-yield .cpool-rule-grid .cpool-inline-check {
  display: flex !important;
  align-items: center !important;
  align-self: end !important;
  gap: 9px !important;
  min-height: 22px !important;
}

html body[data-cpool-controller="cpool_classification_rules"]
  #cpool-main-yield .cpool-rule-grid .cpool-inline-check > input[type="checkbox"] {
  box-sizing: border-box !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #5b5cf6;
}

html body[data-cpool-controller="cpool_classification_rules"]
  #cpool-main-yield .cpool-rule-grid .cpool-inline-check > span {
  margin: 0 !important;
  line-height: 1.35 !important;
}

@media (max-width: 767px) {
  html body:is(
    [data-cpool-controller="cpool_clients"],
    [data-cpool-controller="cpool_client_imports"],
    [data-cpool-controller="cpool_client_identifiers"],
    [data-cpool-controller="cpool_collection_assignments"],
    [data-cpool-controller="cpool_collection_templates"],
    [data-cpool-controller="cpool_collection_batches"],
    [data-cpool-controller="cpool_collection_responses"],
    [data-cpool-controller="cpool_dynamic_templates"],
    [data-cpool-controller="cpool_bulk_dynamic_documents"],
    [data-cpool-controller="cpool_archive_uploads"],
    [data-cpool-controller="cpool_archive_documents"],
    [data-cpool-controller="cpool_classification_rules"]
  ) #cpool-main-yield > :is(
    .cpool-v2-page,
    .cpool-page,
    .cpool-v25-standalone-page,
    .cpool-paperless-page
  ) {
    width: 100% !important;
    max-width: none !important;
  }
}
