/* The adviser statement page (feos:views/adviser-statement/detail; Peter, 13–14 Nov 2026): full width, by provider and
   client or all lines in one table, the columns lined up in every table, a summary at the foot. */
.feos-as { margin: 0 0 18px; }
.feos-as-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; background: #fff;
    border: 1px solid #e3e8ef; border-left: 4px solid #0a5f9c; border-radius: 10px; padding: 16px 20px; }
.feos-as-kicker { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #5b6573; }
.feos-as-title h3 { margin: 2px 0 8px; font-size: 22px; font-weight: 600; }
.feos-as-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.feos-as-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
    background: #f1f4f8; color: #374151; }
.feos-as-chip.is-ar { background: #e8f1fb; color: #0a5f9c; font-weight: 600; }
.feos-as-chip.is-paid { background: #e7f6ec; color: #17733a; font-weight: 600; }
.feos-as-chip.is-status { background: #fff4e0; color: #8a5300; font-weight: 600; }
.feos-as-chip.is-quiet { background: transparent; color: #6b7280; padding-left: 4px; padding-right: 4px; }
.feos-as-rates { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 14px; color: #5b6573; font-size: 12.5px; }
.feos-as-rates b { color: #1f2937; }
.feos-as-bios { margin-top: 8px; font-size: 12px; color: #374151; background: #f7f9fc; border-radius: 6px; padding: 4px 10px; display: inline-block; }
.feos-as-actions { display: flex; gap: 8px; flex-shrink: 0; }
.feos-as-actions .dropdown-menu a { cursor: pointer; }
/* the buttons stand out (Peter, 14 Nov 2026): Ready for adviser / Download blue, Mark paid green, Clarification amber */
.feos-as-actions .btn-success { background: #17733a; border-color: #17733a; color: #fff; }
.feos-as-actions .feos-as-askbtn { background: #f59f00; border-color: #f59f00; color: #1f1300; font-weight: 600; }
.feos-as-actions .feos-as-askbtn:hover { background: #e08e00; border-color: #e08e00; }
.feos-as-preview { background: #fff7e6; border: 1px solid #f5c26b; border-radius: 10px; padding: 8px 14px; margin-bottom: 10px; }
.feos-as-preview a { margin-left: 8px; cursor: pointer; font-weight: 600; }
.feos-as-ask, .feos-as-paid, .feos-as-dl { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 10px 18px; margin-top: 10px; }
.feos-as-paid, .feos-as-dl { display: flex; gap: 8px; align-items: center; }
.feos-as-paid[hidden], .feos-as-dl[hidden], .feos-as-ask[hidden] { display: none; }
.feos-as-paid input { max-width: 170px; }
.feos-as-ask label { font-weight: 600; margin-bottom: 6px; display: block; }
.feos-as-ask-bar { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.feos-as-msg { color: #b42318; }

/* the bar: view switch on the left, the two totals on the right */
.feos-as-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.feos-as-switch { display: inline-flex; background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 3px; }
.feos-as-switch button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; color: #5b6573; }
.feos-as-switch button.is-on { background: #0a5f9c; color: #fff; }
.feos-as-tiles { display: grid; gap: 10px; }
.feos-as-tiles-two { grid-template-columns: repeat(2, minmax(170px, 230px)); }
.feos-as-tile { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 10px 14px; }
.feos-as-tile span { display: block; color: #5b6573; font-size: 12px; }
.feos-as-tile b { font-size: 18px; }
.feos-as-total { background: #eef5fb; border-color: #0a5f9c; }
.feos-as-neg { color: #b42318; }
.feos-as-note, .feos-as-empty { color: #5b6573; margin: 6px 2px 10px; }

/* providers */
.feos-as-prov { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.feos-as-prov header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; background: #f7f9fc; }
.feos-as-prov header b { font-size: 15px; }
.feos-as-count { color: #5b6573; }
.feos-as-sum { margin-left: auto; color: #5b6573; }
.feos-as-sum b { color: #1f2937; font-size: 14px; }

/* every table the same columns at the same widths, so the eye runs straight down across the providers */
.feos-as-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.feos-as-table col.w-prov { width: 11%; }
.feos-as-table col.w-ft { width: 8%; }
.feos-as-table col.w-client { width: 17%; }
.feos-as-table col.w-plan { width: 11%; }
.feos-as-table col.w-type { width: 8%; }
.feos-as-table col.w-cs { width: 12%; }
.feos-as-table col.w-n { width: 8%; }
.feos-as-table col.w-pct { width: 5%; }
.feos-as-table th { font-weight: 500; color: #5b6573; font-size: 12px; padding: 6px 12px; border-bottom: 1px solid #e3e8ef; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feos-as-table td { padding: 6px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: top; overflow: hidden; text-overflow: ellipsis; }
.feos-as-table .n { text-align: right; white-space: nowrap; }
.feos-as-ben { font-size: 11.5px; color: #5b6573; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feos-as-ft { white-space: nowrap; color: #5b6573; font-size: 12px; }
.feos-as-provname { font-weight: 600; }
.feos-as-again, .feos-as-again a { color: #9aa3ae; }
.feos-as-table col.w-why { width: 22%; }
.feos-as-why { color: #8a5300; font-size: 12px; }
.feos-as-ret { color: #9aa3ae; margin-left: 6px; cursor: pointer; text-decoration: none; font-size: 12px; }
.feos-as-ret:hover, .feos-as-ret.is-on { color: #0a5f9c; }
.feos-as-fromret td { background: #f2f7fc; }
.feos-as-x { color: #b42318; font-weight: 700; margin-left: 4px; cursor: pointer; text-decoration: none; }
.feos-as-addft { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.feos-as-addft label { margin: 0; color: #5b6573; font-weight: 500; }
.feos-as-addft input { max-width: 180px; }
.feos-as-pending { border-color: #f5c26b; }
.feos-as-pending.is-potential { border-color: #c7d2e0; }
.feos-as-pending.is-potential header { background: #f4f6f9; }
.feos-as-table col.w-act { width: 20%; }
.feos-as-group td { background: #fbf8f1; font-weight: 600; color: #6b4a00; }
.feos-as-acts { white-space: nowrap; }
.feos-as-acts .btn + .btn { margin-left: 4px; }
.feos-as-scroll { overflow-x: auto; }
.feos-as-wide { table-layout: auto; min-width: 1800px; font-size: 12.5px; }
.feos-as-wide td, .feos-as-wide th { white-space: nowrap; }
.feos-as-pending header { background: #fff7e6; }
.feos-as-gap td { height: 10px; padding: 0; background: #f4f6f9; border-bottom: 1px solid #e3e8ef; }
.feos-as-sub-row td { background: #fafbfd; color: #374151; font-weight: 600; }
.feos-as-tag { font-size: 11px; background: #eef5fb; color: #0a5f9c; border-radius: 6px; padding: 0 5px; }

/* the summary at the foot */
.feos-as-summary { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 12px; margin: 14px 0 6px auto; max-width: 760px; }
.feos-as-scol { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 12px 16px; }
.feos-as-scol h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #5b6573; font-weight: 600; }
.feos-as-srow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f0f2f5; }
.feos-as-srow b { font-weight: 500; }
.feos-as-srow.is-strong { border-top: 1px solid #cbd3dd; border-bottom: 0; margin-top: 4px; }
.feos-as-srow.is-strong b, .feos-as-srow.is-strong span { font-weight: 700; }
.feos-as-srow.is-pay { border-bottom: 0; margin-top: 4px; background: #eef5fb; border-radius: 8px; padding: 8px 10px; }
.feos-as-srow.is-pay span, .feos-as-srow.is-pay b { font-weight: 700; font-size: 15px; }

/* commission transfer: the summary as BIOS showed it (Peter, 17 Nov 2026) */
.feos-ct-services { width: 100%; max-width: 760px; margin: 14px 0 10px; border-collapse: separate; border-spacing: 0; background: #fff;
    border: 1px solid #e3e8ef; border-radius: 10px; overflow: hidden; font-size: 13px; }
.feos-ct-services th { background: #eef5fb; color: #0a5f9c; font-weight: 600; padding: 8px 12px; text-align: left; }
.feos-ct-services td { padding: 7px 12px; border-top: 1px solid #f0f2f5; }
.feos-ct-services .n { text-align: right; white-space: nowrap; }
.feos-ct-services tr.is-sub td { border-top: 1px solid #cbd3dd; }
.feos-ct-services tr.is-total td { background: #eef5fb; font-weight: 700; font-size: 14px; }
.feos-ct-why { max-width: 760px; margin: 0 0 14px; background: #fffbea; border: 1px solid #f1e3a6; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.feos-ct-why h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #7a5d00; font-weight: 600; }

@media (max-width: 768px) {
    .feos-as-head, .feos-as-bar { flex-direction: column; align-items: stretch; }
    .feos-as-prov { overflow-x: auto; }
    .feos-as-table { min-width: 900px; }
    .feos-as-sum { margin-left: 0; }
    .feos-as-summary { grid-template-columns: 1fr; }
    .feos-as-tiles-two { grid-template-columns: 1fr 1fr; }
}

/* Download → PDF: only the statement is printed */
@media print {
    body.feos-as-printing * { visibility: hidden; }
    body.feos-as-printing .feos-as, body.feos-as-printing .feos-as * { visibility: visible; }
    body.feos-as-printing .feos-as { position: absolute; left: 0; top: 0; width: 100%; }
    body.feos-as-printing .feos-as-actions, body.feos-as-printing .feos-as-ask, body.feos-as-printing .feos-as-dl,
    body.feos-as-printing .feos-as-paid, body.feos-as-printing .feos-as-preview, body.feos-as-printing .feos-as-switch,
    body.feos-as-printing .feos-as-addft, body.feos-as-printing .feos-as-pending, body.feos-as-printing .feos-as-full, body.feos-as-printing .feos-as-x, body.feos-as-printing .feos-as-ret { display: none !important; }
    body.feos-as-printing .feos-as-prov { break-inside: avoid; }
}

/* the provider's commission statement (feos:views/commission-statement/detail, 16 Nov 2026) */
.feos-cs-tiles { grid-template-columns: repeat(6, minmax(120px, 1fr)); margin-top: 10px; }
@media (max-width: 900px) { .feos-cs-tiles { grid-template-columns: repeat(2, minmax(120px, 1fr)); } }
.feos-cs-bad { border-color: #b42318; background: #fef3f2; }
.feos-cs-check { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 0; color: #374151; font-size: 13px; }
.feos-cs-warn { background: #fff7e6; color: #8a5300; }
.feos-cs-warn-t { color: #b42318; font-weight: 600; }
.feos-cs-muted { color: #9aa3ae; }
.feos-cs-unmatched td { background: #fffaf0; }
.feos-cs-table td { vertical-align: top; }
.feos-cs-table td, .feos-cs-table th { font-size: 13px; line-height: 1.4; }
.feos-cs-table td a { font-size: inherit; }
.feos-cs-sub { color: #5b6573; }
.feos-cs-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.feos-cs-filters input { width: 280px; }
.feos-cs-filters select { width: auto; min-width: 150px; }
.feos-cs-count { margin-left: auto; color: #5b6573; font-size: 13px; }

/* Brought forward (Peter, 16 Nov 2026): earlier negative statements carried into this one */
.feos-as-bff { display: block; font-weight: 400; color: var(--feos-muted, #8a94a3); font-size: 11px; }
.feos-as-carry { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.feos-as-carry label { margin: 0 8px 0 0; font-weight: 600; }
/* Adviser Statements list: the cash each firm needs (Peter, 16 Nov 2026) */
.feos-as-topay { margin: 0 0 14px; }
.feos-as-topay-head { display: flex; align-items: baseline; gap: 10px; font-weight: 600; color: #1f2937; margin-bottom: 8px; }
.feos-as-topay-head span { font-weight: 400; font-size: 12px; color: #6b7280; }
.feos-as-topay-head b { margin-left: auto; font-size: 16px; color: #0a5f9c; }
.feos-as-topay-row { display: flex; flex-wrap: wrap; gap: 10px; }
.feos-as-topay-box { flex: 1 1 200px; max-width: 320px; background: #fff; border: 1px solid #e3e8ef; border-top: 3px solid #0a5f9c;
    border-radius: 10px; padding: 10px 14px; }
.feos-as-topay-firm { font-size: 12.5px; color: #5b6573; }
.feos-as-topay-sum { font-size: 22px; font-weight: 600; color: #17733a; margin: 2px 0; }
.feos-as-topay-n { font-size: 12px; color: #6b7280; }
.feos-as-topay-more { font-size: 12px; color: #8a5300; margin-top: 2px; }
.feos-as-topay-sum.is-neg { color: #b42318; }

/* "Payments" on a client, policy, mortgage (Peter, 17 Nov 2026) */
.feos-pay-sum { margin: 2px 0 8px; font-size: 13px; color: #475467; }
/* Payments under the record across the whole width (Peter, 2 Dec 2026; feos:views/payments/panel widen) */
.panel.feos-pay-wide { margin-top: 16px; }
.feos-pay-viewers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.feos-pay-as { margin: 0 0 8px; padding: 6px 10px; background: #fff8e6; border: 1px solid #f3dfae; border-radius: 6px; font-size: 13px; }
.feos-pay-scroll { overflow-x: auto; }
.feos-pay-table { font-size: 12.5px; margin: 0; }
.feos-pay-table th { white-space: nowrap; color: #667085; font-weight: 600; }
.feos-pay-table .n { text-align: right; white-space: nowrap; }

/* the % of a line, set by hand on click (Peter, 19 Nov 2026) */
.feos-as-pct { cursor: pointer; border-bottom: 1px dotted currentColor; color: inherit; }
.feos-as-pct:hover { text-decoration: none; opacity: .75; }
.feos-as-pctmark { margin-left: 2px; font-size: 10px; color: #8a6d00; cursor: help; }

/* commission transfer: filters, ticks, Stay in the FEP (Peter, 19 Nov 2026) */
.feos-ct-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; }
.feos-ct-filters .feos-ct-q { width: 220px; }
.feos-ct-filters .feos-ct-shown { color: #555; font-size: 12px; }
.feos-ct-ms { position: relative; }
.feos-ct-ms-list { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 220px; max-height: 320px; overflow: auto; background: #fff;
    border: 1px solid #d6dbe1; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 6px 10px; }
.feos-ct-ms-list label { display: block; font-weight: normal; margin: 3px 0; white-space: nowrap; cursor: pointer; }
.feos-ct-ms-list a { display: inline-block; margin-top: 4px; font-size: 12px; }
.feos-ct-selbar { position: sticky; top: 60px; z-index: 15; display: flex; gap: 12px; align-items: center; background: #fff8e1;
    border: 1px solid #f0d58a; border-radius: 6px; padding: 8px 12px; margin: 6px 0 10px; }
.feos-as-table col.w-tick { width: 30px; }
.feos-as-table tr.is-ticked td { background: #fff8e1; }
.feos-ct-headtick { margin-right: 6px; }

/* commission transfers: sortable column titles and the policy's start (Peter, 20 Nov 2026) */
.feos-as-table col.w-start { width: 9%; }
.feos-as-table th.feos-ct-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.feos-as-table th.feos-ct-sort:hover, .feos-as-table th.feos-ct-sort.is-sorted { color: var(--feos-primary, #1f5fbf); }
.feos-ct-age { color: #8a94a6; font-size: 11px; margin-left: 2px; }
.feos-ct-start-line { color: #8a94a6; font-style: italic; }

/* commission transfers: change the AR % (Peter, 20 Nov 2026) */
.feos-ct-terms-edit { margin-left: 12px; font-size: 12px; cursor: pointer; }
.feos-ct-terms { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.feos-ct-terms label { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; color: #5b6475; margin: 0; }
.feos-ct-terms label input { width: 90px; }
.feos-ct-terms label.is-why input { width: 220px; }

/* commission transfers (Peter, 20 Nov 2026): what the transfer is for as rows; one summary at the bottom */
.feos-ct-hist-table col.w-hd { width: 92px; } .feos-ct-hist-table col.w-hw { width: 110px; } .feos-ct-hist-table col.w-hct { width: 90px; }
.feos-ct-hist-table col.w-hn { width: 56px; } .feos-ct-hist-table col.w-hm { width: 100px; }
.feos-ct-hist-table tr.is-sub td:first-child { padding-left: 22px; }
.feos-ct-hist-text { font-size: 12px; color: #4a5260; line-height: 1.4; white-space: normal; }
.feos-ct-ev { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #eef1f5; color: #4a5260; white-space: nowrap; }
.feos-ct-ev-merge { background: #e8f0fb; color: #0a5f9c; } .feos-ct-ev-minus { background: #fdecec; color: #b42318; }
.feos-ct-ev-plus { background: #e9f7ef; color: #1b7a43; } .feos-ct-ev-adj { background: #fff4e0; color: #8a5a00; }
.feos-ct-ev-paid { background: #e9f7ef; color: #1b7a43; } .feos-ct-ev-made { background: #f1ecfb; color: #5b3fa0; }
.feos-ct-summary { display: flex; justify-content: flex-end; margin: 14px 0 6px; }
.feos-ct-summary .feos-ct-services { max-width: 620px; margin: 0; }
.feos-ct-services tr.is-diff td { font-size: 12px; color: #8a5a00; background: #fffbea; }
.feos-ct-n { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: #eef1f5; font-size: 11px; color: #5b6573; text-align: center; }
/* under Brought forward / Other Deductions: the earlier statement (preview + link) and each deduction's reason */
.feos-as-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 0 3px 16px; font-size: 12px; color: #5b6573; border-bottom: 1px dashed #eef1f4; }
.feos-as-sub > a[data-act] { flex: 1; cursor: pointer; color: #2c6aa0; }
.feos-as-sub > span { flex: 1; }
.feos-as-sub > b { font-weight: 500; }
.feos-as-open { color: #8a95a3; }
.feos-as-bfp { flex-basis: 100%; margin: 4px 0 4px 14px; padding: 6px 10px; background: #f7f9fb; border-radius: 6px; }
.feos-as-bfp > div { display: flex; justify-content: space-between; padding: 2px 0; }
.feos-as-bfp > div.is-pay { border-top: 1px solid #dfe4ea; margin-top: 2px; font-weight: 600; }
.feos-as-ded .feos-as-dedwhy { max-width: 360px; }
.feos-as-hold input { max-width: 420px; }
@media print { .feos-as-open { display: none; } }

/* commission statement: Payment and approval, Office details (Peter, 2 Dec 2026) */
.feos-cs-office { margin: 12px 0 0; padding: 12px 14px; border: 1px solid #dbe3ee; border-radius: 10px; background: #fff; }
.feos-cs-office-h { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 14px; }
.feos-cs-office-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.feos-cs-office-row label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 600; font-size: 13px; }
.feos-cs-office-row input[type=date] { width: 150px; }
.feos-cs-office-row .feos-cs-tick { font-weight: 500; }
.feos-cs-office-row .feos-cs-note { flex: 1 1 260px; min-width: 200px; }
.feos-cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 18px; }
.feos-cs-grid > div, .feos-cs-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.feos-cs-grid span, .feos-cs-text > span { color: #6b7280; font-size: 12px; }
.feos-cs-grid b { font-weight: 500; }
.feos-cs-text { margin-top: 10px; }
.feos-cs-text > div { white-space: pre-wrap; background: #f8fafc; border-radius: 6px; padding: 8px 10px; max-height: 240px; overflow: auto; }
.feos-cs-table th.feos-cs-sort { cursor: pointer; user-select: none; white-space: nowrap; } .feos-cs-table th.feos-cs-sort:hover { color: #1565c0; }
