/**
 * Commercial File tab + ledger on the Client File.
 * Tokens only: --ed-* (shell + 3026). No new palette or type.
 */

.cf-tab--commercial {
  background: transparent;
  color: #5c6673;
  border-color: transparent;
}

.cfc-open { margin: var(--ed-space-2) 0 var(--ed-space-3); }
.cfc-file-reference {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ed-text-muted);
}
.cfc-file-reference span {
  font-variant-numeric: tabular-nums;
  color: var(--ed-navy);
  letter-spacing: 0.02em;
}
.cfc-ledger { display: flex; flex-direction: column; gap: var(--ed-space-4); min-width: 0; }
.cfc-ledger-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ed-space-3); flex-wrap: wrap; }
.cfc-ledger-actions { display: flex; gap: var(--ed-space-2); flex-wrap: wrap; }
.cfc-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--ed-space-2) var(--ed-space-4);
  margin: 0;
  padding: var(--ed-space-3);
  background: var(--ed-surface, var(--surface));
  border: 1px solid var(--ed-border, var(--border));
  border-radius: var(--ed-radius-sm);
}
.cfc-summary div { min-width: 0; }
.cfc-summary dt { font-size: var(--ed-text-xs, 12px); color: var(--ed-text-muted); margin: 0 0 2px; }
.cfc-summary dd { margin: 0; font-size: var(--ed-text-sm, 13px); font-variant-numeric: tabular-nums; }
.cfc-summary .cfc-not-calc { color: var(--ed-text-muted); font-weight: 400; }
.cfc-section-title {
  margin: 0 0 var(--ed-space-2);
  font-size: var(--ed-text-sm, 13px);
  font-weight: 600;
}
.cfc-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 15rem minmax(0, 1fr) 6.75rem;
  gap: var(--ed-space-2) var(--ed-space-3);
  align-items: baseline;
  padding: var(--ed-space-2) 0;
  border-bottom: 1px solid var(--ed-border-light, var(--ed-border));
  font-size: var(--ed-text-sm, 13px);
}
.cfc-entry.is-voided .cfc-entry-label,
.cfc-entry.is-voided .cfc-entry-amount { text-decoration: line-through; color: var(--ed-text-muted); }
.cfc-entry-label { font-weight: 500; }
.cfc-entry-amount { justify-self: stretch; }
.cfc-entry-acts { justify-self: end; }
.cfc-entry-amount, .cfc-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.cfc-finance { width: 100%; }
.cfc-finance th { font-weight: 500; text-align: left; }
.cfc-finance td.cfc-amount {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.cfc-row-meta {
  display: block;
  margin-top: 2px;
  font-size: var(--ed-text-xs, 12px);
  font-weight: 400;
  color: var(--ed-text-muted, var(--text-muted));
}
.cfc-fin-row--booking,
.cfc-entry--booking { background: color-mix(in srgb, var(--ed-text, #243040) 4%, transparent); }
.cfc-fin-row--payment,
.cfc-entry--payment { background: color-mix(in srgb, var(--ed-petrol, #1f5f78) 7%, transparent); }
.cfc-fin-row--balance,
.cfc-entry--balance { background: color-mix(in srgb, var(--ed-petrol, #1f5f78) 12%, transparent); }
.cfc-fin-row--booking .cfc-amount,
.cfc-fin-row--payment .cfc-amount,
.cfc-fin-row--balance .cfc-amount,
.cfc-entry--booking .cfc-entry-amount,
.cfc-entry--payment .cfc-entry-amount,
.cfc-entry--balance .cfc-entry-amount { font-weight: 600; }
.cfc-entry--booking,
.cfc-entry--payment,
.cfc-entry--balance { border-radius: 4px; border-bottom-color: transparent; }
.cfc-audit { margin: var(--ed-space-2) 0 0; }
.cfc-audit summary { cursor: pointer; font-size: var(--ed-text-xs, 12px); font-weight: 600; color: var(--ed-text-muted, var(--text-muted)); }
.cfc-audit ul { margin: 6px 0 0; padding: 0 0 0 18px; }
.cfc-audit li { margin: 0 0 4px; font-size: var(--ed-text-xs, 12px); color: var(--ed-text-muted, var(--text-muted)); }
.cfc-entry-meta { color: var(--ed-text-muted); font-size: var(--ed-text-xs, 12px); min-width: 0; }
.cfc-entry-acts { display: flex; gap: var(--ed-space-2); }
.cfc-entry-acts button { padding: 0; border: 0; background: none; color: var(--ed-text-muted); font: inherit; font-size: var(--ed-text-xs, 12px); cursor: pointer; text-decoration: underline; }
.cfc-entry-acts button:hover { color: var(--ed-text); }
.cfc-src, .cfc-entered { color: var(--ed-text-muted); font-size: var(--ed-text-xs, 12px); }
.cfc-void { color: var(--ed-warn); font-size: var(--ed-text-xs, 12px); }
.cfc-corr { color: var(--ed-text-muted); font-size: var(--ed-text-xs, 12px); display: block; }
.cfc-invoice { margin: 0 0 var(--ed-space-4); padding: 0 0 var(--ed-space-2); border-bottom: 1px solid var(--ed-border); }
.cfc-invoice:last-child { border-bottom: 0; }
.cfc-history { margin: var(--ed-space-2) 0 0; }
.cfc-history summary { cursor: pointer; font-size: var(--ed-text-sm, 13px); font-weight: 600; }
.cfc-history ol { margin: var(--ed-space-2) 0 0; padding: 0 0 0 18px; }
.cfc-history li { margin: 0 0 var(--ed-space-2); font-size: var(--ed-text-xs, 12px); color: var(--ed-text-muted); }
.cfc-ledger-form {
  display: flex;
  flex-direction: column;
  gap: var(--ed-space-3);
  margin: var(--ed-space-2) 0 0;
  min-width: 0;
}
.cfc-form-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.cfc-form-legend {
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ed-text-muted);
}
.cfc-form-help {
  margin: 0;
  font-size: var(--ed-text-xs, 12px);
  color: var(--ed-text-muted);
  line-height: 1.35;
}
.cfc-form-hint {
  font-weight: 400;
  color: var(--ed-text-muted);
}
.cfc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  min-width: 0;
}
.cfc-form-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cfc-ledger-form label,
.cfc-form-grid label,
.cfc-form-full {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ed-text-muted);
  min-width: 0;
}
.cfc-form-full { grid-column: 1 / -1; }
.cfc-ledger-form input,
.cfc-ledger-form select,
.cfc-ledger-form textarea,
.cfc-form-grid input,
.cfc-form-grid select,
.cfc-form-grid textarea,
.cfc-form-full input,
.cfc-form-full select,
.cfc-form-full textarea {
  font: inherit;
  font-size: var(--ed-text-sm, 13px);
  color: var(--ed-text);
  padding: 6px 8px;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius-sm);
  background: var(--ed-surface, var(--surface));
  width: 100%;
  box-sizing: border-box;
  min-height: 32px;
}
.cfc-ledger-form textarea,
.cfc-form-full textarea {
  min-height: 52px;
  resize: vertical;
}
.cfc-form-section--reason {
  padding: 8px 10px;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius-sm);
  background: var(--ed-surface, var(--surface));
}
.cfc-required-mark {
  display: inline-block;
  margin-left: var(--ed-space-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ed-text);
}
.cfc-preserve-note {
  margin: 0 0 var(--ed-space-2);
  padding: 6px 10px;
  border: 1px solid var(--ed-border-light, var(--ed-border));
  border-radius: var(--ed-radius-sm);
  background: var(--ed-ivory-deep, var(--ed-surface));
  color: var(--ed-text);
  font-size: var(--ed-text-xs, 12px);
  line-height: 1.4;
}
.ws-modal-overlay.cfc-workspace-overlay {
  align-items: flex-start;
  justify-content: stretch;
  padding: 12px 16px;
}
.ws-modal.cf-commercial-modal,
.ws-modal.cf-commercial-modal--workspace {
  display: flex;
  flex-direction: column;
  max-width: none;
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 14px 18px 12px;
}
.ws-modal.cf-commercial-modal .ws-modal-title { margin: 0 0 4px; }
.ws-modal.cf-commercial-modal .ws-modal-desc { margin: 0 0 8px; font-size: 13px; }
.ws-modal.cf-commercial-modal .ws-modal-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ed-border-light, var(--ed-border));
}

.fc-cockpit { margin: 8px 0 12px; }
.fc-cockpit h3, .fc-cockpit h4 { margin: 8px 0 4px; font-size: 13px; }
.fc-position { margin: 0 0 8px; }
.fc-position .cfc-summary { margin-top: 4px; }
.fc-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 3px;
  margin: 0;
  padding: 0 2px;
  border-bottom: 1px solid var(--ed-tab-rail, #c5cdd6);
}
.fc-tab {
  appearance: none;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0 0 -1px;
  padding: 6px 8px 7px;
  border: 1px solid var(--ed-border, #c5cdd6);
  border-bottom: 1px solid transparent;
  border-radius: 5px 5px 0 0;
  background: #eef1f4;
  color: #5c6673;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.fc-tab--client { background: var(--ed-tab-acc-bg, #dceaf2); color: var(--ed-tab-acc-fg, #2f4a5a); border-color: var(--ed-tab-acc-bd, #b9ccd8); }
.fc-tab--supplier { background: var(--ed-tab-fees-bg, #ddeee4); color: var(--ed-tab-fees-fg, #2f4a3a); border-color: var(--ed-tab-fees-bd, #b7d0c0); }
.fc-tab--invoices { background: var(--ed-tab-ext-bg, #f0e6d2); color: var(--ed-tab-ext-fg, #5a4b30); border-color: var(--ed-tab-ext-bd, #dcc9a6); }
.fc-tab--adjustments { background: var(--ed-tab-inc-bg, #e8e2f0); color: var(--ed-tab-inc-fg, #46395a); border-color: var(--ed-tab-inc-bd, #cfc4de); }
.fc-tab--review { background: var(--ed-tab-notes-bg, #eee8df); color: var(--ed-tab-notes-fg, #4a4338); border-color: var(--ed-tab-notes-bd, #d5cbb8); }
.fc-tab.is-active { z-index: 1; font-weight: 600; padding-top: 7px; padding-bottom: 8px; }
.fc-cockpit[data-fc-active="client"] .fc-tab--client.is-active { background: var(--ed-tab-acc-active, #f3f8fb); border-bottom-color: var(--ed-tab-acc-active, #f3f8fb); }
.fc-cockpit[data-fc-active="supplier"] .fc-tab--supplier.is-active { background: var(--ed-tab-fees-active, #f3faf5); border-bottom-color: var(--ed-tab-fees-active, #f3faf5); }
.fc-cockpit[data-fc-active="invoices"] .fc-tab--invoices.is-active { background: var(--ed-tab-ext-active, #fbf6ec); border-bottom-color: var(--ed-tab-ext-active, #fbf6ec); }
.fc-cockpit[data-fc-active="adjustments"] .fc-tab--adjustments.is-active { background: var(--ed-tab-inc-active, #f7f4fa); border-bottom-color: var(--ed-tab-inc-active, #f7f4fa); }
.fc-cockpit[data-fc-active="review"] .fc-tab--review.is-active { background: var(--ed-tab-notes-active, #faf7f2); border-bottom-color: var(--ed-tab-notes-active, #faf7f2); }
.fc-panel {
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--ed-border, #c5cdd6);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  min-width: 0;
}
.fc-cockpit[data-fc-active="client"] .fc-panel { background: var(--ed-tab-acc-active, #f3f8fb); border-color: var(--ed-tab-acc-bd, #b9ccd8); }
.fc-cockpit[data-fc-active="supplier"] .fc-panel { background: var(--ed-tab-fees-active, #f3faf5); border-color: var(--ed-tab-fees-bd, #b7d0c0); }
.fc-cockpit[data-fc-active="invoices"] .fc-panel { background: var(--ed-tab-ext-active, #fbf6ec); border-color: var(--ed-tab-ext-bd, #dcc9a6); }
.fc-cockpit[data-fc-active="adjustments"] .fc-panel { background: var(--ed-tab-inc-active, #f7f4fa); border-color: var(--ed-tab-inc-bd, #cfc4de); }
.fc-cockpit[data-fc-active="review"] .fc-panel { background: var(--ed-tab-notes-active, #faf7f2); border-color: var(--ed-tab-notes-bd, #d5cbb8); }
.fc-panel[hidden] { display: none; }
.fc-action {
  margin: 8px 0;
  padding: 0 10px;
  border: 1px solid var(--ed-border, #d9d3c7);
  border-radius: var(--ed-radius-sm, 6px);
  background: var(--ed-surface, #fff);
}
.fc-action > summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}
.fc-action > summary::-webkit-details-marker { display: none; }
.fc-action-title { font-size: 12px; font-weight: 600; }
.fc-action-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--ed-text-muted, #5c6673);
  text-align: right;
}
.fc-action[open] { padding-bottom: 10px; }
.fc-term-row { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.fc-term-days[hidden],
.fc-term-date[hidden] { display: none; }
.fc-term-row + .fc-term-row { border-top: 1px solid var(--ed-border-light, var(--ed-border)); }
.fc-term-add { margin: 0; }
.fc-form--terms .cfc-form-grid label,
.fc-form--review .fc-check { font-size: 11px; }
.fc-audit-block { margin: 12px 0 0; }
.fc-audit-block h4 { margin: 0 0 4px; }
.fc-evidence { margin: 4px 0 8px; padding-left: 1.1rem; font-size: 12px; }
.fc-note { margin: 4px 0 8px; font-size: 12px; color: var(--ed-text-muted, #5c6673); }
.fc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.5rem 0.75rem; margin: 0.75rem 0 1rem; align-items: end; }
.fc-form h4, .fc-form .fc-form-help, .fc-form .fc-checks, .fc-form .cfc-error { grid-column: 1 / -1; }
.fc-form label { display: grid; gap: 0.2rem; font-size: 0.82rem; }
.fc-form.fc-form--terms,
.fc-form.fc-form--review,
.fc-form.fc-form--supplier-invoice { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; }
.fc-supplier-head { display: grid; grid-template-columns: minmax(0, 1.6fr) 8rem; gap: 8px 12px; }
.fc-supplier-sheet { table-layout: fixed; margin: 0; }
.fc-supplier-sheet th:nth-child(1) { width: 9.25rem; }
.fc-supplier-sheet th:nth-child(3) { width: 4.25rem; }
.fc-supplier-sheet th:nth-child(4) { width: 6.25rem; }
.fc-supplier-sheet th:nth-child(5) { width: 7.25rem; }
.fc-supplier-sheet th:nth-child(6) { width: 6.5rem; }
.fc-supplier-sheet td { vertical-align: top; }
.fc-supplier-sheet input,
.fc-supplier-sheet select,
.fc-supplier-sheet textarea { width: 100%; min-width: 0; }
.fc-supplier-date { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fc-supplier-date input[hidden],
.fc-supplier-date .ed-date-field[hidden] { display: none; }
.fc-supplier-service textarea { min-height: 2.4rem; resize: vertical; }
.fc-supplier-supports { margin-top: 4px; }
.fc-supplier-supports summary { cursor: pointer; color: var(--ed-text-muted, #5c6673); font-size: 11px; }
.fc-supplier-support-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.fc-supplier-support-list label { display: flex; gap: 6px; align-items: flex-start; font-size: 11px; }
.fc-supplier-line-total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-supplier-tools { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; }
.fc-text-action {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ed-petrol, #24515c);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.fc-supplier-paste { display: grid; gap: 6px; }
.fc-supplier-paste[hidden] { display: none; }
.fc-supplier-paste textarea { min-height: 4.5rem; }
.fc-reconcile {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 8px 0 0;
  font-size: 12px;
}
.fc-reconcile p { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.fc-reconcile strong { font-variant-numeric: tabular-nums; }
.fc-reconcile-gap[data-open="1"] strong { color: var(--ed-know, #9a6412); }
.fc-supplier-saved { margin: 0; padding-left: 1rem; font-size: 12px; }
.fc-bill-lines { display: flex; flex-direction: column; gap: 6px; }
.fc-form[data-fc-action="save_invoice"] > label:first-of-type,
.fc-form[data-fc-action="save_invoice"] > .fc-note,
.fc-form[data-fc-action="save_invoice"] > .fc-bill-lines {
  grid-column: 1 / -1;
  min-width: 0;
}
.fc-form[data-fc-action="save_invoice"] .fc-bill-line { min-width: 0; }
.fc-reconciliation {
  margin: 16px 0 0;
}
.fc-reconciliation > summary {
  display: block;
  cursor: pointer;
  list-style: none;
}
.fc-reconciliation > summary::-webkit-details-marker { display: none; }
.fc-recon-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.fc-recon-lead {
  display: block;
  margin-top: 2px;
  color: var(--ed-text-muted, #5c6673);
  font-size: 12px;
}
.fc-recon-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 4px;
  font-size: 12px;
}
.fc-recon-action { color: var(--ed-navy, #0f1f33); font-weight: 600; }
.fc-reconciliation:not([open]) > .fc-schedule { display: none; }
.fc-reconciliation[open] > .fc-schedule { margin-top: 8px; }
.fc-recon-plain p {
  margin: 2px 0 0;
  color: var(--ed-text, #171d26);
  font-size: 12px;
  line-height: 1.35;
}
.fc-recon-technical { margin-top: 4px; }
.fc-recon-technical summary {
  cursor: pointer;
  color: var(--ed-text-muted, #5c6673);
  font-size: 11px;
  font-weight: 600;
}
.fc-recon-technical ul {
  margin: 4px 0 0;
  padding-left: 1.1rem;
  color: var(--ed-text-muted, #5c6673);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.fc-bill-line {
  display: grid;
  grid-template-columns: auto 7.5rem minmax(0, 1fr) 8.5rem 7rem;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 12px;
}
.fc-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.fc-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--ed-border, #d9d3c7);
  border-radius: var(--ed-radius-sm, 6px);
  background: var(--ed-surface, #fff);
  font-size: 12px;
  line-height: 1.35;
}
.fc-form--review .btn { justify-self: start; }
.fc-total { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.fc-total strong { font-variant-numeric: tabular-nums; }
.fc-confirm { margin: 0; font-size: 13px; }
.fc-schedule, .fc-report { width: 100%; border-collapse: collapse; font-size: 12px; }
.fc-schedule th, .fc-schedule td, .fc-report th, .fc-report td { padding: 4px 8px; text-align: left; vertical-align: top; }
.fc-schedule .fc-num, .fc-report .fc-num, .fc-schedule td.fc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-review, .fc-reports .cfc-meta { font-size: 12px; }
.fc-report-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0; }
.fc-report-form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; position: relative; }
.fc-report-form input[name="client"],
.fc-report-form input[name="supplier"] {
  width: 9.5rem;
  box-sizing: border-box;
}
.fc-report-actions { display: flex; gap: 8px; flex-wrap: nowrap; }
.fc-report-actions .btn { white-space: nowrap; }
@media (min-width: 1200px) {
  .fc-report-form {
    display: grid;
    grid-template-columns: max-content 10rem 10rem max-content minmax(6rem, 1fr) minmax(6rem, 1fr) auto;
    column-gap: 8px;
    row-gap: 8px;
    align-items: end;
  }
  .fc-report-form > label,
  .fc-report-form > .fc-report-actions { min-width: 0; }
  .fc-report-form .ed-date-field { width: 100%; min-width: 0; }
  .fc-report-form .ed-date-field input.ed-date-display,
  .fc-report-form .ed-select-toggle,
  .fc-report-form input[name="client"],
  .fc-report-form input[name="supplier"],
  .fc-report-form .fc-report-actions .btn {
    min-height: 36px;
    box-sizing: border-box;
  }
  .fc-report-form .ed-date-field input.ed-date-display {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }
  .fc-report-form .ed-select-toggle {
    width: max-content;
    max-width: 16rem;
    min-width: 0;
    white-space: nowrap;
  }
  .fc-report-form input[name="client"],
  .fc-report-form input[name="supplier"] { width: 100%; }
}
.fc-report-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 21; margin: 0; padding: 0; background: var(--ed-surface, #fff); border: 1px solid var(--ed-border, #d9d3c7); max-height: 9rem; overflow: auto; }
.fc-report-suggest[hidden] { display: none; }
.fc-report-suggest-option { display: block; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; font-size: 12px; padding: 4px 8px; cursor: pointer; }
.fc-report-actions { display: flex; gap: 8px; }
.ed-date-pop { position: absolute; z-index: 20; width: 240px; padding: 8px; border: 1px solid var(--ed-border, #d9d3c7); background: var(--ed-surface, #fff); }
.ed-date-pop[hidden] { display: none; }
.ed-date-bar { display: flex; justify-content: space-between; align-items: center; }
.ed-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.ed-date-day { border: 0; background: transparent; padding: 4px 0; cursor: pointer; }
.ed-date-day.is-selected { background: color-mix(in srgb, var(--ed-petrol, #1f5f78) 16%, transparent); }
.fc-reports { position: relative; }

.fc-invoice-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.fc-invoice-view > .btn { align-self: center; }
.fc-invoice-doc {
  width: min(210mm, 100%);
  min-height: 250mm;
  box-sizing: border-box;
  margin: 0;
  padding: 16mm 16mm 14mm;
  background: #fff;
  color: var(--ed-ink-on-light, #0F1F33);
  border-top: 3px solid var(--ed-petrol, #1f5f78);
  box-shadow: 0 16px 40px rgba(28, 36, 48, 0.12);
  font-family: var(--ed-font, Inter, "Segoe UI", sans-serif);
}
.fc-invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.fc-invoice-kicker,
.fc-invoice-parties h2,
.fc-invoice-split h2 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ed-petrol, #1f5f78);
}
.fc-invoice-number {
  margin: 0;
  font-family: var(--ed-font-display, "Cormorant Garamond", Georgia, serif);
  font-size: 42px;
  font-weight: 560;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ed-navy, #1c2430);
}
.fc-invoice-payable {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ed-text-muted, #5c6673);
}
.fc-invoice-logo {
  display: block;
  max-width: 148px;
  max-height: 52px;
  object-fit: contain;
}
.fc-invoice-parties {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 28px;
  margin: 28px 0 0;
  padding: 20px 0 22px;
  border-top: 1px solid rgba(28, 36, 48, 0.2);
  border-bottom: 1px solid rgba(28, 36, 48, 0.2);
}
.fc-invoice-parties p,
.fc-invoice-split p,
.fc-invoice-settled,
.fc-invoice-currency,
.fc-invoice-foot {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.45;
}
.fc-invoice-dates p { margin-bottom: 12px; }
.fc-invoice-dates p span {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ed-text-muted, #5c6673);
}
.fc-invoice-lines {
  width: 100%;
  margin: 8px 0 0;
  border-collapse: collapse;
}
.fc-invoice-lines th {
  padding: 16px 16px 8px 0;
  border-bottom: 1px solid rgba(28, 36, 48, 0.2);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ed-navy-soft, #3d5166);
}
.fc-invoice-lines td {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid rgba(28, 36, 48, 0.08);
  font-size: 15px;
  line-height: 1.4;
  vertical-align: top;
}
.fc-invoice-lines th:last-child,
.fc-invoice-lines td:last-child { padding-right: 0; }
.fc-invoice-amt {
  width: 9.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fc-invoice-due {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 32px;
  margin: 0;
  padding: 18px 0 10px;
  border-bottom: 1px solid rgba(28, 36, 48, 0.2);
}
.fc-invoice-due span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.fc-invoice-due strong {
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.fc-invoice-settled,
.fc-invoice-currency { margin-top: 10px; color: var(--ed-text-muted, #5c6673); }
.fc-invoice-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  margin-top: 28px;
}
.fc-invoice-foot {
  margin-top: 40px;
  padding-top: 12px;
  border-top: 1px solid rgba(28, 36, 48, 0.12);
  color: var(--ed-text-muted, #5c6673);
  font-size: 12px;
}
@media print {
  .fc-invoice-view > .btn { display: none; }
  .fc-invoice-doc { box-shadow: none; min-height: 0; }
}

@media (max-width: 1100px) {
  .cfc-form-grid--4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .cfc-entry { grid-template-columns: minmax(0, 1fr) minmax(15rem, auto); }
  .cfc-entry-meta, .cfc-entry-acts { grid-column: 1 / -1; }
  .cfc-form-grid,
  .cfc-form-grid--4 { grid-template-columns: 1fr; }
}

/* Client file navigation sits under the stage blocks. These beat the shared
   folder colours in the 3026 theme, which otherwise paint workspace tabs and
   the quote lifecycle the same way. Supplier tabs are not included.
   Light only — dark mode uses the same structure with theme tokens below. */
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--details,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--journeys,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--commercial,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--documents,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--notes {
  background: transparent !important;
  color: var(--ed-text-soft, #3d4a58) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-align: left !important;
}
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--details.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--journeys.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--commercial.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--documents.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-tabs .cf-tab--notes.is-active {
  background: rgba(111, 151, 173, 0.16) !important;
  color: var(--ed-ink-on-light, #0F1F33) !important;
  border: 0 !important;
  box-shadow: inset 2px 0 0 var(--ed-petrol-pastel, #6f97ad) !important;
}
html[data-ed-theme="light"] body.ed-y3026 .cf-file-body[data-cf-active-tab] .cf-tab-panel,
html[data-ed-theme="light"] body.ed-y3026 .cf-file-body[data-cf-active-tab="details"] .cf-tab-panel,
html[data-ed-theme="light"] body.ed-y3026 .cf-file-body[data-cf-active-tab="journeys"] .cf-tab-panel,
html[data-ed-theme="light"] body.ed-y3026 .cf-file-body[data-cf-active-tab="commercial"] .cf-tab-panel,
html[data-ed-theme="light"] body.ed-y3026 .cf-file-body[data-cf-active-tab="documents"] .cf-tab-panel,
html[data-ed-theme="light"] body.ed-y3026 .cf-file-body[data-cf-active-tab="notes"] .cf-tab-panel {
  background: #fff !important;
  border-color: #d5dbe3 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--draft,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--issued,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--confirmed,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--accepted,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--cancelled {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 3px 8px 2px !important;
  background: #fff !important;
  color: #3d4654 !important;
  border: 1px solid #d5dbe3 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--draft.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--issued.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--confirmed.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--accepted.is-active,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life-tab--cancelled.is-active {
  padding: 3px 8px 2px !important;
  background: var(--ed-navy, #171d26) !important;
  color: #fff !important;
  border-color: var(--ed-navy, #171d26) !important;
  box-shadow: none !important;
}
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life[data-quote-life-tab] .cf-quote-life-body,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life[data-quote-life-tab="draft"] .cf-quote-life-body,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life[data-quote-life-tab="issued"] .cf-quote-life-body,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life[data-quote-life-tab="confirmed"] .cf-quote-life-body,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life[data-quote-life-tab="accepted"] .cf-quote-life-body,
html[data-ed-theme="light"] body.ed-y3026 .cf-quote-life[data-quote-life-tab="cancelled"] .cf-quote-life-body {
  background: #fff !important;
  border-color: #d5dbe3 !important;
  box-shadow: none !important;
}

/* Same client-file structure in dark: solid dusk surfaces, readable ink. */
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--details,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--journeys,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--commercial,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--documents,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--notes {
  background: transparent !important;
  color: var(--ed-text-quiet) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-align: left !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--details.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--journeys.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--commercial.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--documents.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tabs .cf-tab--notes.is-active {
  background: rgba(111, 151, 173, 0.16) !important;
  color: var(--ed-heading) !important;
  border: 0 !important;
  box-shadow: inset 2px 0 0 var(--ed-petrol-pastel) !important;
}
html[data-ed-theme="light"] body.ed-y3026 .cf-file .cf-file-body[data-cf-active-tab] .cf-tab-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-file .cf-file-body[data-cf-active-tab] .cf-tab-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-file-body[data-cf-active-tab] .cf-tab-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-file-body[data-cf-active-tab="details"] .cf-tab-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-file-body[data-cf-active-tab="journeys"] .cf-tab-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-file-body[data-cf-active-tab="commercial"] .cf-tab-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-file-body[data-cf-active-tab="documents"] .cf-tab-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-file-body[data-cf-active-tab="notes"] .cf-tab-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life[data-quote-life-tab] .cf-quote-life-body,
html[data-ed-theme="dark"] body.ed-y3026 .cf-details-journey-row,
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-card,
html[data-ed-theme="dark"] body.ed-y3026 .ed-account-menu,
html[data-ed-theme="dark"] body.ed-y3026 .fc-report-suggest {
  background: var(--ed-surface-solid) !important;
  border-color: var(--ed-border) !important;
  color: var(--ed-text) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--draft,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--issued,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--confirmed,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--accepted,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--cancelled {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 3px 8px 2px !important;
  background: var(--ed-surface-solid) !important;
  color: var(--ed-text-soft) !important;
  border: 1px solid var(--ed-border) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--draft.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--issued.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--confirmed.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--accepted.is-active,
html[data-ed-theme="dark"] body.ed-y3026 .cf-quote-life-tab--cancelled.is-active {
  padding: 3px 8px 2px !important;
  background: var(--ed-petrol-deep, #1f5f78) !important;
  color: var(--ed-ivory-literal, #F7F3EB) !important;
  border-color: var(--ed-petrol-pastel) !important;
  box-shadow: none !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-details-grid dt,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tab-lead,
html[data-ed-theme="dark"] body.ed-y3026 .cf-tab-empty,
html[data-ed-theme="dark"] body.ed-y3026 .cf-details-journey-meta {
  color: var(--ed-text-quiet) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-details-grid dd,
html[data-ed-theme="dark"] body.ed-y3026 .cf-details-next p,
html[data-ed-theme="dark"] body.ed-y3026 .cf-details-journey-name,
html[data-ed-theme="dark"] body.ed-y3026 .cf-detail-title {
  color: var(--ed-heading) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-client-progress .cf-progress-step,
html[data-ed-theme="dark"] body.ed-y3026 .cf-client-progress .cf-progress .is-done .cf-progress-step,
html[data-ed-theme="dark"] body.ed-y3026 .cf-client-progress .cf-progress .is-ahead .cf-progress-step {
  background: var(--ed-surface-solid) !important;
  color: var(--ed-text-soft) !important;
  border-color: var(--ed-border) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-client-progress .cf-progress .is-ahead .cf-progress-step {
  color: var(--ed-text-quiet) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-client-progress .cf-progress .is-current .cf-progress-step {
  background: var(--ed-petrol-deep, #1f5f78) !important;
  color: var(--ed-ivory-literal, #F7F3EB) !important;
  border-color: var(--ed-petrol-pastel) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-life-more-menu,
html[data-ed-theme="dark"] body.ed-y3026 .ed-menu,
html[data-ed-theme="dark"] body.ed-y3026 .ed-dropdown {
  background: var(--ed-surface-solid) !important;
  color: var(--ed-text) !important;
  border-color: var(--ed-border) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel,
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel .cf-journey-overview-summary {
  background: var(--ed-surface-solid) !important;
  color: var(--ed-text) !important;
  border-color: var(--ed-border) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel .cf-jo-identity,
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel .cf-jo-empty,
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel .cf-jo-value,
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel a,
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel button {
  color: var(--ed-text) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel .cf-jo-label,
html[data-ed-theme="dark"] body.ed-y3026 .cf-journey-overview-panel .cf-journey-overview-summary::after {
  color: var(--ed-text-quiet) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .ce-life li,
html[data-ed-theme="dark"] body.ed-y3026 .ce-life li.is-current {
  background: var(--ed-surface-muted) !important;
  color: var(--ed-text-soft) !important;
  border-color: var(--ed-border) !important;
  box-shadow: none !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .ce-life li.is-current {
  background: var(--ed-interaction-soft) !important;
  color: var(--ed-text) !important;
  border-color: var(--ed-interaction) !important;
  box-shadow: inset 0 -2px 0 var(--ed-interaction) !important;
}
html[data-ed-theme="dark"] body.ed-y3026 .ce-life .is-ahead {
  background: var(--ed-surface-solid) !important;
  color: var(--ed-text-quiet) !important;
  border-color: var(--ed-border) !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
