/* Adaptaciones de Zeus; primitivas comunes en feedbi-foundation.css. */
/* Global Zeus tokens: unconditioned defaults live here.
   Contextual and responsive overrides stay beside their components.
   Existing roles and exact values are preserved; see docs/fases/POLARIS_FASE_2_TOKENS.md. */
:root {
  /* Shared bases by content; readable names/text grow before secondary labels. */
  --column-document:7.5rem;
  --column-date:6.75rem;
  --column-date-label:var(--column-document);
  --column-datetime:11rem;
  --column-date-range:13.5rem;
  --column-month:10rem;
  --column-name:14.375rem;
  --column-name-short:10rem;
  --rating-star-color:#d4a017;
  --column-code:10rem;
  --column-amount:9rem;
  --column-quantity:7rem;
  --column-percent:5.5rem;
  --column-state:11rem;
  --column-state-group:18rem;
  --column-short:5.5rem;
  --column-actions:5.5rem;
  --column-email:16.25rem;
  --column-iban:17.5rem;
  --column-description:18.75rem;
  --column-notes:11.25rem;
  --column-text:12.5rem;
  --column-date-long:var(--column-datetime);
  --column-code-short:6rem;
  --column-tax-id:9rem;
  --column-city:9rem;
  --column-category:var(--column-text);
  --column-discount:4.5rem;
  --column-boolean:3.5rem;
  --column-state-short:6.5rem;
  --column-state-label:var(--column-document);
  --column-percent-help:var(--column-amount);

  /* Shared primitive scales; exact existing values retained. Prefer semantic tokens above consumers. */
  --surface-canvas:#f6f8fb;
  --space-28-px:28px;
  --space-18-px:18px;
  --space-48-px:48px;
  --stroke-1:1px;
  --radius-12:12px;
  --shadow-login-card:0 10px 28px rgba(24, 33, 47, 0.045);
  --space-44-px:44px;
  --space-36-px:36px;
  --space-34-px:34px;
  --palette-rgba-37-99-235-0-32:rgba(37, 99, 235, 0.32);
  --palette-rgba-22-163-106-0-24:rgba(22, 163, 106, 0.24);
  --text-1-8-rem:1.8rem;
  --text-1-rem:1rem;
  --space-6-px:6px;
  --text-0-94-rem:0.94rem;
  --text-0-92-rem:0.92rem;
  --space-26-px:26px;
  --text-0-82-rem:0.82rem;
  --space-10-px:10px;
  --palette-rgba-24-33-47-0-42:rgba(24, 33, 47, 0.42);
  --radius-14:14px;
  --shadow-modal-card:0 28px 80px rgba(24, 33, 47, 0.24);
  --text-1-35-rem:1.35rem;
  --text-1-45-rem:1.45rem;
  --space-14-px:14px;
  --text-1-3-rem:1.3rem;
  --palette-rgba-22-163-106-0-18:rgba(22, 163, 106, 0.18);
  --radius-8:8px;
  --shadow-admin-brand-focus-visible:0 0 0 3px rgba(54, 123, 245, 0.22);
  --space-2-px:2px;
  --radius-pill:999px;
  --stroke-2:2px;
  --space-3-px:3px;
  --shadow-admin-nav-group-menu:0 12px 28px rgba(15, 23, 42, 0.18);
  --radius-4:4px;
  --text-0-78-rem:0.78rem;
  --shadow-user-menu-panel:0 16px 34px rgba(24, 33, 47, 0.14);
  --space-7-px:7px;
  --space-9-px:9px;
  --text-0-7-rem:0.7rem;
  --text-0-9-rem:0.9rem;
  --text-2-65-rem:2.65rem;
  --text-1-15-rem:1.15rem;
  --color-comparison-label:#667085;
  --text-0-75-rem:0.75rem;
  --text-0-86-rem:0.86rem;
  --radius-6:6px;
  --text-1-25-rem:1.25rem;
  --radius-5:5px;
  --text-0-88-rem:0.88rem;
  --palette-rgba-24-33-47-0-16:rgba(24, 33, 47, 0.16);
  --text-0-84-rem:0.84rem;
  --text-0-8-rem:0.8rem;
  --space-5-px:5px;
  --radius-20:20px;
  --text-1-7-rem:1.7rem;
  --text-1-5-rem:1.5rem;
  --space-22-px:22px;
  --surface-row-hover:#f5f9ff;
  --text-0-85-rem:.85rem;
  --space-40-px:40px;
  --stroke-3:3px;
  --text-0-8125-rem:.8125rem;
  --text-0-9375-rem:.9375rem;
  --color-warning-summary:#8a6012;
  --text-0-875-rem:.875rem;
  --shadow-dialog:0 20px 70px #18212f26;
  --backdrop-dialog:#18212f66;
  --color-provider:#111;
  --color-white:#fff;
  --radius-16:16px;
  --text-14-px:14px;
  --radius-9:9px;
  --color-focus-action:#0f7a50;
  --surface-help:#f7f9fc;
  --text-0-72-rem:.72rem;
  --color-ink-base:#18212f;
  --shadow-floating-help-tooltip:0 14px 32px rgba(24,33,47,.18);
  --text-12-px:12px;
  --space-30-px:30px;
  --space-32-px:32px;
  --color-remove-muted:#a0aab3;
  --text-1-1-rem:1.1rem;

  --query-control-gap:var(--space-3);
  --query-search-width:400px;
  --query-state-width:148px;
  --query-submit-width:88px;
  --query-date-width:150px;
  --query-tag-width:240px;
  /* Table */
  --table-header-color:#4a4a4a;
  --table-header-weight:var(--weight-medium);
  --table-header-line-height:1.125rem;
  --table-header-padding-y:var(--space-2);
  --chip-weight:var(--weight-medium);
  --table-header-bg:#f7f7f7;
  --table-header-radius:6px;
  --table-font-size:.875rem;
  --table-cell-padding-y:6px;
  --table-row-content-height:calc(.984rem + 8px);
  --table-row-min-height:calc(var(--table-row-content-height) + 2 * var(--table-cell-padding-y) + 1px);
  --table-detail-cell-padding-y:var(--table-cell-padding-y);
  --table-breakdown-cell-padding-y:var(--table-cell-padding-y);
  /* Spacing, frame and weights */
  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:20px;
  --space-6:24px;
  --radius-control:var(--control-radius);
  --radius-panel:12px;
  --workspace-max-width:1440px;
  --workspace-gutter:24px;
  --workspace-control-radius:6px;
  --nav-font-size:.9375rem;
  --weight-regular:400;
  --weight-medium:500;
  --weight-emphasis:600;
  --weight-primary:700;
  --workspace-line:#e1e6e5;
  --workspace-hover:#f4f8f6;
  /* Navigation */
  --nav-hover-bg:#e7e9ed;
  --nav-active-line:#aab2bc;
  /* Headings and toolbars */
  --view-heading-size:1.15rem;
  --view-heading-line-height:1.3;
  --view-heading-weight:700;
  --view-heading-gap:14px;
  --module-toolbar-gap:var(--space-3);
  --module-toolbar-spacing:var(--space-4);
  /* Native select */
  --select-chevron: url("/select-chevron.svg");
  /* Informational chip */
  --chip-info:#79518c;
  /* Motion */
  --content-fade-duration:160ms;
  --view-transition-duration:180ms;
  --view-transition-easing:cubic-bezier(.25,.1,.25,1);
  --content-pending-opacity:.28;
  --pagination-roll-duration:280ms;
  --status-spin-duration:1s;
  /* Composer compatibility marker */
  --zeus-invoice-composer:4;
  /* Search and placeholders */
  --search-font-size:1rem;
  --search-font-weight:var(--control-field-weight);
  --search-border-color:var(--control-border-color);
  --field-placeholder-color:#757575;
  --field-placeholder-weight:400;
  --search-placeholder-color:var(--field-placeholder-color);
  /* Accessible error */
  --red:#b42318;
  /* Controls */
  --control-font-size:1rem;
  --control-field-weight:400;
  --control-button-weight:var(--control-field-weight);
  --control-radius:6px;
  --control-border-color:#c8d4e1;
  --control-field-padding-x:12px;
  --control-button-padding-x:16px;
  --control-height:3rem;
  --control-padding-y:10px;
  /* Query controls */
  --query-control-height:2.25rem;
  --query-control-padding-y:4px;
  --query-field-weight:400;
  --query-field-hint-color:var(--field-placeholder-color);
  /* Semantic roles: preserve variants instead of merging similar values. */
  --notice-default-ink:#0b6844;
  --notice-default-surface:#e7f5ee;
  --notice-default-border:#bce0cd;
  --notice-attention-ink:#6b4b00;
  --notice-attention-border:#dfb335;
  --notice-attention-surface:#fffbee;
  --notice-padding:14px 18px;
  --notice-radius:8px;
  --data-label-size:.82rem;
  --data-label-spacing:5px;
  --data-emphasis-weight:650;
  --data-value-weight:var(--weight-regular);
  --data-note-size:.78rem;
  --data-inline-value-size:.94rem;
  --surface-disabled:#eef2f7;
  --surface-option-selected:#eef2f7;
  --popover-border:#e2e7eb;
  --popover-radius:8px;
  --popover-shadow:0 12px 28px #27374820;
  --composer-radius:16px;
  --composer-shadow:0 24px 90px #15273730;
  --composer-backdrop:#2434444d;
  --composer-border-frame:#e9edf1;
  --composer-border-section:#edf0f3;
  --composer-border-toolbar:#e3e8ec;
  --composer-border-columns:#e3e9ed;
  --composer-border-total:#e2e8ec;
  --composer-surface-aside:#f8fafb;
  --composer-surface-selected:#f7faf9;
  --composer-text-label:#3e4c5c;
  --composer-text-muted:#687885;
  --composer-text-amount:#3c4e5b;
  --composer-text-summary:#546272;
  --composer-text-total-label:#435464;
  --composer-text-total:#213f35;
  --composer-text-legacy:#758291;
  --composer-label-size:.9375rem;
  --composer-note-size:.8125rem;
  --composer-weight-medium:550;
}

