/* Review 13–18: forms, document registers, CRM, finance and reports. */
.field-label { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; }
.field-label label { margin: 0; }
.required-marker { color: #8b4336; font-size: 13px; }
.required-note { color: var(--muted); font-size: 12px; margin: 0 0 18px; }
.field-errors { color: #8b352b; font-size: 13px; line-height: 1.6; }
.has-errors :is(input, select, textarea) { border-color: #a85142; }
.field .help { line-height: 1.6; }
.field.checkbox-field { align-items: flex-start; gap: 9px; flex-wrap: wrap; }
.field.checkbox-field > input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; }
.field.checkbox-field .field-label { flex: 1; margin: 0; }
.field.checkbox-field > .help, .field.checkbox-field > .field-errors { flex-basis: 100%; }
.password-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.password-control > input { min-width: 0; width: 100%; margin: 0; border-radius: 6px 0 0 6px; }
.password-toggle { border: 1px solid #c6d1c4; border-left: 0; border-radius: 0 6px 6px 0; background: #f5f8f2; color: #355b43; padding: 9px 11px; font-size: 12px; cursor: pointer; }
.password-toggle:hover { background: #e8efdf; }
.form-section { min-width: 0; border: 0; padding: 0; margin: 0 0 24px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 20px; }
.form-section > legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; color: #314f3b; font-size: 16px; font-weight: 650; }
.form-section > legend + * { clear: both; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.form-grid > * { min-width: 0; }
.form-grid > .field { margin: 0; }
.form-grid > .field:has(textarea), .form-grid > .errorlist, .form-grid > .button { grid-column: 1 / -1; }
.form-grid > .button { justify-self: start; }
.form-grid :is(input, select, textarea) { max-width: 100%; }
.form-save-row { padding-top: 18px; border-top: 1px solid var(--line); }
.section-description { margin: -3px 0 14px; color: var(--muted); font-size: 13px; }
.profile-editor { max-width: 1100px; padding: 26px; }
.profile-editor .field label { font-size: 13px; line-height: 1.5; }
.profile-editor :is(input, select) { font-size: 14px; min-height: 42px; }

/* Authentication has a single heading and a predictable field order. */
.auth-layout.account-layout { display: grid; grid-template-columns: 240px minmax(0, 540px); align-items: start; gap: 30px; max-width: 900px; margin: 42px auto 60px; padding: 0 24px; }
.auth-layout.registration-layout { grid-template-columns: 240px minmax(0, 760px); max-width: 1100px; }
.account-layout .auth-aside { min-height: 0; padding: 28px 22px; border-radius: 10px; background: var(--sidebar); color: #fff; }
.account-brand { display: block; font-size: 32px; letter-spacing: -1px; margin-bottom: 22px; }
.account-layout .auth-aside p { font-size: 14px; line-height: 1.7; color: #e0e8de; margin-bottom: 22px; }
.account-layout .auth-aside a { font-size: 13px; color: #deecb7; }
.account-layout .auth-card { min-width: 0; width: 100%; max-width: none; padding: 28px; }
.account-layout .auth-card h1 { font-size: 29px; line-height: 1.3; margin-bottom: 10px; }
.account-layout .auth-card > p { font-size: 14px; line-height: 1.6; color: var(--muted); }
.account-layout .auth-card > .required-note { margin: 14px 0 20px; font-size: 12px; }
.account-layout .field label { font-size: 13px; line-height: 1.5; }
.account-layout .field :is(input, select) { font-size: 14px; min-height: 42px; }
.account-layout .field.checkbox-field > input { min-height: 18px; }
.account-layout .help { font-size: 12px; line-height: 1.6; }
.account-layout .help ul { padding-left: 17px; margin-top: 7px; }
.account-layout .help li + li { margin-top: 5px; }
.account-layout form > .button.full { min-height: 44px; margin-top: 14px; font-size: 14px; }
.account-layout .auth-switch { margin-top: 22px; font-size: 14px; }
.account-layout .account-links { font-size: 13px; gap: 14px; flex-wrap: wrap; }

/* Shared working page components; chat and calendar remain separately scoped. */
.final-page { min-width: 0; }
.final-page .page-heading { align-items: flex-start; margin-bottom: 22px; }
.final-page .page-heading h1 { font-size: 30px; line-height: 1.3; }
.final-page .page-heading p { font-size: 13px; line-height: 1.6; }
.final-page .panel h2 { font-size: 18px; margin-bottom: 14px; }
.final-page .panel h3 { font-size: 15px; margin: 16px 0 8px; }
.final-page .panel-heading { align-items: center; flex-wrap: wrap; gap: 10px; }
.final-page .panel-heading h2 { margin-bottom: 0; }
.final-page .panel-heading > small { font-size: 12px; color: var(--muted); }
.final-page .button { font-size: 13px; min-height: 39px; padding: 9px 14px; }
.final-page .section-tag, .final-page .pill { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.compact-filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 16px 20px; }
.compact-filter-bar > label { min-width: 220px; max-width: 360px; flex: 1; }
.final-page .compact-filter-bar label, .filter-main label, .filter-extra label { font-size: 13px; line-height: 1.5; }
.compact-filter-bar select, .compact-filter-bar input, .filter-main :is(input, select), .filter-extra :is(input, select) { display: block; margin-top: 6px; font-size: 13px; min-height: 39px; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.final-page .filter-actions { font-size: 13px; padding-bottom: 1px; }
.filter-main { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(200px, 1.4fr) minmax(120px, .7fr) auto; align-items: end; gap: 14px; }
.filter-main > * { min-width: 0; }
.filter-main > .field { margin: 0; }
.filter-main .field-label { margin: 0; }
.filter-main .inline-check { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.filter-main .inline-check input { display: inline-block; min-height: 18px; width: 18px; margin: 0; }
.filter-extra { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 11px; }
.filter-extra > summary { font-size: 13px; color: #3d6047; cursor: pointer; }
.filter-extra > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; max-width: 640px; gap: 14px; margin-top: 13px; }
.filter-extra .field { margin: 0; }
.filter-extra .button { justify-self: start; }
.remarks-filter-bar, .finance-filter-bar, .compact-report-filters { padding: 16px 20px; }
.remarks-filter-bar .filter-main { grid-template-columns: minmax(160px, 1.2fr) minmax(100px, .8fr) auto auto; }
.finance-filter-bar .filter-main { grid-template-columns: minmax(220px, 1.6fr) minmax(140px, 1fr) minmax(140px, 1fr) auto; }
.filter-main > .errorlist { grid-column: 1 / -1; }
.records-panel { min-width: 0; }
.record-table-scroll { overflow-x: auto; }
.record-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.record-table :is(th, td) { padding: 13px 12px; vertical-align: top; text-align: left; font-size: 13px; line-height: 1.6; }
.record-table thead th { background: #f3f7ef; font-size: 12px; color: #53694b; white-space: nowrap; }
.record-table td { border-bottom: 1px solid var(--line); }
.record-table td:first-child { min-width: 230px; max-width: 380px; width: 34%; }
.record-table small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.record-title { display: block; color: #294c3b; overflow-wrap: anywhere; font-weight: 600; }
.record-table .section-tag + .record-title { margin-top: 7px; }
.record-table .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.record-table .pill { display: inline-block; }
.final-page .compact-empty { padding: 22px 8px; min-height: 0; text-align: left; }
.final-page .compact-empty h2 { font-size: 20px; }
.compact-empty p { max-width: 70ch; color: var(--muted); font-size: 14px; line-height: 1.7; margin: 10px 0 18px; }
.onboarding-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 22px; margin: 16px 0 22px; padding-left: 20px; font-size: 13px; line-height: 1.6; color: #4b634b; }
.record-editor { scroll-margin-top: 20px; }
.record-editor > summary, .record-history > summary, .report-block > summary, .report-sections > summary { color: #355b43; font-size: 15px; font-weight: 600; cursor: pointer; line-height: 1.6; }
.record-editor > form, .record-history > div, .report-block > div { margin-top: 18px; }
.record-editor .field label { font-size: 13px; }
.record-history .comment, .record-detail .comment { font-size: 14px; line-height: 1.7; }
.record-detail .panel > p { font-size: 14px; line-height: 1.7; margin-bottom: 14px; overflow-wrap: anywhere; }
.record-detail .panel > .button { margin: 0 7px 10px 0; }
.record-detail .panel > form { margin-top: 20px; max-width: 850px; }
.record-detail .panel > form :is(label, select, textarea) { display: block; font-size: 14px; margin: 8px 0; }
.record-detail .panel > form .button { margin-top: 8px; }

/* A request, approved proposal, signed copy and created project remain distinct. */
.sales-page .secondary-actions { margin-bottom: 18px; font-size: 13px; gap: 16px; }
.sales-page .sales-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 0 0 20px; }
.sales-page .sales-steps span { padding: 11px 14px; background: #edf2e9; border: 1px solid #dae3d5; border-radius: 5px; font-size: 13px; line-height: 1.5; }
.sales-page .sales-steps span.current { background: #e0ecc5; border-color: #adca8d; color: #294d39; font-weight: 650; }
.sales-assistant-action { margin: 0 0 18px; }
.sales-page .decision-panel { border-left: 3px solid #adc590; }
.sales-page .business-actions { flex-wrap: wrap; align-items: center; gap: 10px; }
.sales-page .business-actions form { margin: 0; }
.sales-page .panel > p { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.sales-page .task-row { gap: 16px; align-items: center; }
.sales-page .task-row > div { min-width: 0; flex: 1; }
.sales-page .task-row b { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.sales-page .task-row small { font-size: 12px; line-height: 1.6; }
.sales-page .task-row > .section-tag { width: 110px; max-width: 110px; flex-shrink: 0; }
.sales-page .contract-summary { margin-bottom: 22px; gap: 20px; }
.sales-page .contract-summary > div { font-size: 13px; line-height: 1.6; }
.sales-page .contract-summary strong { display: block; font-size: 23px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.sales-page .prose { max-width: 80ch; font-size: 15px; line-height: 1.85; }
.proposal-conditions { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 5px; font-size: 14px; line-height: 1.8; }
.sales-page .editor-form { max-width: 900px; }

/* Finance sums are exact server totals; presentation does not imply payment. */
.finance-mode-note { margin-bottom: 20px; }
.action-disclosure { position: relative; min-width: 0; }
.action-disclosure > summary { list-style: none; cursor: pointer; }
.action-disclosure > summary::-webkit-details-marker { display: none; }
.action-disclosure > summary::after { content: '▾'; margin-left: 10px; }
.action-disclosure > div { position: absolute; z-index: 60; right: 0; top: calc(100% + 8px); width: min(340px, calc(100vw - 40px)); max-height: 50vh; overflow-y: auto; background: #fff; border: 1px solid #c8d6c1; box-shadow: 0 6px 20px #172e3720; border-radius: 8px; padding: 15px; }
.action-disclosure > div > b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.action-disclosure > div a { display: block; padding: 10px 2px; color: #355b43; font-size: 14px; line-height: 1.6; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.action-disclosure small { display: block; font-size: 12px; color: var(--muted); }
.finance-table td:first-child { width: 100px; min-width: 100px; white-space: nowrap; }
.finance-table .number { min-width: 150px; }
.demo-label { display: block !important; width: fit-content; margin-top: 6px; background: #faf3df; color: #72551d; border-color: #e6d5a4; font-size: 11px; }

/* Report filters and saved weekly snapshots. */
.report-page .metrics, .finance-page .metrics { margin: 18px 0; }
.report-page .metrics > div, .finance-page .metrics > div { padding: 15px 18px; }
.report-page .metrics strong, .finance-page .metrics strong { font-size: 26px; margin: 9px 0 0; }
.report-page .metrics strong small, .finance-page .metrics strong small { font-size: 14px; }
.report-sections { padding: 14px 20px; }
.report-sections .section-summary { margin: 15px 0 0; }
.report-block-nav { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.report-block-nav a { border: 1px solid #cddac4; border-radius: 6px; background: #f3f7ed; color: #355b43; padding: 8px 12px; font-size: 13px; }
.weekly-page .report-note { margin: -6px 0 18px; font-size: 12px; line-height: 1.7; }
.weekly-page .report-stats { gap: 15px; }
.weekly-page .report-stats > div { min-width: 0; font-size: 13px; }
.weekly-page .report-stats strong { font-size: 27px; margin: 8px 0; }
.weekly-page .report-stats small { font-size: 12px; line-height: 1.6; }
.weekly-page .task-row { align-items: center; gap: 14px; }
.weekly-page .task-row > div { min-width: 0; flex: 1; }
.weekly-page .task-row b { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.weekly-page .task-row small { font-size: 12px; line-height: 1.6; }
.weekly-page .task-row > .section-tag { width: 110px; max-width: 110px; flex-shrink: 0; }
.weekly-page .report-block { scroll-margin-top: 18px; }
.weekly-current > p, .weekly-current .form-grid p { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.weekly-build-form { display: grid; grid-template-columns: minmax(180px, 240px) auto; gap: 15px; align-items: end; justify-content: start; }
.weekly-build-form > label { font-size: 13px; }
.weekly-build-form input[type=date] { display: block; margin-top: 7px; min-height: 40px; font-size: 14px; }
.weekly-build-form > .inline-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.weekly-build-form .inline-check input { width: 18px; height: 18px; margin: 0; }

@media (max-width: 1100px) {
  .filter-main, .finance-filter-bar .filter-main, .remarks-filter-bar .filter-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-layout.account-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
  .account-layout .auth-aside { padding: 24px 18px; }
}
@media (max-width: 900px) {
  .auth-layout.account-layout { display: block; max-width: 760px; margin-top: 25px; }
  .account-layout .auth-aside { display: none; }
}
@media (max-width: 700px) {
  .final-page .page-heading { flex-wrap: wrap; gap: 15px; }
  .final-page .page-heading h1 { font-size: 26px; }
  .form-grid, .filter-main, .finance-filter-bar .filter-main, .remarks-filter-bar .filter-main { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .profile-editor { padding: 19px; }
  .form-section { margin-bottom: 20px; }
  .form-section > legend { font-size: 15px; }
  .auth-layout.account-layout { padding: 0 15px; margin: 18px auto 32px; }
  .account-layout .auth-card { padding: 21px 18px; }
  .account-layout .auth-card h1 { font-size: 26px; }
  .account-layout .auth-card > p { font-size: 13px; }
  .compact-filter-bar, .remarks-filter-bar, .finance-filter-bar, .compact-report-filters { padding: 15px; }
  .compact-filter-bar > label { min-width: 0; width: 100%; max-width: none; flex-basis: 100%; }
  .filter-extra > div { grid-template-columns: minmax(0, 1fr); }
  .final-page .compact-empty { padding: 15px 0; }
  .final-page .compact-empty h2 { font-size: 18px; }
  .onboarding-steps { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .record-table { min-width: 720px; }
  .record-table :is(th, td) { padding: 11px 10px; }
  .sales-page .sales-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-page .sales-steps span { padding: 9px 10px; }
  .sales-page .task-row, .weekly-page .task-row { flex-wrap: wrap; }
  .sales-page .task-row > .section-tag, .weekly-page .task-row > .section-tag { width: auto; max-width: 100%; flex-basis: auto; }
  .sales-page .task-row:has(> .section-tag) > div, .weekly-page .task-row:has(> .section-tag) > div { flex-basis: 100%; }
  .sales-page .contract-summary { flex-wrap: wrap; }
  .sales-page .contract-summary strong { font-size: 21px; }
  .report-page .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-page .metrics > div, .finance-page .metrics > div { padding: 12px; }
  .report-page .metrics > div:nth-child(3) { border-left: 0; }
  .report-page .metrics > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .report-page .metrics strong, .finance-page .metrics strong { font-size: 23px; }
  .finance-page .metrics.two { grid-template-columns: minmax(0, 1fr); }
  .finance-page .metrics.two > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .weekly-page .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekly-build-form { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
  .weekly-build-form > .button { justify-self: start; }
}
