/* Editorial A: lists, records and forms for Clients, Tasks and Documents.
   Isolated under editorial-records; office theme and native controls remain. */
.editorial-records { --field-border: var(--editorial-line-strong); --field-radius: 6px; }
.editorial-records .workspace-header > div { min-width: 0; }
.editorial-records .workspace-header > .button { flex: 0 0 auto; }
.editorial-records .workspace-header p { max-width: 75ch; line-height: 1.75; }
.editorial-records .record-subtitle { display: flex; flex-wrap: wrap; gap: 8px; }
.editorial-records .breadcrumbs { line-height: 1.7; }
.editorial-records .empty, .editorial-records .calm-empty {
  padding: 36px 0; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: transparent; text-align: left;
}
.editorial-records .empty h2 { font-size: 22px; margin-bottom: 10px; }
.editorial-records .empty p { max-width: 65ch; color: var(--muted); margin-bottom: 22px; }
.editorial-records .compact-empty { padding: 24px 0; }
.editorial-records .compact-empty h3 { margin-top: 0; }
.editorial-records .compact-empty p { max-width: 65ch; color: var(--muted); font-size: 14px; }
.editorial-records .pagination { margin-top: 0; padding: 18px 0; border-top: 1px solid var(--line); gap: 16px; }
.editorial-records .pagination p { font-size: 13px; margin: 0; }
.editorial-records .pagination > div { display: flex; flex-wrap: wrap; gap: 8px; }

