/* ============================================================================
   Accounting: module components only. Tokens only (no hex values), harness
   classes are consumed as-is (DESIGN.md rules 1-2).
   ============================================================================ */

.ac-body { padding-bottom: var(--space-8); }
.ac-loading { padding: var(--space-8) 0; }
.ac-note { margin: var(--space-4) 0 var(--space-3); font-size: var(--fs-sm); color: var(--color-label); line-height: var(--lh-base); max-width: 960px; }
.ac-hint { margin: 0; font-size: var(--fs-sm); color: var(--color-label); line-height: var(--lh-base); }
.ac-sub { font-size: var(--fs-xs); color: var(--color-label); line-height: var(--lh-base); }
.ac-warn { color: var(--color-warn-text); font-size: var(--fs-sm); }
.ac-code { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--color-text); overflow-wrap: anywhere; }
.ac-inline { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ac-grow { flex: 1; }
.ac-banner { margin-top: var(--space-3); }

/* The company chip in the title row */
.ac-company {
  display: inline-flex; align-items: center; gap: var(--space-2); max-width: 320px; padding: 0 var(--space-2);
  height: 32px; border: 1px solid var(--color-border); border-radius: var(--radius-input); background: var(--color-bg);
  color: var(--color-text); font-size: var(--fs-sm); cursor: pointer;
}
.ac-company:hover { background: var(--color-hover); }
.ac-company:empty { display: none; }
.ac-company-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Totals above To Post */
.ac-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }

/* Toolbars (GL period, mappings) */
.ac-toolbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.ac-switch { font-size: var(--fs-sm); color: var(--color-text); cursor: pointer; }

/* Links to the records a document was built from */
.ac-link {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: 0; border: 0; background: none;
  color: var(--color-accent); font: inherit; cursor: pointer; text-align: left; text-decoration: none;
}
.ac-link:hover { text-decoration: underline; }
.ac-link .icon { width: 13px; height: 13px; }
.ac-refs { display: inline-flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }

/* Document panel */
.ac-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); font-weight: var(--fw-semibold); }
.ac-drcr { font-size: var(--fs-sm); white-space: nowrap; }
.ac-total { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--fs-md); color: var(--color-text); }
.ac-fails { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--fs-sm); line-height: var(--lh-base); }

/* Sections on a tab (Inventory, Month End, Labor & Rates, Receiving) */
.ac-section { margin-top: var(--space-6); }
.ac-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.ac-rate-cell { display: grid; gap: var(--space-1); }
.ac-h3 { margin: 0 0 var(--space-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--color-text); }

/* Month End: labor, overhead, produced vs sold side by side */
.ac-me { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.ac-me-card { padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-bg); min-width: 0; }
.ac-me-by { margin-top: var(--space-3); }
.ac-paste-out { margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }

/* GL Impact + Mappings tables sit on the page, not in a panel */
.ac-gl .table-wrap, .ac-map .table-wrap { margin-top: var(--space-2); }

@media (max-width: 640px) {
  .ac-company { max-width: 160px; }
  .ac-toolbar .ui-select { width: 100% !important; }
}
