/* ============================================================
   Sellution — modules 8
   Contacts (list + detail) · Deals · Contracts & Agreements
   ============================================================ */

/* ---------- CRM stage: compact layout, component-forward ---------- */
.crm-stage > section { border-top: 0 !important; }
.crm-stage .section-pad { padding: 26px 0 38px; }
.crm-stage .wrap { max-width: 1200px; }
.crm-stage .demo-head { margin-bottom: 16px; }
.crm-stage .sec-head { border-left: 3px solid var(--accent); padding-left: 16px; max-width: 760px; }
.crm-stage .demo-tag { margin-bottom: 4px; }
.crm-stage .sec-title { font-size: clamp(1.4rem, 2vw, 1.85rem) !important; line-height: 1.12; margin-top: 8px !important; }
.crm-stage .sec-sub { font-size: 0.9rem !important; line-height: 1.5; margin-top: 7px; }
.crm-stage .demo-frame { margin-top: 4px; }
@media (min-width: 1000px) {
  .crm-stage .ct-host, .crm-stage .ib, .crm-stage .pay, .crm-stage .aml,
  .crm-stage .bk, .crm-stage .cal, .crm-stage .wa, .crm-stage .growth,
  .crm-stage .agx-host, .crm-stage .dl-host, .crm-stage .ct-host { min-height: 520px; }
}

