/* Layout and components for the attorney and admin portals. */
body { font-size: 14.5px; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 60px; background: var(--evergreen); color: #fff; position: sticky; top: 0; z-index: 20; }
@media (prefers-color-scheme: dark) { .topbar { background: #0B120F; border-bottom: 1px solid var(--line); } }
.brand { font: 600 19px var(--serif); color: inherit; text-decoration: none; white-space: nowrap; }
.brand small { font: 500 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-left: 8px; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { color: rgba(255,255,255,.78); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 500; white-space: nowrap; }
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 13px; white-space: nowrap; }
.topbar .credits { background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.topbar button { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
main.wrap { max-width: 1320px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h2 { font-size: 18px; margin: 0 0 12px; }
.card h3 { font: 600 14px var(--sans); margin: 0 0 10px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font: 600 26px/1.1 var(--serif); }
.kpi .k { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi .sub { color: var(--faint); font-size: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--field); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--field); color: var(--ink); white-space: nowrap; margin: 0 4px 4px 0; }
.chip.brass { background: var(--brass-soft); color: var(--warn); }
.chip.green { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.chip.red { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.status { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; text-transform: capitalize; white-space: nowrap; }
.s-sold, .s-complete, .s-won, .s-leading { color: var(--good); }
.s-listed, .s-open, .s-texting, .s-calling, .s-on_call { color: var(--evergreen-2); }
.s-needs_review, .s-unsold, .s-outbid, .s-scheduled { color: var(--warn); }
.s-disqualified, .s-opted_out, .s-error, .s-cancelled, .s-lost { color: var(--bad); }
.s-no_reply, .s-unreachable, .s-new, .s-call_ended { color: var(--muted); }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.field { margin-bottom: 14px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
pre.box { white-space: pre-wrap; font: 13px/1.55 var(--sans); background: var(--field); padding: 10px 12px; border-radius: 6px; max-height: 300px; overflow: auto; margin: 8px 0 0; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0; transition: .2s; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-weight: 500; z-index: 100; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); color: #fff; }
dialog { border: 0; border-radius: 12px; padding: 0; max-width: 520px; width: calc(100% - 32px); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 20, 16, .45); }
dialog .dlg-head { padding: 18px 22px 0; } dialog .dlg-head h2 { margin: 0; font-size: 21px; }
dialog .dlg-body { padding: 14px 22px; } dialog .dlg-foot { padding: 0 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.drawer { position: fixed; top: 60px; right: 0; bottom: 0; width: min(880px, 100%); background: var(--paper); border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0,0,0,.12); overflow: auto; z-index: 15; padding: 22px 26px 60px; transform: translateX(100%); transition: transform .2s ease; }
.drawer.open { transform: none; }
.drawer .close { position: sticky; top: 0; float: right; }
.thread { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.bubble { max-width: 85%; padding: 7px 11px; border-radius: 12px; white-space: pre-wrap; font-size: 13.5px; }
.bubble.out { align-self: flex-end; background: var(--evergreen); color: var(--on-primary); border-bottom-right-radius: 3px; }
.bubble.in { align-self: flex-start; background: var(--field); border-bottom-left-radius: 3px; }
.flag { margin: 0 0 6px; padding: 7px 10px; border-left: 3px solid var(--bad); background: var(--field); border-radius: 0 6px 6px 0; font-size: 13px; }
.auth { max-width: 460px; margin: 60px auto; }
.auth .card { padding: 28px 30px; }
.auth h1 { font-size: 30px; margin: 0 0 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--evergreen); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; margin: 0; cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--evergreen); background: color-mix(in srgb, var(--evergreen) 10%, transparent); }
.checks input { accent-color: var(--evergreen); margin: 0; }
.bar-chart { display: flex; align-items: end; gap: 3px; height: 150px; padding-top: 8px; }
.bar-chart .b { flex: 1; background: var(--line-strong); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.bar-chart .b i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--evergreen); border-radius: 3px 3px 0 0; }
.bar-chart .b:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); font-size: 11px; padding: 3px 7px; border-radius: 4px; white-space: nowrap; margin-bottom: 4px; z-index: 2; }
.hbar { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.hbar .track { height: 10px; background: var(--field); border-radius: 5px; overflow: hidden; } .hbar .fill { height: 100%; background: var(--evergreen); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
