/* Contacts, Companies and spreadsheet import (shared/contacts.js). Uses theme.css tokens. */
.crm-toolbar{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin-bottom:16px; }
.crm-toolbar .left,.crm-toolbar .right{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.crm-toolbar .left{ flex:1 1 520px; }
.crm-sheet [hidden],.crm-steps[hidden]{ display:none !important; }
.segmented .crm-count{ margin-left:4px; font-weight:400; }
.crm-toolbar .search{ flex:1 1 240px; max-width:320px; }
.crm-list{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); overflow-x:auto; }
.crm-table{ width:100%; border-collapse:collapse; font-size:var(--t-sm); min-width:640px; }
.crm-table th{ text-align:left; font-weight:500; color:var(--ink-3); padding:11px 16px; border-bottom:1px solid var(--line); white-space:nowrap; }
.crm-table td{ padding:11px 16px; border-bottom:1px solid var(--line-subtle); vertical-align:middle; color:var(--ink-2); }
.crm-table tbody tr{ cursor:pointer; }
.crm-table tbody tr:hover td{ background:var(--surface-hover); }
.crm-table tbody tr:last-child td{ border-bottom:0; }
.crm-person{ display:flex; align-items:center; gap:10px; min-width:0; }
.crm-avatar{ width:32px; height:32px; border-radius:50%; background:var(--surface-sunken); color:var(--ink-2); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; flex:0 0 auto; }
.crm-person .nm{ font-weight:500; color:var(--ink); font-size:var(--t-md); }
.crm-person .tt{ color:var(--ink-3); font-size:var(--t-xs); margin-top:1px; }
.crm-chips{ display:flex; gap:6px; flex-wrap:wrap; }
.crm-count{ color:var(--ink-3); font-variant-numeric:tabular-nums; }
.crm-empty{ padding:48px 24px; text-align:center; color:var(--ink-2); font-size:var(--t-md); line-height:1.55; }
.crm-empty h3{ font-size:var(--t-lg); color:var(--ink); margin-bottom:6px; }
.crm-empty .actions{ display:flex; gap:8px; justify-content:center; margin-top:16px; flex-wrap:wrap; }
.crm-foot{ font-size:var(--t-xs); color:var(--ink-3); margin-top:10px; }

.crm-sheet{ max-width:520px; }
.crm-sheet.wide{ max-width:900px; }
.crm-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.crm-head .sub{ font-size:var(--t-sm); color:var(--ink-2); margin-top:2px; }
.crm-x{ width:32px; height:32px; border:0; border-radius:var(--r-sm); background:none; color:var(--ink-3); cursor:pointer; font-size:20px; line-height:1; flex:0 0 auto; }
.crm-x:hover{ background:var(--surface-hover); color:var(--ink); }
.crm-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 14px; }
.crm-grid .full{ grid-column:1 / -1; }
.crm-sheet .field textarea{ min-height:84px; resize:vertical; }
.crm-sheet .field input[readonly]{ background:var(--surface-sunken); color:var(--ink-2); }
.crm-hint{ font-size:var(--t-xs); color:var(--ink-3); line-height:1.45; }
.crm-notice{ display:flex; gap:10px; padding:10px 12px; border-radius:var(--r-sm); font-size:var(--t-sm); line-height:1.45; background:var(--info-tint); color:var(--ink); }
.crm-notice svg{ width:16px; height:16px; flex:0 0 auto; margin-top:2px; color:var(--info); }
.crm-notice.warn{ background:var(--warn-tint); }
.crm-notice.warn svg{ color:var(--warn-ink); }
.crm-share{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border:1px solid var(--line); border-radius:var(--r-sm); }
.crm-share .t{ font-size:var(--t-sm); font-weight:500; color:var(--ink); }
.crm-share .d{ font-size:var(--t-xs); color:var(--ink-3); margin-top:2px; line-height:1.45; }
.crm-switch{ position:relative; width:38px; height:22px; flex:0 0 auto; border-radius:11px; border:0; background:var(--line-strong); cursor:pointer; transition:background .15s; }
.crm-switch::after{ content:""; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform .15s; }
.crm-switch[aria-checked=true]{ background:var(--brand); }
.crm-switch[aria-checked=true]::after{ transform:translateX(16px); }
.crm-actions{ display:flex; align-items:center; gap:8px; padding-top:4px; }
.crm-actions .spacer{ flex:1; }
.crm-people{ border:1px solid var(--line); border-radius:var(--r-sm); }
.crm-people .list-row{ padding:10px 12px; cursor:pointer; }
.crm-people .list-row:first-child{ border-top:0; }
.crm-people .list-row:hover{ background:var(--surface-hover); }
.crm-section-label{ font-size:var(--t-sm); font-weight:500; color:var(--ink-2); }

