/* CRM records: companies, contacts, company / contact / deal pages, tasks. Everything prefixed crmrec-. */

/* ---------- list pages ---------- */
.crmrec-chiprow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crmrec-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crmrec-sep { width: 1px; height: 22px; background: var(--line); }
.crmrec-sel { width: auto; min-width: 190px; }
.crmrec-count { font-size: 13px; color: var(--ink-3); margin: 0 0 10px; font-weight: 600; }
.crmrec-cname { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.crmrec-cname:hover b { color: var(--brand); text-decoration: underline; }
.crmrec-owner { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.crmrec-gap { height: 14px; }
.crmrec-center { display: flex; justify-content: center; padding-top: 6px; }
.crmrec-mark { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(127, 197, 204, .16); color: var(--band-eyebrow); font: 700 20px var(--f-head); letter-spacing: .02em; flex: none; border: 1px solid rgba(127, 197, 204, .3); }
.crmrec-mark svg { width: 24px; height: 24px; }
.crmrec-mark.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; background: var(--brand-soft); color: var(--brand); border: 0; }

/* icons inside module pieces (base only sizes svg inside .btn, .ti, .empty) */
.crmrec-banner > svg, .crmrec-ctx svg, .crmrec-warn svg, .crmrec-url svg, .crmrec-edit svg, .crmrec-check svg, .crmrec-bub svg, .card-h h2 > svg, .crmrec-nx .avatar svg, .crmrec-cname svg { width: 16px; height: 16px; flex: none; }

/* ---------- hero ---------- */
.crmrec-hero { padding: 22px 24px 20px; display: grid; gap: 18px; }
.crmrec-hero::after { content: ""; position: absolute; right: -80px; top: -90px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(127, 197, 204, .16), transparent 68%); pointer-events: none; }
.crmrec-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; position: relative; z-index: 1; }
.crmrec-id { display: flex; gap: 16px; align-items: center; min-width: 0; }
.crmrec-id .avatar.lg { width: 56px; height: 56px; font-size: 20px; flex: none; }
.crmrec-idt { display: grid; gap: 5px; min-width: 0; }
.crmrec-hero .eyebrow { font: 700 11.5px var(--f-num); letter-spacing: .12em; text-transform: uppercase; }
.crmrec-hero h1 { font: 700 34px/1.04 var(--f-head); letter-spacing: -.005em; color: #fff; overflow-wrap: anywhere; }
.crmrec-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.crmrec-hero .badge { background: rgba(255, 255, 255, .12); color: var(--band-ink); }
.crmrec-hero .badge.ok { background: rgba(120, 214, 156, .2); color: #9fe0b5; }
.crmrec-hero .badge.warn { background: rgba(240, 190, 90, .2); color: #f1cf8c; }
.crmrec-hero .badge.bad { background: rgba(255, 140, 120, .2); color: #ffb4a8; }
.crmrec-hero .badge.quar { background: rgba(190, 150, 240, .22); color: #d9c3f5; }
.crmrec-hero .badge.info, .crmrec-hero .badge.brand { background: rgba(127, 197, 204, .2); color: #a9dde2; }
.crmrec-sub { color: var(--band-muted); font-size: 14.5px; }
.crmrec-sub a { color: var(--band-eyebrow); }
.crmrec-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; position: relative; z-index: 1; }
.crmrec-hero .btn { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .26); color: #fff; }
.crmrec-hero .btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .5); }
.crmrec-hero .btn.primary { background: var(--band-eyebrow); border-color: var(--band-eyebrow); color: var(--band); }
.crmrec-hero .btn.primary:hover { background: #a5dde2; border-color: #a5dde2; }
.crmrec-disabled, .crmrec-hero .btn.crmrec-disabled { opacity: .5; cursor: not-allowed; }
.crmrec-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 24px; margin: 0; padding-top: 16px; border-top: 1px solid var(--band-rule); position: relative; z-index: 1; }
.crmrec-facts dt { font: 700 11px var(--f-num); letter-spacing: .1em; text-transform: uppercase; color: var(--band-eyebrow); opacity: .9; margin-bottom: 4px; }
.crmrec-facts dd { margin: 0; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.crmrec-facts a { color: var(--band-eyebrow); }
.crmrec-big { font: 700 30px/1 var(--f-head); letter-spacing: -.01em; }
.crmrec-edit { display: inline-flex; align-items: center; gap: 7px; border: 1px dashed rgba(255, 255, 255, .28); background: transparent; color: inherit; border-radius: 8px; padding: 3px 8px; font: inherit; cursor: pointer; min-height: 30px; }
.crmrec-edit:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .6); }
.crmrec-edit svg { width: 14px; height: 14px; opacity: .7; }
.crmrec-hero .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .18); }
.crmrec-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid; flex-wrap: wrap; }
.crmrec-banner > svg { width: 22px; height: 22px; }
.crmrec-banner .body { flex: 1; min-width: 200px; }
.crmrec-banner.bad { background: var(--bad-soft); border-color: #e9bdb6; color: #6e2118; }
.crmrec-banner.bad > svg { color: var(--bad); }
.crmrec-banner.ok { background: var(--ok-soft); border-color: #b5dcc3; color: #1b4a2f; }
.crmrec-banner.ok > svg { color: var(--ok); }
.crmrec-banner a:not(.btn) { color: inherit; text-decoration: underline; font-weight: 600; }

/* KPI links */
.crmrec-kl { text-decoration: none; color: inherit; }
.crmrec-kl:hover { border-color: var(--brand); text-decoration: none; }
.crmrec-of { font-size: 18px; color: var(--ink-3); }

/* ---------- details ---------- */
.crmrec-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin: 0; }
.crmrec-dl.two { gap: 10px 16px; }
.crmrec-dl > div { min-width: 0; }
.crmrec-dl .wide { grid-column: 1 / -1; }
.crmrec-dl dt { font: 700 11px var(--f-num); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.crmrec-dl dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.crmrec-h { font: 700 11px var(--f-num); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.crmrec-ctx { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 10px; }
.crmrec-ctx svg { color: var(--brand); }
.crmrec-warn { display: flex; gap: 10px; background: var(--warn-soft); color: var(--warn); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13.5px; }
.crmrec-warn svg { width: 18px; height: 18px; }
.crmrec-url { display: flex; align-items: center; gap: 9px; width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 14px; cursor: pointer; color: var(--ink); text-align: left; }
.crmrec-url:hover { border-color: var(--brand); }
.crmrec-url svg { color: var(--brand); }
.crmrec-url svg:last-child { margin-left: auto; color: var(--ink-3); }
.crmrec-url b { font: 600 14px var(--f-num); overflow-wrap: anywhere; }
.crmrec-demo { display: flex; gap: 12px; align-items: center; }
.crmrec-date { width: 48px; height: 52px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; align-content: center; font: 700 11px var(--f-num); text-transform: uppercase; letter-spacing: .06em; flex: none; line-height: 1.1; }
.crmrec-date b { font: 700 22px/1 var(--f-head); }
.card-h h2 > svg { vertical-align: -3px; margin-right: 4px; color: var(--brand); }

/* ---------- timelines ---------- */
.crmrec-tl .crmrec-li { padding-bottom: 18px; }
.crmrec-t-email, .crmrec-t-sms { background: var(--brand-soft) !important; color: var(--brand) !important; }
.crmrec-t-call, .crmrec-t-meeting { background: #e6eef9 !important; color: #2d5a99 !important; }
.crmrec-t-note { background: var(--surface-3) !important; color: var(--ink-2) !important; }
.crmrec-t-demo { background: var(--quar-soft) !important; color: var(--quar) !important; }
.crmrec-t-stage { background: var(--ok-soft) !important; color: var(--ok) !important; }
.crmrec-t-issue { background: var(--bad-soft) !important; color: var(--bad) !important; }
.crmrec-t-campaign { background: var(--warn-soft) !important; color: var(--warn) !important; }
.crmrec-quote { margin: 5px 0 4px; padding: 9px 12px; border-radius: 4px 12px 12px 12px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line-2); max-width: 640px; white-space: pre-line; overflow-wrap: anywhere; }
.crmrec-quote.out { background: var(--brand-tint); border-color: #cfe3e5; border-radius: 12px 4px 12px 12px; }
.crmrec-quote .tm { margin-top: 4px; }
.crmrec-msgs { display: grid; gap: 8px; }
.crmrec-note { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); display: grid; gap: 8px; }
.crmrec-note header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crmrec-note p { font-size: 14.5px; line-height: 1.5; }

/* ---------- consent ---------- */
.crmrec-crow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.crmrec-crow .k { font: 700 11px var(--f-num); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }

/* ---------- tasks ---------- */
.crmrec-check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ctl-line); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; color: transparent; transition: background .12s, border-color .12s; position: relative; }
.crmrec-check::after { content: ""; position: absolute; inset: -9px; }
.crmrec-check svg { width: 15px; height: 15px; stroke-width: 3; }
.crmrec-check:hover { border-color: var(--brand); color: var(--brand-soft); background: var(--brand-tint); }
.crmrec-check[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.crmrec-task { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.crmrec-task:last-child { border-bottom: 0; }
.crmrec-task .body { min-width: 0; flex: 1; }
.crmrec-tt { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.crmrec-task.done .crmrec-tt, .crmrec-trow.done .crmrec-tt { text-decoration: line-through; color: var(--ink-3); font-weight: 500; }
.crmrec-late { color: var(--bad); font-weight: 600; }
.crmrec-tasks { display: grid; }
.crmrec-trow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line-2); }
.crmrec-trow:last-child { border-bottom: 0; }
.crmrec-trow:hover { background: var(--brand-tint); }
.crmrec-tmain { min-width: 0; display: grid; gap: 2px; }
.crmrec-tmeta { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.crmrec-group .card-h { padding-bottom: 2px; }

/* ---------- deal page ---------- */
.crmrec-trackcard .card-b { padding: 18px 12px 12px; }
.crmrec-trackwrap { overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.crmrec-trackwrap::-webkit-scrollbar { display: none; }
.crmrec-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 600px; }
.crmrec-step { position: relative; display: flex; justify-content: center; }
.crmrec-step::before { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.crmrec-step:first-child::before { display: none; }
.crmrec-step.reached::before { background: var(--brand); }
.crmrec-step button { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 0 4px; cursor: pointer; font: inherit; color: var(--ink-2); width: 100%; }
.crmrec-step button:disabled { cursor: default; }
.crmrec-bub { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--ctl-line); font: 700 14px var(--f-num); color: var(--ink-3); transition: transform .12s, box-shadow .12s; }
.crmrec-bub svg { width: 17px; height: 17px; stroke-width: 3; }
.crmrec-step.done .crmrec-bub { background: var(--brand); border-color: var(--brand); color: #fff; }
.crmrec-step.current .crmrec-bub { background: var(--surface); border-color: var(--brand); border-width: 3px; color: var(--brand); box-shadow: 0 0 0 5px rgba(31, 92, 99, .16); }
.crmrec-step.current.won .crmrec-bub { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 0 0 5px rgba(44, 122, 75, .2); }
.crmrec-step button:not(:disabled):hover .crmrec-bub { transform: scale(1.08); border-color: var(--brand); }
.crmrec-step button:focus-visible { outline-offset: 0; border-radius: 10px; }
.crmrec-sl { font: 600 13px/1.2 var(--f-semi); text-align: center; color: var(--ink-2); }
.crmrec-step.current .crmrec-sl { color: var(--ink); font-weight: 700; }
.crmrec-sd { font: 500 11.5px var(--f-num); color: var(--ink-3); min-height: 1em; }
.crmrec-hint { text-align: center; margin-top: 4px; }
.crmrec-nx { display: flex; gap: 12px; align-items: flex-start; }
.crmrec-nx .body { min-width: 0; display: grid; gap: 2px; }
.crmrec-interests { display: grid; gap: 6px; }
.crmrec-interests > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.crmrec-interests > div:last-child { border-bottom: 0; }
.crmrec-dots { display: inline-flex; gap: 4px; flex: none; }
.crmrec-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--ctl-line); }
.crmrec-dots i.on { background: var(--brand); border-color: var(--brand); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .crmrec-hero { padding: 18px 16px 16px; gap: 14px; }
  .crmrec-hero h1 { font-size: 28px; }
  .crmrec-id .avatar.lg, .crmrec-mark { width: 46px; height: 46px; }
  .crmrec-actions { justify-content: flex-start; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crmrec-actions .btn { min-height: 42px; width: 100%; }
  .crmrec-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .crmrec-dl { grid-template-columns: minmax(0, 1fr); }
  .crmrec-dl.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crmrec-sel { width: 100%; }
  .crmrec-trow { grid-template-columns: auto minmax(0, 1fr); }
  .crmrec-tmeta { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .crmrec-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
  .crmrec-chips::-webkit-scrollbar { display: none; }
  .crmrec-chips .chip { flex: none; min-height: 38px; }
  .crmrec-chiprow { gap: 6px; width: 100%; }
  .crmrec-sep { display: none; }
  .tb .tb-search { flex: 1 1 100%; }
  .page > .tb { min-width: 0; max-width: 100%; }
  .tb > [data-chips] { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  .crmrec-big { font-size: 26px; }
  .crmrec-trackcard .card-b { padding: 14px 6px 10px; }
  .crmrec-check { width: 28px; height: 28px; }
}
