/* BOSMITH Accounts — original stylesheet (no framework). */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --ink: #1c2230;
  --ink-2: #4a5263;
  --ink-3: #7a8191;
  --line: #e4e0d8;
  --line-2: #efece6;
  --pine: #1f5a4c;
  --pine-2: #2b7a66;
  --pine-tint: #e6f0ec;
  --amber: #b86e1f;
  --amber-tint: #fbf0e2;
  --brick: #a3362b;
  --brick-tint: #f8e7e4;
  --sky-tint: #eaf0f7;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 34, 48, .05), 0 4px 18px rgba(28, 34, 48, .05);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.02rem; font-weight: 650; }
h3 { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: 1.1rem; }
.mono { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.strong { font-weight: 650; }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1.4rem; }
.fineprint { color: var(--ink-3); font-size: .8rem; margin: .8rem 0 0; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.4rem;
  background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-text { font-size: .98rem; letter-spacing: .01em; }
.brand-text strong { font-weight: 750; letter-spacing: .06em; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(140deg, var(--pine-2), var(--pine)); color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.brand-mark.lg { width: 46px; height: 46px; border-radius: 12px; font-size: 1.4rem; }
.topsearch { flex: 1; max-width: 520px; }
.topsearch input { width: 100%; border: 0; border-radius: 999px; padding: .5rem 1rem; background: rgba(255,255,255,.12);
  color: #fff; font: inherit; }
.topsearch input::placeholder { color: rgba(255,255,255,.6); }
.topsearch input:focus { outline: 2px solid var(--pine-2); background: rgba(255,255,255,.18); }
.usernav { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.usernav form { margin: 0; }
.who { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--amber); font-weight: 700; font-size: .8rem; }
.role-pill { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; padding: .1rem .45rem; border-radius: 999px; background: rgba(255,255,255,.14); }
.linkbtn { background: none; border: 0; color: rgba(255,255,255,.8); font: inherit; font-size: .88rem; cursor: pointer; padding: 0; }
.linkbtn:hover { color: #fff; text-decoration: underline; }
.menu { position: relative; font-size: .9rem; }
.menu summary { cursor: pointer; list-style: none; color: rgba(255,255,255,.88); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: .75em; }
.menu-pop { position: absolute; right: 0; top: 1.8rem; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  border: 1px solid var(--line); min-width: 180px; padding: .35rem; display: grid; }
.menu-pop a { color: var(--ink); padding: .45rem .7rem; border-radius: 6px; }
.menu-pop a:hover { background: var(--pine-tint); text-decoration: none; }
.beta-strip { background: var(--amber-tint); color: #7a4a14; font-size: .8rem; text-align: center; padding: .3rem 1rem; border-bottom: 1px solid #f0dcc2; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 1.6rem 1.4rem 4rem; }
.page-title { margin-bottom: 1rem; }

/* Cards and grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 520px; margin: 3rem auto; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.span-all { grid-column: 1 / -1; }
#terms { grid-column: span 1; }
#aging { grid-column: span 2; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* Buttons and form controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 10px; cursor: pointer; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn.primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn.primary:hover { background: var(--pine-2); }
.btn.ghost { background: transparent; }
.btn.xs { padding: .18rem .6rem; font-size: .8rem; border-radius: 7px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
input, select { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: .5rem .7rem; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--pine-2); outline-offset: 0; border-color: transparent; }
label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.stack { display: grid; gap: .9rem; }
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin-bottom: 1rem; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.sm { font-size: .7rem; padding: .05rem .45rem; }
.chip.good { background: var(--pine-tint); color: var(--pine); }
.chip.warn { background: var(--amber-tint); color: #8a5214; }
.chip.bad { background: var(--brick-tint); color: var(--brick); }
.chip.link { background: var(--sky-tint); color: #24527a; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Login */
.login-page { background: radial-gradient(1200px 600px at 10% -10%, #dfe9e4 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #f3e3cf 0%, transparent 55%), var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px; border: 1px solid var(--line); padding: 2rem; box-shadow: 0 10px 40px rgba(28,34,48,.10); }
.login-brand { display: flex; gap: .9rem; align-items: center; margin-bottom: 1.5rem; }
.login-brand h1 { font-size: 1.35rem; margin: 0; }
.login-brand p { margin: .1rem 0 0; font-size: .88rem; }
.alert { padding: .65rem .85rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.alert.bad { background: var(--brick-tint); color: var(--brick); }

/* Search */
.searchpanel { max-width: 860px; margin: 1.2rem auto 1.4rem; }
.bigsearch-row { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .45rem .45rem .45rem 1rem; box-shadow: var(--shadow); }
.bigsearch-row:focus-within { border-color: var(--pine-2); box-shadow: 0 0 0 4px rgba(43,122,102,.14); }
.bigsearch-row .icon { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.bigsearch-row input { flex: 1; border: 0; font-size: 1.15rem; padding: .55rem .2rem; min-width: 0; }
.bigsearch-row input:focus { outline: none; }
.search-options { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: .8rem; padding: 0 .3rem; }
.hint { color: var(--ink-3); font-size: .84rem; }
.switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-weight: 600; color: var(--ink); grid-auto-flow: column; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #cfcac0; position: relative; transition: background .15s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--pine); }
.switch input:checked + .track .thumb { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--pine-2); outline-offset: 2px; }
.results { max-width: 1060px; margin: 0 auto; padding: 0; overflow: hidden; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.results-head h2 { margin: 0; }
.results-meta { display: flex; gap: .5rem; flex-wrap: wrap; }
.tips { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; }
.tip { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: .7rem .9rem; display: grid; gap: .15rem; font-size: .88rem; color: var(--ink-2); }
.tip-k { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--pine); }
.asof { text-align: center; color: var(--ink-3); font-size: .82rem; margin-top: 1.6rem; }
.empty { padding: 1.4rem 1.25rem; color: var(--ink-3); }

/* Tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; padding: .55rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .6rem .75rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.table .num { text-align: right; }
.results-table td { padding: .75rem 1.25rem; }
.results-table th { padding: .6rem 1.25rem; }
.clickrow { cursor: pointer; }
.clickrow:hover td { background: #faf8f4; }
.clickrow .name { font-weight: 650; }
.clickrow .first { font-weight: 500; }
.sub { color: var(--ink-3); font-size: .8rem; margin-top: .1rem; }
.is-co td:first-child { box-shadow: inset 3px 0 0 var(--brick); }
.is-junk { opacity: .7; }
.history-table td { padding: .45rem .75rem; font-size: .9rem; }
.kind { font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.kind.k-payment, .kind.k-down_payment {  background: var(--pine-tint); color: var(--pine); }
.kind.k-late_fee, .kind.k-interest, .kind.k-finance_charge { background: var(--amber-tint); color: #8a5214; }
.kind.k-chargeoff, .kind.k-reversal { background: var(--brick-tint); color: var(--brick); }
.kind.k-sale, .kind.k-sales_tax { background: var(--sky-tint); color: #24527a; }
.showall { margin: .6rem auto 0; display: flex; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .45rem .9rem; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a:hover { text-decoration: none; background: var(--line-2); }
.tabs a.on:hover { background: var(--ink); }

/* Account page */
.backlink { display: inline-block; margin-bottom: .8rem; font-size: .88rem; }
.acct-head { position: sticky; top: 50px; z-index: 10; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow); margin-bottom: .8rem; }
.acct-head.co { border-left: 5px solid var(--brick); }
.acct-num { color: var(--pine); font-weight: 700; font-size: .95rem; letter-spacing: .03em; }
.acct-head h1 { margin: .1rem 0 .5rem; }
.acct-figs { display: grid; grid-template-columns: repeat(4, auto); gap: .3rem 2rem; margin: 0; align-content: center; }
.acct-figs dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
.acct-figs dd { margin: 0; }
.acct-figs .big { font-size: 1.3rem; font-weight: 700; }
.acct-figs .is-pastdue dd { color: var(--brick); }
.jump { display: flex; gap: .2rem; flex-wrap: wrap; margin: 0 0 1rem; }
.jump a { font-size: .82rem; padding: .25rem .65rem; border-radius: 999px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.jump a:hover { text-decoration: none; border-color: var(--pine-2); color: var(--pine); }
.kv { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: .4rem 1rem; margin: 0; }
.kv dt { color: var(--ink-3); font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.cols { grid-template-columns: repeat(auto-fill, minmax(140px, max-content) minmax(140px, 1fr)); margin-top: .8rem; }
.phones, .refs, .related, .notes { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.phones li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .4rem .6rem; border-radius: 9px; background: #faf8f4; }
.phones li.primary { background: var(--pine-tint); }
.refs li, .related li { padding: .5rem .6rem; border-radius: 9px; background: #faf8f4; }
.related li { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .6rem; align-items: baseline; }
.related .sub { grid-column: 1 / -1; }
.ssn { display: inline-flex; align-items: center; gap: .5rem; }
.ssn.revealed .ssn-value { background: var(--amber-tint); padding: 0 .35rem; border-radius: 5px; }
.aging-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--line-2); margin: .3rem 0 1rem; }
.seg { display: block; height: 100%; }
.s-cur { background: var(--pine-2); } .s-30 { background: #d9a441; } .s-60 { background: #d07a2e; } .s-90 { background: #b8502b; } .s-over { background: #8c2a22; } .s-none { background: var(--line-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .5rem; vertical-align: -1px; }
.notes { max-height: 460px; overflow: auto; }
.note { padding: .55rem .7rem; border-radius: 9px; background: #faf8f4; border-left: 3px solid var(--line); }
.note.n-cusfile { border-left-color: var(--pine-2); }
.note.n-lcomment { border-left-color: var(--brick); }
.note-meta { display: flex; gap: .35rem; margin-bottom: .2rem; }
.note-text { white-space: pre-wrap; font-size: .9rem; }
details summary { cursor: pointer; }
h2.inline { display: inline; }

/* Responsive */
@media (max-width: 1020px) {
  .grid { grid-template-columns: 1fr 1fr; }
  #aging { grid-column: span 1; }
  .acct-figs { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { flex-wrap: wrap; padding: .55rem .9rem; gap: .5rem .8rem; }
  .topsearch { order: 3; flex-basis: 100%; max-width: none; }
  .who-name { display: none; }
  .wrap { padding: 1rem .8rem 3rem; }
  .grid, .cols2 { grid-template-columns: 1fr; }
  #terms, #aging { grid-column: auto; }
  .hide-sm { display: none; }
  .acct-head { position: static; }
  .acct-figs { grid-template-columns: 1fr 1fr; width: 100%; }
  .results-table td, .results-table th { padding: .65rem .8rem; }
  .bigsearch-row input { font-size: 1rem; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  /* results become stacked rows: account + balance, name, payment */
  .results-table thead { display: none; }
  .results-table, .results-table tbody { display: block; }
  .results-table tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "acct bal" "name pay"; gap: .1rem .8rem;
    padding: .7rem .9rem; border-bottom: 1px solid var(--line-2); }
  .results-table td { display: block; padding: 0; border: 0; }
  .results-table td:nth-child(1) { grid-area: acct; }
  .results-table td:nth-child(2) { grid-area: name; }
  .results-table td:nth-child(4) { grid-area: pay; align-self: end; font-size: .85rem; color: var(--ink-2); }
  .results-table td:nth-child(4)::before { content: "Pays "; font-family: var(--font); color: var(--ink-3); }
  .results-table td:nth-child(5) { grid-area: bal; font-size: 1.02rem; }
  .is-co td:first-child { box-shadow: none; }
  .results-table tr.is-co { box-shadow: inset 3px 0 0 var(--brick); }
  .kv dd { margin-bottom: .45rem; }
}
.notice { background: var(--amber-tint); color: #6e4512; border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; margin-bottom: .8rem; }
.na { font-size: .95rem; font-weight: 600; color: var(--ink-3); font-family: var(--font); }
.kvp + .kvp::before { content: "· "; color: var(--ink-3); }
.usernav a.linkbtn { color: rgba(255,255,255,.8); font-size: .88rem; }
.card.narrow input { width: 100%; }
.card.narrow ul { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .78rem; font-weight: 400; color: var(--ink-3); }