/* import wizard */
.crm-steps{ display:flex; gap:6px; align-items:center; font-size:var(--t-xs); color:var(--ink-3); flex-wrap:wrap; }
.crm-steps span{ display:inline-flex; align-items:center; gap:6px; }
.crm-steps b{ width:18px; height:18px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--surface-sunken); color:var(--ink-3); font-weight:600; font-size:10px; }
.crm-steps .on{ color:var(--ink); font-weight:500; }
.crm-steps .on b{ background:var(--brand); color:#fff; }
.crm-steps .done b{ background:var(--brand-tint); color:var(--brand); }
.crm-steps i{ width:16px; height:1px; background:var(--line-strong); }
.crm-drop{ border:1.5px dashed var(--line-strong); border-radius:var(--r-lg); padding:36px 20px; text-align:center; cursor:pointer; background:var(--surface-sunken); transition:border-color .15s, background .15s; }
.crm-drop:hover,.crm-drop.over{ border-color:var(--brand); background:var(--brand-tint); }
.crm-drop svg{ width:28px; height:28px; color:var(--ink-3); }
.crm-drop .t{ font-size:var(--t-md); font-weight:500; color:var(--ink); margin-top:8px; }
.crm-drop .d{ font-size:var(--t-sm); color:var(--ink-2); margin-top:4px; }
.crm-map{ display:grid; grid-template-columns:150px minmax(0,1fr) minmax(0,1fr); gap:8px 14px; align-items:center; font-size:var(--t-sm); }
.crm-map .h{ font-size:var(--t-xs); color:var(--ink-3); font-weight:500; }
.crm-map .lbl{ font-weight:500; color:var(--ink); }
.crm-map .lbl small{ display:block; font-weight:400; color:var(--ink-3); font-size:var(--t-xs); }
.crm-map .ex{ color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crm-map select{ height:34px; border:1px solid var(--line-strong); border-radius:var(--r-sm); padding:0 8px; background:var(--surface); font:inherit; color:var(--ink); min-width:0; width:100%; }
.crm-summary{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; font-size:var(--t-sm); color:var(--ink-2); }
.crm-preview{ max-height:46vh; overflow:auto; border:1px solid var(--line); border-radius:var(--r-sm); }
.crm-preview table{ width:100%; border-collapse:collapse; font-size:var(--t-sm); min-width:680px; }
.crm-preview th{ position:sticky; top:0; background:var(--surface); text-align:left; font-weight:500; color:var(--ink-3); padding:8px 10px; border-bottom:1px solid var(--line); white-space:nowrap; z-index:1; }
.crm-preview td{ padding:8px 10px; border-bottom:1px solid var(--line-subtle); color:var(--ink-2); vertical-align:middle; }
.crm-preview tr.off td{ color:var(--ink-3); }
.crm-preview tr.off td.nm{ text-decoration:line-through; }
.crm-preview td.nm{ color:var(--ink); font-weight:500; }
.crm-preview input[type=checkbox]{ width:16px; height:16px; accent-color:var(--brand); }
.crm-result{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:var(--r-sm); }
.crm-result > div{ padding:14px 16px; border-left:1px solid var(--line-subtle); }
.crm-result > div:first-child{ border-left:0; }
.crm-result .n{ font-size:var(--t-2xl); font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums; line-height:1.2; }
.crm-result .l{ font-size:var(--t-xs); color:var(--ink-3); }
.crm-issues{ max-height:180px; overflow:auto; font-size:var(--t-sm); color:var(--ink-2); border:1px solid var(--line); border-radius:var(--r-sm); }
.crm-issues div{ padding:7px 12px; border-top:1px solid var(--line-subtle); }
.crm-issues div:first-child{ border-top:0; }
.crm-history .list-row{ padding:12px 0; }
.crm-history .list-row:first-child{ border-top:0; }
.crm-spin{ width:16px; height:16px; border:2px solid var(--line-strong); border-top-color:var(--brand); border-radius:50%; animation:crmspin .7s linear infinite; display:inline-block; vertical-align:-3px; }
@keyframes crmspin{ to{ transform:rotate(360deg); } }

@media (max-width:640px){
  .crm-grid{ grid-template-columns:minmax(0,1fr); }
  .crm-map{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .crm-map .ex,.crm-map .h.ex{ display:none; }
  .crm-result{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-result > div:nth-child(3){ border-left:0; }
  .crm-result > div:nth-child(n+3){ border-top:1px solid var(--line-subtle); }
  .crm-toolbar .search{ max-width:none; }
  .crm-table{ min-width:0; }
  .crm-table th:nth-child(3),.crm-table td:nth-child(3),.crm-table th:nth-child(4),.crm-table td:nth-child(4){ display:none; }
  .crm-table th,.crm-table td{ padding:10px 12px; }
}
