/* CRM upgrade (modules/crm.js): board, deal page, tasks. Uses the app's tokens so themes and dark mode follow. */
.crm-pipes { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--white); border: 1px solid var(--line); border-radius: 9px; padding: 3px; margin: 4px 0 12px; }
.crm-pipes button { border: 0; background: transparent; color: var(--muted); font: 600 12px 'DM Sans', sans-serif; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.crm-pipes button.on { background: var(--primary); color: #fff; }
.crm-board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.crm-col { flex: 0 0 240px; background: color-mix(in srgb, var(--line) 55%, var(--paper)); border-radius: 12px; padding: 8px; min-height: 260px; border: 2px dashed transparent; }
.crm-col.over { border-color: var(--primary); background: var(--tint, var(--mint)); }
.crm-col-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 8px; font-size: 12px; }
.crm-col-head span { background: var(--white); border-radius: 10px; padding: 0 7px; } .crm-col-head small { margin-left: auto; color: var(--muted); }
.crm-card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; display: grid; gap: 2px; cursor: grab; user-select: none; -webkit-touch-callout: none; box-shadow: var(--elev-1); }
.crm-card:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.crm-card b { font-size: 13px; } .crm-card > span { color: var(--muted); font-size: 11px; }
.crm-card-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; font-size: 11px; }
.crm-card-foot em { font-style: normal; font-weight: 700; } .crm-card-foot small { color: var(--muted); }
.crm-card.dragging { opacity: .35; }
.crm-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; box-shadow: var(--elev-3); }
.late { color: var(--sec-warn, #c07a35); font-weight: 700; }

.crm-crumb { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.crm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; min-height: 0; }
.crm-head h2 { font-size: 20px; margin: 0 0 4px; } .crm-head p { margin: 0; font-size: 12px; color: var(--muted); }
.crm-amt { font: 700 20px Manrope, sans-serif; } .crm-amt small { font: 500 12px 'DM Sans', sans-serif; color: var(--muted); }
.crm-record { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.crm-record .panel { min-height: 0; }
.crm-details { display: grid; gap: 4px; }
.crm-stage { display: grid; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.crm-stage select { width: 100%; }
.crm-logbox { display: grid; gap: 8px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.crm-logbox textarea { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.crm-logbox div { display: flex; gap: 6px; flex-wrap: wrap; }
.crm-tl { display: grid; grid-template-columns: 12px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.crm-tl:last-child { border-bottom: 0; } .crm-tl p { margin: 0; } .crm-tl small { color: var(--muted); font-size: 11px; }
.crm-tl-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 !important; }
.crm-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; background: var(--muted); }
.crm-k-call .crm-dot { background: var(--primary); } .crm-k-email .crm-dot { background: #4c7fb5; } .crm-k-meeting .crm-dot { background: #8a5fb0; }
.crm-k-reply .crm-dot { background: #2f9b8f; } .crm-k-stage .crm-dot { background: var(--secondary); } .crm-tl-notes .crm-dot { background: #c2a23a; }
.crm-side { display: grid; gap: 12px; }
@media (max-width: 1180px) { .crm-record { grid-template-columns: 260px minmax(0, 1fr); } .crm-side { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 760px) {
  .crm-col { flex-basis: 78vw; }
}
/* fit the app's panel style */
.crm-side .panel-heading { margin-bottom: 6px; } .crm-side .panel-heading h2 { margin: 0; }
.crm-head .status-pill { display: inline-flex; width: auto; vertical-align: middle; margin: 0 2px; }

/* R2: companies */
.crm-co-row { cursor: pointer; } .crm-co-row:hover td { background: var(--tint, var(--mint)); }
.crm-co-row[hidden] { display: none; }
#crm-co-filter { margin: 4px 0 10px; max-width: 320px; }
.crm-record h2.crm-gap { margin-top: 14px; }
.crm-head a { color: var(--primary); text-decoration: none; font-weight: 600; }
.crm-record .linked-row span, .crm-side .linked-row span { font-size: 13px; }
.crm-record .linked-row small, .crm-side .linked-row small { font-size: 11px; }
/* Business badges (multi-business CRM): the hue is per business; text and fill follow the light/dark theme. */
.crm-biz { --c: #6b7280; display: inline-block; vertical-align: middle; font: 700 10px/1.6 'DM Sans', sans-serif; letter-spacing: .02em; padding: 0 7px; border-radius: 999px; white-space: nowrap; color: color-mix(in srgb, var(--c) 72%, var(--ink)); background: color-mix(in srgb, var(--c) 15%, var(--white)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.crm-biz-0 { --c: #1d765d; } .crm-biz-1 { --c: #c0562b; } .crm-biz-2 { --c: #7a4fb0; } .crm-biz-3 { --c: #1f6fa8; } .crm-biz-4 { --c: #a07d14; } .crm-biz-5 { --c: #b03a6a; }
.crm-bizes small { opacity: .7; margin-left: 2px; font-weight: 600; }
.crm-col-unlisted { border-color: color-mix(in srgb, var(--sec-warn, #c07a35) 55%, transparent); }
.crm-rep-biz { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 8px; } .crm-rep-biz select { font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; }
.crm-agent{display:inline-block;font-size:11px;font-weight:600;padding:1px 6px;border-radius:999px;border:1px solid var(--mod-sig);color:inherit}
#page-content .crm-migrate{min-height:0;border-left:4px solid var(--mod-gold);margin-bottom:14px}.crm-migrate ul{margin:8px 0 12px;padding-left:18px;font-size:14px;line-height:1.7}
/* CRM made easy (7 Nov): Today panel and Next step — big, plain, one tap. */
#page-content .crme-today,#page-content .crme-next{min-height:0;margin-bottom:14px;border-left:4px solid var(--mod-gold)}
.crme-today h2,.crme-next h2{font-size:18px;margin:0 0 10px}.crme-today h2 small{font-size:13px;opacity:.7;margin-left:6px}
.crme-today{display:grid;gap:10px}
.crme-card{border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:grid;gap:6px}
.crme-card header{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.crme-name{background:none;border:0;padding:0;font:inherit;font-size:16px;font-weight:700;color:inherit;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.crme-when{margin-left:auto;font-size:13px;font-weight:600}.crme-when.late{color:#b91c1c}
.app-shell[data-mode="dark"] .crme-when.late{color:#fca5a5}
.crme-stage,.crme-say{margin:0;font-size:14px}.crme-say{font-weight:600}
.crme-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.crme-actions .button{min-height:40px}
.crme-later{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:13px}
.crme-lost{margin-left:auto}
.crme-calm{margin:0;font-size:15px}
.crme-heat{display:inline-block;font-size:11px;font-weight:700;padding:1px 7px;border-radius:999px;border:1px solid var(--line)}.crme-hot{border-color:#b91c1c;color:#b91c1c}.app-shell[data-mode="dark"] .crme-hot{border-color:#fca5a5;color:#fca5a5}
.crme-help{font-size:14px}.crme-help summary{cursor:pointer;font-weight:600;min-height:32px}.crme-help ol{margin:8px 0;padding-left:20px;line-height:1.7}
.crme-stage{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.crme-stage .status-pill{display:inline-flex;width:auto;flex:0 0 auto}
/* Inbox (7 Nov) */
.ib-bar{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;margin-bottom:12px}
#page-content .ib-panel{min-height:0}
.ib-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.ib-item{display:grid;grid-template-columns:32px 1fr auto auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.ib-item.ib-open{border-left:4px solid var(--mod-sig)}.ib-item.ib-hot{border-left-color:#b91c1c}
.ib-icon{font-size:20px}.ib-body{display:flex;flex-direction:column;gap:2px;min-width:0}.ib-body b{overflow-wrap:anywhere}.ib-body small{font-size:12px;opacity:.8}
.ib-act{display:flex;gap:6px}.ib-count{display:inline-block;min-width:20px;padding:0 6px;margin-left:6px;border-radius:999px;background:#b91c1c;color:#fff;font-size:11px;font-weight:700;text-align:center}
@media (max-width:640px){.ib-item{grid-template-columns:28px 1fr}.ib-item>.status-pill,.ib-act{grid-column:2}}
#page-content .fo-panel{min-height:0}.fo-tiles{margin-bottom:12px}.fo-low td{color:#b91c1c}.app-shell[data-mode="dark"] .fo-low td{color:#fca5a5}
