/* Equity Recovery Advisors CRM: the company brand (Plus Jakarta Sans, navy #2453C9 / #0F1F5C, gold #F2B33D)
   on a soft gray canvas with white 22px cards, a hairline and a lift. */
:root {
  --bg: #F7F8F9;
  --card: #FFFFFF;
  --sunken: #F1F2F4;
  --seg: #EEF0F2;
  --ink: #101821;
  --ink-2: #3C434B;
  --muted: #636C75;
  --faint: #99A0A8;
  --menu: #646468;
  --menu-ic: #8A8A8E;
  --menu-hover: #EBEDEF;
  --menu-active: #E5E7EA;
  --line: #E4E7EA;
  --row: #F0F1F3;
  --hair: rgba(16, 24, 33, .08);
  --blue: #2453C9;
  --blue-2: #2F62E0;
  --navy: #0F1F5C;
  --navy-2: #13276E;
  --mint: #E7EDFB;
  --mint-2: #B9CBF5;
  --sky: #E7EDFB;
  --up: #1E8A57;
  --down: #C8473A;
  --amber: #8A6100;
  --r: 22px;
  --r-md: 14px;
  --r-sm: 11px;
  --lift: 0 1px 2px rgba(16, 24, 33, .03), 0 12px 32px -24px rgba(16, 24, 33, .18);
  --lift-2: 0 2px 4px rgba(9, 31, 54, .05), 0 28px 60px -30px rgba(9, 31, 54, .45);
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--mint); }
h1 { font-size: 24px; margin: 0; font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 12px; margin: 0 0 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--faint); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.up { color: var(--up); }
.down { color: var(--down); }
.ic { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.sm { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 284px 1fr; height: 100vh; }
.nav { background: var(--bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px 14px; overflow-y: auto; scrollbar-width: none; }
.brand { font-weight: 600; font-size: 22px; padding: 2px 6px 20px; display: flex; gap: 11px; align-items: center; letter-spacing: -.035em; color: var(--ink); }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark img { width: 34px; height: 34px; flex: none; }
.brand-mark .wm { display: flex; flex-direction: column; font-size: 15.5px; line-height: 1.12; letter-spacing: -.03em; white-space: nowrap; color: var(--ink); }
.brand-mark .wm b { font-weight: 700; }
.brand-mark .wm span { font-weight: 400; opacity: .6; }
.brand { flex-wrap: nowrap; }
.brand-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); background: var(--sky); border-radius: 6px; padding: 3px 6px; margin-left: 2px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(160deg, #3485DB, var(--blue) 45%, var(--navy-2)); color: #fff; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px -2px rgba(0,42,122,.5); flex: none; }
.logo .ic { width: 19px; height: 19px; stroke-width: 2; }
.nav a { color: var(--menu); height: 40px; padding: 0 12px; border-radius: var(--r-sm); display: flex; gap: 12px; align-items: center; font-weight: 500; font-size: 15px; transition: background .12s; }
.nav a .ic { color: var(--menu-ic); width: 19px; height: 19px; }
.nav a:hover { background: var(--menu-hover); color: var(--ink); }
.nav a.active { background: var(--menu-active); color: var(--ink); font-weight: 600; }
.nav a.active .ic { color: var(--ink); }
.nav a.home { height: 46px; font-size: 16px; }
.nav .section { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; padding: 16px 12px 8px; color: var(--faint); border-top: 1px solid var(--line); margin-top: 12px; }
.nav .spacer { flex: 1; min-height: 20px; }
.nav .promo { background: var(--sky); border-radius: var(--r-md); padding: 12px 14px; margin: 0 4px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.nav .promo b { display: block; color: var(--navy); font-size: 14.5px; margin-bottom: 2px; }
.nav .me { display: flex; gap: 11px; align-items: center; padding: 8px 8px 2px; }
.nav .me .who { min-width: 0; line-height: 1.25; }
.nav .me .who b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.nav .me .who a { all: unset; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.nav .me .who a:hover { color: var(--blue); }
.nav .me .out { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 7px; border-radius: 50%; display: grid; }
.nav .me .out:hover { background: var(--menu-hover); color: var(--ink); }
.me-av { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.main { overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 32px 20px; }
.tb-search { position: relative; display: flex; align-items: center; width: 240px; height: 44px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--hair); padding: 0 10px 0 38px; color: var(--muted); }
.tb-search .ic { position: absolute; left: 13px; color: var(--muted); }
.tb-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 15px; color: var(--ink); }
.tb-search input::placeholder { color: var(--muted); }
.tb-search kbd { font: 500 11.5px var(--sans); color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.tb-search:focus-within { border-color: var(--mint-2); box-shadow: 0 0 0 4px var(--sky); }
.tbbtn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--hair); color: var(--ink); cursor: pointer; flex: none; }
.tbbtn:hover { background: #F2F4F6; color: var(--ink); }
.tbbtn .ic { width: 19px; height: 19px; }
.tbav { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; box-sizing: border-box; font: 600 14px var(--sans); color: var(--navy); background: var(--card); border: 2px solid var(--navy); letter-spacing: .02em; }
.tbav:hover { background: var(--sky); color: var(--navy); }
.page-head { display: flex; align-items: center; gap: 12px; padding: 0 32px 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page { padding: 0 32px 56px; }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--hair); background: var(--card); border-radius: 12px; height: 40px; padding: 0 16px; cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 14.5px; display: inline-flex; gap: 7px; align-items: center; justify-content: center; color: var(--ink); transition: background .12s, border-color .12s; }
.btn:hover { background: #F2F4F6; color: var(--ink); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--down); }
.btn.danger:hover { background: #FBEDEA; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn.ghost.sm { width: 32px; padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { border: 1px solid var(--line); border-radius: 12px; height: 40px; padding: 0 12px; background: var(--card); min-width: 0; font-size: 14.5px; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 10px 12px; width: 100%; min-height: 84px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 32px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23636C75' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 14px; }
.input:focus { outline: none; border-color: var(--mint-2); box-shadow: 0 0 0 4px var(--sky); }
.input:disabled { background: var(--sunken); color: var(--muted); }
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search { width: 280px; padding-left: 36px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 32px 12px; }
.toolbar .grow { flex: 1; }
.toolbar .input { font-size: 14px; height: 38px; }
.chip { border: 1px solid var(--line); border-radius: 999px; height: 34px; padding: 0 14px; background: var(--card); cursor: pointer; font-size: 13.5px; font-weight: 500; white-space: nowrap; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; transition: all .12s; }
.chip:hover { border-color: #CED3D8; color: var(--ink); }
.chip.on { background: var(--mint); border-color: var(--mint-2); color: var(--navy); }
.seg { display: inline-flex; background: var(--seg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 13px; cursor: pointer; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--lift), 0 1px 2px rgba(16,24,33,.06); font-weight: 600; }
.groupby { display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.field > .input { color: var(--ink); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.form-grid .span2 { grid-column: span 2; }
.checkbox { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ink-2); font-weight: 400; }
input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--lift); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .tbl-scroll { overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 16px 24px; margin: -22px -24px 18px; border-bottom: 1px solid var(--row); }
.card-head h3 { margin: 0; color: var(--ink-2); font-size: 13px; }
.card-head .meta { color: var(--muted); font-size: 14px; }
.goarrow { width: 34px; height: 34px; border-radius: 50%; background: var(--card); border: 1px solid var(--hair); color: var(--ink); display: grid; place-items: center; flex: none; cursor: pointer; transition: transform .2s, background .12s; }
.goarrow:hover { background: #F2F4F6; transform: translateX(2px); }
.goarrow .ic { width: 16px; height: 16px; }
.grid { display: grid; gap: 18px; align-content: start; }
.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1150px) { .dash { grid-template-columns: 1fr; } }

/* Notch-style navy review banner */
.banner { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 18px 0 16px; border-radius: 18px; margin-bottom: 18px; color: #fff; cursor: pointer;
  background: linear-gradient(90deg, #0B4C9E 0%, var(--navy-2) 45%, var(--navy) 100%); box-shadow: var(--lift-2); }
.banner:hover { filter: brightness(1.06); }
.banner .chk { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.banner .t { font-size: 17px; font-weight: 500; flex: 1; }
.banner .count { min-width: 30px; height: 30px; padding: 0 9px; border-radius: 999px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-weight: 600; font-size: 14px; }

/* greeting hero */
.hero { padding: 26px 26px 22px; margin-bottom: 18px; }
.hero h1 { font-size: 32px; font-weight: 500; letter-spacing: -.03em; }
.hero .lbl { color: var(--muted); font-size: 15px; margin-top: 8px; }
.hero .big { font-size: 34px; font-weight: 600; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hero .chg { font-size: 15px; margin-top: 4px; color: var(--muted); }
.hero .chg b { font-weight: 600; color: var(--up); }
.stackbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--sunken); margin: 24px 0 10px; gap: 2px; }
.stackbar span { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 22px -26px -22px; border-top: 1px solid var(--row); }
.kpi { padding: 16px 26px 18px; border-right: 1px solid var(--row); }
.kpi:last-child { border-right: 0; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 1px; }

/* "Needs you" checklist */
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 20px 14px 24px; margin: 0 -24px; border-top: 1px solid var(--row); cursor: pointer; }
.card-head + .todo { border-top: 0; margin-top: -18px; }
.todo:hover { background: #FAFAFB; }
.todo .ring { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #C9CED4; flex: none; }
.todo .ring.red { border-color: var(--down); }
.todo .ring.amber { border-color: #D99A06; }
.todo .ring.done { border-color: var(--up); background: var(--up); }
.todo .tx { flex: 1; min-width: 0; }
.todo .tx b { display: block; font-weight: 600; font-size: 15.5px; }
.todo .tx span { color: var(--muted); font-size: 14px; }
.todo > .ic { color: var(--faint); }
.card .todo:last-child { margin-bottom: -22px; }

/* ---------- status pills ---------- */
.pill { --c: #99A0A8; display: inline-flex; align-items: center; gap: 7px; min-width: 140px; height: 30px; padding: 0 12px 0 10px; font-size: 13px; font-weight: 500; border-radius: 999px; cursor: default; white-space: nowrap; border: 0;
  background: color-mix(in srgb, var(--c) 11%, white); color: color-mix(in srgb, var(--c) 70%, #101821); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.pill.click { cursor: pointer; transition: background .12s; }
.pill.click:hover { background: color-mix(in srgb, var(--c) 18%, white); }
.pill.sm { min-width: 0; height: 26px; padding: 0 10px 0 9px; font-size: 12.5px; gap: 6px; }
.pill.none { --c: #C9CED4; color: var(--faint); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 22px; }
.badge.red { background: #FBEDEA; color: var(--down); }
.badge.green { background: #E6F4EC; color: var(--up); }
.badge.amber { background: #FFF3CF; color: var(--amber); }
.badge.blue { background: var(--mint); color: var(--navy); }
.badge .ic { width: 12px; height: 12px; vertical-align: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; flex: none; letter-spacing: .02em; }
.avatar.none { background: var(--card); border: 1.5px dashed #C9CED4; color: #B4BAC1; font-weight: 400; font-size: 14px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; vertical-align: middle; }
.owner-cell { display: inline-flex; gap: 8px; align-items: center; }
.owner-cell[data-act] { border-radius: 999px; padding: 2px; }
.owner-cell[data-act]:hover { background: var(--sunken); }

/* ---------- board ---------- */
.board-summary { padding: 4px 32px 20px; color: var(--muted); font-size: 14px; display: flex; gap: 22px; }
.board-summary b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.group { margin: 0 32px 24px; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; cursor: pointer; user-select: none; }
.group-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.group-head .name { font-weight: 600; font-size: 16px; white-space: nowrap; letter-spacing: -.01em; }
.group-head .count { color: var(--muted); font-size: 12.5px; font-weight: 500; background: var(--seg); border-radius: 999px; padding: 0 9px; line-height: 22px; }
.group-head .caret { color: var(--faint); display: grid; transition: transform .15s; }
.group-head.collapsed .caret { transform: rotate(-90deg); }
.group-head .gstats { color: var(--muted); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--lift); }
table.tbl { border-collapse: collapse; width: 100%; min-width: 1240px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 14px 12px; white-space: nowrap; cursor: pointer; user-select: none; }
.tbl th:first-child { padding-left: 22px; }
.tbl th:hover { color: var(--ink); }
.tbl th.sorted { color: var(--blue); }
.tbl th.nosort { cursor: default; }
.tbl th.nosort:hover { color: var(--muted); }
.tbl td { padding: 10px 14px; border-top: 1px solid var(--row); vertical-align: middle; white-space: nowrap; height: 60px; }
.tbl td:first-child { padding-left: 22px; }
.tbl td .clip { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tbl tbody tr { transition: background .08s; }
.tbl tbody tr:hover { background: #FAFAFB; }
.tbl tbody tr.selected { background: var(--sky); }
.tbl tr.clickable { cursor: pointer; }
.tbl .name-cell { width: 300px; min-width: 300px; max-width: 300px; }
.tbl .name-cell .n { font-weight: 600; font-size: 15px; display: flex; gap: 7px; align-items: center; }
.tbl .name-cell .s { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tbl input[type=date] { border: 1px solid transparent; background: transparent; height: 32px; padding: 0 6px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); }
.tbl input[type=date]:hover { border-color: var(--line); background: var(--card); }
.money-strong { font-weight: 600; color: var(--ink); }
.overdue, .overdue input { color: var(--down) !important; font-weight: 600; }
.today { color: var(--amber) !important; font-weight: 600; }
.phone-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.phone-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #D3D7DC; }
.phone-dot.yes { color: var(--up); }
.phone-dot.yes::before { background: var(--up); }
.bulkbar { position: sticky; bottom: 20px; margin: 0 auto; width: max-content; max-width: calc(100% - 64px); background: var(--navy); color: #fff; border-radius: 18px; padding: 10px 12px 10px 20px; display: flex; gap: 10px; align-items: center; box-shadow: var(--lift-2); z-index: 5; flex-wrap: wrap; }
.bulkbar select { background-color: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.bulkbar select option { color: var(--ink); }
.bulkbar .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; padding: 0 32px 28px; overflow-x: auto; align-items: flex-start; }
.kcol { flex: 0 0 284px; background: var(--seg); border-radius: 18px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); transition: background .12s; }
.kcol-head { padding: 14px 14px 10px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.kcol-head .lbl { display: flex; align-items: center; gap: 8px; }
.kcol-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.kcol-head .muted { font-weight: 500; font-size: 13px; }
.kcol-body { padding: 0 8px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kcol.drop { background: var(--mint); box-shadow: inset 0 0 0 2px var(--mint-2); }
.kcard { background: var(--card); border-radius: var(--r-md); padding: 13px 14px; border: 1px solid var(--hair); box-shadow: var(--lift); cursor: pointer; transition: box-shadow .12s, transform .12s; }
.kcard:hover { box-shadow: var(--lift-2); transform: translateY(-1px); }
.kcard .t { font-weight: 600; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 13px; color: var(--muted); gap: 6px; }
.kcard .amt b { color: var(--ink); font-weight: 600; }

/* ---------- case page (the old pop-out drawer, now a full page) ---------- */
.case-page { padding: 22px 32px 60px; max-width: 1440px; }
.case-page .drawer { position: static; width: auto; display: block; animation: none; box-shadow: var(--lift), 0 0 0 1px var(--hair); overflow: visible; }
.case-page .drawer-body { overflow: visible; padding: 26px 30px 40px; }
.case-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.case-topbar .back-link { margin-bottom: 0; }
.btn.danger-ghost { background: none; border: 1px solid #F1C9C2; color: var(--down); }
.btn.danger-ghost:hover { background: #FBEDEA; }
.back-link { border: 0; background: none; padding: 0; margin-bottom: 14px; cursor: pointer; color: var(--blue); font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.back-link svg { transform: rotate(180deg); width: 16px; height: 16px; }
.back-link:hover { text-decoration: underline; }
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.ov-grid > div { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ov-grid .section-block { margin: 0; border: 1px solid var(--hair); border-radius: 16px; padding: 16px 18px; background: var(--card); }
.ov-grid dl.kv { grid-template-columns: minmax(110px, 40%) 1fr; }
.ov-grid .edit-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 1250px) { .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-grid > div:nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
@media (max-width: 860px) { .ov-grid, .ov-grid > div:nth-child(3) { grid-template-columns: 1fr; } .ov-grid > div:nth-child(3) { display: flex; } .case-page { padding: 14px 12px 40px; } .case-page .drawer-body { padding: 20px 16px 30px; } }
details.state-law > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px; margin: 0; }
details.state-law > summary::-webkit-details-marker { display: none; }
details.state-law > summary > span:not(.fold) { grid-column: 1 / -1; grid-row: 2; }
details.state-law > summary .fold { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--blue); white-space: nowrap; }
details.state-law > summary .fold::before { content: "Show the rules"; }
details.state-law[open] > summary .fold::before { content: "Hide"; }
details.state-law > summary .fold svg { width: 15px; height: 15px; transition: transform .15s; }
details.state-law[open] > summary { margin-bottom: 12px; }
details.state-law[open] > summary .fold svg { transform: rotate(90deg); }
.ov-grid .edit-grid > * { min-width: 0; }
.ov-grid .input { width: 100%; min-width: 0; box-sizing: border-box; }

/* ---------- drawer (new-case form) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 18, 56, .18); backdrop-filter: blur(2px); z-index: 20; animation: fade .15s ease-out; }
.drawer { position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(960px, calc(100vw - 20px)); background: var(--card); z-index: 21; display: flex; flex-direction: column; box-shadow: var(--lift-2), 0 0 0 1px var(--hair); border-radius: var(--r); overflow: hidden; animation: slide .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(28px); opacity: 0; } }
.drawer-head { padding: 24px 30px 0; border-bottom: 1px solid var(--row); }
.drawer-head .top { display: flex; gap: 12px; align-items: flex-start; }
.drawer-head .title { flex: 1; min-width: 0; }
.drawer-head .eyebrow { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.drawer-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.04em; }
.drawer-head .close { border: 1px solid var(--hair); background: var(--card); cursor: pointer; color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.drawer-head .close:hover { background: #F2F4F6; }
.drawer-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 20px 0 6px; background: var(--bg); border-radius: 16px; }
.stat { padding: 12px 16px; min-width: 0; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.stat .l { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.stat .v { font-weight: 600; font-size: 16px; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.stat .v.hl { color: var(--blue); }
.stat .v.text { font-size: 12.5px; font-weight: 400; white-space: normal; color: var(--muted); letter-spacing: 0; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.tabs { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; margin-top: 16px; }
.tabs button { position: relative; border: 0; background: none; padding: 6px 0 13px; cursor: pointer; color: var(--muted); white-space: nowrap; font-weight: 600; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button .n { font-size: 12px; font-weight: 500; color: var(--faint); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 22px; height: 4px; border-radius: 4px; background: var(--blue-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 26px 30px 52px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .nav { display: none; } .page, .toolbar, .board-summary, .page-head, .topbar { padding-left: 16px; padding-right: 16px; } .group { margin-left: 16px; margin-right: 16px; } .tb-search { width: auto; flex: 1; } }
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13.5px; }
dl.kv dd { margin: 0; word-break: break-word; color: var(--ink); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.edit-grid label.field.wide { grid-column: 1 / -1; }
.drawer-body h3:not(:first-child), .card h3:not(:first-child) { margin-top: 28px; }
.locked { font-size: 14px; color: var(--muted); background: var(--bg); border-radius: 12px; padding: 11px 14px; margin-bottom: 16px; display: flex; gap: 9px; align-items: center; }
.locked.danger { background: #FBEDEA; color: var(--down); }
.contact { border: 1px solid var(--hair); border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--lift); }
.contact .head { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.contact .head .n { font-weight: 600; font-size: 17px; letter-spacing: -.015em; }
.contact .actions { margin-left: auto; display: flex; gap: 6px; }
.phone-line { display: flex; gap: 9px; align-items: center; padding: 4px 0; }
.phone-line .ic { color: var(--faint); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 13px 0; position: relative; }
.timeline li + li::before { content: ""; position: absolute; left: 17.5px; top: -13px; height: 26px; width: 1px; background: var(--line); }
.timeline .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--muted); }
.timeline .ico.call, .timeline .ico.text { background: var(--sky); color: var(--blue); }
.timeline .ico.email, .timeline .ico.letter { background: #ECE7FF; color: #6B4FD8; }
.timeline .ico.visit, .timeline .ico.meeting { background: #E6F4EC; color: var(--up); }
.timeline .ico.note { background: #FFF3CF; color: var(--amber); }
.timeline .head { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.timeline .head .end { margin-left: auto; }
.timeline .when { font-size: 13px; color: var(--muted); margin-top: 1px; }
.timeline .body { margin-top: 7px; white-space: pre-wrap; color: var(--ink-2); line-height: 1.55; }
.timeline .body.boxed { background: var(--bg); border-radius: 12px; padding: 11px 14px; }
.log-box { border: 1px solid var(--hair); border-radius: 18px; padding: 18px 20px; margin-bottom: 24px; background: var(--card); box-shadow: var(--lift); }
.type-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.steps { padding-left: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { margin-bottom: 12px; line-height: 1.6; padding-left: 36px; position: relative; color: var(--ink-2); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: var(--navy); font-size: 12.5px; font-weight: 600; display: grid; place-items: center; }
.src { border: 1px solid var(--hair); border-radius: 16px; margin-bottom: 14px; overflow: hidden; }
.src .h { background: var(--bg); padding: 11px 16px; font-weight: 600; display: flex; justify-content: space-between; }
.src table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.src td { padding: 8px 16px; border-top: 1px solid var(--row); vertical-align: top; word-break: break-word; }
.src td:first-child { color: var(--muted); width: 38%; font-size: 13px; }
.task-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--row); }
.task-row:first-child { border-top: 0; }
.task-row.done .tt > div:first-child { text-decoration: line-through; color: var(--faint); }
.task-row .tt { flex: 1; min-width: 0; }
.task-row .tt > div:first-child { font-weight: 500; }

/* ---------- misc ---------- */
.menu { position: fixed; background: var(--card); border-radius: 16px; box-shadow: var(--lift-2), 0 0 0 1px var(--hair); padding: 6px; z-index: 50; display: flex; flex-direction: column; gap: 2px; min-width: 210px; max-height: 70vh; overflow-y: auto; animation: fade .1s; }
.menu button { border: 0; text-align: left; padding: 6px 8px; border-radius: 10px; cursor: pointer; background: none; display: flex; gap: 9px; align-items: center; font-weight: 500; }
.menu button:hover { background: var(--sunken); }
.menu .pill { width: 100%; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 14px; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 100; max-width: 90vw; box-shadow: var(--lift-2); font-weight: 500; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--down); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(120% 90% at 85% 0%, rgba(47,98,224,.55), transparent 60%), radial-gradient(70% 60% at 10% 110%, rgba(242,179,61,.18), transparent 70%), #0A1238; }
.login .card { width: 100%; max-width: 400px; padding: 34px 32px 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); border: 0; }
.login .brand { padding: 0 0 6px; font-size: 22px; }
.login .headline { font: 800 32px/1.1 var(--sans); letter-spacing: -.04em; margin: 0; }
.login .btn { height: 46px; font-size: 15.5px; margin-top: 4px; }
.err-text { color: var(--down); font-size: 13.5px; min-height: 18px; }
.bar { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; }
.funnel-row { display: grid; grid-template-columns: 160px 1fr 44px 100px; gap: 14px; align-items: center; padding: 8px 10px; margin: 0 -10px; cursor: pointer; border-radius: 10px; }
.funnel-row:hover { background: #FAFAFB; }
.funnel-row .lbl { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-weight: 500; }
.funnel-row .lbl i { width: 8px; height: 8px; border-radius: 50%; }
.list-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 24px; margin: 0 -24px; cursor: pointer; align-items: center; border-top: 1px solid var(--row); }
.card-head + .list-row { border-top: 0; margin-top: -18px; }
.list-row:hover { background: #FAFAFB; }
.card > .list-row:last-child { margin-bottom: -22px; }
.list-row .t { font-weight: 600; font-size: 15px; }
.list-row .s { color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.lead { display: flex; align-items: center; gap: 13px; min-width: 0; }
.lead-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--sky); color: var(--navy); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; border: 1px solid var(--hair); }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.note-block { background: #FFF8E6; border-radius: 12px; padding: 12px 15px; line-height: 1.55; color: #5E4A12; }
.note-block.info { background: var(--sky); color: var(--navy); }
table.plain { width: 100%; border-collapse: collapse; }
table.plain th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; }
table.plain td { border-top: 1px solid var(--row); padding: 11px 10px; vertical-align: top; }
table.plain tr.clickable { cursor: pointer; }
table.plain tr.clickable:hover td { background: #FAFAFB; }

/* ---------- editable fact sections ---------- */
.section-block { margin-bottom: 30px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 32px; }
.sec-head h3 { margin: 0 !important; }
.edit-btn { color: var(--blue); width: auto !important; padding: 0 10px !important; gap: 5px; }
.edit-btn:hover { background: var(--sky); color: var(--navy); }
.edited { color: var(--blue); font-size: 9px; vertical-align: 1px; cursor: help; }
#fact-form { background: var(--bg); border-radius: 16px; padding: 16px; }
#fact-form .row-gap { margin-bottom: 0; }

/* ---------- documents ---------- */
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-actions label.btn { cursor: pointer; }
.docs { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .docs { grid-template-columns: 1fr; } }
.folders { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 16px; padding: 8px; }
.fold-row { display: flex; align-items: center; position: relative; }
.fold { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-weight: 500; text-align: left; }
.fold .ic { color: var(--menu-ic); }
.fold span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold i { font-style: normal; font-size: 12px; color: var(--faint); }
.fold:hover { background: var(--menu-hover); }
.fold.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--lift), 0 0 0 1px var(--hair); }
.fold.on .ic { color: var(--blue); }
.fold.sub { padding-left: 30px; }
.fold-menu { position: absolute; right: 4px; opacity: 0; }
.fold-row:hover .fold-menu { opacity: 1; }
.fold-row:hover .fold i { visibility: hidden; }
.files { border: 1px solid var(--hair); border-radius: 16px; min-height: 160px; transition: background .12s, box-shadow .12s; }
.files.drop { background: var(--sky); box-shadow: inset 0 0 0 2px var(--mint-2); }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--row); }
.file:first-child { border-top: 0; }
.file:hover { background: #FAFAFB; }
.ftype { width: 38px; height: 44px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; flex: none; background: var(--sunken); color: var(--muted); }
.ftype.pdf { background: #FBEDEA; color: var(--down); }
.ftype.img { background: #ECE7FF; color: #6B4FD8; }
.ftype.doc { background: var(--sky); color: var(--blue); }
.fmain { flex: 1; min-width: 0; }
.fname { font-weight: 600; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.fname:hover { color: var(--blue); }
.fmeta { color: var(--muted); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.share { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.share.on { background: var(--mint); border-color: var(--mint-2); color: var(--navy); }
.share:disabled { cursor: default; }
.req { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--row); }
.sec-head + .req { border-top: 0; }
.req .rmain { flex: 1; min-width: 0; }
.req .t { font-weight: 600; }
td .ftype { width: 32px; height: 38px; font-size: 9px; }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; }
.modal-back { position: absolute; inset: 0; background: rgba(10, 18, 56, .22); backdrop-filter: blur(2px); animation: fade .12s; }
.modal { position: relative; width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); box-shadow: var(--lift-2), 0 0 0 1px var(--hair); animation: pop .16s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 4px 24px; }
.modal-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.modal-head .close { border: 1px solid var(--hair); background: var(--card); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.modal-body { padding: 14px 24px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; }
.linkbox { display: flex; gap: 8px; }
.linkbox .input { flex: 1; font-size: 13.5px; color: var(--ink-2); }
.sig-field { display: grid; grid-template-columns: 1fr 130px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.btn.ghost.sm.clear { width: auto; padding: 0 12px; margin-left: 2px; color: var(--blue); font-weight: 500; }
.btn.ghost.sm.clear:hover { background: var(--sky); color: var(--navy); }

/* state rules (repossession surplus by state) */
.rules-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--row); }
.rules-q { width: 340px; max-width: 100%; }
.rules-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rules-head, .rule summary { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 300px) 18px; gap: 14px; align-items: center; padding: 12px 20px; }
.rules-head { color: var(--muted); font-size: 12.5px; font-weight: 500; border-bottom: 1px solid var(--row); padding-right: 52px; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 300px); }
.rule { border-bottom: 1px solid var(--row); }
.rule summary { cursor: pointer; list-style: none; font-size: 14px; }
.rule summary::-webkit-details-marker { display: none; }
.rule summary:hover { background: #FAFAFB; }
.rule summary b { font-weight: 600; }
.rule summary > .ic { color: var(--faint); transition: transform .15s; }
.rule[open] summary { background: var(--bg); }
.rule[open] summary > .ic { transform: rotate(90deg); }
.rule-body { padding: 4px 20px 18px 214px; background: var(--bg); font-size: 14px; line-height: 1.55; }
.rule-body dl.kv { grid-template-columns: 190px minmax(0, 1fr); }
.warn-text { color: var(--amber); font-weight: 500; }
.state-law { border: 1px solid #CFE0F3; border-radius: 16px; padding: 14px 16px; background: #F7FAFE; }
@media (max-width: 860px) { .rules-head { display: none; } .rule summary { grid-template-columns: minmax(0, 1fr) 18px; } .rule summary > span { grid-column: 1; } .rule-body { padding-left: 20px; } .rule-body dl.kv { grid-template-columns: 1fr; } }

/* real-estate view: one more column, and the per-state blocks */
.rules-views { justify-self: start; }
.rules-re .rules-head { grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 280px); }
.rules-re .rule summary { grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 280px) 18px; }
.rules-re .rule-body { padding-left: 20px; }
.re-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.re-block { background: var(--card); border: 1px solid var(--hair); border-radius: 14px; padding: 14px 16px; }
.re-block h4 { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.re-block dl.kv { grid-template-columns: 130px minmax(0, 1fr) !important; font-size: 13.5px; }
.re-unv { margin-top: 14px; background: #FBEDEA; color: #8F2D1F; border-radius: 12px; padding: 12px 16px; font-size: 13.5px; }
.re-unv b { font-weight: 600; } .re-unv ul { margin: 6px 0 0; padding-left: 20px; } .re-unv li { margin: 3px 0; }
.unv-inline { color: var(--down); font-weight: 600; }
.state-law .re-block { margin-bottom: 10px; }
.state-law .re-unv { margin: 0 0 10px; }
@media (max-width: 1100px) { .re-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .rules-re .rule summary { grid-template-columns: minmax(0, 1fr) 18px; } .rules-re .rules-head { display: none; } }
.re-ent { margin-top: 14px; }
.guide-page { padding: 0 !important; }
.guide-frame { display: block; width: 100%; height: calc(100vh - 92px); border: 0; background: var(--card); }

/* ---------- pipeline: view switch and stage management ---------- */
.view-seg .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.ic.flip { transform: rotate(180deg); }
.kcol-head[draggable="true"] { cursor: grab; }
.kcol-head[draggable="true"]:active { cursor: grabbing; }
.kcol-head { border-top: 3px solid var(--c, transparent); border-radius: 18px 18px 0 0; }
.kcol-head .kname { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcol-head .kmenu { padding: 0 4px; height: 26px; margin-right: -6px; }
.kempty { color: var(--faint); font-size: 13px; text-align: center; padding: 18px 0; border: 1.5px dashed #D6DADF; border-radius: var(--r-md); }
.kadd { flex: 0 0 200px; height: 52px; border: 1.5px dashed #C9CED4; border-radius: 18px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.kadd:hover { border-color: var(--blue); color: var(--blue); background: var(--sky); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw span { display: block; width: 28px; height: 28px; border-radius: 8px; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sw input:checked + span { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.sw input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- case activity (audit trail) ---------- */
.composer-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.trail-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.trail-filters .chip { height: 30px; font-size: 13px; padding: 0 12px; }
.timeline .head .when-r { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.timeline .head .end { margin-left: 4px; }
.timeline .body.audit { margin-top: 5px; font-size: 13.5px; white-space: normal; }
.timeline .body.audit .arrow { color: var(--faint); }
.timeline .ico.change { background: var(--sunken); }
.timeline .ico.task { background: #E6F4EC; color: var(--up); }
.timeline .ico.document { background: #ECE7FF; color: #6B4FD8; }
.timeline .ico.update { background: var(--mint); color: var(--navy); }
.trail li { padding: 11px 0; }

/* ---------- contacts ---------- */
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.contacts-tbl { width: 1640px; table-layout: fixed; }
.contacts-tbl td { height: auto; padding-top: 12px; padding-bottom: 12px; vertical-align: top; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.contacts-tbl th:nth-child(1) { width: 280px; } .contacts-tbl th:nth-child(2) { width: 270px; } .contacts-tbl th:nth-child(3) { width: 250px; }
.contacts-tbl th:nth-child(4) { width: 260px; } .contacts-tbl th:nth-child(5) { width: 170px; } .contacts-tbl th:nth-child(6) { width: 190px; }
.contacts-tbl th:nth-child(7) { width: 220px; }
.contacts-tbl .badge { white-space: normal; line-height: 1.3; padding: 3px 8px; }
.contacts-tbl td a { color: var(--ink); text-decoration: none; }
.contacts-tbl td a:hover { color: var(--blue); text-decoration: underline; }
.sticky-col { position: sticky; left: 0; background: var(--card); z-index: 1; box-shadow: 1px 0 0 var(--row); }
.tbl tbody tr:hover .sticky-col { background: #FAFAFB; }
.owner-cell.editable { cursor: pointer; border-radius: 999px; padding: 2px 10px 2px 2px; margin-left: -2px; }
.owner-cell.editable:hover { background: var(--sunken); }

/* ---------- documents ---------- */
.docs-page { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; padding: 0 32px 56px; align-items: start; }
.doc-rail { position: sticky; top: 12px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--lift); padding: 10px; max-height: calc(100vh - 140px); overflow-y: auto; }
.rail-sec { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 6px; }
.rail-item { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink-2); padding: 7px 10px; border-radius: 10px; cursor: pointer; text-align: left; }
.rail-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item i { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-item:hover { background: var(--menu-hover); }
.rail-item.on { background: var(--mint); color: var(--navy); font-weight: 600; }
.rail-item .ic { color: var(--menu-ic); }
.tdot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; display: inline-block; }
.doc-main { min-width: 0; }
.doc-toolbar { padding: 0 0 14px; }
.doc-expand { display: flex; gap: 4px; justify-content: flex-end; margin: 0 0 8px; }
.rail-item span.tdot { flex: none; }
.doc-group { background: var(--card); border: 1px solid var(--hair); border-radius: 16px; box-shadow: var(--lift); margin-bottom: 10px; overflow: hidden; }
.doc-ghead { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; flex-wrap: wrap; }
.doc-ghead .caret { color: var(--faint); display: grid; transition: transform .15s; }
.doc-group.collapsed .doc-ghead .caret { transform: rotate(-90deg); }
.doc-ghead .count { color: var(--muted); font-size: 12.5px; font-weight: 500; background: var(--seg); border-radius: 999px; padding: 0 9px; line-height: 22px; }
.doc-ghead .grow { flex: 1; }
.doc-tbl { width: 100%; min-width: 820px; }
.doc-tbl td { height: 50px; padding-top: 6px; padding-bottom: 6px; }
.doc-tbl .doc-name { width: 40%; }
.doc-tbl .fname { color: var(--ink); text-decoration: none; font-weight: 500; white-space: normal; }
.doc-tbl .fname:hover { color: var(--blue); text-decoration: underline; }
.doc-tbl td a { color: var(--ink); text-decoration: none; }
.type-pill { --c: #C4C4C4; border: 0; border-radius: 999px; height: 26px; padding: 0 11px; font: inherit; font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  background: color-mix(in srgb, var(--c) 16%, white); color: color-mix(in srgb, var(--c) 70%, #101821); }
.type-pill.none { background: none; border: 1px dashed #C9CED4; color: var(--faint); }
.type-pill:disabled { cursor: default; }
.doc-more { text-align: center; padding: 10px 0 20px; }
.sec-title { font-weight: 600; font-size: 15px; margin: 4px 2px 10px; }
@media (max-width: 900px) {
  .docs-page { grid-template-columns: 1fr; padding: 0 16px 40px; }
  .doc-rail { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .rail-sec { width: 100%; padding: 6px 6px 2px; }
  .rail-item { width: auto; }
  .rail-item span { overflow: visible; }
}

/* ---------- task board (Monday-style) ---------- */
.task-board { padding-bottom: 80px; }
.tgroup { margin-bottom: 30px; }
.tg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tg-head h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--g); letter-spacing: -.01em; padding: 2px 6px; border-radius: 8px; }
.tg-head h2.editable { cursor: pointer; }
.tg-head h2.editable:hover { background: var(--sunken); }
.tg-caret { border: 0; background: none; color: var(--g); display: grid; cursor: pointer; padding: 2px; transition: transform .15s; }
.tg-caret.collapsed { transform: rotate(-90deg); }
.tgroup .hscroll { border-left: 6px solid var(--g); border-radius: 10px 0 0 10px; background: var(--card); box-shadow: var(--lift); }
.ttable { border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.ttable th { font-weight: 500; color: var(--ink-2); font-size: 13.5px; text-align: center; padding: 9px 8px; border: 1px solid var(--line); border-top: 0; background: var(--card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttable th.editable { cursor: pointer; }
.ttable th.editable:hover { background: var(--sunken); }
.ttable th .ic { width: 12px; height: 12px; vertical-align: -1px; color: var(--faint); }
.ttable th.ttitle { text-align: left; padding-left: 14px; }
.ttable td { border: 1px solid var(--line); height: 40px; padding: 0 6px; text-align: center; vertical-align: middle; background: var(--card); overflow: hidden; }
.ttable tbody tr:hover td { background: #F5F6F8; }
.ttable tr.selected td { background: var(--sky); }
.ttable tr.done .cell-input.title { color: var(--muted); text-decoration: line-through; }
.ttable .tsel { width: 40px; text-align: center; position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.ttable .ttitle { text-align: left; position: sticky; left: 39px; z-index: 2; padding: 0 4px 0 8px; box-shadow: 1px 0 0 var(--line); }
.tt-in { display: flex; align-items: center; gap: 2px; }
.ttable .tadd { width: 48px; }
.ttable td.tc-status, .ttable td.tc-prio, .ttable td.tc-c { padding: 0; }
.cell-input { width: 100%; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--ink); text-align: inherit; }
.cell-input:hover { border-color: var(--line); }
.cell-input:focus { outline: none; border-color: var(--blue); background: var(--card); }
.cell-input.num { text-align: right; }
.tt-in .cell-input, .tnew-form .cell-input { flex: 1; min-width: 0; text-align: left; }
.tnote { opacity: 0; padding: 0 5px; height: 26px; flex: none; }
.tnote.has { opacity: 1; color: var(--blue); }
.ttable tr:hover .tnote { opacity: 1; }
.cell-label { --c: #C4C4C4; width: 100%; height: 39px; border: 0; background: var(--c); color: #fff; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; display: grid; place-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.cell-label.empty { background: #E4E6E9; }
.cell-label:hover:not(:disabled) { filter: brightness(.94); }
.cell-label:disabled { cursor: default; }
.menu .cell-label { height: 30px; border-radius: 6px; min-width: 150px; }
.cell-date { width: 100%; max-width: 118px; height: 28px; border: 0; border-radius: 999px; background: #E4E6E9; color: transparent; font: inherit; font-size: 13px; text-align: center; padding: 0 8px; cursor: pointer; }
.cell-date.set { background: var(--blue); color: #fff; font-weight: 500; }
.cell-date.set.overdue { background: var(--down); color: #fff !important; }
.cell-date.set.today { background: #D99A06; color: #fff !important; }
.cell-date::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.cell-date { position: relative; }
.cell-date:not(.set):hover { background: #D6D9DD; }
.cell-click { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; min-width: 40px; min-height: 32px; border-radius: 8px; }
.cell-click:hover { background: var(--sunken); }
.avatar.ghost { background: none; border: 1.5px solid #C9CED4; color: #A9B0B7; }
.avatar.ghost .ic { width: 15px; height: 15px; }
.avatar.more { background: var(--seg); color: var(--muted); }
.av-stack { display: inline-flex; }
.av-stack .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.clip-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.ttable td.tc-case { text-align: left; padding: 3px 10px; line-height: 1.3; }
.ttable td.tc-case a { color: var(--ink); text-decoration: none; font-size: 13.5px; }
.ttable td.tc-case a:hover { color: var(--blue); }
.ttable td.tc-address { text-align: left; padding: 0 10px; white-space: nowrap; text-overflow: ellipsis; }
.cell-link { display: flex; align-items: center; gap: 2px; justify-content: center; font-size: 13px; }
.tnew td { background: var(--card); }
.tnew .ttitle { box-shadow: none; }
.tnew-form { flex: 1; }
.tnew .cell-input { color: var(--muted); }
.ttable tfoot td { border: 0; background: transparent; height: 38px; padding: 4px 6px; }
.ttable tfoot tr td:nth-child(n+3) { border-bottom: 1px solid var(--line); }
.sum-bar { display: flex; height: 24px; border-radius: 3px; overflow: hidden; }
.sum-bar span { display: block; }
.sum-range { display: inline-block; background: var(--blue); color: #fff; border-radius: 999px; padding: 0 12px; font-size: 12.5px; line-height: 24px; white-space: nowrap; }
.sum-range.empty { background: #E4E6E9; color: transparent; min-width: 80px; }
.label-row { display: grid; grid-template-columns: 64px 1fr 34px; gap: 8px; margin-bottom: 8px; }
.label-row select { color: var(--c); font-size: 18px; }
.check-list { display: grid; gap: 10px; max-height: 340px; overflow-y: auto; }
.check-list .checkbox { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) { .ttable .ttitle { position: static; } .ttable .tsel { position: static; } }
@media (max-width: 900px) { .doc-toolbar .seg { flex-wrap: wrap; } .doc-toolbar .groupby { flex-wrap: wrap; } }

/* Brand: heavy, tight page titles (Plus Jakarta Sans 800), like the website. */
.page-head h1, .card h2 { font-weight: 800; letter-spacing: -.035em; }

/* Pipeline table: every cell keeps its text inside its own column. */
.tbl td { overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.tbl .name-cell .n { min-width: 0; }
.tbl .name-cell .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tbl .name-cell .n .badge { flex: none; }
.tbl td .clip, .tbl td .small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.tbl input[type=date] { max-width: 140px; }
/* Confirmation window */
.confirm-msg { margin: 0 0 6px; color: var(--ink-2); line-height: 1.55; }
.btn.danger-solid { background: var(--down); border-color: var(--down); color: #fff; }
.btn.danger-solid:hover { background: #A93A2E; border-color: #A93A2E; color: #fff; }
