/* IBG MART CRM | Phase 5 — English-only, mobile-first, modular. */
:root{--v5-ink:#192638;--v5-muted:#76879d;--v5-blue:#2168e8;--v5-pale:#eef5ff;--v5-bg:#f5f8fd;--v5-border:#e5ecf5;--v5-teal:#0eaa91;--v5-amber:#e29b32;--v5-red:#d9596b}
.rail{box-shadow:3px 0 22px rgba(36,55,85,.025)}
.rail-nav{scrollbar-width:thin;overflow-y:auto;overflow-x:hidden}
.rail-nav a{position:relative;display:flex;align-items:center;justify-content:center}
.rail-glyph{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px}
.rail-glyph svg{width:20px;height:20px;stroke:currentColor}
.rail-nav a.on:before{content:"";position:absolute;left:-11px;width:3px;height:18px;border-radius:5px;background:#2f70ea}
.crm-v5-page{padding:34px clamp(20px,4vw,62px) 70px;background:var(--v5-bg);min-width:0;overflow:auto}
.crm-v5-top{display:flex;align-items:center;gap:18px;justify-content:space-between;margin-bottom:26px;flex-wrap:wrap}
.crm-v5-top h1{font-size:clamp(28px,3vw,44px);letter-spacing:-.055em;color:#18263a;margin:8px 0 7px;line-height:1.05;font-weight:760}
.crm-v5-top p{color:var(--v5-muted);font-size:14px;margin:4px 0;line-height:1.6}
.crm-v5-back{border:1px solid #dee7f3;padding:12px 17px;border-radius:14px;background:white;color:#27436c;font-size:13px;text-decoration:none;white-space:nowrap;font-weight:650}
.crm-v5-overline{font-size:10px;letter-spacing:.19em;font-weight:800;color:#8192a9;display:block;text-transform:uppercase}
.crm-v5-muted{color:var(--v5-muted)!important;font-size:12px;font-weight:450;line-height:1.5}
.crm-v5-surface{border:1px solid var(--v5-border);background:#fff;border-radius:24px;padding:25px;box-shadow:0 16px 52px rgba(33,65,111,.035);min-width:0}
.crm-v5-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.crm-v5-section-head h2,.crm-v5-section-head h3{color:var(--v5-ink);font-size:21px;line-height:1.2;letter-spacing:-.04em;margin:7px 0 0}
.crm-v5-counter{min-width:33px;height:33px;padding:6px 9px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;font-weight:750;background:#eaf2ff;color:var(--v5-blue)}
.crm-v5-filter-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:4px 0 24px}
.crm-v5-pill{display:inline-flex;border-radius:11px;padding:11px 15px;color:#6c7f98;background:#fff;border:1px solid var(--v5-border);text-decoration:none;font-size:13px;font-weight:620}
.crm-v5-pill.is-active{color:#145edd;background:#eaf2ff;border-color:#bfd5fc}
.crm-v5-date-filter{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-left:auto;font-size:12px;color:#657a93}
.crm-v5-date-filter input,.crm-v5-mini-form input,.crm-v5-stack input,.crm-v5-edit-source input,.crm-v5-source-classify select{min-width:0;outline:none;background:#f8faff;border:1px solid #dce7f4;color:#293c57;border-radius:12px;padding:10px 13px;font:inherit;max-width:100%}
.crm-v5-date-filter input:focus,.crm-v5-mini-form input:focus,.crm-v5-stack input:focus,.crm-v5-edit-source input:focus,.crm-v5-source-classify select:focus{border-color:#77a6fa;box-shadow:0 0 0 3px #d9e8ff}
.crm-v5-small-btn,.crm-v5-button{appearance:none;border:0;background:#2168e8!important;color:white!important;display:inline-flex;align-items:center;justify-content:center;text-align:center;min-height:39px;border-radius:11px;padding:10px 15px;font-size:12px;letter-spacing:.005em;font-weight:750;cursor:pointer;text-decoration:none!important;white-space:nowrap}
.crm-v5-small-btn:hover,.crm-v5-button:hover{background:#1356c9!important}
.crm-v5-subtle-btn{appearance:none;background:#eef4fd;border:0;color:#2c65bd;font-weight:650;border-radius:11px;min-height:39px;padding:10px 13px;cursor:pointer;font-size:12px;white-space:nowrap}
.crm-v5-subtle-btn:hover{background:#e1ecfc}
.crm-v5-task-list{display:flex;flex-direction:column}
.crm-v5-task{display:flex;align-items:center;gap:16px;padding:19px 0;border-top:1px solid #edf2f8;min-width:0}
.crm-v5-task-time{display:flex;flex-direction:column;gap:5px;width:104px;flex:0 0 auto}
.crm-v5-task-time strong{font-size:16px;color:#204172;font-weight:750;white-space:nowrap}
.crm-v5-task-time small{font-size:11px;color:#8a9bb0}
.crm-v5-task-body{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.crm-v5-task-body strong,.crm-v5-contact-info strong{font-size:14px;color:#1c2f4a}
.crm-v5-task-body a{text-decoration:none;color:#1a59be}
.crm-v5-task-body p{color:#677990;margin:5px 0 0;font-size:12px;overflow-wrap:anywhere}
.crm-v5-task-body small,.crm-v5-contact-info small{font-size:11px;color:#8b9aad}
.crm-v5-task-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.crm-v5-task-actions form{margin:0}
.crm-v5-flash{background:#ecf8f4;border:1px solid #c7eae0;color:#227c68;border-radius:12px;padding:13px 16px;font-weight:620;font-size:13px;margin:14px 0}
.crm-v5-empty{padding:60px 18px;text-align:center;color:#73839a}
.crm-v5-empty h3{color:#24354c;font-size:20px;margin:8px 0}
.crm-v5-empty p{font-size:13px;margin:4px 0}
.crm-v5-empty-icon{background:#eaf9f4;color:#159d82;display:inline-flex;width:50px;height:50px;border-radius:16px;align-items:center;justify-content:center;font-size:24px}
.crm-v5-hint{font-size:12px;color:#8393a8;line-height:1.7;margin-top:20px}
.crm-v5-contact-row{display:flex;align-items:center;gap:13px;padding:16px 0;border-top:1px solid #eef2f7;text-decoration:none;color:#274066}
.crm-v5-list-avatar{width:38px;height:38px;border-radius:13px;background:#e8f1ff;color:#3870d2;display:grid;place-items:center;flex:0 0 auto;font-weight:750}
.crm-v5-contact-info{display:flex;flex-direction:column;gap:5px;flex:1;min-width:0}
.crm-v5-contact-row:hover .crm-v5-contact-info strong{color:#2168e8}
.crm-v5-source-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(275px,1fr);gap:20px;align-items:start}
.crm-v5-source-directory{display:flex;flex-direction:column}
.crm-v5-source-item{display:flex;gap:12px;align-items:center;border-top:1px solid #edf1f7;padding:15px 0;flex-wrap:wrap}
.crm-v5-source-dot{background:#2bbe96;border-radius:100%;width:8px;height:8px;flex:0 0 8px}
.crm-v5-source-dot.is-off{background:#bbc5d3}
.crm-v5-source-info{display:flex;flex-direction:column;gap:5px;flex:1;min-width:105px}
.crm-v5-source-info strong{font-size:14px;color:#253751}
.crm-v5-source-info small{font-size:11px;color:#8696a8}
.crm-v5-edit-source{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.crm-v5-edit-source input[name=name]{width:142px}
.crm-v5-edit-source label{font-size:12px;color:#6a7b93;display:flex;gap:5px;align-items:center}
.crm-v5-stack{display:flex;flex-direction:column;gap:12px}
.crm-v5-stack label{font-size:12px;font-weight:700;color:#5c6e86}
.crm-v5-check{display:flex;align-items:center;gap:8px}
.crm-v5-placeholder{max-width:690px;margin:auto;text-align:center;padding:70px 45px}
.crm-v5-placeholder p{max-width:480px;margin:12px auto 0;color:#7a8ba3;font-size:14px;line-height:1.8}
.crm-v5-large-icon{margin:auto;width:70px;height:70px;background:#edf4ff;display:grid;place-items:center;color:#1e65dc;border-radius:23px;font-size:36px}
.crm-v5-chat-tools{background:linear-gradient(180deg,#f7faff,#fdfefe);border:1px solid #e7effa;border-radius:17px;margin:0 12px 19px;padding:16px;max-width:100%;font-size:12px;min-width:0}
.crm-v5-chat-tool-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.crm-v5-tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.crm-v5-mini-form{display:flex;flex-direction:column;gap:8px;min-width:0;max-width:100%}
.crm-v5-mini-form label,.crm-v5-category-controls label,.crm-v5-source-classify label{font-size:12px;color:#40536e;font-weight:760}
.crm-v5-calendar-row{display:flex;align-items:stretch;gap:7px;min-width:0}
.crm-v5-calendar-row input{flex:1;max-width:100%;width:100%;font-size:12px;min-height:39px}
.crm-v5-calendar-row input[type=file]{max-width:100%;padding:7px 5px;font-size:11px}
.crm-v5-mini-input{width:100%}
.crm-v5-chat-tools .crm-v5-flash{margin:0 0 12px}
.crm-v5-bubble{max-width:min(100%,360px)}
.crm-v5-file-link{display:flex;align-items:center;gap:9px;background:#f4f7fc;padding:10px 12px;border:1px solid #e6edf8;border-radius:11px;text-decoration:none;color:#215cbc;font-weight:700;font-size:12px;overflow-wrap:anywhere}
.crm-v5-file-link span:nth-child(2){min-width:0;flex:1}
.crm-v5-image-preview{display:block;margin:9px 0}
.crm-v5-image-preview img{max-width:230px;max-height:220px;object-fit:contain;border-radius:12px}
.crm-v5-category-controls{display:flex;flex-direction:column;gap:10px}
.crm-v5-category-badges{display:flex;flex-wrap:wrap;gap:7px}
.crm-v5-category-badges form{margin:0}
.crm-v5-category-btn{border:1px solid #dce6f3;background:#f6f9fd;color:#688099;font-size:11px;font-weight:650;padding:8px 10px;border-radius:10px;cursor:pointer}
.crm-v5-category-btn.is-selected{background:#e5f0ff;color:#1e65db;border-color:#a9caf9}
.crm-v5-source-classify{display:flex;flex-direction:column;align-items:stretch;gap:10px}
.crm-v5-source-classify select{width:100%}
/* A polished, quiet live dashboard — chart data is real, polling only while the page is open. */
.crm-v5-insights{margin:23px 0 30px;min-width:0}
.crm-v5-live-line{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:15px;flex-wrap:wrap}
.crm-v5-live-line h2{font-size:22px;letter-spacing:-.045em;margin:5px 0 0;color:#172b44}
.crm-v5-live-status{border:1px solid #dae9e2;border-radius:50px;display:flex;align-items:center;gap:7px;font-size:11px;color:#5e8a7e;padding:8px 12px;background:#f5fcfa}
.crm-v5-live-dot{width:7px;height:7px;border-radius:50%;background:#10aa87;box-shadow:0 0 0 4px #dbf5eb;animation:crm-v5-pulse 2.8s ease-in-out infinite}
@keyframes crm-v5-pulse{50%{box-shadow:0 0 0 7px #e9f9f3}}
.crm-v5-insight-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(260px,1fr);gap:17px}
.crm-v5-insights .crm-v5-surface{border-radius:22px;padding:22px}
.crm-v5-chart{display:block;width:100%;height:auto;max-height:225px;overflow:visible}
.crm-v5-chart-foot{color:#9aa8b8;font-size:11px;margin:10px 0 0}
.crm-v5-stage-row{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid #eff3f8;color:#617189;font-size:13px}
.crm-v5-stage-row strong{color:#1e3554;margin-left:auto;font-size:16px;font-weight:760}
.crm-v5-stage-dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px}
.crm-v5-dot-awareness{background:#a8b7cb}.crm-v5-dot-interested{background:#2775f0}.crm-v5-dot-not_interested{background:#e7a15a}.crm-v5-dot-order{background:#16b294}
.crm-v5-insight-link{text-decoration:none;font-size:12px;color:#2165dd;display:inline-block;margin-top:19px;font-weight:690}
.crm-v5-followup-strip{display:flex;align-items:center;gap:18px;justify-content:space-between;flex-wrap:wrap;margin-top:16px;border-radius:19px;background:#eaf2ff;padding:18px 23px;border:1px solid #dce9fd}
.crm-v5-followup-strip>div:first-child{display:flex;flex-direction:column;gap:6px}
.crm-v5-followup-strip strong{color:#203d67;font-size:13px}
.crm-v5-followup-values{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.crm-v5-followup-values span{font-size:12px;color:#5a7293;display:flex;align-items:baseline;gap:6px}
.crm-v5-followup-values b{color:#2365d1;font-size:21px}
.crm-v5-followup-values span:last-child b{color:#cc5c61}
/* Preserves existing compact conversation UI while allowing new controls */
.conversation-body{min-width:0}
.details-pane{overflow-y:auto}
.crm-v5-chat-tools input,.crm-v5-chat-tools button{min-width:0}
.crm-v5-page a:focus-visible,.crm-v5-page button:focus-visible,.crm-v5-page input:focus-visible,.crm-v5-chat-tools button:focus-visible,.crm-v5-chat-tools input:focus-visible{outline:3px solid #a8cbff;outline-offset:2px}
@media(max-width:1100px){.crm-v5-insight-grid,.crm-v5-source-layout{grid-template-columns:1fr}.crm-v5-task{align-items:flex-start}.crm-v5-task-actions{justify-content:flex-end}}
@media(max-width:760px){.crm-v5-page{padding:18px 14px 78px;min-height:100dvh}.crm-v5-top{align-items:flex-start}.crm-v5-filter-row{gap:7px}.crm-v5-date-filter{margin:7px 0 0;width:100%}.crm-v5-surface{padding:16px;border-radius:18px}.crm-v5-task{gap:10px;flex-wrap:wrap}.crm-v5-task-time{width:85px}.crm-v5-task-actions{width:100%;justify-content:flex-start;margin-left:95px}.crm-v5-tool-grid{grid-template-columns:1fr}.crm-v5-chat-tools{padding:13px;margin:0 7px 15px}.crm-v5-edit-source{width:100%;margin-left:20px}.crm-v5-followup-strip{padding:18px;gap:14px}.crm-v5-source-layout{gap:13px}.crm-v5-insights{margin:18px 0}.crm-v5-insight-grid{grid-template-columns:1fr}.crm-v5-followup-values{gap:14px}}
@media (prefers-reduced-motion:reduce){.crm-v5-live-dot{animation:none}}
