/* Compact working surface for exposure, limits and transfer slips. */
.balance-page {
  --bal-blue:#146db1; --bal-navy:#22356b; --bal-red:#b91e23; --bal-green:#187665;
  --bal-line:#dce4ee; --bal-muted:#5d6d82; --bal-ink:#29374b; --bal-soft:#f5f7fb;
  box-sizing:border-box; min-width:0; max-width:100%; padding:12px 16px 32px;
  background:var(--bal-soft); color:var(--bal-ink); font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.balance-page *,.balance-page *::before,.balance-page *::after { box-sizing:border-box }
.balance-page h2,.balance-page h3,.balance-page p,.balance-page dl,.balance-page dd { margin:0 }
.balance-page h2 { color:var(--bal-navy);font-size:14px;font-weight:700 }
.balance-page h3 { color:var(--bal-navy);font-size:13px;font-weight:700 }
.balance-page label { margin:0 }
.balance-page button { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:5px 10px;border:1px solid var(--bal-line);border-radius:6px;background:#fff;color:#445771;font:inherit;font-size:12px;font-weight:600;line-height:1.4;cursor:pointer;transition:background .15s,border-color .15s }
.balance-page button:hover:not(:disabled) { border-color:#adc9e1;background:#edf5fc;color:var(--bal-blue) }
.balance-page button:active:not(:disabled) { background:#dcecf9 }
.balance-page button:disabled { background:#f0f3f7;border-color:#dfe5ed;color:#8792a2;cursor:not-allowed }
.balance-page .balance-button-primary { background:var(--bal-blue);border-color:var(--bal-blue);color:#fff }
.balance-page .balance-button-primary:hover:not(:disabled) { background:#105c98;border-color:#105c98;color:#fff }
.balance-page .balance-button-primary:disabled { background:#edf1f6;border-color:var(--bal-line);color:#8792a2 }
.balance-page input { min-width:0;max-width:100%;height:32px;padding:5px 9px;border:1px solid #cdd8e6;border-radius:6px;background:#fff;color:var(--bal-ink);font:inherit;font-size:13px }
.balance-page input::placeholder { color:#788598 }
.balance-page input:disabled { background:#f0f3f7;color:#8792a2 }
.balance-page :is(button,input,summary,[tabindex]):focus-visible { outline:2px solid var(--bal-blue);outline-offset:2px }
.balance-sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0 }
/* Two aligned rows keep scope selection and configuration close together. */
.balance-controls { border:1px solid var(--bal-line);border-radius:9px;background:#fff;margin-bottom:10px }
.balance-toolbar { display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 12px }
.balance-tabs { display:flex;gap:2px;padding:3px;border-radius:7px;background:#edf1f7;flex:none }
.balance-page .balance-tabs button { min-width:77px;min-height:30px;padding:4px 9px;border-color:transparent;background:transparent;color:#52627b }
.balance-page .balance-tabs button[aria-pressed=true] { background:var(--bal-navy);color:#fff;border-color:var(--bal-navy) }
.balance-date { flex:none;width:170px }
.balance-day-shortcuts { display:flex;gap:4px }
.balance-page .balance-day-shortcuts button { border-color:transparent;background:transparent;font-weight:500 }
.balance-page .balance-day-shortcuts button[aria-pressed=true] { background:#edf5fc;color:var(--bal-blue);border-color:#d3e3f2 }
.balance-field { display:flex;align-items:center;gap:8px;color:var(--bal-muted);font-size:12px;white-space:nowrap }
.balance-customer { flex:none }
.balance-customer .contact-select { width:190px;min-width:0 }
.balance-page .contact-select-button { display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:32px;min-height:32px;border-color:#cdd8e6;padding:5px 9px;color:var(--bal-ink);font-size:13px;font-weight:400;background:#fff;text-align:left }
.balance-page .contact-select-button.is-open { border-color:var(--bal-blue);box-shadow:0 0 0 2px #146db114 }
.balance-page .balance-refresh { background:var(--bal-red);border-color:var(--bal-red);color:#fff }
.balance-page .balance-refresh:hover:not(:disabled) { background:#a1171d;border-color:#a1171d;color:#fff }
.balance-page .balance-help-button { margin-left:auto;border-color:transparent;color:var(--bal-muted);background:transparent }
.balance-common { display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:9px 12px;border-top:1px solid var(--bal-line);background:#fafbfd;border-radius:0 0 9px 9px }
.balance-common input { width:126px }
.balance-page .balance-apply { color:var(--bal-blue);border-color:#c6daed;background:#edf5fc }
.balance-page .balance-save { color:var(--bal-navy);border-color:#cbd7e8;background:#fff }
.balance-page .balance-save:disabled { color:#8792a2;background:#f0f3f7;border-color:#dfe5ed }
.balance-save-state { color:var(--bal-muted);font-size:11px }
.balance-save-state.is-dirty { display:inline-flex;align-items:center;gap:5px;color:#8d5c08;font-weight:600 }
.balance-save-state.is-dirty::before { content:"";width:6px;height:6px;border-radius:50%;background:#bf831b }
.balance-config-hint { color:var(--bal-muted);font-size:11px;border-left:1px solid var(--bal-line);padding-left:10px }
.balance-common .balance-scope-caption { margin-left:auto;color:var(--bal-muted);font-size:11px }
/* Filters are visible and grouped, without dropdowns or oversized cards. */
.balance-filters { padding:10px 12px;border:1px solid var(--bal-line);border-radius:9px;background:#fff }
.balance-filter-line { display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0 }
.balance-filter-line+.balance-filter-line { margin-top:8px }
.balance-filter-label { flex:0 0 32px;color:var(--bal-navy);font-size:12px;font-weight:700 }
.balance-choice-row { display:contents }
.balance-page .balance-choice-row button { min-height:28px;padding:4px 10px;border-radius:5px;font-size:12px;font-weight:500;white-space:normal;text-align:left }
.balance-page .balance-choice-row button[aria-pressed=true] { background:#e8f2fc;border-color:#8bb9de;color:#105c98;font-weight:650 }
.balance-page .balance-choice-row button[aria-pressed=true]:hover:not(:disabled) { background:#d9ebfa }
.balance-pair-choices .balance-choice-label { margin-left:6px;padding-left:10px;border-left:1px solid var(--bal-line);color:var(--bal-muted);font-size:11px }
.balance-page .balance-pair-choices button { background:#f5f7fb }
.balance-page .balance-pair-choices button[aria-pressed=true] { background:#e8f2fc }
.balance-kind-choices::before { content:"";height:14px;border-left:1px solid var(--bal-line);margin:0 2px }
.balance-page .balance-clear-filters { padding:4px 6px;border-color:transparent;background:transparent;color:var(--bal-blue);font-size:11px }
.balance-filter-toolbar { display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;margin-top:9px;padding-top:9px;border-top:1px solid #edf0f5 }
.balance-search { display:flex;align-items:center;gap:7px;width:220px;padding:0 9px;border:1px solid #cdd8e6;border-radius:6px;color:var(--bal-muted);background:#fff }
.balance-search:focus-within { border-color:var(--bal-blue);box-shadow:0 0 0 2px #146db11a;outline:none }
.balance-page .balance-search input { flex:1;min-width:0;width:100%;border:0;border-radius:0;background:transparent;padding:5px 0;outline:none;box-shadow:none }
.balance-page .balance-search input:focus,.balance-page .balance-search input:focus-visible { border:0;outline:none;box-shadow:none }
.balance-search>i { flex:0 0 14px;font-size:13px;text-align:center }
.balance-filter-options { display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px }
.balance-check { display:inline-flex;align-items:center;gap:7px;min-height:32px;color:#52627b;font-size:12px;cursor:pointer }
.balance-page .balance-check input[type=checkbox] { appearance:none;-webkit-appearance:none;position:relative;flex:0 0 28px;width:28px;height:16px;padding:0;margin:0;border:1px solid #8b9bb0;border-radius:20px;background:#a5b3c5;cursor:pointer;transition:background .15s }
.balance-check input::after { content:"";position:absolute;left:1px;top:1px;width:12px;height:12px;background:#fff;border-radius:50%;transition:transform .15s }
.balance-page .balance-check input:checked { background:var(--bal-blue);border-color:var(--bal-blue) }
.balance-check input:checked::after { transform:translateX(12px) }
.balance-check:has(input:checked) { color:#105c98 }
/* One compact total bar; filters do not change the whole-region totals. */
.balance-total-bar { display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;margin:10px 0 12px;padding:9px 12px;border:1px solid #cfdcec;border-left:3px solid var(--bal-navy);border-radius:7px;background:#fff }
.balance-summary { display:flex;align-items:center;flex-wrap:wrap;gap:10px 20px }
.balance-metric { display:flex;align-items:baseline;gap:6px;font-variant-numeric:tabular-nums }
.balance-metric dt { color:var(--bal-muted);font-size:12px }
.balance-metric dd { font-size:15px;font-weight:700;color:var(--bal-navy);line-height:1.3 }
.balance-metric.is-keep dd { color:var(--bal-green) }
.balance-metric.is-transfer dd { color:var(--bal-red) }
.balance-total-caption { margin-left:auto;color:var(--bal-muted);font-size:11px }
/* Station heading, compact group tools and readable numeric tables. */
.balance-station { display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;padding:8px 10px;border-radius:6px;background:#eaf0f8;margin:14px 0 7px;border-left:3px solid var(--bal-navy) }
.balance-station-name { display:flex;align-items:center;gap:8px;color:var(--bal-navy) }
.balance-station-totals { display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-left:auto;color:var(--bal-muted);font-size:12px;font-variant-numeric:tabular-nums }
.balance-station b { color:var(--bal-navy) }
.balance-page .balance-station button { background:#fff;border-color:#cedced;min-height:28px }
.balance-card { margin-bottom:9px;border:1px solid var(--bal-line);border-radius:7px;background:#fff;min-width:0 }
.balance-card-head { display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;padding:8px 10px;background:#fafbfd;border-bottom:1px solid var(--bal-line);border-radius:7px 7px 0 0 }
.balance-group-title { display:flex;align-items:baseline;gap:7px }
.balance-group-title>span { color:var(--bal-muted);font-size:11px }
.balance-card-head>label { display:flex;align-items:center;gap:6px;font-size:12px;color:var(--bal-muted) }
.balance-card-head input { width:100px;height:29px }
.balance-group-totals { display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:12px;color:var(--bal-muted);font-variant-numeric:tabular-nums }
.balance-group-actions { display:flex;align-items:center;gap:5px;margin-left:auto }
.balance-page .balance-group-actions button { min-height:28px;padding:4px 8px;font-size:12px }
.balance-page .balance-copy-small { color:var(--bal-blue);border-color:#c6daed;background:#edf5fc }
.balance-card-body { padding:0 10px 8px }
.balance-hint { color:var(--bal-muted);font-size:11px;line-height:1.5 }
.balance-card-body>.balance-source { padding:6px 0 }
.balance-chips { display:flex;gap:5px;flex-wrap:wrap;padding-bottom:7px }
.balance-page .balance-chips button { min-height:25px;padding:3px 7px;font-size:11px;background:#eef5fc;color:#105c98 }
.balance-scroll { max-height:none;overflow-x:auto;overflow-y:visible;border:1px solid var(--bal-line);border-radius:5px }
.balance-scroll table { width:100%;min-width:620px;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:12px;font-variant-numeric:tabular-nums }
.balance-scroll th,.balance-scroll td { padding:6px 9px;border:0;border-right:1px solid #e5eaf1;border-bottom:1px solid #e5eaf1;text-align:right;vertical-align:middle }
.balance-scroll tr>*:last-child { border-right:0 }
.balance-scroll tbody tr:last-child>* { border-bottom:0 }
.balance-scroll thead th { position:sticky;top:0;z-index:2;background:var(--bal-navy);color:#fff;font-size:11px;font-weight:600;box-shadow:inset -1px 0 #ffffff26 }
.balance-scroll thead th:first-child,.balance-scroll tbody th { text-align:left;width:115px }
.balance-scroll thead th:last-child { width:42px;text-align:center }
.balance-scroll tbody tr:nth-child(odd) { background:#f7faff }
.balance-scroll tbody tr:hover { background:#eaf3fd }
.balance-scroll tbody td:last-child { text-align:center;padding:2px }
.balance-page .balance-scroll input { width:100%;min-width:60px;max-width:105px;height:28px;text-align:right;padding:3px 7px;background:#fff }
.balance-page .balance-scroll td>button { min-height:26px;width:26px;padding:0;border-color:transparent;background:transparent;color:var(--bal-muted);font-size:18px }
.balance-number { color:var(--bal-navy);font-weight:700;font-size:13px;white-space:nowrap }
.balance-page .balance-transfer { color:var(--bal-red);font-weight:700 }
.balance-scroll td.balance-transfer { background:#fff5f5 }
.balance-scroll td small { display:block;font-size:10px;white-space:normal }
.balance-card-body>button { margin-top:7px }
.balance-manual { display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:8px 0 0;padding-top:8px;border-top:1px solid #edf0f5 }
.balance-manual>label { color:var(--bal-blue);font-size:12px;font-weight:600 }
.balance-page .balance-manual>input { flex:0 1 230px;min-width:120px;height:30px }
.balance-page .balance-manual>button { min-height:30px;color:var(--bal-blue);border-color:#c6daed;background:#edf5fc }
.balance-manual-hint { color:var(--bal-muted);font-size:11px }
.balance-page .balance-manual>input[aria-invalid=true] { border-color:var(--bal-red);background:#fff5f5 }
.balance-manual-error,.balance-manual-notice { flex-basis:100%;font-size:12px }
.balance-manual-error { color:#a01b2b }
.balance-manual-notice { color:var(--bal-green) }
.balance-help { border:1px solid #cedeed;border-radius:7px;padding:12px;margin:10px 0;background:#eef5fc }
.balance-help p { margin-top:6px;max-width:90ch;font-size:12px }
.balance-page .balance-error,.balance-page .balance-notice,.balance-page .balance-over-warning { display:flex;align-items:baseline;gap:6px;padding:8px 10px;margin:8px 0;border:1px solid #efcbd0;border-radius:6px;background:#fff3f4;color:#a01b2b;font-size:12px }
.balance-page .balance-notice { border-color:#bcdfd4;background:#eff9f5;color:#18705c }
.balance-warning { color:#966315 }
.balance-page .balance-over-warning { border-color:#ebd6a6;background:#fff9eb;color:#80530e }
.balance-page .balance-loading { position:fixed;right:20px;bottom:20px;z-index:70;padding:8px 14px;border:1px solid var(--bal-line);border-radius:7px;background:#fff;color:var(--bal-navy);box-shadow:0 3px 15px #22356b18;font-size:12px }
.balance-empty { padding:28px 12px;text-align:center;border:1px dashed #cad5e3;border-radius:7px;background:#fafbfd;color:var(--bal-muted) }
.balance-empty>i { font-size:22px;color:#889bb5;margin-bottom:8px }
.balance-empty h3 { margin-bottom:5px }
.balance-empty p { font-size:12px }
.balance-copy-note { display:flex;align-items:baseline;gap:6px;color:var(--bal-muted);font-size:11px;margin-top:10px!important }
@media(max-width:1200px) { .balance-common .balance-scope-caption { flex-basis:100%;margin-left:0 }.balance-config-hint { margin-left:auto }.balance-toolbar { gap:7px }.balance-page .balance-help-button { margin-left:0 }.balance-card-head .balance-group-totals { margin-left:auto } }
@media(max-width:767px) {
  .balance-page { padding:10px 10px calc(var(--tts-bottombar-height,68px) + 20px) }
  .balance-toolbar { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px }
  .balance-tabs { grid-column:1/-1 }.balance-page .balance-tabs button { flex:1;min-height:40px }
  .balance-date { width:100% }.balance-day-shortcuts { justify-content:flex-end }.balance-page .balance-day-shortcuts button { min-height:40px;padding-inline:8px }
  .balance-customer { grid-column:1/-1 }.balance-customer .contact-select { flex:1;width:auto }
  .balance-page .contact-select-button { height:40px;min-height:40px }
  .balance-page .balance-refresh,.balance-page .balance-help-button { min-height:40px;width:100%;margin:0 }
  .balance-common { padding:10px;gap:8px }.balance-common>.balance-field { flex-basis:100% }.balance-common input { flex:1;width:auto;height:36px }
  .balance-common>button { min-height:40px;flex:1 }.balance-save-state { flex-basis:100% }
  .balance-config-hint { margin:0;border:0;padding:0 }.balance-common .balance-scope-caption { flex-basis:100% }
  .balance-filters { padding:10px }.balance-filter-label { flex-basis:100% }.balance-page .balance-choice-row button { min-height:40px;padding:6px 10px }
  .balance-pair-choices .balance-choice-label { margin:0;padding:0;border:0;flex-basis:100% }.balance-kind-choices::before { display:none }
  .balance-filter-toolbar { gap:8px }.balance-search { width:100% }.balance-page .balance-search input { height:36px }.balance-filter-options { gap:5px 12px }.balance-check { min-height:40px }
  .balance-total-bar { gap:10px;padding:10px }.balance-summary { gap:8px 14px }.balance-total-bar>button { width:100%;min-height:40px }.balance-total-caption { margin-left:0 }
  .balance-station-totals { flex-basis:100%;margin:0;order:3 }.balance-station>button { margin-left:auto }
  .balance-card-head { gap:8px }.balance-group-title { flex:1 }.balance-group-actions { flex-basis:100%;margin:0 }.balance-page .balance-group-actions button { min-height:40px;flex:1 }.balance-card-head .balance-group-totals { margin:0;flex-basis:100% }
  .balance-scroll { max-height:none }.balance-page .balance-scroll input { height:34px }.balance-scroll th,.balance-scroll td { padding-block:8px }.balance-page .balance-scroll td>button { min-height:36px;width:32px }
  .balance-manual>label { flex-basis:100% }.balance-page .balance-manual>input { flex:1;min-width:0;height:40px }.balance-page .balance-manual>button { min-height:40px }.balance-manual-hint { flex-basis:100% }
  .balance-page .balance-loading { bottom:calc(var(--tts-bottombar-height,68px) + 10px);right:10px }
}
@media(prefers-reduced-motion:reduce) { .balance-page * { transition:none!important;scroll-behavior:auto!important } }

@media(max-width:767px) {
  .balance-common .balance-save-state:not(.is-dirty),.balance-common .balance-scope-caption { display:none }
}

/* Shared Add message picker: searchable, bounded list and ellipsis for long names. */
.balance-contact-picker .select2-container--classic .select2-selection--single { display: flex; align-items: center; height: 40px; border: 1px solid var(--tts-vien, #e4e9f0) !important; border-radius: 8px !important; background: #fff !important; background-image: none !important; outline: 0; }
.balance-contact-picker .select2-container--classic .select2-selection--single:hover { border-color: #cfd7e3 !important; }
.balance-contact-picker .select2-container--classic.select2-container--open .select2-selection--single,
.balance-contact-picker .select2-container--classic.select2-container--focus .select2-selection--single { border-color: var(--tts-xanh, #146db1) !important; box-shadow: 0 0 0 3px rgba(20, 109, 177, .15); }
.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__rendered { flex: 1; padding: 0 36px 0 12px; color: var(--tts-muc, #23334e); font-size: 13px; font-weight: 600; line-height: 38px; }
.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__placeholder { color: var(--tts-muc-nhat, #64748b); }
.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__arrow { top: 0; right: 0; width: 36px; height: 38px; border: 0 !important; border-radius: 0 8px 8px 0; background: transparent !important; background-image: none !important; }
.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__arrow b { display: none; }
.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__arrow::before { content: "\f078"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--tts-muc-nhat, #64748b); font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 11px; transition: transform .15s; }
.balance-contact-picker .select2-container--classic.select2-container--open .select2-selection__arrow::before { transform: rotate(180deg); color: var(--tts-xanh, #146db1); }
.balance-contact-picker .select2-container--classic.select2-container--open .select2-selection--single { border-bottom-left-radius: 8px !important; border-bottom-right-radius: 8px !important; }

.balance-contact-picker .select2-container--classic .select2-dropdown { overflow: hidden; margin-top: 4px; border: 1px solid var(--tts-vien, #e4e9f0) !important; border-radius: 10px !important; background: #fff; box-shadow: 0 12px 32px rgba(35, 51, 78, .16); }
.balance-contact-picker .select2-container--classic .select2-dropdown--above { margin-top: -4px; }
.balance-contact-picker .select2-container--classic .select2-search--dropdown { position: relative; padding: 8px; border-bottom: 1px solid var(--tts-vien, #e4e9f0); }
.balance-contact-picker .select2-container--classic .select2-search--dropdown::before { content: "\f002"; position: absolute; top: 50%; left: 20px; transform: translateY(-50%); color: var(--tts-muc-nhat, #64748b); font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 12px; pointer-events: none; }
.balance-contact-picker .select2-container--classic .select2-search--dropdown .select2-search__field { height: 36px; padding: 6px 10px 6px 32px; border: 1px solid var(--tts-vien, #e4e9f0) !important; border-radius: 8px; color: var(--tts-muc, #23334e); font-size: 13px; outline: 0; }
.balance-contact-picker .select2-container--classic .select2-search--dropdown .select2-search__field:focus { border-color: var(--tts-xanh, #146db1) !important; box-shadow: 0 0 0 3px rgba(20, 109, 177, .12); }
.balance-contact-picker .select2-container--classic .select2-results > .select2-results__options { max-height: 280px; padding: 4px; }
.balance-contact-picker .select2-container--classic .select2-results__option { margin: 1px 0; padding: 7px 10px; border-radius: 7px; color: var(--tts-muc, #23334e); font-size: 13px; }
.balance-contact-picker .select2-container--classic .select2-results__option--highlighted[aria-selected] { color: var(--tts-navy, #22356b); background: #edf4fa; }
.balance-contact-picker .select2-container--classic .select2-results__option[aria-selected="true"] { color: var(--tts-navy, #22356b); background: #eef0f8; font-weight: 700; }
.balance-contact-picker .select2-container--classic .select2-results__option[aria-selected="true"] .msg-user-option::after { content: "\f00c"; margin-left: auto; color: var(--tts-xanh, #146db1); font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 11px; }
.balance-contact-picker .select2-container--classic .select2-results__message { color: var(--tts-muc-nhat, #64748b); }

.balance-contact-picker { position:relative;width:190px;min-width:0 }
.balance-contact-picker .select2-container { max-width:100% }
.balance-contact-picker .select2-container--classic .select2-selection--single { height:32px;border-color:#cdd8e6!important;border-radius:6px!important }
.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__rendered { font-weight:400;line-height:30px;padding-left:9px }
.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__arrow { height:30px }
.balance-contact-picker .select2-container--classic .select2-results > .select2-results__options { max-height:min(260px,45vh);overflow-y:auto }
.balance-contact-picker .msg-user-option { display:flex;align-items:center;gap:8px;min-width:0 }
.balance-contact-picker .msg-user-avatar { display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px;border-radius:50%;background:#edf2fa;color:var(--bal-navy);font-size:11px;font-weight:700 }
/* Danh sách khách hiện đủ tên: rộng hơn ô chọn (select2 đặt width bằng ô 190px), tên dài thì xuống dòng thay vì cắt "…" */
.balance-contact-picker .select2-dropdown { min-width:min(300px,calc(100vw - 32px)) }
.balance-contact-picker .select2-results__option .msg-user-name { white-space:normal;overflow-wrap:anywhere;line-height:1.35 }
.balance-contact-picker .select2-container--disabled .select2-selection--single { background:#f0f3f7!important }
@media(max-width:767px) { .balance-contact-picker{flex:1;width:auto}.balance-contact-picker .select2-container--classic .select2-selection--single{height:40px}.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__rendered{line-height:38px}.balance-contact-picker .select2-container--classic .select2-selection--single .select2-selection__arrow{height:38px} }
/* Reuse the message modal shell: same header, close button, footer and buttons. */
.balance-help-overlay { position:fixed;inset:0;z-index:2100;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.5) }
.balance-help-overlay .balance-help-modal { width:min(960px,100%);max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);line-height:1.65 }
.balance-help-modal * { box-sizing:border-box }
.balance-help-modal .modal-header { align-items:center }
.balance-help-modal .balance-help-content { min-height:0;overflow:auto;overscroll-behavior:contain }
.balance-help-content h3 { margin:18px 0 8px;color:var(--tts-navy,#22356b);font-size:15px;font-weight:700 }
.balance-help-content h3:first-child { margin-top:0 }
.balance-help-content p { margin:8px 0 }
.balance-help-content ul,.balance-help-content ol { margin:8px 0;padding-left:22px }
.balance-help-content li { margin:6px 0 }
.balance-help-content code { color:var(--tts-xanh,#146db1);background:#edf4fa;padding:2px 5px;border-radius:4px;font-size:12px;overflow-wrap:anywhere }
.balance-help-example { padding:10px 12px;border-left:3px solid var(--tts-xanh,#146db1);background:#edf4fa;border-radius:4px }
.balance-help-modal button:focus-visible,.balance-help-content:focus-visible { outline:2px solid var(--tts-xanh,#146db1);outline-offset:-2px }
@media(max-width:767px) { .balance-help-overlay{padding:8px}.balance-help-overlay .balance-help-modal{max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)} }

/* Each betting type can be folded independently; searches stay local to the group. */
.balance-group-filter { display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:0 0 8px }
.balance-group-filter>.balance-search { flex:0 1 240px;width:240px;min-height:32px;margin:0 }
.balance-group-filter>span { color:var(--bal-muted);font-size:11px;font-variant-numeric:tabular-nums }
.balance-page .balance-group-filter>button { min-height:28px;padding:3px 6px;border:0;background:transparent;color:var(--bal-blue);font-size:11px }
.balance-row-actions { display:flex;flex-wrap:wrap;gap:7px;padding-top:7px }
.balance-page .balance-group-title .balance-collapse { gap:7px;min-height:30px;padding:3px 4px;border:0;background:transparent;color:var(--bal-navy);font-size:13px;font-weight:700;text-align:left }
.balance-page .balance-group-title .balance-collapse:hover { color:var(--bal-blue);background:#edf5fc }
.balance-group-title .balance-collapse>i { width:10px;font-size:10px;text-align:center }
.balance-card-head:has(.balance-collapse[aria-expanded=false]) { border-bottom:0;border-radius:7px }
@media(max-width:767px) { .balance-group-filter>.balance-search{flex-basis:100%;width:100%}.balance-page .balance-group-title .balance-collapse{min-height:40px}.balance-row-actions button{min-height:36px} }