.environment-label { color:var(--admin-muted); font-size:var(--text-0-8-rem); border:var(--stroke-1) solid var(--line); padding:var(--space-5-px) var(--space-10-px); border-radius:var(--radius-20); }
h1 { font-size:var(--text-1-7-rem); letter-spacing:-.035em; margin:0 0 var(--space-2); }
h2 { font-size:var(--text-1-15-rem); letter-spacing:-.015em; margin:0 0 var(--space-14-px); }
p { line-height:1.6; margin:0 0 var(--space-4); }
.view-heading p { margin:0; }
.welcome-panel { max-width:800px; padding:var(--space-36-px); }
.welcome-panel h2 { font-size:var(--text-1-5-rem); margin-top:var(--space-5); }
.welcome-panel p { max-width:640px; }
.card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:var(--space-5); }
.status-pill { display:inline-flex; align-items:center; font-size:var(--text-0-82-rem); font-weight:var(--chip-weight); line-height:1.2; color:var(--green); background:color-mix(in srgb,var(--green) 18%,transparent); border-radius:var(--radius-pill); padding:var(--space-1) var(--space-9-px); white-space:nowrap; }
#recovery-help { margin-top:var(--space-22-px); }
#recovery-copy { margin-top:var(--space-3); font-size:var(--text-0-88-rem); }
.notice { color:var(--notice-default-ink); background:var(--notice-default-surface); border:var(--stroke-1) solid var(--notice-default-border); padding:var(--notice-padding); border-radius:var(--notice-radius); margin-top:var(--space-5); }
.narrow-form { max-width:600px; }
.table-panel { padding:var(--space-18-px); min-width:0; }
.table-panel:not(.panel) { padding:0; }
tbody tr:hover td { background:var(--surface-row-hover); }
.data-table { border-collapse:separate; border-spacing:0; }
/* Use the compact status chip as the row baseline. Distinct concepts can grow. */
.data-table > tbody > tr { height:var(--table-row-min-height); }
/* Compact controls do not raise the row; their transparent hit area stays 32px. */
.data-table :is(.row-action-menu-trigger,.table-icon-button) { position:relative; height:var(--table-row-content-height); min-height:var(--table-row-content-height); padding:0; }
.data-table :is(.row-action-menu-trigger,.table-icon-button)::after { content:""; position:absolute; inset-inline:0; top:50%; height:32px; transform:translateY(-50%); }
.data-table .row-action-menu-placeholder { height:var(--table-row-content-height); }
.data-table thead th,.data-table thead td { color:var(--table-header-color); font-weight:var(--table-header-weight); line-height:var(--table-header-line-height); padding-block:var(--table-header-padding-y); background:var(--table-header-bg); border-bottom:0; }
.data-table .table-sort { display:inline-flex; align-items:center; justify-content:inherit; gap:var(--space-1); max-width:100%; margin:0; padding:0; min-height:0; border:0; border-radius:0; background:none; box-shadow:none; color:inherit; font:inherit; text-align:inherit; cursor:pointer; }
.table-sort svg { flex:none; width:1em; height:1em; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; opacity:0; }
th[aria-sort="ascending"] .table-sort svg,th[aria-sort="descending"] .table-sort svg,.table-sort:hover svg,.table-sort:focus-visible svg { opacity:1; }
.table-sort:focus-visible { outline:var(--stroke-2) solid var(--focus); outline-offset:var(--space-1); }
.table-sort:disabled { cursor:wait; }
@media (hover:none) { .table-sort svg { opacity:1; } }
.data-table thead tr:first-child > :first-child { border-top-left-radius:var(--table-header-radius); }
.data-table thead tr:first-child > :last-child { border-top-right-radius:var(--table-header-radius); }
.data-table thead tr:last-child > :first-child { border-bottom-left-radius:var(--table-header-radius); }
.data-table thead tr:last-child > :last-child { border-bottom-right-radius:var(--table-header-radius); }
.data-table .table-row-total>td { font-weight:650; }
.data-table .table-row-breakdown>td { padding-block:var(--table-breakdown-cell-padding-y); color:var(--admin-muted); font-size:var(--table-font-size); }
.data-table .table-row-breakdown>td:first-child { padding-inline-start:var(--space-6); }
.data-table tfoot th,.data-table tfoot td { background:var(--table-header-bg); border-top:var(--stroke-2) solid var(--line); font-size:inherit; font-weight:650; color:inherit; }
.data-table.balanced-table { table-layout:fixed; }
/* Intrinsic identifiers may expand their column; overflow remains local to the table. */
.data-table.intrinsic-columns { table-layout:auto; }
/* Compact reference and timestamp; the descriptive column takes remaining space. */
.reference-date-table thead th { white-space:nowrap; }
.reference-date-table :is(th,td)[data-column-role="date"] { padding-inline-end:var(--space-6); }
.data-table .table-cell-tabular { font-variant-numeric:tabular-nums; }
.data-table.planning-table  { min-width:1084px; }
.data-table.planning-table .status-pill  { white-space:nowrap; overflow-wrap:normal; }
.data-table.balanced-table th,.data-table.balanced-table td { overflow-wrap:anywhere; }
.data-table.balanced-table th[data-column-role="amount"],.data-table.balanced-table th[data-column-role="quantity"] { font-variant-numeric:tabular-nums; }
/* Opt-in profile for one descriptive identity and compact supporting metrics. */
.data-table.metrics-summary-table { table-layout:fixed; min-width:936px; }
.data-table.metrics-summary-table .status-pill  { white-space:nowrap; overflow-wrap:normal; }
.table-cell-compact { white-space:nowrap; }
.table-status-group { display:inline-flex; align-items:center; flex-wrap:nowrap; gap:var(--space-2); }
.table-status-group > .status-pill { flex:none; max-width:none; }
.data-table .table-cell-number { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.rating-stars { color:var(--rating-star-color); }
.number-value.is-negative,.table-cell-number.is-negative { color:var(--red); }
.data-table .table-header-wrap { white-space:normal; overflow-wrap:normal; }
.table-cell-number > .heading-with-help { justify-content:flex-end; }
.data-table :is(.table-name-excerpt,.table-value-excerpt) { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; max-width:100%; max-height:1.35em; overflow:hidden; overflow-wrap:anywhere; white-space:normal; line-height:1.35; text-align:left; }
.data-table .table-value-excerpt { display:block; width:0; min-width:100%; white-space:nowrap; text-overflow:ellipsis; text-align:inherit; }
.data-table:has(th:last-child.table-actions-header) td:last-child { text-align:right; }
.data-table:has(th:last-child.table-actions-header) td:last-child .row-actions { justify-content:flex-end; }
.data-table:has(th:last-child.table-actions-header) td:last-child .link-button { font-size:var(--text-0-86-rem); }
.reference { font-size:var(--text-0-8-rem); color:var(--admin-muted); }
.heading-actions { display:flex; flex-wrap:wrap; gap:var(--space-3); }
.back-link { display:inline-block; margin:0 0 var(--space-5); }
.navigation-trail { display:block; max-width:100%; color:var(--admin-muted); }
.navigation-trail ol { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-1) var(--space-2); margin:0; padding:0; list-style:none; }
.navigation-trail li { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.navigation-trail li:not(:first-child) { display:flex; align-items:baseline; gap:var(--space-2); }
.navigation-trail li:not(:first-child) > span { flex-shrink:0; color:var(--nav-active-line); }
.navigation-trail .link-button { max-width:100%; text-align:left; overflow-wrap:anywhere; }
.navigation-back { display:inline-flex; align-items:center; gap:var(--space-2); max-width:100%; min-height:2.25rem; text-align:left; border-radius:var(--radius-6); }
.navigation-back-label { min-width:0; overflow-wrap:anywhere; }
.navigation-back-icon { display:inline-grid; place-items:center; flex:none; width:2rem; height:2rem; border-radius:50%; background:var(--nav-hover-bg); color:var(--admin-ink); }
.navigation-back-icon svg { width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.navigation-back:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.navigation-back:focus-visible .navigation-back-icon { background:var(--line); }
@media (hover:hover) { .navigation-back:not(:disabled):not([aria-disabled="true"]):hover .navigation-back-icon { background:var(--line); } }
@media (max-width:820px), (pointer:coarse) {
 .navigation-back { min-height:2.75rem; }
 .navigation-back-icon { width:2.25rem; height:2.25rem; }
}
.search-form { display:flex; gap:var(--space-3); margin:0 0 var(--space-5); }
.search-form input { max-width:650px; }
.empty-table { margin:0; }
.secondary-line { display:block; margin-top:var(--space-5-px); }
.catalogue-scope { margin-top:var(--space-5); max-width:850px; font-size:var(--text-0-85-rem); }
.product-section { margin-top:var(--space-6); }
/* Same 48px control row and 14px bottom spacing, with or without actions. */
.section-heading { display:flex; align-items:flex-start; justify-content:space-between; min-height:62px; gap:var(--space-5); padding:0 0 var(--space-14-px); }
.section-heading p,.section-heading h2 { margin:0 0 var(--space-5-px); }
.section-heading h2,.section-title-medium { font-weight:var(--weight-medium); }
.section-heading p { font-size:var(--text-0-88-rem); }
.section-heading>div,.section-heading>h2,.view-heading>div { min-width:0; overflow-wrap:anywhere; }
.product-summary dl { display:flex; flex-wrap:wrap; gap:var(--space-4) var(--space-6); margin:0; }
.product-summary[data-product-section="general"] dl { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:var(--space-4) var(--space-6); }
.product-summary[data-product-section="general"] dl>div { min-width:0; overflow-wrap:anywhere; }
@media(max-width:1100px) {
 .product-summary[data-product-section="general"] dl { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(max-width:700px) {
 .product-summary[data-product-section="general"] dl { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:400px) {
 .product-summary[data-product-section="general"] dl { grid-template-columns:minmax(0,1fr); }
}
.product-summary dt { color:var(--admin-muted); font-size:var(--data-label-size); margin-bottom:var(--data-label-spacing); }
.product-summary dd { margin:0; font-weight:var(--data-value-weight); }
.product-summary>p { margin-top:var(--space-5); white-space:pre-wrap; }
.client-summary dl { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-4) var(--space-6); }
.client-summary dl>div { min-width:0; overflow-wrap:anywhere; }
.detail-heading-secondary { font-size:var(--text-0-94-rem); font-weight:400; }
@media(max-width:1100px) { .client-summary dl { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:700px) { .client-summary dl { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:400px) { .client-summary dl { grid-template-columns:minmax(0,1fr); } }
.external-id { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.form-details { min-width:0; }
.form-details summary { cursor:pointer; font-weight:700; margin:var(--space-10-px) 0 var(--space-5); }
/* A form grid owns section spacing; do not add collapsed-summary/paragraph margins. */
.form-grid .form-details > summary { margin:0; }
.form-grid .form-details[open] > summary { margin-bottom:var(--space-3); }
.form-grid .form-details > p { margin:0 0 var(--space-3); }
.form-details .form-grid > p { margin:0; }

.document-line { display:grid; grid-template-columns:minmax(0,1fr) 100px 36px; gap:var(--space-3); margin:0 0 var(--space-10-px); padding:var(--space-10-px); border:var(--stroke-1) solid var(--line); border-left:var(--stroke-3) solid var(--line); border-radius:var(--radius-8); align-items:end; }
.document-line > * { min-width:0; }
.document-line.is-selected { border-color:var(--admin-action); background:var(--admin-active-bg,#f2f7fc); }
.document-line:focus-visible { outline:2px solid var(--admin-action); outline-offset:2px; }
.document-lines-toolbar { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); }
.document-lines-actions { display:flex; gap:var(--space-2); }
.document-lines-empty { font-size:var(--text-0-82-rem); margin:var(--space-2) 0 var(--space-3); }
.document-line .line-price:empty { display:none; }
@media(max-width:600px) { .document-line { grid-template-columns:minmax(0,1fr) 72px 36px; gap:var(--space-2); padding:var(--space-2); } }
.line-price { grid-column:1/-1; }
/* Document concepts use the same order, scale and numeric alignment as the editor. */
.data-table.document-concepts-table { min-width:760px; font-size:var(--table-font-size); }
.document-concepts-table th { font-size:var(--text-0-8125-rem); }
.document-concepts-table :is(th,td) { padding:var(--table-detail-cell-padding-y) var(--space-10-px); vertical-align:top; }
.document-concepts-table :is(th,td):nth-child(n+2)  { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.document-totals { padding:var(--space-6); text-align:right; }
.document-review { padding:var(--space-4) var(--space-18-px); }
.document-review .heading-actions { gap:var(--space-2); }
.document-validation-errors { margin:0 0 var(--space-3); color:var(--red); }
.document-validation-errors h3 { margin:0; font-size:var(--text-0-9375-rem); }
.document-review ul { margin:var(--space-6-px) 0 0; padding-left:var(--space-5); line-height:1.5; overflow-wrap:anywhere; }
.document-review li + li { margin-top:var(--space-1); }
.document-review-warnings { margin:0 0 var(--space-3); }
.document-review-warnings summary { width:fit-content; color:var(--color-warning-summary); cursor:pointer; font-size:var(--text-0-875-rem); font-weight:550; }
.document-review-warnings ul { color:var(--admin-muted); font-size:var(--text-0-9375-rem); }
.document-review > .check-label { margin:var(--space-10-px) 0 var(--space-3); align-items:flex-start; font-size:var(--text-0-875-rem); }
.document-review .document-review-hint { margin:var(--space-2) 0 0; font-size:var(--text-0-8125-rem); }

.check-label { display:flex; gap:var(--space-10-px); align-items:center; font-size:var(--text-0-88-rem); }
.check-label input { width:20px; min-height:20px; height:20px; flex:0 0 20px; accent-color:var(--admin-action); }
dialog { width:min(640px,calc(100% - 36px)); border:var(--stroke-1) solid var(--line); border-radius:var(--radius-14); padding:var(--space-26-px); color:var(--ink); box-shadow:var(--shadow-dialog); }
dialog::backdrop { background:var(--backdrop-dialog); }
.dialog-header { display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); }
.dialog-header h2 { margin:0; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:var(--space-5); }
.wide { grid-column:1/-1; }
@media(max-width:700px) {
.environment-label { display:none; }
.section-heading { align-items:flex-start; flex-direction:column; padding:0 0 var(--space-14-px); }
.form-grid { grid-template-columns:1fr; }
.wide { grid-column:auto; }
.table-panel { padding:var(--space-18-px); }
}
.preserve-lines { white-space:pre-wrap; overflow-wrap:anywhere; }
pre.preserve-lines { font:inherit; }
.rule-builder {border-top:var(--stroke-1) solid var(--line);padding-top:var(--space-4);min-width:0}
.rule-row {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-10-px);margin:var(--space-3) 0;padding:var(--space-3);background:var(--soft);border-radius:var(--radius-8)}
.rule-row .rule-remove {justify-self:start}
.rule-builder h3 {margin-bottom:var(--space-2)}
.secondary-line {display:block}
.rule-builder select {max-width:100%}
@media(max-width:600px) {
.rule-row {grid-template-columns:1fr}
}
dialog:has(.rule-builder) {width:min(940px,calc(100% - 36px))}
.shopify-attention {display:inline-flex;align-items:center;gap:var(--space-7-px);color:var(--notice-attention-ink);font-weight:600}
.attention-icon {width:21px;height:21px;min-width:21px;vertical-align:middle}
.notice-inline { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-4); }
.notice-inline > p { margin:0; min-width:0; }
.notice-inline > button { flex-shrink:0; }
.notice-panel-attention {border-color:var(--notice-attention-border);background:var(--notice-attention-surface)}
.shopify-warning-text {margin:var(--space-14-px) 0}
.shopify-warning-text .shopify-attention {align-items:flex-start}
.shopify-attention {max-width:100%;overflow-wrap:anywhere}
.attention-icon {flex-shrink:0}
.status-pill .attention-icon {width:1em;height:1em;min-width:1em}
.openai-continue { background:var(--color-provider); border-color:var(--color-provider); color:var(--color-white); }
#openai-welcome { max-width:520px; padding:var(--space-28-px); border:var(--stroke-1) solid var(--line); border-radius:var(--radius-16); }
.shopify-connection-details { overflow-wrap:anywhere; }
.shopify-connection-details .form-actions { flex-wrap:wrap; justify-content:flex-start; }
.core-lot-line { margin:var(--space-3) 0; padding:var(--space-14-px); border:var(--stroke-1) solid var(--line); border-radius:var(--radius-8); min-width:0; }
.core-lot-line label { margin:var(--space-10-px) 0; }
.core-correction-notice { padding:var(--space-4); border:var(--stroke-1) solid var(--notice-attention-border); border-radius:var(--radius-8); margin-bottom:var(--space-18-px); overflow-wrap:anywhere; }
.incident-counts { display:flex; flex-wrap:wrap; gap:var(--space-10-px) var(--space-6); margin-bottom:var(--space-18-px); }
.incident-history { border-top:var(--stroke-1) solid var(--line); padding:var(--space-14-px) 0; }
.incident-history summary { cursor:pointer; font-weight:600; }
.incident-history dt { color:var(--admin-muted); font-size:var(--data-label-size); margin-top:var(--space-3); }
.incident-history dd { margin:var(--space-1) 0; }
[data-incident-row] { cursor:pointer; }

/* Zeus layouts use Feedbi primitives; technical identifiers retain compatibility. */
[hidden] { display:none !important; }
form { display:grid; gap:var(--space-14-px); min-width:0; }
.admin-shell,.dashboard,#view,form,fieldset,.form-grid>* { min-width:0; }
.admin-nav { flex-wrap:wrap; }
.admin-header { display:grid; }
/* The application frame is shared; dense list content opts in separately below. */
/* Keep the viewport width constant when short and long modules alternate. */
html:has(.dashboard:not([hidden])) { overflow-y:scroll; }
.admin-shell:has(> .dashboard:not([hidden])) { width:min(var(--workspace-max-width),100%); padding:var(--space-4) var(--workspace-gutter) var(--space-48-px); }
.admin-header { grid-template-columns:minmax(0,1fr) auto; margin-bottom:var(--space-2); gap:var(--space-3); }
.admin-brand { font-size:var(--text-1-25-rem); font-weight:var(--weight-emphasis); gap:var(--space-2); }
.admin-brand img { width:32px; height:32px; flex-basis:32px; filter:none; }
.user-menu-button { width:40px; height:40px; padding:0; font-size:var(--text-0-9375-rem); font-weight:var(--weight-medium); }
.admin-header .header-actions { justify-content:flex-end; align-items:center; }
.admin-nav { gap:var(--space-1) var(--space-4); }
.admin-nav button { font-size:var(--nav-font-size); font-weight:var(--weight-medium); }
.admin-nav button:is(.is-active,[aria-current="page"]) { font-weight:var(--weight-emphasis); }
/* Reserve the selected label width in both navigation states. */
.admin-nav .action-label-measure,.product-tabs .action-label-measure { font-weight:var(--weight-emphasis); }
.admin-body { --nav-active-color:var(--admin-ink); }
.admin-nav > button::after { content:none; }
.admin-nav > button,.product-tabs [role=tab] { position:relative; isolation:isolate; cursor:pointer; }
.admin-nav > button::before,.product-tabs [role=tab]::before { content:""; position:absolute; inset:4px -6px; z-index:-1; border-radius:var(--workspace-control-radius); pointer-events:none; }
.admin-nav > button:is(.is-active,[aria-current="page"])::before { background:var(--nav-hover-bg); }
@media (hover:hover) {
 .admin-nav > button:not(:disabled):not([aria-disabled="true"]):hover::before,.product-tabs [role=tab]:not(:disabled):not([aria-disabled="true"]):hover::before { background:var(--nav-hover-bg); }
}
.admin-nav > button:focus-visible::before,.product-tabs [role=tab]:focus-visible::before { background:var(--nav-hover-bg); }
/* Absorb the horizontal gap into the hit areas without moving labels or paint. */
@media(min-width:821px) {
 .admin-nav > button { padding-inline:calc(var(--space-2-px) + var(--space-4) / 2); margin-inline:calc(var(--space-4) / -2); }
 .admin-nav > button::before { inset-inline:calc(var(--space-4) / 2 - 6px); }
}


@media(max-width:820px) {
 .admin-shell:has(> .dashboard:not([hidden])) { --workspace-gutter:16px; }
 .admin-header { grid-template-columns:minmax(0,1fr) auto; }
 .user-menu-button { width:44px; height:44px; }
 .admin-header .user-menu-panel { left:auto; right:0; }
}
#editor label { color:var(--admin-muted); font-weight:650; }
.view-heading { display:flex; align-items:flex-start; justify-content:space-between; margin:0 0 var(--space-4); gap:var(--view-heading-gap); }
.view-heading h1 { font-size:var(--view-heading-size); line-height:var(--view-heading-line-height); font-weight:var(--view-heading-weight); letter-spacing:0; margin:0 0 var(--space-2); }
.view-heading p { font-size:var(--text-0-94-rem); line-height:1.45; color:var(--admin-muted); }
.panel { min-width:0; }
.panel .view-heading { margin:0 0 var(--view-heading-gap); }
.panel .view-heading h1 { margin:0; }
p { line-height:1.45; }
.card-grid { gap:var(--space-14-px); grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); }
.form-grid { gap:var(--space-14-px); grid-template-columns:repeat(2,minmax(0,1fr)); }
.search-form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:var(--space-14-px); margin:0 0 var(--space-4); }
.search-form input { max-width:none; }
.search-form label { display:grid; }
.search-form .sr-only { position:static; clip:auto; width:auto; height:auto; margin:0; overflow:visible; white-space:normal; }
input[type="checkbox"],input[type="radio"] { min-height:auto; width:20px; height:20px; accent-color:var(--admin-action); }
/* Same 16px chevron as the public Feedbi backoffice reference. */
select:not([multiple]):is(:not([size]),[size="0"],[size="1"]) {
  appearance:none;
  background-image:var(--select-chevron);
  background-position:right 12px center;
  background-repeat:no-repeat;
  background-size:16px;
  padding-right:var(--space-36-px);
}
select:is([multiple],[size]:not([size="0"],[size="1"])) { background-image:none; padding-right:var(--space-4); }
summary { position:relative; list-style:none; padding-right:var(--space-28-px); cursor:pointer; }
summary::marker { content:""; }
summary::-webkit-details-marker { display:none; }
summary::after {
  content:""; position:absolute; right:0; top:50%; width:16px; height:16px;
  background:var(--select-chevron) center / var(--space-4) var(--space-4) no-repeat;
  transform:translateY(-50%) rotate(-90deg);
}
details[open]>summary::after { transform:translateY(-50%); }
summary:focus-visible { outline:2px solid var(--focus); outline-offset:3px; border-radius:var(--radius-4); }
.filters { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.form-actions,.heading-actions { flex-wrap:wrap; align-items:center; }
.form-actions.query-actions-bottom { align-self:flex-end; }

.link-button.subtle-action { color:var(--admin-muted); font-size:var(--text-0-8125-rem); font-weight:400; min-height:24px; margin-inline-start:var(--space-1); padding:0 var(--space-1); text-decoration:underline; text-underline-offset:2px; }
.detail-footer-actions { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-4); padding-inline:var(--space-5); }
.detail-footer-actions > .subtle-action { margin:0; padding-inline:0; }
.link-button.subtle-action-icon { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; padding:0; vertical-align:middle; text-decoration:none; }
.subtle-action-icon svg { width:12px; height:12px; flex-shrink:0; }
.notice { margin:0 0 var(--space-4); }
.notice, .error-text { overflow-wrap:anywhere; }
.notice.is-error { color:var(--red); background:color-mix(in srgb,var(--red) 7%,var(--paper)); border-color:color-mix(in srgb,var(--red) 30%,var(--line)); }
.empty-table { color:var(--admin-muted); line-height:1.45; }
.compact-empty-panel > .section-heading { display:grid; grid-template-columns:minmax(0,1fr) fit-content(50%); min-height:0; padding:0; gap:var(--space-3); }
.compact-empty-panel > .section-heading h2 { margin:0; }
.compact-empty-panel .empty-table { display:block; min-height:0; padding:0; margin:var(--space-1) 0 0; }
@media(max-width:600px) {
 .compact-empty-panel > .section-heading { row-gap:var(--space-1); }
 .compact-empty-panel > .section-heading > div:has(> .empty-table) { display:contents; }
 .compact-empty-panel > .section-heading > div > :is(h2,.heading-with-help) { grid-column:1; grid-row:1; }
 .compact-empty-panel > .section-heading > :is(button,a,.heading-actions) { grid-column:2; grid-row:1; }
 .compact-empty-panel > .section-heading > div > p { grid-column:1/-1; }
 .compact-empty-panel .empty-table { margin:0; }
}
.status-pill { font-size:var(--text-0-82-rem); }
.table-wrap { max-width:100%; }
.table-wrap:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
.environment-label { border:0; border-radius:0; padding:0; }
.login-panel label { display:block; }
.login-panel .check-label { display:flex; text-align:left; }
.login-panel .auth-text-link { border:0; background:transparent; padding:0; }
/* Acceso: ritmo vertical compartido por login, OTP, recuperación y alta. */
.login-panel .error-text { margin:var(--space-5) 0 0; }
.login-panel .link-button { margin-top:var(--space-6); }
#recovery-help { margin:var(--space-6) auto 0; }
#recovery-copy { margin:var(--space-14-px) 0 0; text-align:center; }
.login-panel .login-copy:empty,.error-text:empty { display:none; }
#access-form { gap:var(--space-5); }
#access-panel .login-brand { margin:var(--space-26-px) 0 0; }
#editor { max-height:min(760px,calc(100dvh - 48px)); overflow:auto; padding:var(--space-6); box-shadow:var(--shadow-modal-card); }
#editor::backdrop { background:var(--palette-rgba-24-33-47-0-42); backdrop-filter:blur(2px); }
#editor .dialog-header { align-items:flex-start; gap:var(--space-4); margin-bottom:0; }
#editor-form > .error-text { margin:0; }
#editor .dialog-header h2 { font-size:var(--text-1-35-rem); letter-spacing:0; }
#editor.inline-editor { position:static; width:100%; max-height:none; margin:var(--space-4) 0; padding:var(--space-18-px); box-shadow:var(--shadow-login-card); border-radius:var(--radius-12); }
.icon-button { display:grid; place-items:center; }
button.is-loading-action { cursor:progress; opacity:.72; }
@media(max-width:1120px) and (min-width:821px) { .filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:820px) {
 .view-heading,.section-heading { flex-direction:column; align-items:flex-start; gap:var(--space-14-px); }
 .section-heading { min-height:0; }
 .filters,.search-form,.form-grid { grid-template-columns:minmax(0,1fr); }
 .wide { grid-column:auto; }
 .search-form button,.filters>.primary-button,.filters>.secondary-button { width:100%; }
 .admin-nav { flex-wrap:unset; }
 .admin-nav button { min-height:44px; }
 .heading-actions { max-width:100%; }
}

.product-section { margin-top:var(--space-4); }
.card-grid>.panel { margin-bottom:0; }
.catalog-panel .catalogue-scope { margin-bottom:0; }
.list-state-filter { display:flex; align-items:center; gap:var(--space-2); margin:0; font-size:var(--text-14-px); }
.list-state-filter select { width:148px; margin:0; }
.module-toolbar:has(>.has-state-filter) { flex-wrap:wrap; }


.module-toolbar { display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:var(--module-toolbar-gap) var(--space-5); margin:0 0 var(--module-toolbar-spacing); }
/* Context above filters: identity or account data with visible actions. */
.module-toolbar.module-context-toolbar { align-items:flex-start; }
.module-toolbar>.module-filters { flex:1 1 620px; min-width:0; margin:0; }
.module-toolbar>.module-main-actions { margin-left:auto; flex:0 1 auto; }
.section-heading.module-toolbar:last-child { margin-bottom:0; }
.module-main-actions>button,.module-main-actions>a { white-space:nowrap; }
.module-filters.form-grid { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); align-items:end; }
/* Optional filters sized by content role, shared across report tasks. */
.module-filters.filter-fields,.filter-fields > .filter-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--query-control-gap); }
.filter-fields > .filter-row,.filter-fields > .form-details,.filter-fields > .form-actions { flex:0 0 100%; min-width:0; }
.filter-fields > .filter-row > :is(label,.record-picker) { flex:0 1 12rem; width:12rem; max-width:100%; min-width:0; }
.filter-fields > .filter-row > .filter-field-category { flex-basis:14rem; width:14rem; }
.filter-fields > .filter-row > .filter-field-date { flex-basis:10rem; width:10rem; }
.filter-fields > .filter-row > :is(.filter-field-search,.filter-field-long) { flex-basis:16rem; width:16rem; }
/* A help icon occupies its own space; keep the long control's 16rem. */
@media(min-width:601px) {
 .filter-fields > .filter-row > .filter-field-long.heading-with-help { flex-basis:calc(16rem + 18px + 6px); width:calc(16rem + 18px + 6px); }
}
.filter-fields > .filter-row > .record-picker { flex-basis:20rem; width:20rem; }
.filter-fields > .filter-row:has(> .record-picker) { align-items:flex-start; }
.filter-fields > .form-actions,.filter-fields > .filter-row > .form-actions { margin:0; gap:var(--query-control-gap); }
.list-toolbar-main { display:flex; align-items:flex-start; gap:var(--space-5); width:100%; min-width:0; }
.list-toolbar-main>.filter-row { display:flex; flex:1; flex-wrap:wrap; gap:var(--space-3) var(--space-4); min-width:0; }
.list-toolbar-main>.filter-row>label { flex:0 1 12rem; width:12rem; max-width:100%; min-width:0; }
.list-toolbar-main>.filter-row>.filter-field-search { flex:1 1 16rem; }
.list-toolbar-main>.module-main-actions { flex:none; }
/* Opt-in: the trailing secondary filter spans the search and creation actions. */
.list-toolbar-secondary { display:flex; flex-wrap:wrap; gap:var(--space-3) var(--space-4); flex:0 0 100%; min-width:0; }
.list-toolbar-secondary>.filter-row { display:contents; }
.list-toolbar-alignment { container-type:inline-size; }

@media(max-width:600px) {
 .list-toolbar-main { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:var(--space-3); }
 .list-toolbar-main>.filter-row { display:contents; }
 .list-toolbar-main>.filter-row>label { grid-column:1/-1; width:100%; }
 .list-toolbar-main>.filter-row>button { justify-self:start; }
 .list-toolbar-main>.module-main-actions { align-self:start; }
}
.filter-fields > .form-details > summary,.report-flow .form-details > summary { margin:0; }
.filter-fields > .form-details[open] > summary,.report-flow .form-details[open] > summary { margin-bottom:var(--space-3); }
@media(max-width:600px) {
 .filter-fields > .filter-row > :is(label,.record-picker,.filter-field-category,.filter-field-date,.filter-field-search,.filter-field-long) { flex-basis:100%; width:100%; }
}
/* Short month filters keep their content width at every viewport. */
.filter-fields > .filter-row > .filter-field-month { flex:0 0 9rem; width:9rem; }
.module-panel>.module-section,.module-panel>[data-live-results]>.module-section { padding:0; margin:0 0 var(--space-5); }
.module-panel>.module-section:last-child,.module-panel>[data-live-results]>.module-section:last-child { margin-bottom:0; }
.module-panel>.view-heading { min-width:0; grid-column:1/-1; align-items:flex-start; }
.module-panel>.view-heading h1 { overflow-wrap:anywhere; }
.module-panel>.view-heading+.module-toolbar { margin-top:0; }
.module-panel .module-section>h2 { margin-top:0; }
@media(max-width:820px) {
 .module-toolbar { align-items:stretch; flex-direction:column; gap:var(--module-toolbar-gap); }
 .module-toolbar.module-context-toolbar { flex-direction:row; }
 .module-toolbar>.module-filters { flex:auto; width:100%; max-width:none; }
 .module-filters.form-grid { grid-template-columns:minmax(0,1fr); }
 .module-main-actions { align-self:flex-end; max-width:100%; }
 .module-main-actions>button,.module-main-actions>a { white-space:normal; }
}
/* Simple search/create toolbars keep the same breakpoint as Products. */



#editor.inline-editor .dialog-header h2 { font-size:var(--text-1-15-rem); }
.row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-2) var(--space-4); }
.heading-actions a { color:var(--blue); font-weight:700; text-decoration:none; }
.heading-actions a:not(.primary-button):not(.secondary-button):hover { text-decoration:underline; }
@media(max-width:820px) { .card-grid { grid-template-columns:minmax(0,1fr); } }
@media(max-width:820px) { .user-menu-panel { left:0; right:auto; max-width:calc(100vw - 36px); } }
.status-pill.inactive { color:var(--muted); background:color-mix(in srgb,var(--muted) 18%,transparent); }
/* Malva informativo: separado del azul de los enlaces navegables. */
.status-pill.draft,.status-pill.lot-in-use { color:var(--chip-info); background:color-mix(in srgb,var(--chip-info) 14%,transparent); }
.status-pill.status-pending,.status-pill.lot-next { color:color-mix(in srgb,var(--orange) 60%,black); background:color-mix(in srgb,var(--orange) 18%,transparent); }
/* Shared categorical palette; these colors identify groups, not operational states. */
.status-pill.category-chip { color:var(--category-ink,#526171); background:var(--category-bg,#e7e9ee); }
.category-green { --category-ink:#216943; --category-bg:#d9edc9; }
.category-blue { --category-ink:#195d91; --category-bg:#d2e9f8; }
.category-red { --category-ink:#9b2c31; --category-bg:#f9d8d6; }
.category-yellow { --category-ink:#73501b; --category-bg:#ffedb0; }
.category-orange { --category-ink:#874814; --category-bg:#ffdcc5; }
.category-purple { --category-ink:#654486; --category-bg:#e7daf3; }
.category-slate { --category-ink:#315f6d; --category-bg:#d5e7eb; }
.category-pink { --category-ink:#88356b; --category-bg:#f7d5eb; }

.initial-product-fields { margin:0; padding:var(--space-18-px); border:var(--stroke-1) solid var(--line); border-radius:var(--radius-8); }
.initial-product-fields legend { padding:0 var(--space-6-px); font-weight:700; }

/* Paginación del backoffice Feedbi: geometría y estados conservados. */
.table-pagination {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  justify-content: flex-start;
  padding-top: var(--space-14-px);
}

.pagination-controls {
  display: inline-flex;
}

.pagination-controls button {
  align-items: center;
  background: var(--paper);
  border: var(--stroke-1) solid var(--line);
  color: var(--ink);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.pagination-controls button:first-child {
  border-radius: var(--radius-9) 0 0 var(--radius-9);
}

.pagination-controls button:last-child {
  border-left: 0;
  border-radius: 0 var(--radius-9) var(--radius-9) 0;
}

.pagination-controls svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 18px;
}
.table-pagination[hidden]{display:none}.table-pagination{flex-wrap:wrap}.pagination-range{color:var(--ink);font-size:var(--text-1-rem)}.table-wrap[data-pagination="local"] tbody tr[hidden]{display:none}

/* Product detail: same typography, controls and active accent as the main navigation. */
.product-tabs { --tab-hit-gap:var(--space-5); display:flex; flex-wrap:wrap; gap:0 var(--tab-hit-gap); margin-top:var(--space-5); border-bottom:var(--stroke-1) solid var(--border,#dce4ec); }
/* Initial task tabs follow module navigation; detail tabs retain their header gap. */
#view > .sr-only:first-child + .detail-tabs { margin-top:0; }
.dashboard:has(> #view > .sr-only:first-child + .detail-tabs) > .admin-nav { margin-bottom:var(--space-2); }
.product-tabs [role=tab] { appearance:none; border:0; border-bottom:var(--stroke-1) solid transparent; border-radius:0; background:transparent; padding:var(--space-3) var(--space-2-px); color:var(--muted,#64748b); font:inherit; font-size:var(--nav-font-size); font-weight:var(--weight-medium); cursor:pointer; }
/* Split each gap between adjacent hit areas, preserving labels, paint and underline. */
.product-tabs [role=tab]::after { content:""; position:absolute; inset:0 calc(var(--tab-hit-gap) / -2); z-index:-1; }
.product-tabs [role=tab][aria-selected=true] { color:var(--nav-active-color); border-bottom-color:var(--nav-active-line); font-weight:var(--weight-emphasis); }
.product-tabs [role=tab]:not(:disabled):not([aria-disabled="true"]):hover { color:var(--nav-active-color); }
.product-tabs [role=tab]:focus-visible { outline:2px solid var(--nav-active-color); outline-offset:-2px; }
.product-tab-panel[hidden] { display:none; }
.product-tab-panel { padding-top:var(--space-5); }
.product-tab-content { min-height:var(--product-tab-min-height,0px); }
/* The inline form already supplies the page height while it is open. Keep
   the tab's scroll reserve for consultation, without a gap before the form. */
#dashboard:has(+ #editor.inline-editor[open]) .product-tab-content { min-height:0; }
.product-tab-panel > .product-section:first-child { margin-top:0; }
.product-tab-panel:focus-visible { outline:2px solid var(--color-focus-action); outline-offset:4px; }
@media(max-width:680px) { .product-tabs { --tab-hit-gap:var(--space-3); } .product-tabs [role=tab] { padding:var(--space-10-px) 0; } }
.row-action-menu-panel { max-height:calc(100dvh - 16px); overflow-y:auto; }

/* Feedbi controls: shared sizing; search actions align with the input itself. */
/* Compact list refresh follows Feedbi's dashboard control. */
.refresh-button { display:inline-flex; align-items:center; justify-content:center; align-self:center; flex:none; width:34px; height:34px; min-height:34px; padding:0; border:var(--stroke-1) solid var(--admin-action); border-radius:var(--radius-pill); background:var(--admin-action); color:var(--color-white); font-size:var(--text-1-rem); font-weight:900; line-height:1; cursor:pointer; }

.view-heading:has(> .heading-actions > .refresh-button) { flex-direction:row; align-items:flex-start; }
.view-heading:has(> .heading-actions > .refresh-button) > .heading-actions { flex:none; margin-left:auto; }

/* Direct table inspection uses Feedbi's compact eye control. */
.table-icon-button { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-height:32px; padding:var(--space-5-px); vertical-align:middle; border:var(--stroke-1) solid transparent; border-radius:var(--radius-6); background:transparent; color:var(--blue); cursor:pointer; }

.table-icon-button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:var(--stroke-2); stroke-linecap:round; stroke-linejoin:round; }

.search-form>.primary-button,.search-form>.secondary-button { align-self:end; }
/* Multi-node fields keep the same label/control spacing as plain labels. */
.form-field { display:grid; gap:var(--space-6-px); min-width:0; }
/* Share label/control tracks so companion options align to the control itself. */
.form-control-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto; gap:var(--space-6-px) var(--space-14-px); min-width:0; }
.form-control-pair > .form-field { grid-row:1 / span 2; grid-template-rows:subgrid; }
.form-control-pair > .check-label { grid-column:2; grid-row:2; align-self:center; }
@media(max-width:820px) {
 .form-control-pair { grid-template-columns:minmax(0,1fr); grid-template-rows:none; gap:var(--space-14-px); }
 .form-control-pair > .form-field { grid-row:auto; grid-template-rows:none; }
 .form-control-pair > .check-label { grid-column:auto; grid-row:auto; }
}

.heading-with-help { display:flex; align-items:center; gap:var(--space-6-px); min-width:0; }
.heading-with-help>h1,.heading-with-help>h2,.heading-with-help>h3 { min-width:0; }
/* Minimal save feedback: the same slot in every state, next to a heading. */
.save-status { display:inline-flex; flex:0 0 var(--space-5); width:var(--space-5); height:var(--space-5); color:var(--admin-action); }
.save-status > .save-status-control { display:inline-grid; place-items:center; width:100%; height:100%; min-height:0; padding:0; border:0; border-radius:var(--radius-control); background:transparent; color:inherit; line-height:1; }
.save-status svg { width:var(--space-4); height:var(--space-4); fill:none; stroke:currentColor; stroke-width:var(--stroke-2); stroke-linecap:round; stroke-linejoin:round; }
.save-status[data-state="saving"] { color:var(--admin-muted); }
.save-status[data-state="saving"] svg { animation:save-status-spin var(--status-spin-duration) linear infinite; }
.save-status[data-state="error"] { color:var(--red); }
@keyframes save-status-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .save-status[data-state="saving"] svg { animation:none; } }

.help-tip { position:relative; flex:0 0 18px; width:18px; height:18px; border:var(--stroke-1) solid var(--control-border-color); border-radius:50%; background:var(--surface-help); color:var(--muted); display:inline-grid; place-items:center; padding:0; font-size:var(--text-0-72-rem); font-weight:900; line-height:1; cursor:help; }

.floating-help-tooltip { position:fixed; z-index:1000; box-sizing:border-box; width:max-content; max-width:min(260px,calc(100vw - 24px)); max-height:calc(50dvh - 32px); overflow-y:auto; padding:var(--space-10-px) var(--space-3); border-radius:var(--radius-8); background:var(--color-ink-base); color:white; box-shadow:var(--shadow-floating-help-tooltip); font-size:var(--text-0-78-rem); font-weight:400; line-height:1.35; pointer-events:auto; text-align:left; white-space:pre-line; overflow-wrap:anywhere; }
/* A modal's top layer cannot display a body tooltip above it. */
#editor>.floating-help-tooltip { position:fixed; }
#view:has(.product-tabs),.product-tab-content { overflow-anchor:none; }
.financial-table tr[data-financial-state="current"] [data-money-amount] { font-weight:650; }
.financial-state:not(.inactive):not(.draft) { color:var(--admin-action); }
.financial-state.draft { color:color-mix(in srgb,var(--blue) 78%,black); }
.status-pill.status-suggestion { color:var(--blue); background:color-mix(in srgb,var(--blue) 10%,transparent); }
.status-pill.status-error { color:color-mix(in srgb,var(--red) 75%,black); background:color-mix(in srgb,var(--red) 15%,transparent); }
.data-table .status-pill { font-weight:var(--chip-weight); display:inline-block; max-width:100%; box-sizing:border-box; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.status-pill.financial-state-cancelled { background:color-mix(in srgb,var(--muted) 9%,transparent); }

.detail-heading-actions { align-items:center; }
p>.detail-heading-actions { display:inline-flex; margin-left:var(--space-10-px); vertical-align:middle; }

.catalogue-data { margin:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:var(--space-4) var(--space-6); }
.catalogue-data dt { color:var(--admin-muted); font-size:var(--data-label-size); margin-bottom:var(--data-label-spacing); }
.catalogue-data dd { margin:0; font-weight:var(--data-value-weight); white-space:pre-wrap; overflow-wrap:anywhere; }

/* Route snapshots only for the opted-in Products/Clients navigation. */
:root.is-view-transitioning {
  view-transition-name: none;
}
.is-view-transitioning .route-transition-surface { view-transition-name: zeus-route-content; }
/* Keep the normal dimmed pending state, then capture fully opaque new content.
   The snapshots perform the fade; a second live opacity tween would blink. */
.is-view-transitioning .route-transition-surface.content-transition { transition: none; }
:root.is-view-transitioning::view-transition { pointer-events: none; }
::view-transition-group(zeus-route-content) { animation: none; }
::view-transition-image-pair(zeus-route-content) { isolation: isolate; }
::view-transition-old(zeus-route-content),
::view-transition-new(zeus-route-content) {
  height: 100%;
  object-fit: none;
  object-position: left top;
  mix-blend-mode: normal;
  animation-duration: var(--view-transition-duration);
  animation-timing-function: var(--view-transition-easing);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(zeus-route-content),
  ::view-transition-old(zeus-route-content),
  ::view-transition-new(zeus-route-content) { animation: none; }
}

/* Search feedback stays outside controls and never steals the typing focus. */
.content-transition:not(.content-transition-table),.content-transition-table tbody,.content-transition-table:not(:has(table)) { transition:opacity var(--content-fade-duration) ease; }
.is-content-pending:not(.content-transition-table),.is-content-pending.content-transition-table tbody,.is-content-pending.content-transition-table:not(:has(table)) { opacity:var(--content-pending-opacity); transition-delay:80ms; }
.pagination-range { position:relative; font-variant-numeric:tabular-nums; white-space:nowrap; }
.pagination-range.is-rolling > .pagination-label { opacity:0; }
.pagination-roll { position:absolute; inset:0; display:flex; align-items:center; pointer-events:none; white-space:pre; }
.pagination-roll span::after { content:attr(data-new); }
.pagination-digit { position:relative; display:inline-block; width:1ch; height:1.25em; line-height:1.25; overflow:hidden; }
.pagination-digit::after { display:block; }
.pagination-digit.is-changing::before { content:attr(data-old); position:absolute; inset:0; animation:pagination-digit-out var(--pagination-roll-duration) ease both; }
.pagination-digit.is-changing::after { animation:pagination-digit-in var(--pagination-roll-duration) ease both; }
.pagination-roll { --digit-enter:100%; --digit-exit:-100%; }
.pagination-roll.is-backward { --digit-enter:-100%; --digit-exit:100%; }
@keyframes pagination-digit-in { from { transform:translateY(var(--digit-enter)); opacity:0; } to { transform:translateY(0); opacity:1; } }
@keyframes pagination-digit-out { from { transform:translateY(0); opacity:1; } to { transform:translateY(var(--digit-exit)); opacity:0; } }
@media (prefers-reduced-motion:reduce) {
 .content-transition,.content-transition tbody { transition:none!important; }
 .pagination-roll { display:none; }
 .pagination-range.is-rolling > .pagination-label { opacity:1; }
}
.search-feedback { margin:var(--space-3) 0; color:var(--admin-muted); font-size:var(--text-0-9-rem); }
.search-feedback.search-pending { position:absolute; width:1px; height:1px; padding:0; margin:calc(-1 * var(--stroke-1)); overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.search-feedback.error-text { color:var(--red); }
[role="listbox"] [role="option"][aria-selected="true"] { background:var(--surface-option-selected); outline:2px solid var(--blue); outline-offset:2px; }
.record-picker { min-width:0; }
.record-picker > [role="listbox"]:empty { display:none; }
.record-picker > [role="listbox"] { margin-top:var(--space-2); }
.record-picker [role="option"] { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.record-picker [role="presentation"] { margin:0 0 var(--space-2); }
.record-picker [role="presentation"]:last-child { margin-bottom:0; }

.fefo-warning {padding:var(--space-4);border:var(--stroke-1) solid var(--notice-attention-border);border-radius:var(--radius-12);background:var(--notice-attention-surface);color:var(--ink)}
.fefo-warning p {margin:var(--space-2) 0 var(--space-4)}
.fefo-warning .checkbox-label {display:flex;align-items:flex-start;gap:var(--space-10-px)}
.fefo-warning input[type=checkbox] { flex:0 0 20px; margin:var(--space-2-px) 0 0; }

/* Document pickers keep quantity aligned while their suggestions expand below. */
.document-line > .document-record-options,.document-line > .search-feedback { grid-column:1/-1; }
#editor .document-record-options:empty,.search-picker-options:empty { display:none; }
#editor .document-record-options [role="option"],.search-picker-options [role="option"] { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:left; }

/* Keep the shared lot overview separate from the tab underline. */

.table-text-excerpt { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.table-text-excerpt[data-help] { cursor:help; }
.table-name-excerpt:focus-visible,.table-text-excerpt:focus-visible,.table-value-excerpt:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.floating-help-tooltip.observation-tooltip { max-width:min(480px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow-y:auto; white-space:pre-wrap; font-size:var(--text-0-875-rem); font-weight:400; }
.floating-help-tooltip.observation-tooltip:not(.is-scrollable) { pointer-events:none; }
/* Preserve the document profile while allowing columns to follow enlarged text. */
.document-list-table .document-col-document { width:7.5rem; }
.document-list-table .document-date { white-space:nowrap; font-variant-numeric:tabular-nums; }
.invoice-list-table .invoice-paid { text-align:center; }

/* Shared sticky identity: header tint and body surface remain distinct. */
:is(.document-list-table,.lot-trace-list-table) :is(th,td):first-child:where(:not([colspan])) { position:sticky; left:0; z-index:1; background:var(--paper); box-shadow:var(--stroke-1) 0 0 var(--line); }
:is(.document-list-table,.lot-trace-list-table) thead th:first-child { z-index:2; background:var(--table-header-bg); }
:is(.document-list-table,.lot-trace-list-table) tbody tr:hover td:first-child:where(:not([colspan])) { background:var(--surface-row-hover); }

.document-list-table .status-pill { max-width:100%; box-sizing:border-box; white-space:nowrap; }

/* Balance product identity with the supporting fields, preserving complete text. */
.data-table.product-list-table { min-width:680px; }
.product-list-table :is(th,td):first-child  { overflow-wrap:anywhere; }
.product-list-table :is(th,td):nth-child(n+2) { white-space:nowrap; }

/* Give client identity and locality room; short fields follow their content. */
/* Two independent identities share remaining width; metadata stays compact. */
.data-table.client-list-table { table-layout:fixed; min-width:1100px; }
.client-list-table thead th,.client-list-table .status-pill { white-space:nowrap; }

/* Compact read-only cards: group related values and size headings to their content. */
.detail-card { display:grid; gap:var(--space-5); }
.detail-card > p,.detail-card > .view-heading,.detail-card > .module-toolbar,.detail-card > .detail-card-section { margin:0; }
.section-heading.compact-heading { min-height:0; padding:0; gap:var(--space-3); flex-direction:row; align-items:flex-start; }
.compact-heading h2,.detail-card-section h3 { margin:0; }
.compact-heading > .status-pill,.compact-heading > .shopify-attention { flex:0 0 auto; }
.detail-data-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-4) var(--space-6); margin:0; }
.detail-data-regular { --data-value-weight:var(--weight-regular); }
.detail-data-emphasized,.summary-metrics,.report-metrics,.detail-data-inline-prominent { --data-value-weight:var(--data-emphasis-weight); }
.data-value-emphasized { --data-value-weight:var(--data-emphasis-weight); font-weight:var(--data-emphasis-weight); }
.section-heading .section-title-primary { font-weight:var(--weight-primary); }
.detail-section-title,.detail-card-section h3 { font-size:var(--text-0-9375-rem); font-weight:var(--weight-emphasis); }
.detail-data-grid > div { min-width:0; }
.detail-data-grid dt { color:var(--admin-muted); font-size:var(--data-label-size); margin:0 0 var(--data-label-spacing); }
.detail-data-grid dd { margin:0; font-weight:var(--data-value-weight); overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.detail-data-note { display:block; margin-top:var(--space-1); color:var(--admin-muted); font-size:var(--data-note-size); font-weight:var(--weight-regular); }
/* Opt-in monthly trend and its period summary. */
.detail-data-grid.summary-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
.summary-metrics dd { font-size:var(--text-1-35-rem); }
.trend-chart-coverage { margin:var(--space-4) 0 0; font-size:var(--text-0-85-rem); }
.trend-chart { margin:var(--space-4) 0; min-width:0; }
.trend-chart-legend,.trend-chart-readout { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2) var(--space-5); }
.trend-chart-legend { justify-content:flex-start; color:var(--admin-muted); font-size:var(--text-0-8-rem); }
.trend-chart-key { display:inline-flex; align-items:center; gap:var(--space-2); }
.trend-chart-key::before { content:""; width:20px; border-top:var(--stroke-3) solid var(--green); }
.trend-chart-key.is-provisional::before { border-top-style:dashed; }
.trend-chart-readout { min-height:28px; margin:var(--space-4) 0 var(--space-2); font-size:var(--text-0-9-rem); font-variant-numeric:tabular-nums; }
.trend-chart-frame { min-width:0; touch-action:pan-y; }
.trend-chart-frame svg { display:block; max-width:100%; overflow:visible; }
.trend-chart-grid { stroke:var(--line); stroke-width:1; }
.trend-chart-axis { fill:var(--admin-muted); font-size:var(--text-12-px); }
.trend-chart-area { fill:var(--green); opacity:.08; }
.trend-chart-line { fill:none; stroke:var(--green); stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.trend-chart-line.is-provisional { stroke-dasharray:5 5; }
.trend-chart-dot { fill:var(--green); }
.trend-chart-dot.is-provisional { fill:var(--paper); stroke:var(--green); stroke-width:2; }
.trend-chart-cursor { stroke:var(--admin-muted); stroke-width:1; stroke-dasharray:3 5; opacity:.5; }
.trend-chart-selected { fill:var(--green); stroke:var(--paper); stroke-width:2; }
.trend-chart-selected.is-provisional { fill:var(--paper); stroke:var(--green); }
.trend-chart-control { display:block; color:var(--admin-muted); font-size:var(--text-0-8-rem); }
.trend-chart-control .trend-chart-range { width:100%; height:24px; min-height:24px; padding:0; margin-top:var(--space-1); accent-color:var(--green); }
.data-table.trend-chart-data-table { min-width:0; }
@media(max-width:600px) { .detail-data-grid.summary-metrics { grid-template-columns:minmax(0,1fr); gap:var(--space-4); } }
/* Document identity, fiscal data and financial balance share one compact surface. */
.document-summary .document-summary-identity { display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-2) var(--space-3); margin-bottom:var(--space-1); }
.document-summary .document-summary-identity .status-pill { flex:0 0 auto; }
.document-summary [data-payment-status] { display:inline-flex; }
.document-summary .document-payment-help { margin:var(--space-10-px) 0 0; font-size:var(--text-0-875-rem); }
.document-economic-detail > summary { font-weight:600; color:var(--ink,#263548); }
.document-economic-body { display:grid; gap:var(--space-5); margin-top:var(--space-5); }
.document-economic-section { min-width:0; }
.document-economic-section + .document-economic-section { border-top:var(--stroke-1) solid var(--line); padding-top:var(--space-5); }
.document-economic-section h2,.document-economic-section h3 { margin:0 0 var(--space-3); font-size:var(--text-0-9375-rem); font-weight:600; }
.document-economic-section > p { margin:var(--space-2) 0 0; }
.document-rectifications > .section-heading { margin-bottom:var(--space-14-px); }
.document-rectifications .data-table  { table-layout:fixed; }
.document-rectifications .rectification-number { width:40%; }
.document-rectifications .rectification-amount { width:26%; }
.document-rectifications .rectification-state { width:34%; }
.document-rectifications .link-button { overflow-wrap:anywhere; }
.document-rectifications .status-pill { overflow-wrap:normal; }
.document-rectifications td:nth-child(2) { white-space:nowrap; font-variant-numeric:tabular-nums; }
/* Related reading groups: flexible names, compact metadata and adjacent totals. */
.detail-data-groups { display:flex; flex-wrap:wrap; align-items:flex-start; gap:var(--space-4) var(--space-6); margin-top:var(--space-4); }
.detail-data-groups > .detail-data-grid { display:grid; flex:1 1 28rem; margin:0; gap:var(--space-4) var(--space-6); }
.detail-data-inline { display:flex; flex-wrap:wrap; align-items:flex-start; gap:var(--space-4) var(--space-6); min-width:0; margin:0; }
.detail-data-groups > .detail-data-inline { flex:0 1 auto; max-width:100%; margin:0; gap:var(--space-4) var(--space-6); }
.detail-data-inline > div { min-width:0; max-width:100%; }
/* Opt-in breathing room for short reading summaries; compact spacing on mobile. */
@media(min-width:601px) { [data-layout-composition="data-list"].detail-data-spaced { column-gap:calc(var(--space-6) + var(--space-3)); } }
.detail-data-grid.detail-data-grid-identity { grid-template-columns:minmax(0,8rem) minmax(0,1fr); }
@media(max-width:600px) { .detail-data-grid.detail-data-grid-identity { grid-template-columns:minmax(0,1fr); } }
.detail-data-inline dt { color:var(--admin-muted); font-size:var(--data-label-size); margin:0 0 var(--data-label-spacing); }
.detail-data-inline dd { margin:0; font-size:var(--data-inline-value-size); font-weight:var(--data-value-weight); overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.detail-data-inline-prominent dd { font-size:var(--text-1-15-rem); line-height:1.3; }
.detail-data-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-4) var(--space-6); margin-top:var(--space-4); padding-top:var(--space-4); border-top:var(--stroke-1) solid var(--line); }
.detail-data-footer > .detail-data-inline { margin:0; gap:var(--space-4) var(--space-6); }
.document-summary .detail-data-grid dd { font-size:var(--text-0-94-rem); }
.document-summary abbr { text-decoration:none; }
.detail-card-section { display:grid; gap:var(--space-3); min-width:0; }
.detail-card-section > p { margin:0; }
/* Compact text groups share breathing room on both sides of each divider. */
.detail-card-section-separated { border-top:var(--stroke-1) solid var(--line); padding-block:var(--space-3); gap:var(--space-2); }
.detail-card-section-separated:last-child { padding-bottom:0; }
.detail-card-section-separated > header { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-3); }
.detail-card-section-separated > header > .heading-actions { flex:none; }
.detail-card-section-separated h3 { color:var(--ink,#263548); }
.detail-card-section-separated > header .link-button { flex-shrink:0; min-height:32px; padding:var(--space-1) var(--space-2); font-size:var(--text-0-875-rem); }
.detail-card-section-separated > p { font-size:var(--text-0-9375-rem); }
@media(max-width:900px) { .detail-data-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .section-heading.compact-heading { flex-wrap:wrap; gap:var(--space-2); } }
@media(max-width:360px) { .detail-data-grid { grid-template-columns:minmax(0,1fr); } }

.lot-trace-list-table :is(th,td):last-child:not([colspan]) { white-space:nowrap; }

/* Monetary payout columns keep amounts comparable within the local table scroll. */


/* Payouts: source and action share the toolbar; last load is a compact data group. */
.payout-source { flex:1 1 280px; min-width:0; }
.payout-source > strong { display:block; font-weight:650; }
.payout-source > p { margin:var(--space-1) 0 0; font-size:var(--text-0-85-rem); }
.detail-data-highlight,.payout-download-summary.detail-data-grid { padding:var(--space-10-px) var(--space-14-px); border:var(--stroke-1) solid var(--line); border-radius:var(--radius-8); background:var(--surface-canvas); }
.payout-download-summary.detail-data-grid { grid-template-columns:minmax(155px,1.4fr) minmax(185px,1.7fr) repeat(4,minmax(0,.8fr)); gap:var(--space-3); margin:0 0 var(--space-3); }
.payout-download-summary dd { font-size:var(--text-0-85-rem); }
.payout-download-summary .payout-download-counter { --data-value-weight:var(--data-emphasis-weight); display:flex; flex-direction:column-reverse; justify-content:flex-end; gap:var(--space-3-px); }
.payout-download-counter dt { margin:0; }
.payout-download-counter dd { font-size:var(--text-1-rem); }
#payout-download-error:empty { display:none; }
@media(max-width:820px) {
 .payout-download-summary.detail-data-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .payout-download-date,.payout-download-period { grid-column:span 2; }
}
@media(max-width:820px) {
 .payout-overview > .payout-source { flex:1 1 250px; }
}
@media(max-width:600px) {
 .payout-download-summary.detail-data-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-10-px) var(--space-4); }
 .payout-download-date,.payout-download-period { display:flex; flex-wrap:wrap; align-items:baseline; gap:var(--space-2-px) var(--space-2); }
 .payout-download-summary :is(.payout-download-date,.payout-download-period) dt { margin:0; }
 .payout-download-summary .payout-download-counter { flex-direction:row-reverse; justify-content:flex-end; align-items:baseline; gap:var(--space-6-px); }
}

/* Inventory: product/lot takes the remaining width; balances and dates stay compact. */
.data-table.inventory-list-table { min-width:920px; }
.inventory-list-table :is(th,td):first-child  { overflow-wrap:anywhere; }
.inventory-list-table :is(th,td):nth-child(n+2) { white-space:nowrap; }
.inventory-list-table .status-pill { white-space:nowrap; overflow-wrap:normal; }

/* Bank statement amounts align for comparison in previews and reconciliation. */

/* Reconciliation: account context and imports share one compact toolbar. */
.bank-accounts { display:flex; flex:1 1 320px; flex-wrap:wrap; gap:var(--space-3) var(--space-28-px); min-width:0; margin:0; }
.bank-accounts > div { min-width:0; max-width:100%; }
.bank-accounts dt { font-weight:650; overflow-wrap:anywhere; }
.bank-accounts dd { margin:var(--space-1) 0 0; color:var(--admin-muted); font-size:var(--text-0-85-rem); overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.bank-accounts-empty { flex:1 1 320px; min-width:0; margin:0; }
@media(max-width:820px) {
 .bank-overview > .bank-accounts,.bank-overview > .bank-accounts-empty { flex:auto; }
}

/* Reconciliation: keep short values compact and give concepts the remaining width. */
.data-table.bank-movements-table { min-width:980px; }
.bank-movements-table .bank-cell-compact { white-space:nowrap; }
.bank-movements-table .bank-cell-account  { overflow-wrap:anywhere; }
.bank-movements-table .bank-cell-concept  { overflow-wrap:anywhere; }
.bank-movements-table :is(td):nth-child(-n+2) { font-variant-numeric:tabular-nums; }

/* The full collection action uses the common table menu without shrinking invoice data. */
.data-table.document-list-table.has-collection-actions { --document-actions-width:5.5rem; }

/* Opt-in review dialogs group related fields without cumulative vertical margins. */
.dialog-flow { display:grid; gap:var(--space-5); min-width:0; }
#editor:has(.dialog-flow) #editor-form { gap:var(--space-5); }
#editor:has(.dialog-flow) .dialog-header { margin-bottom:0; }
.compact-heading > .heading-link { min-height:24px; padding:0; line-height:1.3; align-self:flex-start; }
.dialog-field { display:grid; gap:var(--space-2); min-width:0; }
.dialog-picker { display:grid; gap:var(--space-4); min-width:0; }
.dialog-picker .search-form { margin:0; }
.selection-result { display:grid; gap:var(--space-2); min-width:0; }
/* Shared multiline action summary: action, exact amounts and supporting identity. */
.button-summary { max-width:100%; min-width:0; }
.button-summary > small { font-size:var(--text-0-875-rem); font-weight:400; }
.selection-result + .selection-result { padding-top:var(--space-4); border-top:var(--stroke-1) solid var(--line); }
.selection-result > button { justify-self:start; margin-top:var(--space-1); max-width:100%; white-space:normal; text-align:left; }
.bank-movements-table .status-pill { white-space:nowrap; overflow-wrap:normal; }

/* Service amounts belong to the selected concept, without inventory controls. */
.document-service-price { grid-column:1/-1; }
.document-service-price[hidden] { display:none; }
.document-service-price label { display:block; max-width:240px; }
.document-legacy-shipping p { margin:0 0 var(--space-10-px); }

/* Invoice composer: document canvas with a quiet context and totals sidebar. */
#editor.document-editor { width:min(1320px,calc(100% - 48px)); max-height:calc(100dvh - 48px); padding:0; overflow:hidden; border:0; border-radius:var(--composer-radius); box-shadow:var(--composer-shadow); }
#editor.document-editor::backdrop { background:var(--composer-backdrop); backdrop-filter:blur(4px); }
#editor.document-editor #editor-form { display:flex; flex-direction:column; gap:0; max-height:inherit; }
#editor.document-editor .dialog-header { align-items:center; flex-shrink:0; margin:0; padding:var(--space-6) var(--space-30-px) var(--space-5); border-bottom:var(--stroke-1) solid var(--composer-border-frame); }
#editor.document-editor .dialog-header h2 { font-size:var(--text-1-5-rem); font-weight:650; letter-spacing:-.025em; }
#editor.document-editor #editor-fields { display:block; overflow:auto; min-height:0; margin:0; padding:0; }
#editor.document-editor #editor-error { flex-shrink:0; margin:0; padding:var(--space-10-px) var(--space-30-px); }
#editor.document-editor #editor-error:empty { display:none; }
#editor.document-editor .form-actions { display:flex; flex-shrink:0; align-items:center; flex-wrap:nowrap; gap:var(--space-10-px); margin:0; padding:var(--space-4) var(--space-6) var(--space-4) var(--space-30-px); border-top:var(--stroke-1) solid var(--composer-border-frame); background:var(--color-white); }
.invoice-composer { display:grid; grid-template-columns:minmax(0,1fr) 240px; min-height:450px; }
.invoice-composer-main { display:flex; flex-direction:column; gap:var(--space-28-px); min-width:0; padding:var(--space-28-px) var(--space-30-px) var(--space-30-px); }
.invoice-composer-aside { display:flex; flex-direction:column; gap:var(--space-32-px); min-width:0; padding:var(--space-28-px) var(--space-6); border-left:var(--stroke-1) solid var(--composer-border-section); background:var(--composer-surface-aside); }
#editor.document-editor :is(label,h3) { color:var(--composer-text-label); font-size:var(--composer-label-size); font-weight:var(--composer-weight-medium); }
#editor.document-editor h3 { margin:0; }
/* El editor documental usa el placeholder común de los formularios. */
#editor.document-editor .invoice-customer > label { display:block; margin:0 0 var(--space-2); }
.document-client-context { margin:var(--space-2) 0 0; height:20px; min-height:20px; line-height:var(--space-5); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--composer-text-muted); font-size:var(--text-0-875-rem); }
.document-search-field,.search-picker-popover { position:relative; min-width:0; }
#editor.document-editor .document-record-options:not(:empty),
.search-picker-popover > .search-picker-options:not(:empty),
.search-picker-popover > .search-feedback,
#editor.document-editor .document-search-field > .search-feedback { position:absolute; top:100%; left:0; max-width:min(600px,calc(100vw - 80px)); border:var(--stroke-1) solid var(--popover-border); border-radius:var(--popover-radius); background:var(--color-white); box-shadow:var(--popover-shadow); }
#editor.document-editor .document-record-options:not(:empty),.search-picker-popover > .search-picker-options:not(:empty) { z-index:6; width:max(100%,300px); max-height:260px; overflow:auto; padding:var(--space-5-px); }
#editor.document-editor .document-record-options p,.search-picker-options p { margin:0; }
.admin-body .suggestion-option { display:block; width:100%; min-height:38px; padding:var(--space-9-px) var(--space-10-px); border:0; border-radius:var(--control-radius); color:var(--admin-ink); font-size:var(--text-0-875-rem); font-weight:var(--control-field-weight); text-decoration:none; }

#editor.document-editor .document-search-field > .search-feedback,.search-picker-popover > .search-feedback { z-index:7; width:max(100%,240px); margin:0; padding:var(--space-10-px) var(--space-3); color:var(--composer-text-muted); font-size:var(--text-0-875-rem); overflow-wrap:anywhere; }
#editor.document-editor .document-search-field > .search-feedback.error-text,.search-picker-popover > .search-feedback.error-text { color:var(--red); }
.invoice-items { min-width:0; }
.invoice-items-heading { display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); margin:0 0 var(--space-3); }
#editor.document-editor .document-lines-actions { display:flex; align-items:center; gap:var(--space-3-px); }
.invoice-toolbar-divider { height:14px; width:1px; margin:0 var(--space-6-px); background:var(--composer-border-toolbar); }
.invoice-columns,.document-editor .document-line { display:grid; grid-template-columns:minmax(160px,1fr) 64px 112px 76px 92px 104px 28px; gap:var(--space-10-px); }
.invoice-columns { padding:0 var(--space-2) var(--space-9-px); border-bottom:var(--stroke-1) solid var(--composer-border-columns); color:var(--composer-text-muted); font-size:var(--composer-label-size); font-weight:var(--composer-weight-medium); }
.invoice-columns > :nth-child(n+2) { text-align:right; }
.document-editor .document-line { align-items:start; margin:0; padding:var(--space-14-px) var(--space-2); border:0; border-bottom:var(--stroke-1) solid var(--composer-border-section); border-radius:0; background:transparent; }
.document-editor .document-line.is-selected { border-color:var(--composer-border-section); background:var(--composer-surface-selected); }
.document-editor .document-price-cell > label { display:block; }
.document-editor .document-vat-included { display:block; margin-top:var(--space-1); color:var(--composer-text-muted); font-size:var(--composer-note-size); text-align:right; }
.document-editor .document-vat-included[hidden] { display:none; }
.document-editor .document-vat-rate { display:flex; justify-content:flex-end; align-items:center; min-height:40px; color:var(--composer-text-amount); font-size:var(--text-1-rem); font-variant-numeric:tabular-nums; }
.document-editor .document-field-label { position:absolute; width:1px; height:1px; padding:0; margin:calc(-1 * var(--stroke-1)); overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.document-editor .document-line :is(.document-quantity-cell,.document-price-cell,.document-discount-cell,.document-vat-cell) { display:block; min-width:0; }
.document-editor .document-line :is(.document-unit-price,.document-discount,.document-quantity-cell input) { text-align:right; font-variant-numeric:tabular-nums; }
.document-line-amount { display:flex; align-items:center; justify-content:flex-end; min-height:40px; color:var(--composer-text-amount); font-size:var(--text-1-rem); font-weight:var(--composer-weight-medium); font-variant-numeric:tabular-nums; white-space:nowrap; }
.item-remove-button { display:grid; place-items:center; width:24px; min-height:28px; margin:var(--space-1) 0 0; padding:0; border:0; border-radius:var(--radius-4); background:transparent; color:var(--color-remove-muted); font-size:var(--text-1-1-rem); font-weight:400; }

.document-line-meta { display:flex; align-items:baseline; flex-wrap:wrap; gap:var(--space-1) var(--space-10-px); margin:var(--space-5-px) var(--space-2) 0; }
.document-line-meta:has(.line-price:empty):has(.document-use-tariff[hidden]) { display:none; }
.document-editor .line-price { color:var(--composer-text-muted); font-size:var(--composer-note-size); line-height:1.4; }
.inline-text-action { min-height:0; padding:0; border:0; background:transparent; color:var(--admin-action); font-size:var(--text-0-8125-rem); font-weight:var(--control-button-weight); }
.inline-text-action[hidden] { display:none; }
.document-editor .document-lines-empty { margin:var(--space-7-px) var(--space-2) 0; color:var(--composer-text-muted); font-size:var(--composer-note-size); }
.invoice-notes { margin-top:auto; }
#editor.document-editor .invoice-notes > label { display:flex; align-items:baseline; gap:var(--space-10-px); margin:0 0 var(--space-2); }
.invoice-notes label span { color:var(--composer-text-muted); font-size:var(--composer-note-size); font-weight:400; }
#editor.document-editor #document-notes { height:68px; min-height:68px; }
.invoice-details { display:grid; gap:var(--space-4); }
.invoice-details h3 { margin-bottom:0; }
.invoice-rectification,.invoice-rectification-period { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-14-px); min-width:0; }
.invoice-rectification[hidden],.invoice-rectification-period[hidden] { display:none; }
.invoice-rectification h3,.invoice-rectification .wide { grid-column:1/-1; }
.invoice-rectification label { display:grid; gap:var(--space-6-px); min-width:0; }
.invoice-rectification textarea { min-height:80px; }
.manual-rectification-data .wide { grid-column:1/-1; }
.invoice-details label { display:grid; gap:var(--space-6-px); }
.invoice-summary { margin-top:auto; }
.invoice-summary dl { margin:var(--space-18-px) 0 0; }
.invoice-summary dl > div { display:flex; align-items:baseline; justify-content:space-between; gap:var(--space-10-px); padding:var(--space-7-px) 0; }
.invoice-summary dl > div[hidden] { display:none; }
.invoice-summary dt { color:var(--composer-text-muted); font-size:var(--composer-note-size); }
.invoice-summary dd { margin:0; color:var(--composer-text-summary); font-size:var(--text-1-rem); font-variant-numeric:tabular-nums; white-space:nowrap; }
.invoice-summary .invoice-total { margin-top:var(--space-3); padding-top:var(--space-18-px); border-top:var(--stroke-1) solid var(--composer-border-total); }
.invoice-total dt { color:var(--composer-text-total-label); font-size:var(--text-0-875-rem); }
.invoice-total dd { color:var(--composer-text-total); font-size:var(--text-1-45-rem); font-weight:600; letter-spacing:-.03em; }
.document-editor .document-legacy-shipping { color:var(--composer-text-legacy); font-size:var(--composer-note-size); }
@media(max-width:1200px) {
 #editor.document-editor { width:calc(100% - 40px); }
 .invoice-composer { grid-template-columns:minmax(0,1fr); min-height:0; }
 .invoice-composer-main { padding:var(--space-6) var(--space-28-px); gap:var(--space-6); }
 .invoice-composer-aside { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; padding:var(--space-6) var(--space-28-px); gap:var(--space-40-px); border-left:0; border-top:var(--stroke-1) solid var(--composer-border-section); }
 .invoice-details { grid-template-columns:1fr 1fr; gap:var(--space-3); }
 .invoice-details h3 { grid-column:1/-1; }
 .invoice-summary { margin:0; }
 .invoice-summary dl { margin-top:var(--space-6-px); }
}
@media(max-width:920px) {
 #editor.document-editor { width:calc(100% - 20px); max-height:calc(100dvh - 20px); border-radius:var(--radius-12); }
 #editor.document-editor .dialog-header { padding:var(--space-18-px) var(--space-5); }
 #editor.document-editor .dialog-header h2 { font-size:var(--text-1-35-rem); }
 .invoice-composer-main { padding:var(--space-22-px) var(--space-4); gap:var(--space-6); }
 .invoice-items-heading { align-items:center; gap:var(--space-6-px); }
 .invoice-toolbar-divider { margin:0 var(--space-2-px); }
 .invoice-columns { display:none; }
 .document-editor .document-line { position:relative; grid-template-columns:repeat(4,minmax(0,1fr)); padding:var(--space-14-px) var(--space-2); gap:var(--space-3) var(--space-2); }
 .document-concept-cell { grid-column:1/-1; padding-right:var(--space-32-px); }
 #editor.document-editor .document-remove-line { position:absolute; top:14px; right:8px; margin:0; }
 .document-editor .document-quantity-cell { grid-column:1; }
 .document-editor .document-price-cell { grid-column:2; }
 .document-editor .document-discount-cell { grid-column:3; }
 .document-editor .document-vat-cell { grid-column:4; }
 .document-editor .document-amount-cell { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; }
 .document-editor .document-field-label { position:static; display:block; width:auto; height:auto; margin:0 0 var(--space-5-px); overflow:visible; clip:auto; white-space:normal; color:var(--composer-text-muted); font-size:var(--composer-note-size); font-weight:400; }
 .document-editor :is(.document-quantity-cell,.document-price-cell,.document-discount-cell,.document-vat-cell) .document-field-label { min-height:36px; line-height:1.35; }
 .document-concept-cell > .document-field-label { display:none; }
 .document-line-meta { margin-top:var(--space-1); }
 .invoice-notes label { flex-wrap:wrap; }
 .invoice-notes label span { font-size:var(--composer-note-size); }
 .invoice-composer-aside { grid-template-columns:1fr; gap:var(--space-6); padding:var(--space-22-px) var(--space-6); }
 .invoice-details { gap:var(--space-3); }
 .invoice-summary dl { margin-top:var(--space-2); }
 .invoice-summary .invoice-total { margin-top:var(--space-2); padding-top:var(--space-3); }
 #editor.document-editor .form-actions { padding:var(--space-3) var(--space-4); gap:var(--space-2); }
 #editor.document-editor #editor-error { padding:var(--space-10-px) var(--space-5); }
}

/* Global organization management follows the shared compact detail pattern. */
.organization-summary { display:grid; grid-template-columns:repeat(2,minmax(100px,1fr)); gap:var(--space-5); margin:0 0 var(--space-18-px); max-width:440px; }
@media(max-width:600px) { .organization-summary { grid-template-columns:1fr 1fr; gap:var(--space-4); } }

.invoice-issue-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-14-px) var(--space-5); }
.invoice-issue-summary > div { min-width:0; }
.invoice-issue-summary dd { overflow-wrap:anywhere; }
@media(max-width:560px){ .invoice-issue-summary { grid-template-columns:minmax(0,1fr); } }

/* Text metadata needs room for addresses, subjects and filenames in any detail or dialog. */
.detail-data-grid.detail-data-grid-text { grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); }

/* Shared rendering for formatted messages reviewed before sending. */
.message-content p { margin:0 0 var(--space-4); overflow-wrap:anywhere; }
.message-content p:last-child { margin-bottom:0; }

/* Shared disclosure for tables inside detail grids: keep scrolling local. */
.detail-disclosure { min-width:0; }
.detail-disclosure[open] > summary { margin-bottom:var(--space-2); }

/* Shared search with state and two period boundaries; labels remain accessible. */
/* Empty period filters retain their native calendar and keyboard editing. */
.date-filter { display:block; position:relative; min-width:0; }
.date-filter input { display:block; }
.date-filter-placeholder { display:none; position:absolute; inset:0; align-items:center; padding:0 var(--space-48-px) 0 var(--control-field-padding-x); pointer-events:none; color:var(--field-placeholder-color); font-weight:var(--field-placeholder-weight); overflow:hidden; white-space:nowrap; }
.date-filter.is-empty:not(:focus-within)>.date-filter-placeholder { display:flex; }
.date-filter.is-empty:not(:focus-within)>input { color:transparent; }
.date-filter.is-empty:not(:focus-within)>input::-webkit-datetime-edit { opacity:0; }
.date-filter-value { display:none; position:absolute; inset:0; align-items:center; padding:0 var(--space-48-px) 0 var(--control-field-padding-x); pointer-events:none; color:var(--admin-ink); font-weight:var(--query-field-weight); white-space:nowrap; }
.date-filter.has-month-display>.date-filter-value { display:flex; }
.date-filter.has-month-display>input { color:transparent; }
.date-filter.has-month-display>input::-webkit-datetime-edit { opacity:0; }
.module-toolbar:has(>.has-period-filter),.module-toolbar>.has-period-filter { margin-bottom:0; }



/* Page-based record forms share the same groups, controls and action footer. */
.record-form { max-width:960px; gap:var(--space-5); }
.record-form .compact-heading h2 { font-size:var(--text-0-9375-rem); font-weight:650; }
.record-form .form-grid { align-items:start; }
.record-form > .error-text { margin:0; }
.record-form > :empty,.record-form .form-feedback:empty { display:none; }
.record-form textarea { min-height:112px; }
.form-grid-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.choice-fieldset { border:0; padding:0; margin:0; min-width:0; }
.choice-fieldset > legend { padding:0; margin-bottom:var(--space-3); color:var(--admin-muted); font-size:var(--text-0-9-rem); font-weight:650; }
.choice-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:var(--space-2) var(--space-4); }
.choice-grid > .check-label { min-width:0; min-height:48px; padding:var(--space-3); border:var(--stroke-1) solid var(--line); border-radius:var(--radius-control); cursor:pointer; }
.choice-grid > .check-label:has(:checked) { border-color:var(--admin-action); background:color-mix(in srgb,var(--admin-action) 6%,var(--paper)); }
.choice-grid > .check-label:focus-within { outline:2px solid var(--focus); outline-offset:2px; }
/* Opt-in matrix of mutually exclusive choices; labels stay native and touchable. */
.choice-matrix { min-width:0; }
.choice-matrix-header,.choice-matrix-row { display:grid; grid-template-columns:minmax(0,1fr) repeat(3,minmax(6rem,.4fr)); align-items:center; column-gap:var(--space-2); padding:var(--space-2) var(--space-3); }
.choice-matrix-header { background:var(--table-header-bg); color:var(--admin-muted); font-size:var(--text-0-9-rem); font-weight:650; }
.choice-matrix-header > :not(:first-child) { text-align:center; }
.choice-matrix-row { border-bottom:var(--stroke-1) solid var(--line); }
.choice-matrix-name { min-width:0; font-weight:650; overflow-wrap:anywhere; }
.choice-matrix-option { position:relative; display:flex; align-items:center; justify-content:center; gap:var(--space-2); min-width:0; min-height:48px; margin:0; padding:var(--space-2); border:var(--stroke-1) solid transparent; border-radius:var(--radius-control); color:var(--ink); font-size:var(--text-0-875-rem); font-weight:500; cursor:pointer; }
.choice-matrix-option input { padding:0; margin:0; flex:0 0 20px; }
.choice-matrix-option:has(:checked) { border-color:var(--admin-action); background:color-mix(in srgb,var(--admin-action) 6%,var(--paper)); }
.choice-matrix-option:has(:focus-visible) { outline:2px solid var(--focus); outline-offset:2px; }
.choice-matrix-option:has(:disabled),.choice-matrix-unavailable { color:var(--admin-muted); cursor:default; }
.choice-matrix-text { position:absolute; width:1px; height:1px; padding:0; margin:calc(-1 * var(--stroke-1)); overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:600px) {
 .choice-matrix-header { display:none; }
 .choice-matrix-row { grid-template-columns:repeat(3,minmax(0,1fr)); row-gap:var(--space-2); padding:var(--space-3) 0; }
 .choice-matrix-name { grid-column:1/-1; }
 .choice-matrix-option { flex-direction:column; padding:var(--space-2) var(--space-1); }
 .choice-matrix-text { position:static; width:auto; height:auto; margin:0; overflow:visible; clip:auto; white-space:normal; text-align:center; }
}
.record-form-actions { justify-content:flex-end; gap:var(--space-3); border-top:var(--stroke-1) solid var(--line); padding-top:var(--space-5); }
@media(max-width:600px) { .form-grid-three { grid-template-columns:minmax(0,1fr); } }

/* Shared report composition: task metrics and a semantic ranking. */
.detail-data-grid.report-metrics { grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr)); margin-block:var(--space-4); }
.report-metrics dd { font-size:var(--text-1-35-rem); }
/* Reports own the spacing between blocks; related content uses the shared 12px section. */
.report-flow { display:grid; gap:var(--space-6); min-width:0; }
.report-flow > *,.report-flow > .view-heading,.report-flow .detail-card-section > *,
.report-flow .heading-with-help > :is(h1,h2),.report-flow :is(.trend-chart,.metric-ranking,.table-pagination) { margin-block:0; }
.report-flow .table-pagination { padding-top:0; }
.metric-ranking { list-style:none; padding:0; margin:var(--space-4) 0; display:grid; gap:var(--space-3); }
.metric-ranking li { display:grid; grid-template-columns:minmax(8rem,1.5fr) minmax(3rem,2fr) minmax(7rem,auto); align-items:center; gap:var(--space-3); font-size:var(--text-0-9-rem); }
.metric-ranking li > span { overflow-wrap:anywhere; }
.metric-ranking meter { width:100%; height:12px; accent-color:var(--green); }
.metric-ranking meter::-webkit-meter-bar { background:var(--line); border:0; border-radius:var(--radius-6); }
.metric-ranking meter::-webkit-meter-optimum-value { background:var(--green); }
.metric-ranking strong { text-align:right; font-variant-numeric:tabular-nums; }
.trend-chart-line.is-comparison { stroke:var(--admin-muted); stroke-dasharray:4 5; }
.trend-chart-key.is-comparison::before { border-color:var(--admin-muted); border-top-style:dashed; }
@media(max-width:600px) { .metric-ranking li { grid-template-columns:minmax(0,1fr) auto; gap:var(--space-6-px) var(--space-3); } .metric-ranking meter { grid-row:2; grid-column:1/-1; } }

/* Shared search typography: independent of label size and editor placement. */
:is(.dashboard,#editor) input:is([type="search"],.search-input) { font-size:var(--search-font-size); font-weight:var(--search-font-weight); font-style:normal; }

/* One clear control for list searches and record pickers, including restored values. */
.search-control { display:block; position:relative; min-width:0; width:100%; }
/* Reserve the same interior space even in compact inputs with their own padding. */
.search-control > input.search-input { width:100%; padding-inline-start:var(--space-40-px) !important; padding-inline-end:var(--space-44-px) !important; }
.search-control > .search-icon { position:absolute; inset-inline-start:12px; top:50%; transform:translateY(-50%); width:20px; height:20px; color:var(--search-placeholder-color); pointer-events:none; }
.search-control > input::-webkit-search-cancel-button { display:none; }
.search-control > .search-clear { display:flex; position:absolute; inset-inline-end:2px; top:2px; align-items:center; justify-content:center; width:36px; height:calc(100% - 4px); min-height:0; padding:0; margin:0; border:0; border-radius:var(--radius-6); background:transparent; color:var(--search-placeholder-color); cursor:pointer; }
.search-control > .search-clear svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }

.search-control > input:is(:placeholder-shown,:disabled,[readonly]) + .search-clear { display:none; }

/* Opt-in presentation for data-heavy working lists. First adoption: invoices.
   Roles, column widths, live-search nodes and state colours remain shared. */
.workspace-list { --line:var(--workspace-line); --table-header-bg:#f6f8f7; border-radius:var(--radius-panel); box-shadow:none; }
.workspace-list .data-table { color:var(--admin-ink); }
.workspace-list .data-table th { font-size:var(--text-0-8125-rem); }
.workspace-list .data-table tbody tr:hover td { background:var(--workspace-hover); }
.workspace-list .table-pagination { padding-top:var(--space-4); color:var(--admin-muted); font-size:var(--text-0-875-rem); }
.workspace-list .empty-table { padding:var(--space-3) 0; }

/* Generated, read-only secrets: shared field, reveal and clipboard controls. */
.secret-control { display:flex; align-items:center; gap:var(--space-2); min-width:0; }
.secret-control > input { flex:1 1 0; min-width:0; }
.secret-control > button { flex:none; }
.secret-control svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:var(--stroke-2); stroke-linecap:round; stroke-linejoin:round; }
.secret-copy-status:empty { display:none; }
.secret-copy-status { margin-top:var(--space-2); margin-bottom:0; }

.generated-secret { grid-template-columns:minmax(0,1fr); padding-bottom:var(--space-4,20px); }
.generated-secret p { overflow-wrap:anywhere; }
.secret-field { min-width:0; }
.secret-field > label { margin-bottom:var(--space-6-px); }

/* Inline validation feedback must not stretch neighbouring label/control rows. */
.form-grid-feedback { align-items:start; }

/* Shared field feedback; preserves each form's layout and native validity. */
.form-error-summary { max-height:30vh; overflow:auto; overflow-wrap:anywhere; }
.form-error-heading,.form-error-help,.form-error-items,.form-error-items > [role="listitem"] { display:block; }
.form-error-help,.form-error-items { margin:var(--space-2) 0; }
.form-error-items > [role="listitem"] { margin-block:var(--space-1); }
.form-error-summary .link-button { color:inherit; font-weight:inherit; text-decoration:underline; line-height:1.5; }
.form-error-summary:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.field-error { display:block; min-height:0; margin-top:var(--space-6-px); font-size:var(--text-0-875-rem); line-height:1.4; overflow-wrap:anywhere; }
:is(input,select,textarea)[aria-invalid="true"] { border-color:var(--red); }
@media (forced-colors:active) { :is(input,select,textarea)[aria-invalid="true"] { outline:2px solid CanvasText; } }

/* Papel de navegación explícito por tarea; no cambia acciones ni destinos. */
.data-table :is(.link-button,a,span).table-link-primary { font-weight:var(--weight-emphasis); }
.data-table :is(.link-button,a).table-link-related { font-weight:var(--weight-regular); }

/* Shared organizational labels: descriptive grouping, independent of statuses. */
.tag-chips { display:flex; flex-wrap:wrap; gap:var(--space-6-px); margin-top:var(--space-6-px); }
.tag-chip.status-pill { display:inline-block; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.data-table .tag-chip.status-pill { white-space:nowrap; }
.record-tags { margin-top:var(--space-4); }
.record-tags-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:var(--space-3); }
.record-tags-heading h3 { margin:0; font-size:var(--text-14-px); }
.record-tags p { margin:var(--space-6-px) 0 0; }
.tag-picker { min-width:0; }
.tag-picker-results { position:relative; min-height:3rem; max-height:max(3rem,min(320px,35dvh)); margin:var(--space-3) 0; }
.tag-picker-results > #tag-picker-options { height:100%; overflow-y:auto; scrollbar-gutter:stable; }
.tag-picker-results > .search-feedback { position:absolute; inset:0; margin:0; overflow-y:auto; }
.tag-picker-results [data-tag-empty] { margin:0; }
.tag-options { border:0; margin:0; padding:0; min-width:0; }
.tag-options .check-label { min-height:44px; margin:0; padding:var(--space-6-px) var(--space-2-px); overflow-wrap:anywhere; }
.tag-options .check-label[hidden] { display:none; }
.tag-options .check-label span { min-width:0; }
.list-tag-filter { display:flex; min-width:0; margin:0; }
.list-tag-filter select { width:100%; min-width:0; margin:0; text-overflow:ellipsis; }


/* Shared controls. Reference: Buscar referencia (03/11/2026); all modules and dialogs inherit it.
   Only geometry/interaction variants (query bars, icon actions, multiline summaries) specialize it. */
.admin-body { --control-border-hover:color-mix(in srgb,var(--admin-muted) 62%,var(--control-border-color)); }
.admin-body :is(input,select,textarea) {
 width:100%; min-width:0; min-height:var(--control-height); border:var(--stroke-1) solid var(--control-border-color);
 border-radius:var(--control-radius); background-color:var(--paper); color:var(--admin-ink);
 padding:var(--control-padding-y) var(--control-field-padding-x);
 font-family:inherit; font-size:var(--control-font-size); font-weight:var(--control-field-weight); line-height:1.5;
 transition:border-color 140ms ease,box-shadow 140ms ease,background-color 140ms ease;
}
.admin-body textarea { resize:vertical; min-height:170px; }
.admin-body :is(input,textarea)::placeholder {
 color:var(--field-placeholder-color); opacity:1; font-size:var(--control-font-size);
 font-weight:var(--field-placeholder-weight); font-style:normal;
}
.admin-body :is(input,select,textarea):not(:disabled):hover:not(:focus-visible):not([aria-invalid="true"]) { border-color:var(--control-border-hover); }
.admin-body :is(input,select,textarea):focus-visible {
 border-color:var(--button-focus-color); box-shadow:0 0 0 var(--space-3-px) color-mix(in srgb,var(--button-focus-color) 18%,transparent); outline:0;
}
.admin-body :is(input,select,textarea):disabled { background-color:var(--surface-disabled); color:var(--admin-ink); cursor:not-allowed; }
.admin-body :is(input,select,textarea)[aria-invalid="true"] { border-color:var(--red); }
.admin-body select:not([multiple]):is(:not([size]),[size="0"],[size="1"]) { padding-inline-end:var(--space-36-px); }
.admin-body input:is([type="checkbox"],[type="radio"]) { width:20px; height:20px; min-height:20px; padding:0; }
.admin-body :is(.primary-button,.secondary-button) {
 min-height:var(--query-control-height); height:auto; border:var(--stroke-1) solid var(--control-border-color); border-radius:var(--control-radius);
 padding:var(--query-control-padding-y) var(--control-button-padding-x); font-family:inherit;
 font-size:var(--control-font-size); font-weight:var(--control-button-weight); line-height:1.5;
 text-decoration:none; display:inline-flex; align-items:center; justify-content:center;
 cursor:pointer; transition:background-color 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 140ms ease;
}
/* Entrar y Verificar código: altura de acceso aprobada por Pedro (07/11/2026). */
/* Inicio: excepción de altura48px aprobada por Pedro (08/11/2026). */
.admin-body .secondary-button.home-module-button,
.admin-body .primary-button.access-auth-submit { min-height:var(--control-height); padding-block:var(--control-padding-y); }
/* Equal action labels size to shared reference text, without pixel widths. */
.action-label-stack { display:inline-grid; text-align:center; }
.action-label-stack > span { grid-area:1 / 1; }
.action-label-measure { visibility:hidden; }
.admin-body :is(.primary-button,.secondary-button).icon-only { width:var(--query-control-height); padding-inline:0; flex-shrink:0; }
.admin-body .button-summary { padding:var(--space-3) var(--control-button-padding-x); display:grid; gap:var(--space-1); justify-content:start; white-space:normal; text-align:left; overflow-wrap:anywhere; }

.admin-body { --query-field-color:var(--admin-ink); }
/* One field contract for list/report headers, including the invoice reference.
   Empty/all and explicitly declared default options are hints; a concrete selection remains visibly distinct. */
@media(max-width:820px),(pointer:coarse) {
 :root { --query-control-height:2.75rem; --query-control-padding-y:8px; }
}

/* Shared unobtrusive actions inside an editable collection; not module skins. */
.inline-action { display:inline-flex; align-items:center; justify-content:center; gap:var(--space-5-px); min-height:36px; padding:var(--space-1) var(--space-7-px); border:0; border-radius:var(--control-radius); background:transparent; color:var(--admin-action); font-size:var(--text-0-875-rem); font-weight:var(--control-button-weight); }
.inline-action.icon-only { width:36px; flex-shrink:0; padding:var(--space-1); color:var(--admin-muted); font-size:var(--control-font-size); }
.inline-action.icon-only svg { width:var(--space-4); height:var(--space-4); fill:currentColor; flex-shrink:0; }
.inline-action.icon-only.is-contained { --button-bg:var(--table-header-bg); }
.inline-action.icon-only.is-contained svg, .action-outline-icon { width:var(--space-5); height:var(--space-5); fill:none; stroke:currentColor; stroke-width:var(--stroke-1); stroke-linecap:round; stroke-linejoin:round; }

/* Approved CSV/PDF export glyph: same control-font size in every carrier. */
svg.export-icon,.inline-action.icon-only.is-contained svg.export-icon,.table-icon-button .export-icon { font-size:var(--control-font-size); width:1.25em; height:1.25em; flex-shrink:0; fill:currentColor; stroke:none; vertical-align:middle; }

/* Button interaction contract: all action families share these states.
   Components above define geometry only; semantic variants supply tokens here.
   Navigation/tab selection and entity-link hierarchy keep their own contracts. */
.admin-body {
 --button-primary-color:#0f6cbd; --button-primary-hover:#115ea3; --button-primary-active:#0f548c;
 --button-focus-color:var(--button-primary-color); --button-disabled-opacity:.68;
 --button-hover-bg:color-mix(in srgb,var(--admin-muted) 5%,var(--paper));
 --button-press-bg:color-mix(in srgb,var(--admin-muted) 12%,var(--paper));
 --button-transition:background-color 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 140ms ease;
}
/* Keep defaults at class specificity so semantic button tokens can override them. */
.admin-body :is(.primary-button,.secondary-button,.refresh-button,.icon-button,.table-icon-button,.link-button,.auth-text-link,.inline-action,.inline-text-action,.item-remove-button,.row-action-menu-trigger,.row-action-menu-item,.search-clear,.help-tip,.user-menu-button,.admin-nav-toggle,.pagination-controls :where(button),.user-menu-panel :where(button),.user-menu-panel :where(a)) {
 --button-bg:transparent; --button-border:transparent; --button-ink:var(--blue);
 --button-hover-border:var(--button-border); --button-hover-ink:var(--button-ink);
 --button-active-bg:var(--button-press-bg);
 background:var(--button-bg); border-color:var(--button-border); color:var(--button-ink);
 font-weight:var(--control-button-weight); transition:var(--button-transition);
}
.admin-body :is(.primary-button,.refresh-button) {
 --button-bg:var(--button-primary-color); --button-border:var(--button-primary-color); --button-ink:#fff;
 --button-hover-bg:var(--button-primary-hover); --button-hover-border:var(--button-primary-hover);
 --button-active-bg:var(--button-primary-active);
}
.admin-body :is(.secondary-button,.icon-button,.admin-nav-toggle,.pagination-controls :where(button)) {
 --button-bg:var(--paper); --button-border:var(--control-border-color); --button-ink:var(--admin-muted);
 --button-hover-border:var(--control-border-hover); --button-hover-ink:var(--admin-ink);
}
.selection-choice .number-value { white-space:nowrap; }
/* Explicitly selected reconciliation choice: preserve the common button geometry. */
.admin-body .selection-choice[aria-pressed="true"] {
 --button-bg:color-mix(in srgb,var(--green) 18%,var(--paper)); --button-border:var(--green); --button-ink:var(--admin-ink);
 --button-hover-bg:color-mix(in srgb,var(--green) 24%,var(--paper)); --button-hover-border:var(--green); --button-hover-ink:var(--admin-ink);
 --button-active-bg:color-mix(in srgb,var(--green) 30%,var(--paper));
}
.admin-body :is(.table-icon-button,.row-action-menu-trigger) { --button-hover-border:var(--control-border-hover); }
.admin-body .link-button { --button-ink:var(--blue); }
.admin-body :is(.inline-action,.inline-text-action) { --button-ink:var(--button-primary-color); }
.admin-body :is(.link-button,.auth-text-link,.inline-text-action) {
 --button-hover-bg:transparent; --button-active-bg:transparent;
 --button-hover-ink:color-mix(in srgb,var(--button-ink) 75%,black);
}
.admin-body :is(.row-action-menu-item,.user-menu-panel :where(button),.user-menu-panel :where(a),.suggestion-option) { --button-ink:var(--admin-ink); }
.admin-body .suggestion-option { --button-hover-bg:var(--button-press-bg); --button-active-bg:var(--button-press-bg); }
.admin-body :is(.subtle-action,.search-clear,.inline-action.icon-only) { --button-ink:var(--admin-muted); --button-hover-ink:var(--admin-ink); }
.admin-body button.help-tip { --button-bg:#f7f9fc; --button-border:var(--control-border-color); --button-ink:var(--admin-muted); --button-hover-border:var(--control-border-hover); font-weight:900; }
.admin-body :is(.item-remove-button,.row-action-menu-item.is-danger) {
 --button-ink:var(--red); --button-hover-bg:color-mix(in srgb,var(--red) 7%,var(--paper));
 --button-active-bg:color-mix(in srgb,var(--red) 12%,var(--paper));
}
.admin-body .form-error-summary .link-button { --button-ink:var(--red); }
.admin-body .user-menu-button { --button-bg:var(--admin-identity); --button-border:var(--admin-identity); --button-ink:#fff; --button-hover-bg:color-mix(in srgb,var(--admin-identity) 90%,black); --button-active-bg:color-mix(in srgb,var(--admin-identity) 80%,black); }
.admin-body .user-menu-panel :where(button).is-active { --button-bg:var(--button-hover-bg); }
.admin-body .user-menu-panel :where(button).is-active .user-menu-icon { stroke:var(--admin-action); }
.admin-body #logout-button { --button-hover-bg:color-mix(in srgb,var(--red) 7%,var(--paper)); --button-hover-ink:var(--red); }
.admin-body :is(.admin-nav button,.product-tabs [role=tab]) { --button-focus-color:var(--nav-active-color); }
.admin-body :is(.primary-button,.secondary-button,.refresh-button,.icon-button,.table-icon-button,.link-button,.auth-text-link,.inline-action,.inline-text-action,.item-remove-button,.row-action-menu-trigger,.row-action-menu-item,.search-clear,.help-tip,.user-menu-button,.admin-nav-toggle,.pagination-controls :where(button),.user-menu-panel :where(button),.user-menu-panel :where(a)):not(:disabled):not([aria-disabled="true"]):is(:hover,:focus-visible) {
 background:var(--button-hover-bg); border-color:var(--button-hover-border); color:var(--button-hover-ink);
}
.admin-body :is(button,a.primary-button,a.secondary-button,a.link-button,a.auth-text-link,.user-menu-panel a):not(:disabled):not([aria-disabled="true"]):focus-visible {
 outline:2px solid var(--button-focus-color); outline-offset:2px;
 box-shadow:0 0 0 var(--space-3-px) color-mix(in srgb,var(--button-focus-color) 18%,transparent);
}
.admin-body :is(.primary-button,.secondary-button,.refresh-button,.icon-button,.table-icon-button,.link-button,.auth-text-link,.inline-action,.inline-text-action,.item-remove-button,.row-action-menu-trigger,.row-action-menu-item,.search-clear,.help-tip,.user-menu-button,.admin-nav-toggle,.pagination-controls :where(button),.user-menu-panel :where(button),.user-menu-panel :where(a)):not(:disabled):not([aria-disabled="true"]):active { background:var(--button-active-bg); }
.admin-body .row-action-menu-trigger[aria-expanded="true"]:not(:disabled) { background:var(--button-hover-bg); border-color:var(--button-hover-border); }
.admin-body :is(button,a.primary-button,a.secondary-button,a.link-button,a.auth-text-link,.user-menu-panel a):is(:disabled,[aria-disabled="true"]) { opacity:var(--button-disabled-opacity); cursor:not-allowed; }
.admin-body :is(button,a.primary-button,a.secondary-button,a.link-button,a.auth-text-link,.user-menu-panel a).is-loading-action { cursor:progress; }
@media (prefers-reduced-motion:reduce) { .admin-body :is(button,a.primary-button,a.secondary-button,a.link-button,a.auth-text-link,.user-menu-panel a) { transition:none; } }

/* Deferred task hosts retain event handlers and the existing panel rhythm. */
.detail-task-content > .product-section:first-of-type { margin-top:0; }

.dashboard :is(.catalog-search,.search-form,.filter-fields,.module-filters,.module-toolbar,.module-main-actions,.view-heading,.section-heading) {
 --search-font-weight:var(--query-field-weight);
 --field-placeholder-weight:var(--query-field-weight);
}
.dashboard :is(.catalog-search,.search-form,.filter-fields,.module-filters,.module-toolbar,.module-main-actions,.view-heading,.section-heading) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),select:not([multiple]):is(:not([size]),[size="0"],[size="1"])) {
 font-weight:var(--query-field-weight);
}
.dashboard :is(.catalog-search,.search-form,.filter-fields,.module-filters,.module-toolbar,.module-main-actions,.view-heading,.section-heading) select:not(:disabled) {
 color:var(--query-field-color);
}
.dashboard :is(.catalog-search,.search-form,.filter-fields,.module-filters,.module-toolbar,.module-main-actions,.view-heading,.section-heading) select:not(:disabled):has(option:checked:is([value=""],[value="all"],[data-query-hint])) {
 color:var(--query-field-hint-color);
}
.dashboard :is(.catalog-search,.search-form,.filter-fields,.module-filters,.module-toolbar,.module-main-actions,.view-heading,.section-heading) select option {
 color:var(--query-field-color); font-weight:var(--query-field-weight);
}
.dashboard .heading-actions :is(.primary-button,.secondary-button),
.dashboard :is(.catalog-search,.search-form,.filter-fields,.module-filters,.module-toolbar,.module-main-actions,.view-heading,.section-heading) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),select:not([multiple]):is(:not([size]),[size="0"],[size="1"]),.primary-button,.secondary-button) {
 min-height:var(--query-control-height); height:auto; padding-block:var(--query-control-padding-y); font-size:var(--text-1-rem); line-height:1.5;
}
.dashboard .heading-actions :is(.primary-button,.secondary-button).icon-only,
.dashboard :is(.catalog-search,.search-form,.filter-fields,.module-filters,.module-toolbar,.module-main-actions,.view-heading,.section-heading) :is(.primary-button,.secondary-button).icon-only {
 width:var(--query-control-height); padding-inline:0;
}

/* Query controls: one geometry per role, with common wrapping when space runs out. */
.dashboard .module-toolbar { flex-wrap:wrap; min-width:0; max-width:100%; }
.dashboard .catalog-search { display:flex; flex-wrap:wrap; align-items:center; gap:var(--query-control-gap); flex:0 1 auto; width:100%; max-width:none; margin:0; min-width:0; }
.dashboard .module-toolbar>.catalog-search { flex:1 1 auto; width:auto; }
.dashboard .catalog-search>:is(input,.search-control,.filter-field-search) { flex:0 1 var(--query-search-width); width:var(--query-search-width); max-width:100%; min-width:0; margin:0; }
.dashboard .catalog-search>:is(label,select):where(:not(.sr-only)) { flex:0 0 var(--query-state-width); width:var(--query-state-width); max-width:100%; margin:0; }
.dashboard .catalog-search>.filter-field-search { flex-basis:var(--query-search-width); width:var(--query-search-width); }
.dashboard .catalog-search>:is(label,.search-control) :is(input,select) { width:100%; margin:0; }
.dashboard .catalog-search>.form-actions { gap:var(--query-control-gap); }
.dashboard .catalog-search>:is(button[type="submit"],.form-actions) { flex:none; margin:0; }
.dashboard .catalog-search>button[type="submit"],.dashboard .catalog-search>.form-actions>button[type="submit"] { width:var(--query-submit-width); padding-inline:var(--space-3); }
.dashboard .catalog-search>.list-tag-filter { flex-basis:var(--query-tag-width); width:var(--query-tag-width); }
.dashboard .catalog-search>.date-filter { flex-basis:var(--query-date-width); width:var(--query-date-width); }
.dashboard .list-toolbar-main { display:flex; flex-wrap:wrap; align-items:flex-start; gap:var(--space-3); }
.dashboard .list-toolbar-main>.catalog-search { display:flex; flex:1 1 auto; width:auto; }
.dashboard .list-toolbar-main>.module-main-actions { margin-left:auto; }

@media(max-width:820px) {
 .dashboard .module-toolbar>.catalog-search,.dashboard .list-toolbar-main>.catalog-search { width:100%; flex:none; }
}

.dashboard .catalog-search.has-period-filter { margin-bottom:var(--space-4); }
.dashboard .module-toolbar>.catalog-search.has-period-filter { margin-bottom:0; }

/* Opt-in single query row: keep controls intact, with local scrolling on narrow screens. */
.dashboard .catalog-search.query-single-row { flex-wrap:nowrap; overflow-x:auto; }
.dashboard .catalog-search.query-single-row>:is(input,.search-control,.filter-field-search) { flex:1 1 var(--query-search-width); min-width:var(--query-state-width); }
.dashboard .catalog-search.query-single-row>.date-filter { flex-shrink:0; }
.dashboard .catalog-search.query-single-row>.list-state-filter { flex-basis:auto; width:auto; }
.dashboard .catalog-search.query-single-row>.list-state-filter select { width:auto; min-width:var(--query-state-width); }
.dashboard .catalog-search.query-single-row>.form-actions { flex-wrap:nowrap; }
.query-status { white-space:nowrap; font-size:var(--text-0-875-rem); font-variant-numeric:tabular-nums; }

/* States with variable explanatory text need an intrinsic column, like identifiers. */
.data-table.intrinsic-table,.data-table.state-summary-table { table-layout:auto; }
.data-table.state-summary-table :is(th,td) { white-space:nowrap; }


/* Captions are needed for year/responsible and organization status; control geometry stays shared. */
.dashboard .catalog-search.query-labeled { align-items:flex-end; }

/* Every data table consumes one geometry contract; no per-screen width overrides. */
.data-table.shared-column-table { table-layout:fixed; width:var(--table-columns-min); min-width:var(--table-columns-min); }
.data-table.shared-column-table.has-flexible-columns { width:100%; }
.shared-column-table :is(th,td) { min-width:0; overflow-wrap:anywhere; }
.data-table.shared-column-table thead th,.shared-column-table .table-sort { white-space:nowrap; }
.shared-column-table td:is([data-width-role="code"],[data-width-role="document"]) { white-space:normal; overflow-wrap:anywhere; }
.shared-column-table td:is([data-width-role="code"],[data-width-role="document"]) :is(button,a):not(.table-name-excerpt,.table-text-excerpt,.table-value-excerpt) { white-space:normal; overflow-wrap:anywhere; max-width:100%; }
.shared-column-table td:is([data-width-role="date"],[data-width-role="date-label"],[data-width-role="datetime"],[data-width-role="amount"],[data-width-role="quantity"],[data-width-role="percent"],[data-width-role="percent-help"]) { font-variant-numeric:tabular-nums; }
.shared-column-table td:is([data-width-role="date"],[data-width-role="date-long"],[data-width-role="datetime"]) { white-space:nowrap; }

/* Access cards: shared columns across groups, including incomplete rows. */
:root { --access-card-min-width:20rem; }
.card-grid.access-card-grid { grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--access-card-min-width)),1fr)); }
.access-card-grid > .panel { display:flex; flex-direction:column; align-items:flex-start; }
.access-card-grid > .panel > button { margin-top:auto; flex-shrink:0; }
.check-label.check-label-regular,#editor .check-label.check-label-regular { font-weight:var(--weight-regular); }

/* Approved phase/task collection: shared controls, surfaces and spacing. */
.checklist-tree { gap:var(--space-3); width:100%; }
@media(min-width:1201px) { .checklist-tree > .checklist-phase { width:calc(50% - var(--space-18-px) - var(--stroke-1)); } }
.checklist-tree > .section-heading { margin-bottom:var(--space-2); }
.checklist-phase { border:var(--stroke-1) solid var(--line); border-radius:var(--radius-control); overflow:hidden; }
.checklist-phase > summary { display:grid; grid-template-columns:minmax(0,1fr) var(--column-quantity) auto; align-items:center; gap:var(--space-3); padding:var(--space-3) var(--space-4) var(--space-3) var(--space-36-px); background:var(--table-header-bg); }
.checklist-phase > summary:has(> .form-actions) { grid-template-columns:minmax(0,1fr) auto; }
.checklist-phase > summary > .form-actions { margin-block:calc(-1 * var(--space-2)); }
.checklist-phase[open] > summary { margin-bottom:0; }
.checklist-phase > summary::after { left:var(--space-3); right:auto; transition:transform var(--view-transition-duration) ease; }
.checklist-phase > summary > :first-child { min-width:0; overflow-wrap:anywhere; font-weight:var(--weight-medium); }
.checklist-phase > summary > :last-child { font-variant-numeric:tabular-nums; }
.checklist-progress { appearance:none; display:block; width:100%; height:var(--space-1); border:0; border-radius:var(--radius-pill); overflow:hidden; background:var(--line); color:var(--admin-muted); }
.checklist-progress::-webkit-progress-bar { background:var(--line); border-radius:var(--radius-pill); }
.checklist-progress::-webkit-progress-value { background:var(--admin-muted); border-radius:var(--radius-pill); }
.checklist-progress::-moz-progress-bar { background:var(--admin-muted); border-radius:var(--radius-pill); }
.checklist-children { display:grid; padding:var(--space-2); }
.checklist-task { display:flex; align-items:center; gap:var(--space-3); min-width:0; padding:var(--space-1) var(--space-2); border-radius:var(--radius-control); transition:var(--button-transition); }
.checklist-task:hover,.checklist-task:focus-within { background:var(--surface-row-hover); }
.checklist-task > input[type=checkbox] { flex-shrink:0; margin:0; }
.checklist-task > .link-button { flex-shrink:0; white-space:nowrap; }
.checklist-task > .checklist-task-name { flex:1 1 auto; min-width:0; text-align:left; white-space:normal; overflow-wrap:anywhere; color:var(--ink); font-weight:var(--weight-regular); padding-block:var(--space-2); }
.checklist-task:has(>input:checked) > .checklist-task-name { color:var(--admin-muted); }
.checklist-task-actions { display:grid; grid-template-columns:var(--space-48-px) var(--space-36-px); align-items:center; gap:var(--space-1); flex:none; }
.checklist-task-count { min-width:var(--space-36-px); text-decoration:none; }
.checklist-task-actions > .checklist-task-files { flex:none; width:var(--space-48-px); min-height:var(--space-36-px); color:var(--button-ink); --button-ink:var(--admin-muted); --button-hover-ink:var(--admin-action); }
.checklist-task-files.has-files { --button-ink:var(--admin-ink); font-weight:var(--weight-medium); }
.checklist-task-files.needs-document { --button-ink:var(--red); --button-hover-ink:var(--red); }
.checklist-task-files svg { width:var(--space-4); height:var(--space-4); flex-shrink:0; }
.checklist-file-row { display:flex; align-items:center; gap:var(--space-3); }
.checklist-file-row > a { min-width:0; overflow-wrap:anywhere; flex:1; }
.checklist-phase > summary:focus-visible,.checklist-task > :focus-visible,.checklist-task-actions > :focus-visible { outline:var(--stroke-2) solid var(--focus); outline-offset:calc(-1 * var(--stroke-2)); }
@supports (interpolate-size:allow-keywords) {
 .checklist-phase { interpolate-size:allow-keywords; }
 .checklist-phase::details-content { height:0; opacity:0; overflow:clip; transition:height var(--view-transition-duration) ease,opacity var(--view-transition-duration) ease,content-visibility var(--view-transition-duration) allow-discrete; }
 .checklist-phase[open]::details-content { height:auto; opacity:1; }
}
@media(max-width:560px) {
 .checklist-phase > summary { grid-template-columns:minmax(0,1fr) var(--space-48-px) auto; gap:var(--space-2); padding-right:var(--space-3); }
 .checklist-task { gap:var(--space-2); }
 .checklist-task-actions > :is(.checklist-task-files,.checklist-task-count) { min-height:var(--space-44-px); }
}
@media(prefers-reduced-motion:reduce) {
 .checklist-phase > summary::after,.checklist-phase::details-content,.checklist-task { transition:none; }
}

/* Confirmed subscription indicator requested for customer email addresses. */
.table-status-group:has(>.subscription-confirmed) { max-width:100%; gap:0; vertical-align:middle; }
.subscription-confirmed { flex:none; display:inline-flex; vertical-align:middle; width:var(--space-4); height:var(--space-4); margin-inline-start:var(--space-1); color:var(--green); }
.subscription-confirmed svg { width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:var(--stroke-2); stroke-linecap:round; stroke-linejoin:round; }

/* Opt-in reading block: half a desktop row, full width at smaller viewports. */
.reading-summary-half { width:100%; min-width:0; }
@media(min-width:1201px) { .reading-summary-half { width:50%; } }
