/* Debt Resolution -- a set of defaulted accounts settled as one piece of business.
   The set header carries the totals; the rows beneath are the accounts, in urgency
   order. Only .dr-body scrolls, so the icon band and the black header stay pinned. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #F2F2F4; color: #222; font-family: "Segoe UI", system-ui, sans-serif; }

.page-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#lwIconBand, .ct-header, .dr-setbar { flex: 0 0 auto; }

.ct-header { background: #3C3C3C; color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1; }
.ct-header button { color: #fff; background: #4F46E5; border: none; border-radius: 4px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ct-header button:hover { background: #6257F0; }
.ct-header button.secondary { background: #5A5A5E; }

/* ---- set bar: which set, when more than one ---- */
.dr-setbar { display: none; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid #E2E2E6; }
.dr-setbar.show { display: flex; }
.dr-setbar .picker-wrap { flex: 1; }

/* ---- the scroller ---- */
.dr-body { flex: 1; overflow: auto; padding: 14px 16px 72px; }
.dr-status { font-size: 12px; color: #777; margin-bottom: 10px; min-height: 14px; }

/* ---- set header card ---- */
.dr-set { background: #fff; border: 1px solid #E2E2E6; border-left: 5px solid #4F46E5; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.dr-set.is-closed { border-left-color: #7A8B7A; }
.dr-set-title { font-size: 15pt; font-weight: 600; margin: 0 0 2px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dr-set-about { color: #555; margin: 0 0 8px; }
.dr-set-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: #444; margin-bottom: 10px; }
.dr-set-meta a { color: #0A66C2; text-decoration: none; }
.dr-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #EEF; color: #3730A3; }
.dr-chip.terminal { background: #E5EFE7; color: #1F5A32; }
.dr-chip.warn { background: #FBE3E3; color: #8A1C1C; }

.dr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.dr-kpi { background: #F7F7FA; border: 1px solid #E6E6EA; border-radius: 8px; padding: 8px 10px; }
.dr-kpi .k { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: .3px; }
.dr-kpi .v { font-size: 15pt; font-weight: 600; margin-top: 2px; white-space: nowrap; }
.dr-kpi.face .v { color: #8A1C1C; }
.dr-kpi.paid .v { color: #1F5A32; }
.dr-kpi.cash .v { color: #1F3A8A; }
.dr-kpi .s { font-size: 11px; color: #777; }

/* ---- account rows ---- */
.dr-list { display: flex; flex-direction: column; gap: 8px; }
.dr-row { background: #fff; border: 1px solid #E2E2E6; border-left: 4px solid #9AA0AA; border-radius: 10px; padding: 10px 12px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.dr-row:hover { background: #FAFAFC; }
.dr-row.u1 { border-left-color: #D14343; }
.dr-row.u2 { border-left-color: #C98A16; }
.dr-row.is-paid { border-left-color: #2E7D4F; opacity: .85; }
.dr-row.is-suit { border-left-color: #8A1C1C; background: #FFF6F6; }
.dr-row.is-focus { outline: 2px solid #4F46E5; }
.dr-row-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dr-urg { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 6px; background: #EEE; font-size: 12px; font-weight: 700; color: #333; }
.dr-row.u1 .dr-urg { background: #FBD5D5; color: #8A0000; }
.dr-row.u2 .dr-urg { background: #FFE9C2; color: #7A4A00; }
.dr-label { font-weight: 600; font-size: 13.5px; flex: 1; }
.dr-face { font-weight: 700; white-space: nowrap; }
.dr-row-mid { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: #444; margin-top: 4px; }
.dr-row-mid a { color: #0A66C2; text-decoration: none; }
.dr-row-money { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; margin-top: 6px; }
.dr-row-money span b { font-weight: 600; }
.dr-row-money .exp b { color: #1F3A8A; }
.dr-row-money .agr b { color: #7A4A00; }
.dr-row-money .pd b  { color: #1F5A32; }
.dr-sit { font-size: 12px; color: #666; margin-top: 4px; }
.dr-files { font-size: 12px; color: #4F46E5; }

/* ---- contact log: the spreadsheet, one row per letter or call ---- */
.dr-log-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; }
.dr-log-head h2 { margin: 0; font-size: 13pt; flex: 1; }
.dr-log-sub { font-size: 12px; font-weight: 400; color: #777; margin-left: 8px; }
.dr-log-head button { color: #fff; background: #4F46E5; border: none; border-radius: 4px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.dr-log-wrap { overflow-x: auto; background: #fff; border: 1px solid #E2E2E6; border-radius: 8px; }
.dr-log { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 980px; }
.dr-log th, .dr-log td { border-bottom: 1px solid #E6E6EA; padding: 6px 8px; text-align: left; vertical-align: top; white-space: nowrap; }
.dr-log th { background: #F3F3F6; font-weight: 600; font-size: 11.5px; color: #444; position: sticky; top: 0; }
.dr-log td.num, .dr-log th.num { text-align: right; }
.dr-log th.sortable { cursor: pointer; user-select: none; }
.dr-log th.sortable:hover { background: #E7E7EE; }
.dr-log th.sorted { color: #4F46E5; }
.dr-sort-arrow { font-size: 9px; margin-left: 4px; }
.dr-log td.wrap { white-space: normal; min-width: 220px; }
.dr-log td.wrap { max-width: 420px; }
.dr-log a.dr-more { color: #4F46E5; text-decoration: none; font-weight: 600; white-space: nowrap; }
.dr-log tbody tr { cursor: pointer; }
.dr-log tbody tr.is-inactive { color: #8A8A93; background: #F1F1F4; opacity: .72; }   /* a finished (terminal-status) row reads faded */
.dr-log tbody tr.is-inactive td:first-child { box-shadow: inset 4px 0 0 #7A8B7A; }   /* a finished row: faded with a green edge, never struck through */
.dr-log td.act { white-space: nowrap; }
.dr-log td.act a { color: #4F46E5; text-decoration: none; margin-right: 6px; }
.dr-showall { font-size: 12px; color: #666; display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.dr-log-check { font-size: 12.5px; margin: 0 0 8px; }
.dr-log-check .ok { color: #1F5A32; }
.dr-log-check .warn { color: #8A1C1C; background: #FBE3E3; border: 1px solid #F1C4C4; border-radius: 6px; padding: 6px 10px; display: block; margin-bottom: 6px; }
.dr-log-check .note { color: #666; }
.dr-log tbody tr.is-dup td { background: #FFF5F5; }
.dr-res.dup { background: #FBE3E3; color: #8A1C1C; }
.dr-res { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 1px 7px; margin-right: 6px; background: #EEF0F5; color: #414553; }
.dr-log tbody tr:hover { background: #FAFAFC; }
.dr-log td a { color: #0A66C2; text-decoration: none; }
.dr-log .empty { color: #777; padding: 10px 8px; }
.dr-log tfoot td { background: #F3F3F6; font-weight: 600; border-top: 2px solid #C9C9D0; border-bottom: none; }
.dr-log tfoot td.wrap { font-weight: 400; color: #666; font-size: 11.5px; }
.dr-tot-lbl { display: block; font-weight: 400; color: #666; font-size: 11px; line-height: 1.2; white-space: normal; max-width: 150px; margin-left: auto; }
tfoot td.num { vertical-align: bottom; }
.dr-log tfoot tr + tr td { border-top: 1px solid #DADAE0; }
.dr-log tfoot tr.dr-tot-final td { border-top: 2px solid #C9C9D0; color: #1F3A8A; }
.dr-log tfoot tr.dr-tot-final td.wrap { color: #666; }
.dr-log-wrap { margin-bottom: 24px; }

/* ---- settlement calculator (Tony, 2026-09-14) ---- */
.dr-log a.dr-calc { color: #4F46E5; margin-left: 6px; display: inline-block; vertical-align: -2px; line-height: 0; }
.dr-log a.dr-calc:hover { color: #312E81; }
.modal.dr-calc-modal { max-width: 440px; }
#calcBack { z-index: 70; }   /* opens on top of the one-creditor box, which comes later in the page */
.dr-calc-amt { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; color: #444; }
.dr-calc-amt input { flex: 1; width: 100%; font: inherit; font-size: 15px; padding: 7px 9px; border: 1px solid #C9C9D0; border-radius: 6px; text-align: right; }
.dr-calc-offer { font-size: 13px; color: #1F3A8A; margin: 0 0 8px; min-height: 0; }
.dr-calc-offer:empty { display: none; }
.dr-log.dr-cr-table tbody tr.is-offer td { background: #E8EAFD; font-weight: 600; }

/* ---- not on any credit report (hard-coded list, Tony 2026-09-14): amber ---- */
.dr-chip.unreported { background: #FDEBC8; color: #7A4A00; }
.dr-row.is-unreported { background: #FFF8E6; border-top-color: #F0D9A0; border-right-color: #F0D9A0; border-bottom-color: #F0D9A0; }
.dr-row.is-unreported:hover { background: #FFF2D6; }
.dr-log tbody tr.is-unreported:not(.is-inactive):not(.is-dup) td { background: #FFF8E6; }
.dr-log tbody tr.is-unreported:not(.is-inactive) td:first-child { box-shadow: inset 4px 0 0 #D49A1A; }
.dr-log-check .legend-unreported { display: inline-block; color: #7A4A00; background: #FFF8E6; border: 1px solid #F0D9A0; border-left: 4px solid #D49A1A; border-radius: 6px; padding: 2px 8px; margin-left: 4px; }

/* ---- modals ---- */
.modal-back { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 18px; width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 12px; font-size: 15pt; }
.dr-field { display: block; margin-bottom: 10px; }
.dr-field > span { display: block; font-size: 12px; color: #555; margin-bottom: 3px; }
.dr-field input[type="text"], .dr-field input[type="number"], .dr-field input[type="date"], .dr-field textarea {
    display: block; width: 100%; box-sizing: border-box; padding: 7px 9px; font: inherit; font-size: 13.5px;
    border: 1px solid #C9C9D0; border-radius: 6px; background: #fff; color: #222; }
.dr-field textarea { min-height: 70px; resize: vertical; }
.dr-field .voice-mic-wrap { display: block; }
.dr-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dr-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .dr-row3 { grid-template-columns: 1fr 1fr; } }
.dr-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; }
.dr-modal-btns { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dr-modal-btns .spacer { flex: 1; }
.dr-modal-btns button { padding: 8px 14px; font: inherit; font-size: 13px; border-radius: 6px; border: 1px solid #C9C9D0; background: #fff; cursor: pointer; }
.dr-modal-btns button.primary { background: #4F46E5; border-color: #4F46E5; color: #fff; }
.dr-modal-btns button.danger { background: #B91C1C; border-color: #B91C1C; color: #fff; }
.dr-modal-sub { color: #555; font-size: 13px; margin: -6px 0 12px; }
.dr-modal-sub a { color: #0A66C2; text-decoration: none; }
.modal.dr-modal-wide { max-width: 820px; }
.dr-log.dr-cr-table { min-width: 0; }
.dr-log.dr-cr-table tbody tr { cursor: default; }
.dr-log a.dr-creditor-link { color: #0A66C2; text-decoration: none; font-weight: 600; }
.dr-log a.dr-creditor-link:hover { text-decoration: underline; }

/* Money boxes hold formatted text (11,602.00) and read like the money columns: right-aligned. */
.dr-field input.dr-money { text-align: right; }

/* ---- expand / collapse each big section (Tony, 2026-09-24) ---- */
.dr-sec-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; }
.dr-sec-head h2 { margin: 0; font-size: 13pt; flex: 1; }
button.dr-fold, .dr-log-head button.dr-fold { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 0; margin: 0; color: inherit; font: inherit; font-size: inherit; font-weight: inherit; cursor: pointer; text-align: left; }
.dr-fold-caret { display: inline-block; font-size: 0.8em; color: #4F46E5; width: 1em; transition: transform .15s; }
button.dr-fold.is-folded .dr-fold-caret { transform: rotate(-90deg); }

/* The settled line is its own section below the agreement lines. */
.dr-log tfoot tr.dr-tot-sec td { border-top: 3px double #7A8B7A; color: #1E6B3A; }
.dr-log tfoot tr.dr-tot-sec td.wrap { color: #666; }
[data-fold-body][hidden] { display: none !important; }   /* .dr-list is display:flex, which would beat the hidden attribute */
