/* IBG MART CRM — Phase 7 | One brand, two-column conversations, accessible profile modal. */
:root{
  --crm-v7-accent:#256bed; --crm-v7-navy:#172840;
  --crm-v7-line:#e8edf5; --crm-v7-muted:#7889a1;
  --crm-v6-sidebar:258px;
}
.workspace{background:#f6f9fc;min-width:0}
.workspace>.rail{width:var(--crm-v6-sidebar)!important;min-width:var(--crm-v6-sidebar)!important;max-width:var(--crm-v6-sidebar)!important;flex:0 0 var(--crm-v6-sidebar)!important;padding-top:13px!important;}
.crm-v7-sidebar-header{display:flex;align-items:center;gap:7px;flex:0 0 auto;min-height:79px;padding:9px 9px 17px;border-bottom:1px solid var(--crm-v7-line);margin-bottom:12px}
.crm-v7-brand{display:flex;gap:11px;align-items:center;min-width:0;flex:1;text-decoration:none!important}
.crm-v7-brand img{object-fit:contain;display:block;width:45px;height:45px;border-radius:50%;flex-shrink:0}
.crm-v7-brand-text{min-width:0;display:flex;flex-direction:column;gap:5px}
.crm-v7-brand-text strong{color:#16253c;font-size:11.5px;line-height:1.37;letter-spacing:-.01em;font-weight:850}
.crm-v7-brand-text small{font-size:9.5px;font-weight:750;color:#7187aa;letter-spacing:.17em}
.rail-nav{gap:5px!important}
.rail-nav .crm-v7-nav-group{display:flex;flex-direction:column;min-width:0}
.rail-nav button.crm-v7-group-button{appearance:none;border:0;cursor:pointer;background:transparent;min-width:0;color:#76849a}
.rail-nav button.crm-v7-group-button.on{background:#f1f6ff!important;color:#225fd5!important}
.rail-nav button.crm-v7-group-button:focus-visible,.crm-v7-subitem:focus-visible,.crm-v7-profile-trigger:focus-visible,.crm-v7-profile-action:focus-visible,.crm-v7-profile-top button:focus-visible,.crm-v7-permission-master:focus-within{outline:3px solid #adcaf8;outline-offset:2px}
.crm-v7-chevron{display:inline-flex;margin-left:auto;transition:transform .18s ease;opacity:.63}
.crm-v7-chevron svg{width:14px;height:14px}
.crm-v7-group-button[aria-expanded=true] .crm-v7-chevron{transform:rotate(90deg)}
.crm-v7-submenu{padding:3px 5px 7px 29px;display:flex;flex-direction:column;gap:2px}
.crm-v7-submenu[hidden]{display:none!important}
.rail-nav .crm-v7-subitem{display:flex;min-height:39px;align-items:center;gap:10px;width:100%;border-radius:10px;padding:8px 10px;font-size:11.5px;font-weight:650;color:#7d8da3;text-decoration:none!important;line-height:1.35}
.rail-nav .crm-v7-subitem:hover{background:#f4f8ff;color:#3368bc}
.rail-nav .crm-v7-subitem.on{background:#ebf2ff;color:#2369e7;font-weight:760}
.crm-v7-subdot{width:6px;height:6px;border-radius:50%;background:#c2ccda;flex-shrink:0}
.crm-v7-subitem.on .crm-v7-subdot{background:var(--crm-v7-accent)}
/* The CRM has exactly one prominent logo after login: the sidebar brand. */
.dash-topbar .dash-logo,.dash-topbar .brand-logo,.blank-state .brand-empty-logo{display:none!important}
.dash-topbar .dash-brandname{font-size:11px;letter-spacing:.15em;color:#506783}
.dash-topbar .dash-brandname small{font-size:10px;letter-spacing:.035em;color:#95a3b7}
.crm-v7-empty-icon{width:72px;height:72px;border-radius:22px;background:#e9f1fd;color:#6996d8;display:grid;place-items:center;margin:0 auto 15px!important}
.crm-v7-empty-icon svg{width:32px;height:32px}
/* WhatsApp-like two-column workspace; details removed from permanent split view. */
.workspace>.contact-pane{width:344px;max-width:clamp(290px,27vw,378px);min-width:292px;flex:0 0 344px;border-right-color:var(--crm-v7-line)}
.workspace>.conversation{flex:1 1 auto;min-width:0;width:auto;max-width:none;background:#f9fbff}
.conversation-head{background:rgba(255,255,255,.98);padding:12px 25px;min-height:78px;gap:12px}
.crm-v7-profile-trigger{appearance:none;border:0;border-radius:14px;padding:6px 9px 6px 4px;background:transparent;display:flex;align-items:center;gap:10px;text-align:left;min-width:0;color:inherit;cursor:pointer;transition:background .2s}
.crm-v7-profile-trigger:hover{background:#f1f6fd}
.crm-v7-profile-label{display:flex;min-width:0;flex-direction:column;gap:4px}
.crm-v7-profile-label strong{color:#182a43;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px;max-width:330px}
.crm-v7-profile-label small{color:#8494aa;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:330px}
.crm-v7-info-icon{font-size:15px;color:#86a1c5;line-height:1}
.crm-v7-profile-action{display:inline-flex;align-items:center;gap:7px;min-height:38px;border:1px solid #e0e9f5;background:#f7faff;border-radius:11px;padding:8px 12px;color:#3363a2;font-size:11px;font-weight:760;cursor:pointer;white-space:nowrap}
.crm-v7-profile-action:hover{background:#eaf2ff;border-color:#b8cdee}
.crm-v7-profile-action svg{width:17px;height:17px}
.conversation-body{background-color:#f8fbff;background-image:radial-gradient(#a2c0e52b .9px,transparent .9px);background-size:24px 24px}
.crm-v7-intro-profile{appearance:none;display:flex;flex-direction:column;align-items:center;gap:8px;margin:0 auto 10px;background:transparent;border:0;border-radius:20px;padding:8px 22px;cursor:pointer;font-weight:730;color:#253750;font-size:16px}
.crm-v7-intro-profile:hover{background:#eff5ff}
.crm-v7-intro-profile .contact-avatar.large{margin:0 0 5px}
.crm-v7-intro-profile:focus-visible{outline:3px solid #adcaf8}
/* Native dialog gets proper focus trapping, Escape and responsive backdrop. */
.workspace dialog.crm-v7-profile-dialog:not([open]){display:none!important}
.workspace dialog.crm-v7-profile-dialog[open]{position:fixed!important;inset:0!important;display:block!important;margin:auto!important;z-index:95!important;width:min(465px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;min-width:0!important;max-height:min(86dvh,850px)!important;height:auto!important;padding:22px 24px 28px!important;background:#fff!important;border:1px solid #e4ebf6!important;box-shadow:0 35px 100px #0b193a52!important;border-radius:24px!important;text-align:center;overflow-y:auto!important;color:var(--crm-v7-navy)}
.crm-v7-profile-dialog::backdrop{background:#0a182f9a;backdrop-filter:blur(5px)}
.crm-v7-profile-top{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #ecf0f6;padding-bottom:14px;margin-bottom:15px;text-align:left}
.crm-v7-profile-top span{font-weight:800;font-size:10px;letter-spacing:.2em;color:#8a9bb0}
.crm-v7-profile-top button{border:0;appearance:none;background:#eff4fb;color:#546f93;font-size:24px;line-height:1;border-radius:12px;width:42px;height:42px;cursor:pointer}
.crm-v7-profile-dialog .details-title{margin-bottom:20px!important;color:#72839c;font-size:12px}
.crm-v7-profile-dialog .details-avatar{margin-top:7px}
.crm-v7-profile-dialog .separator{margin:20px 0}
.crm-v7-profile-dialog .details-form label{font-size:12px;text-align:left}
.crm-v7-profile-dialog .crm-v5-category-controls,.crm-v7-profile-dialog .crm-v5-source-classify{text-align:left}
.crm-v7-profile-dialog select,.crm-v7-profile-dialog button[type=submit]{min-height:43px}
.crm-v7-profile-dialog .crm-v5-category-badges{justify-content:flex-start}
/* Employee access groups exactly mirror main navigation + its submenus. */
.crm-v7-permission-group{border:1px solid #e5ecf5;border-radius:16px;overflow:hidden;margin:13px 0;background:#fff}
.crm-v7-permission-master{display:flex;align-items:center;gap:11px;padding:14px 13px;background:#f4f8fe;cursor:pointer;margin:0!important;color:#1f3553}
.crm-v7-permission-master input{width:17px;height:17px;accent-color:var(--crm-v7-accent);flex-shrink:0}
.crm-v7-permission-master-icon{display:flex;align-items:center;color:#3e7ee6}
.crm-v7-permission-master-icon svg{width:18px;height:18px}
.crm-v7-permission-master strong{font-size:13px;flex:1}
.crm-v7-permission-master small{font-size:10px;color:#8091a9}
.crm-v7-permission-children{padding:3px 14px 11px 18px}
.crm-v7-permission-children .access-option{margin:0!important;padding:10px 4px 10px 12px;border-top:1px solid #eef2f7}
.crm-v7-permission-children .access-option:first-child{border-top:0}
.crm-v7-permission-children .access-option strong{font-size:12px}
.crm-v7-permission-children .access-option small{font-size:11px}
/* Responsive tablet/mobile, touch targets and safe-area handling. */
@media(max-width:1200px){:root{--crm-v6-sidebar:226px}.workspace>.rail{padding-left:8px!important;padding-right:8px!important}.workspace>.contact-pane{width:310px;flex-basis:310px;min-width:260px}.crm-v7-brand-text strong{font-size:10px}}
@media(max-width:900px) and (min-width:681px){:root{--crm-v6-sidebar:208px}.workspace>.contact-pane{width:275px;min-width:260px;flex-basis:275px}.crm-v7-profile-action span{display:none}.conversation-head{padding-inline:13px}.crm-v7-profile-label strong{max-width:135px}.crm-v7-profile-label small{max-width:155px}}
@media(max-width:680px){
 .workspace{height:100dvh;max-height:100dvh;min-height:0;padding-top:calc(54px + env(safe-area-inset-top,0px))!important}
 .workspace>.rail{top:0!important;bottom:0!important;min-width:0!important;width:min(286px,88vw)!important;max-width:88vw!important;padding-top:max(13px,env(safe-area-inset-top))!important;z-index:70!important}
 .crm-v7-sidebar-header{min-height:65px;padding-bottom:10px}
 .crm-v6-mobile-top{height:calc(54px + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px)!important;padding-inline:14px;z-index:60}
 .workspace>.contact-pane{width:100%!important;max-width:none!important;min-width:0!important;flex:1 1 auto!important;height:100%!important}
 .workspace>.conversation{width:100%!important;height:100%!important;min-width:0;max-width:none}
 .conversation-head{padding:7px 10px;min-height:67px;gap:5px;justify-content:space-between}
 .crm-v7-profile-trigger{padding:4px 1px;gap:6px}
 .crm-v7-profile-trigger .contact-avatar{width:34px;height:34px;font-size:18px}
 .crm-v7-profile-label strong{max-width:35vw;font-size:12px}
 .crm-v7-profile-label small{max-width:35vw;font-size:10px}
 .crm-v7-info-icon{display:none}
 .crm-v7-profile-action{width:36px;height:36px;min-height:36px;justify-content:center;padding:0;flex:0 0 36px}
 .crm-v7-profile-action span{display:none}
 .crm-v7-profile-action svg{width:17px;height:17px}
 .convo-actions .action-circle{width:36px;height:36px}
 .conversation-body{padding:13px 10px!important;-webkit-overflow-scrolling:touch}
 .crm-v5-chat-tools{margin:0 0 15px;max-width:100%;padding:12px}
 .crm-v5-chat-tool-head{flex-wrap:wrap}
 .crm-v5-calendar-row{flex-wrap:wrap}
 .crm-v5-calendar-row input{min-width:0;width:100%}
 .crm-v5-calendar-row button{min-height:42px;flex:1}
 .message-compose input{font-size:16px!important}
 .workspace dialog.crm-v7-profile-dialog[open]{width:100%!important;max-width:100%!important;max-height:calc(100dvh - env(safe-area-inset-top,0px))!important;height:calc(100dvh - env(safe-area-inset-top,0px))!important;inset:env(safe-area-inset-top,0px) 0 0 0!important;border:0!important;border-radius:18px 18px 0 0!important;padding:18px 20px calc(34px + env(safe-area-inset-bottom,0px))!important;overflow-y:auto!important}
 .crm-v7-profile-dialog .details-title{margin-bottom:15px!important}
 .crm-v7-profile-top button{min-width:44px;min-height:44px}
 .crm-v7-permission-master{min-height:52px}
 .contact-item{min-height:69px}
 .rail-nav .crm-v7-subitem{min-height:42px}
}
@media(max-width:360px){.crm-v7-profile-label strong,.crm-v7-profile-label small{max-width:31vw}.crm-v7-profile-action{width:33px;flex-basis:33px}.convo-actions{gap:3px}}
@media(prefers-reduced-motion:reduce){.crm-v7-chevron{transition:none}}