/* Lists: controls and rows share a single open working surface. */
.editorial-records .filter-bar {
  display: grid; grid-template-columns: minmax(180px, 1.6fr) minmax(140px, 1fr) minmax(140px, .9fr) auto;
  gap: 16px; align-items: end; padding: 22px 0; margin: 0;
  border: 0; border-block: 1px solid var(--line); border-radius: 0; background: transparent;
}
.editorial-records .filter-bar label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.editorial-records .filter-bar :is(.filter-search,.filter-field) { min-width: 0; grid-column: auto; }
.editorial-records .filter-actions { gap: 8px; flex-wrap: wrap; }
.editorial-records .table-wrap { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.editorial-records .data-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.editorial-records .data-table th {
  padding: 14px 12px; background: transparent; border-bottom: 1px solid var(--line);
  text-transform: none; font-size: 12px; letter-spacing: 0; font-weight: 500; color: var(--muted);
}
.editorial-records .data-table td { padding: 20px 12px; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; vertical-align: middle; }
.editorial-records .data-table :is(th,td):first-child { padding-left: 0; }
.editorial-records .data-table :is(th,td):last-child { padding-right: 0; }
.editorial-records .data-table tr:hover, .editorial-records .data-table tr:focus-within { background: var(--soft); }
.editorial-records .data-table th:first-child { width: 34%; }
.editorial-records .data-table th:nth-child(2) { width: 30%; }
.editorial-records .data-table th:nth-child(3) { width: 24%; }
.editorial-records .data-table th:last-child { width: 12%; }
.editorial-records .record-link { display: grid; gap: 4px; text-decoration: none; color: var(--ink); }
.editorial-records .record-link strong { font-size: 15px; font-weight: 550; }
.editorial-records .record-link small, .editorial-records .table-context { font-size: 12px; color: var(--muted); line-height: 1.7; }
.editorial-records .record-link:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.editorial-records .row-action a { font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }
.editorial-records section.task-workspace { max-width: none; border: 0; background: transparent; border-radius: 0; }
.editorial-records .list-heading { padding-inline: 0; border-top: 1px solid var(--line); }
.editorial-records .view-switch a { font-size: 14px; padding-block: 16px; }
.editorial-records .task-filters { padding: 22px 0 14px; }
.editorial-records .primary-filters { gap: 16px; }
.editorial-records .inline-filter label { font-size: 12px; }
.editorial-records .advanced-filters summary { min-height: 44px; padding-block: 10px; font-size: 13px; }
.editorial-records .active-filters { padding: 0 0 18px; }
.editorial-records .filter-chip { min-height: 36px; }
.editorial-records .task-table th:first-child { width: 39%; }
.editorial-records .task-table th:nth-child(2) { width: 19%; }
.editorial-records .task-table th:nth-child(3) { width: 16%; }
.editorial-records .task-table th:nth-child(4) { width: 12%; }
.editorial-records .task-table th:last-child { width: 14%; }
.editorial-records .task-table .record-title { font-size: 14px; }
.editorial-records .task-table .assignee { font-size: 13px; align-items: flex-start; }
.editorial-records .task-table .assignee .avatar { margin-top: 2px; }
.editorial-records .date-cell time { font-size: 13px; }
.editorial-records .date-cell small { font-size: 12px; margin-top: 5px; }
.editorial-records .result-count { font-size: 13px; }

/* Details: content at left; contact, ownership and context at right. */
.editorial-records .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 36px; margin-bottom: 32px; }
.editorial-records .detail-main { padding: 0; background: transparent; border: 0; border-radius: 0; min-width: 0; }
.editorial-records .detail-main .description { max-width: 75ch; font-size: 14px; line-height: 1.85; }
.editorial-records .detail-side { padding: 0 0 0 24px; background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; min-width: 0; }
.editorial-records .metadata { margin-top: 20px; }
.editorial-records .metadata > div { padding: 15px 0; }
.editorial-records .metadata dt { font-size: 12px; color: var(--muted); }
.editorial-records .metadata dd { font-size: 14px; margin: 5px 0 0; overflow-wrap: anywhere; }
.editorial-records .metadata p { font-size: 12px; margin: 6px 0 0; }
.editorial-records .notes { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.editorial-records .notes h3 { margin-top: 0; }
.editorial-records .record-list li { padding: 22px 0; gap: 20px; }
.editorial-records .record-list strong { font-size: 15px; font-weight: 550; }
.editorial-records .record-list a span { margin-top: 5px; font-size: 12px; }
.editorial-records .task-documents { padding: 24px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.editorial-records .task-documents h2 { margin-bottom: 16px; }
.editorial-records .task-documents ul { list-style: none; padding: 0; margin: 20px 0 0; }
.editorial-records .task-documents li { padding: 15px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

/* Forms: one paper surface, labelled fields and visible native feedback. */
.editorial-records .form-card, .editorial-records form.task-workspace, .editorial-records .document-template-setup {
  max-width: 820px; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; min-width: 0;
}
.editorial-records .field :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size: 14px; line-height: 1.65; }
.editorial-records .field label { font-size: 13px; }
.editorial-records .field-optional { display: inline; font-size: 12px; margin-left: 5px; }
.editorial-records .field textarea { min-height: 120px; }
.editorial-records .field :is(input,select,textarea):focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.editorial-records .form-errors { border: 1px solid var(--danger); border-radius: 6px; padding: 16px; }
.editorial-records .read-only-note { border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font-size: 13px; padding: 14px; }
.editorial-records .form-section { padding: 0; border: 0; border-radius: 0; background: transparent; }
.editorial-records .form-section-heading { margin-bottom: 24px; }
.editorial-records .form-section-heading h2 { font-size: 18px; }
.editorial-records .form-section-heading p { font-size: 13px; }
.editorial-records .task-more-details { padding: 18px 0; background: transparent; }
.editorial-records .task-more-details summary { font-size: 14px; flex-wrap: wrap; }
.editorial-records .task-more-details summary span { font-size: 12px; }
.editorial-records .form-action-bar { padding-top: 22px; margin-top: 24px; }
.editorial-records .form-action-bar .button { min-width: 100px; }
.editorial-records .task-access-summary { font-size: 13px; }
.editorial-client-form .form-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; }
.editorial-client-form .form-card > :is(.form-errors,.form-actions,.read-only-note), .editorial-client-form .field:has(#id_name,#id_notes,#id_responsible) { grid-column: 1/-1; }
.editorial-client-form .form-card > .form-actions { margin-top: 4px; }

/* Document library and production: clear rows, one working sheet and a rail. */
.editorial-records .document-library { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.editorial-records .document-row { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 20px; padding: 24px 0; min-width: 0; }
.editorial-records .document-row-main { min-width: 0; }
.editorial-records .editorial-file-icon { color: var(--accent-ink); width: 21px; height: 21px; stroke-width: 1.5; align-self: start; margin-top: 3px; }
.editorial-records .document-row h2 { font-size: 16px; font-weight: 550; overflow-wrap: anywhere; }
.editorial-records .document-row p { font-size: 13px; margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.editorial-records .document-row > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 500; }
.editorial-records .document-template-actions { gap: 18px; justify-content: flex-end; }
.editorial-records .document-template-actions > details { max-width: 240px; }
.editorial-records .document-template-actions summary { min-height: 44px; display: list-item; padding-top: 10px; font-size: 13px; }
.editorial-records .document-template-actions details[open] a { display: block; padding: 10px 0; }
.editorial-records .document-choice { margin-bottom: 28px; gap: 16px; }
.editorial-records .document-choice label { align-items: flex-start; border-color: var(--editorial-line-strong); padding: 18px; }
.editorial-records .document-choice input { flex: 0 0 auto; margin-top: 5px; accent-color: var(--accent); }
.editorial-records .document-choice label:has(input:checked) { background: var(--soft); border-color: var(--accent-ink); }
.editorial-records .document-form > .panel { padding: 0 0 24px; border: 0; border-radius: 0; background: transparent; }
.editorial-records .document-form > details.panel { padding: 20px 0; border-top: 1px solid var(--line); }
.editorial-records .document-form > .panel h2 { margin-bottom: 12px; }
.editorial-records .document-form > .panel > label { display: block; margin: 16px 0 7px; font-weight: 550; }
.editorial-records .document-form > .panel > .button { margin-top: 16px; }
.editorial-records summary { cursor: pointer; min-height: 44px; }
.editorial-records .document-template-setup { padding-top: 0; }
.editorial-records .document-template-field { padding-block: 22px; }
.editorial-records .document-template-field legend { font-size: 17px; overflow-wrap: anywhere; }
.editorial-records .document-setup-steps { font-size: 13px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.editorial-records .document-create-form, .editorial-records .document-context-form { grid-template-columns: minmax(0,1fr) 300px; gap: 36px; }
.editorial-records .document-create-main, .editorial-records .document-data-sheet, .editorial-records .document-context-form > .source-selection { padding: 0 28px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; }
.editorial-records .document-data-sheet, .editorial-records .document-context-form > .source-selection { padding-block: 28px; }
.editorial-records .document-create-actions, .editorial-records .context-save-panel { border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0 0 0 24px; background: transparent; }
.editorial-records .document-create-actions h2, .editorial-records .context-save-panel h2 { font-size: 18px; }
.editorial-records .document-create-actions .button, .editorial-records .context-save-actions .button { min-height: 44px; }
.editorial-records .document-model-fields { columns: 1; }
.editorial-records .source-option { border-radius: 0; }
.editorial-records .source-option .check-label small { line-height: 1.7; }
.editorial-records .source-preview .snapshot-text { border: 1px solid var(--line); }
.editorial-records .document-chosen-sources { font-size: 14px; }
.editorial-records .document-confirmed-fields { gap: 16px 24px; }
.editorial-records .attachment-preview { padding: 0; background: transparent; border: 0; }
.editorial-records .attachment-preview pre { padding: 28px; border: 1px solid var(--line); background: var(--paper); border-radius: 2px; line-height: 1.8; }

@media(max-width:1200px) {
  .editorial-records .filter-bar { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr); }
  .editorial-records .filter-actions { grid-column: 1/-1; justify-content: flex-end; }
  .editorial-records .document-create-form, .editorial-records .document-context-form { gap: 24px; grid-template-columns: minmax(0,1fr) 260px; }
  .editorial-records .document-template-actions { flex-direction: column; gap: 6px; align-items: flex-start; }
}
@media(max-width:1050px) {
  .editorial-records .detail-grid, .editorial-records .document-create-form, .editorial-records .document-context-form { grid-template-columns: minmax(0,1fr); }
  .editorial-records .detail-side { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .editorial-records .document-create-actions, .editorial-records .context-save-panel { position: static; padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .editorial-records .document-create-actions .button, .editorial-records .context-save-actions { max-width: 480px; }
  .editorial-records .document-cancel, .editorial-records .document-alternate-action { text-align: left; }
}
@media(max-width:760px) {
  .editorial-records .filter-bar { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .editorial-records .filter-actions { justify-content: stretch; }
  .editorial-records .primary-filters { flex-wrap: wrap; gap: 12px; }
  .editorial-records .search-field { flex-basis: 100%; }
  .editorial-records .inline-filter { min-width: 0; flex: 1; }
  .editorial-records .inline-filter label { display: block; }
  .editorial-records .inline-filter select { width: 100%; min-width: 0; }
  .editorial-records .advanced-filter-grid { grid-template-columns: minmax(0,1fr); }
  .editorial-records .advanced-filter-grid .button { grid-column: 1; justify-self: stretch; }
  .editorial-records .list-heading { align-items: center; gap: 12px; flex-wrap: wrap; }
  .editorial-records .task-workspace .pagination { padding-inline: 0; }
  .editorial-records .data-table tr { padding: 18px 0; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
  .editorial-records .data-table :is(td,td:first-child,td:last-child) { grid-template-columns: 92px minmax(0,1fr); padding: 7px 0; border: 0; gap: 12px; font-size: 14px; }
  .editorial-records .data-table td:first-child { display: block; padding-bottom: 14px; }
  .editorial-records .data-table td:first-child::before { display: none; }
  .editorial-records .data-table td::before { font-size: 12px; font-weight: 500; }
  .editorial-records .data-table .row-action { display: block; padding-top: 2px; }
  .editorial-records .data-table .row-action a { margin-left: 0; }
  .editorial-records .data-table .record-title, .editorial-records .record-link strong { font-size: 15px; }
  .editorial-records .record-list li { flex-wrap: wrap; gap: 12px; }
  .editorial-records .record-list li > a { flex-basis: 100%; }
  .editorial-records .form-card, .editorial-records form.task-workspace, .editorial-records .document-template-setup { padding: 20px 16px; }
  .editorial-records .field-row, .editorial-client-form .form-card { grid-template-columns: minmax(0,1fr); }
  .editorial-records .field :is(input:not([type=checkbox]):not([type=radio]),select,textarea), .editorial-records input.control, .editorial-records select.control { font-size: 16px; }
  .editorial-records .task-more-details summary span { flex-basis: 100%; }
  .editorial-records .document-row { grid-template-columns: 20px minmax(0,1fr); gap: 12px; padding-block: 22px; }
  .editorial-records .document-row-main { grid-column: 2; }
  .editorial-records .document-row > a, .editorial-records .document-template-actions { grid-column: 2; justify-self: start; }
  .editorial-records .document-template-actions { align-items: flex-start; gap: 6px; }
  .editorial-records .document-create-main, .editorial-records .document-data-sheet, .editorial-records .document-context-form > .source-selection { padding-inline: 16px; }
  .editorial-records .document-data-sheet, .editorial-records .document-context-form > .source-selection { padding-block: 20px; }
  .editorial-records .document-choice { grid-template-columns: minmax(0,1fr); }
  .editorial-records .document-choice label { padding: 14px; min-width: 0; }
  .editorial-records .document-choice span { min-width: 0; }
  .editorial-records .document-confirmed-fields { grid-template-columns: minmax(0,1fr); }
  .editorial-records .attachment-preview pre { padding: 20px; }
}