/* ---------- CRM area section switcher (sticky sidebar) ---------- */
.crm-shell { display: grid; grid-template-columns: 264px 1fr; }
.crm-side { background: linear-gradient(180deg, #0d1a30, #16284a); border-right: 1px solid rgba(255,255,255,0.08); }
.crm-side-inner { position: sticky; top: 70px; padding: 22px 16px; display: flex; flex-direction: column; gap: 5px; max-height: calc(100vh - 70px); overflow-y: auto; scrollbar-width: thin; }
.crm-side-h { padding: 0 8px 12px; }
.crm-side-eyebrow { display: block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2); }
.crm-side-sub { display: block; font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-top: 3px; }
.crm-nav { display: flex; flex-direction: column; gap: 4px; }
.crm-nv { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: none; cursor: pointer; padding: 10px 11px; border-radius: 11px; transition: background 0.16s, transform 0.16s; overflow: hidden; }
.crm-nv:hover { background: rgba(255,255,255,0.06); }
.crm-nv.on { background: rgba(255,255,255,0.1); }
.crm-nv.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.crm-nv-ic { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); display: grid; place-items: center; transition: all 0.16s; }
.crm-nv-ic svg { width: 18px; height: 18px; }
.crm-nv.on .crm-nv-ic { background: var(--accent); color: #1a1205; }
.crm-nv-tx { flex: 1; min-width: 0; }
.crm-nv-t { display: block; font-weight: 700; font-size: 0.9rem; color: rgba(255,255,255,0.92); letter-spacing: -0.01em; }
.crm-nv-d { display: block; font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-nv.on .crm-nv-t { color: #fff; }
.crm-nv-ar { color: rgba(255,255,255,0.25); flex-shrink: 0; opacity: 0; transform: translateX(-4px); transition: all 0.16s; }
.crm-nv-ar svg { width: 15px; height: 15px; }
.crm-nv:hover .crm-nv-ar, .crm-nv.on .crm-nv-ar { opacity: 1; transform: translateX(0); }
.crm-nv.on .crm-nv-ar { color: var(--accent-2); }
.crm-stage { min-width: 0; }
.crm-stage > section { scroll-margin-top: 70px; }

/* CRM sub-tab strip (level 2) */
.crm-subnav { position: sticky; top: 56px; z-index: 9; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crm-sub-inner { display: flex; gap: 4px; padding: 10px 28px; max-width: 1200px; margin: 0 auto; overflow-x: auto; scrollbar-width: thin; }
.crm-sub { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; color: var(--muted); padding: 8px 16px; border-radius: 999px; white-space: nowrap; transition: all 0.14s; }
.crm-sub:hover { color: var(--ink); border-color: var(--line-2); }
.crm-sub.on { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 900px) { .crm-subnav { top: 110px; } .crm-sub-inner { padding: 9px 16px; } }

@media (max-width: 900px) {
  .crm-shell { grid-template-columns: 1fr; }
  .crm-side { position: sticky; top: 56px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.1); z-index: 20; }
  .crm-side-inner { position: static; flex-direction: row; gap: 8px; padding: 12px 14px; overflow-x: auto; max-height: none; }
  .crm-side-h { display: none; }
  .crm-nav { flex-direction: row; gap: 8px; }
  .crm-nv { flex-direction: column; gap: 6px; min-width: 96px; padding: 11px 9px; text-align: center; }
  .crm-nv.on::before { display: none; }
  .crm-nv-d, .crm-nv-ar { display: none; }
  .crm-nv-t { font-size: 0.76rem; }
}
@media (prefers-reduced-motion: reduce) { .crm-nv, .crm-nv-ic, .crm-nv-ar { transition: none; } }

/* ---------- shared bits ---------- */
.ct-host, .dl-host, .agx-host { display: block; }
.ct-av { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; flex-shrink: 0; }
.ct-av.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 1.05rem; }
.ct-stage { font-style: normal; font-size: 0.7rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ct-stage.client { background: var(--ok-soft); color: var(--ok); }
.ct-stage.opportunity { background: var(--primary-soft); color: var(--primary); }
.ct-stage.lead { background: var(--accent-soft); color: var(--gold); }

/* ---------- contacts: list ---------- */
.ct-list { display: flex; flex-direction: column; }
.ct-list-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.ct-view-toggle { display: inline-flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.ct-view-toggle button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.8rem; color: var(--muted); padding: 7px 12px; border-radius: 7px; }
.ct-view-toggle button svg { width: 14px; height: 14px; }
.ct-view-toggle button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.ct-count { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted-2); }
.ct-saved { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); flex-wrap: wrap; }
.ct-saved-btn { border: 1px solid var(--line); background: #fff; cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; color: var(--muted); padding: 6px 13px; border-radius: 999px; }
.ct-saved-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ct-search { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; font-size: 0.8rem; color: var(--muted-2); }
.ct-search svg { width: 14px; height: 14px; }
.ct-table { background: #fff; }
.ct-row { display: grid; grid-template-columns: 2.4fr 1fr 1.1fr 1.1fr 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 13px 18px; cursor: pointer; transition: background 0.14s; font-size: 0.86rem; color: var(--body); }
.ct-row:not(.head):hover { background: var(--primary-soft); }
.ct-row.head { background: var(--bg-2); font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); cursor: default; }
.ct-name { display: flex; align-items: center; gap: 11px; }
.ct-name b { color: var(--ink); font-size: 0.9rem; }
.ct-name em { display: block; font-style: normal; font-size: 0.74rem; color: var(--muted); }
.ct-owner { color: var(--muted); }
.ct-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.ct-last { font-size: 0.78rem; color: var(--muted-2); }
@media (max-width: 760px) { .ct-row { grid-template-columns: 2fr 1fr 1fr; } .ct-row span:nth-child(3), .ct-row span:nth-child(5) { display: none; } }

/* ---------- contacts: detail ---------- */
.cd { display: flex; flex-direction: column; }
.cd-head { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.ct-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; color: var(--muted); padding: 0; }
.ct-back svg { width: 15px; height: 15px; }
.ct-back:hover { color: var(--primary); }
.cd-id { display: flex; align-items: center; gap: 14px; }
.cd-id h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--ink); letter-spacing: -0.02em; }
.cd-sub { font-size: 0.82rem; color: var(--muted); }
.cd-headstats { margin-left: auto; display: flex; gap: 24px; }
.cd-headstats span { display: flex; flex-direction: column; }
.cd-headstats em { font-style: normal; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.cd-headstats b { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
@media (max-width: 620px) { .cd-headstats { display: none; } }
.cd-body { display: grid; grid-template-columns: 1fr 240px; min-height: 360px; }
@media (max-width: 820px) { .cd-body { grid-template-columns: 1fr; } }
.cd-main { padding: 18px 20px; border-right: 1px solid var(--line); }
.cd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.cd-tab { border: 0; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.84rem; color: var(--muted); padding: 9px 4px; margin-right: 12px; border-bottom: 2px solid transparent; }
.cd-tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.cd-tlfilter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cd-tlf { border: 1px solid var(--line); background: #fff; cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 0.74rem; color: var(--muted); padding: 5px 11px; border-radius: 999px; }
.cd-tlf.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cd-tlfeed { display: flex; flex-direction: column; gap: 12px; }
.cd-tl { display: flex; gap: 12px; }
.cd-tl-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.cd-tl-ic svg { width: 16px; height: 16px; }
.cd-tl-b { flex: 1; min-width: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cd-tl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cd-tl-top b { font-size: 0.86rem; color: var(--ink); }
.cd-tl-top em { font-style: normal; font-size: 0.72rem; color: var(--muted-2); }
.cd-tl-b p { margin: 3px 0 0; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.cd-empty { padding: 30px; text-align: center; color: var(--muted-2); font-size: 0.84rem; background: var(--bg-2); border-radius: 11px; }

.cd-info { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .cd-info { grid-template-columns: 1fr; } }
.cd-field { display: flex; gap: 11px; align-items: center; }
.cd-field-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-2); color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.cd-field-ic svg { width: 16px; height: 16px; }
.cd-field-lbl { display: block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.cd-field-val { font-size: 0.88rem; color: var(--ink); font-weight: 600; }

.cd-port-sum { display: flex; gap: 28px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.cd-port-sum span { font-size: 0.74rem; color: var(--muted); }
.cd-port-sum b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); font-weight: 800; margin-top: 2px; }
.cd-hold { display: grid; grid-template-columns: 2fr 0.6fr 1fr 1fr 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.84rem; color: var(--body); font-variant-numeric: tabular-nums; }
.cd-hold span:not(.cd-hold-n) { text-align: right; }
.cd-hold.head { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2); }
.cd-hold-n { color: var(--ink); font-weight: 600; }
.pos { color: var(--ok); } .neg { color: #d4533a; }

.cd-aml-status { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: 13px; margin-bottom: 14px; }
.cd-aml-status.ok { background: var(--ok-soft); color: var(--ok); }
.cd-aml-status.warn { background: var(--accent-soft); color: var(--gold); }
.cd-aml-status.muted { background: var(--bg-2); color: var(--muted); }
.cd-aml-status svg { width: 24px; height: 24px; flex-shrink: 0; }
.cd-aml-status b { font-size: 0.95rem; }
.cd-aml-status span { display: block; font-size: 0.78rem; opacity: 0.85; margin-top: 1px; }
.cd-aml-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cd-aml-chip { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font-size: 0.84rem; color: var(--muted); }
.cd-aml-chip b { font-weight: 700; } .cd-aml-chip b.ok { color: var(--ok); } .cd-aml-chip b.warn { color: var(--gold); } .cd-aml-chip b.muted { color: var(--muted-2); }
.cd-aml-run { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--primary); color: #fff; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.84rem; padding: 10px 16px; border-radius: 9px; }
.cd-aml-run svg { width: 15px; height: 15px; }

.cd-rail { padding: 18px; background: var(--bg-2); }
.cd-rail-h { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 12px; }
.cd-rail-row { display: flex; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cd-rail-ic { width: 30px; height: 30px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.cd-rail-ic svg { width: 15px; height: 15px; }
.cd-rail-lbl { display: block; font-size: 0.78rem; color: var(--muted); }
.cd-rail-val { font-size: 0.84rem; color: var(--ink); font-weight: 600; }

/* ---------- deals ---------- */
.dl { display: flex; flex-direction: column; }
.dl-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.dl-view { display: inline-flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.dl-vb { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.8rem; color: var(--muted); padding: 7px 12px; border-radius: 7px; }
.dl-vb svg { width: 14px; height: 14px; }
.dl-vb.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.dl-total { font-size: 0.82rem; color: var(--muted); } .dl-total b { color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
.dl-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 16px; overflow-x: auto; }
@media (max-width: 900px) { .dl-board { grid-template-columns: repeat(5, 180px); } }
.dl-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 200px; }
.dl-col-h { display: flex; flex-direction: column; gap: 4px; padding: 4px 6px 10px; border-bottom: 2px solid var(--sc); margin-bottom: 10px; }
.dl-col-h span { display: flex; align-items: baseline; gap: 7px; }
.dl-col-h b { font-size: 0.84rem; color: var(--ink); }
.dl-col-h em { font-style: normal; font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted-2); }
.dl-col-h i { font-style: normal; font-size: 0.74rem; font-weight: 700; color: var(--sc); }
.dl-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 8px; box-shadow: var(--shadow-sm); cursor: grab; }
.dl-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.dl-av { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 0.62rem; font-weight: 700; }
.dl-card-top b { font-family: var(--font-display); font-size: 0.92rem; color: var(--ink); }
.dl-card-n { font-size: 0.78rem; color: var(--body); line-height: 1.35; }
.dl-empty { text-align: center; color: var(--muted-2); padding: 16px 0; }
.dl-list { padding: 12px 18px; }
.dl-lrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl-ln { flex: 1; font-weight: 600; color: var(--ink); font-size: 0.88rem; }
.dl-lstage { font-size: 0.72rem; font-weight: 700; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, #fff); border-radius: 999px; padding: 4px 11px; }
.dl-lv { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- agreements ---------- */
.agx { display: grid; grid-template-columns: 300px 1fr; min-height: 380px; }
@media (max-width: 820px) { .agx { grid-template-columns: 1fr; } .ag-detail { display: none; } }
.ag-list { border-right: 1px solid var(--line); background: #fff; padding: 14px; }
.ag-list-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ag-list-h b { color: var(--ink); font-size: 1rem; }
.ag-new { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--primary); color: #fff; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.78rem; padding: 7px 12px; border-radius: 8px; }
.ag-new svg { width: 13px; height: 13px; }
.ag-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; cursor: pointer; padding: 12px 13px; border-radius: 11px; margin-bottom: 8px; transition: all 0.14s; }
.ag-row.on { border-color: var(--primary); background: var(--primary-soft); }
.ag-row-b { flex: 1; min-width: 0; }
.ag-row-b b { display: block; font-size: 0.86rem; color: var(--ink); }
.ag-row-b em { font-style: normal; font-size: 0.74rem; color: var(--muted); }
.ag-pill { font-style: normal; font-size: 0.66rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.ag-pill.ok { background: var(--ok-soft); color: var(--ok); }
.ag-pill.warn { background: var(--accent-soft); color: var(--gold); }
.ag-pill.muted { background: var(--bg-2); color: var(--muted); }
.ag-detail { padding: 22px; background: var(--bg-2); }
.ag-detail-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ag-d-type { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.ag-detail-h h4 { margin: 4px 0 2px; font-size: 1.2rem; color: var(--ink); font-weight: 800; }
.ag-d-who { font-size: 0.82rem; color: var(--muted); }
.ag-paper { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.ag-paper p { margin: 0 0 8px; font-size: 0.86rem; color: var(--body); line-height: 1.6; }
.ag-more { color: var(--muted-2) !important; font-size: 0.78rem !important; }
.ag-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .ag-sigs { grid-template-columns: 1fr; } }
.ag-sig { display: flex; align-items: center; gap: 8px; border: 1.5px dashed var(--line-2); border-radius: 11px; padding: 13px; font-size: 0.82rem; color: var(--muted); }
.ag-sig.done { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.ag-sig svg { width: 17px; height: 17px; }
.ag-sig-wait { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); }
.ag-d-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ag-d-seal { display: inline-flex; align-items: center; gap: 7px; font-size: 0.76rem; color: var(--muted); }
.ag-d-seal svg { width: 14px; height: 14px; color: var(--ok); }
.ag-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: var(--accent); color: #1a1205; cursor: pointer; font-family: var(--font-body); font-weight: 800; font-size: 0.84rem; padding: 10px 16px; border-radius: 9px; }
.ag-btn svg { width: 15px; height: 15px; }
.ag-btn.ghost { background: #fff; border: 1px solid var(--line-2); color: var(--ink); }
