/* CRM list and bounded board only; other modules retain their styles. */
#view-crm.crm58-active #crmRoot{display:none!important}
#view-crm.crm58-active.crm58-tasks-mode #crmRoot{display:block!important}
#view-crm.crm58-tasks-mode #crmRoot>.crm-metrics,#view-crm.crm58-tasks-mode #crmRoot>.crm-toolbar,#view-crm.crm58-tasks-mode #crm253Toolbar{display:none!important}
#view-crm.crm58-tasks-mode :is(#crm58results,#crm58pager,.crm58-controls,#crm58stages,#crm58status){display:none!important}
#crm58{color:#173348;margin:16px 0;font-size:13px}
#crm58 [hidden]{display:none!important}
#crm58 button,#crm58 input,#crm58 select{font:inherit;box-sizing:border-box}
#crm58 button{cursor:pointer;border:1px solid #cddbe4;border-radius:7px;padding:8px 12px;background:#fff;color:#24485f;line-height:1.4}
#crm58 button:disabled{cursor:default;opacity:.45}
#crm58 button:hover:not(:disabled){background:#edf5f5}
#crm58 :is(button,input,select):focus-visible{outline:3px solid #68bdb0;outline-offset:2px}
#crm58 .active{background:#176858!important;border-color:#176858;color:white}
.crm58-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
#crm58 h2{font-size:22px;margin:0 0 5px}.crm58-title p{margin:0;color:#607987;font-size:13px}
.crm58-views{display:flex;gap:6px;flex-shrink:0}
.crm58-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;background:#fff;border:1px solid #d7e3ea;padding:14px;border-radius:10px}
.crm58-controls>label{display:grid;gap:5px}.crm58-controls label>span{font-size:12px;font-weight:600;color:#456071}
.crm58-search{flex:1;min-width:230px}
#crm58 input:not([type=checkbox]),#crm58 select{height:38px;border:1px solid #cad9e3;border-radius:7px;background:white;color:#19374c;padding:7px 10px;max-width:100%}
#crm58 .crm58-check{display:flex;align-items:center;min-height:38px;gap:6px}
#crm58 input[type=checkbox]{width:17px;height:17px;accent-color:#176858}
#crm58stages{display:grid;gap:10px;margin:14px 0 9px}
.crm58-stage-group{display:grid;grid-template-columns:130px minmax(0,1fr);align-items:start;gap:10px;padding:11px 12px;border:1px solid #d7e3ea;border-radius:10px;background:#fff}.crm58-stage-group>span{padding-top:8px;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#607987}.crm58-stage-group>div{display:flex;flex-wrap:wrap;gap:6px}.crm58-stage-group.issues{background:#fffaf2;border-color:#ead8ae}.crm58-stage-group.issues>span{color:#8a6422}.crm58-stage-group.issues button{border-color:#e4cfaa;background:#fffdf8;color:#6f531f}
#crm58stages button{display:flex;align-items:center;gap:9px;min-height:36px}#crm58stages b{font-size:11px;background:#eaf1f4;padding:2px 6px;border-radius:5px;color:#486476}#crm58stages .issues b{background:#f4e7ca;color:#795a20}#crm58stages .active b{background:#368371;color:#fff}
@media(max-width:760px){.crm58-stage-group{grid-template-columns:1fr}.crm58-stage-group>span{padding-top:0}}
#crm58status{font-size:12px;color:#5d7788;min-height:20px}
#crm58error{color:#9e361d;border:1px solid #efbcac;background:#fff1ec;padding:12px;margin:10px 0;border-radius:8px}
#crm58selection{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:#eef6f5;padding:10px;border:1px solid #b9dcd5;border-radius:8px;margin:10px 0}
#crm58pager{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:12px 0}
#crm58pager>div{display:flex;align-items:center;gap:10px}#crm58pager label{display:inline-flex;align-items:center;gap:6px}#crm58page{width:72px}
.crm58-table-scroll{max-height:58vh;overflow:auto;border:1px solid #d6e2e9;border-radius:10px;background:#fff;overscroll-behavior:contain}
#crm58 table{width:100%;min-width:960px;border-collapse:separate;border-spacing:0}
#crm58 th{position:sticky;top:0;z-index:1;background:#ecf2f6;text-align:left;font-size:12px;padding:12px 10px;border-bottom:1px solid #cddce6;white-space:nowrap}
#crm58 td{padding:10px;border-bottom:1px solid #e6edf1;font-size:13px;vertical-align:middle}
#crm58 td:nth-child(2){min-width:230px;max-width:330px}#crm58 td:nth-child(3),#crm58 td:nth-child(5){max-width:170px;overflow-wrap:anywhere}
#crm58 tbody tr:hover{background:#f6fafb}#crm58 td small{display:block;font-size:11px;color:#637b89;margin-top:3px;overflow-wrap:anywhere}
#crm58 button.crm58-company{border:0;padding:0;background:transparent;color:#163e59;text-align:left;font-weight:700;line-height:1.5;overflow-wrap:anywhere}
#crm58 button.crm58-company:hover{text-decoration:underline}#crm58 td select{min-width:120px}
.crm58-task-count{display:inline-flex;justify-content:center;min-width:27px;padding:4px;background:#f0f4f6;border-radius:6px}.crm58-task-count.has-tasks{background:#fff0cd;color:#7e5811;font-weight:700}
.crm58-empty{padding:48px 16px;background:#fff;border:1px solid #d9e4eb;border-radius:10px;text-align:center;color:#607b8a}
.crm58-board-note{font-size:12px;color:#607b8a}
.crm58-board{display:flex;gap:12px;overflow:auto;max-height:62vh;align-items:stretch;padding-bottom:12px;overscroll-behavior:contain}
.crm58-column{flex:0 0 260px;background:#eef3f7;border:1px solid #d7e2e9;border-radius:9px;padding:10px;max-height:59vh;overflow:auto}
.crm58-column h3{font-size:13px;position:sticky;top:-10px;background:#eef3f7;z-index:1;padding:10px 0;margin:-10px 0 8px;display:flex;justify-content:space-between}.crm58-column h3 small{color:#698290}
.crm58-card{position:relative;background:white;border:1px solid #d7e3ea;border-radius:8px;padding:12px;margin:0 0 8px;display:grid;gap:8px}
.crm58-card>label{position:absolute;top:10px;right:8px}.crm58-card>.crm58-company{padding-right:25px!important;min-height:28px}.crm58-card small,.crm58-card>span{font-size:11px;color:#647e8c}
@media(max-width:800px){.crm58-title{align-items:flex-start;flex-direction:column}.crm58-controls>label{flex:1;min-width:150px}.crm58-search{flex-basis:100%!important}#crm58pager>div{width:100%;justify-content:space-between}.crm58-views{flex-wrap:wrap}.crm58-table-scroll{max-height:56vh}}

/* SPARKER CRM AUTOMATIC FOLLOW-UP V59 */
.crm59-pill{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;border:1px solid;font-size:10px;font-weight:800;white-space:nowrap}
.crm59-pill.waiting{background:#fff7df;border-color:#e7cc8f;color:#795600}.crm59-pill.replied{background:#eaf7ef;border-color:#b8ddc5;color:#22683c}.crm59-pill.completed{background:#edf3f8;border-color:#c8d7e2;color:#385c73}.crm59-pill.stopped{background:#f4f4f4;border-color:#d8d8d8;color:#6d6d6d}
.crm59-board-follow{display:grid;gap:3px}.crm59-board-follow small{margin:0!important}.crm59-none{color:#8a9aa4}
.crm59-settings textarea{width:100%;box-sizing:border-box;border:1px solid #cedae1;border-radius:8px;padding:10px;font:inherit;font-size:11px;line-height:1.5;resize:vertical;color:#203d50;background:#fff}
.crm59-summary{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#eef6f5;border:1px solid #bedbd5;border-radius:8px;padding:10px}.crm59-summary b{font-size:12px}.crm59-summary span{font-size:10px;color:#58756f}
.crm59-help{margin:0;color:#687f8b;font-size:10px;line-height:1.55}.crm59-help code{background:#eef3f6;padding:2px 4px;border-radius:4px}
.crm59-detail{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 10px;padding:11px 12px;border:1px solid #d7e3e9;border-radius:9px;background:#f8fbfc}.crm59-detail>div:first-child{min-width:0}.crm59-detail span,.crm59-detail strong,.crm59-detail small{display:block}.crm59-detail span{font-size:8px;font-weight:950;letter-spacing:.8px;color:#6d808b}.crm59-detail strong{margin-top:4px;font-size:12px;color:#183b4e}.crm59-detail small{margin-top:3px;font-size:9px;color:#6f848f;overflow-wrap:anywhere}.crm59-detail>div:last-child{display:flex;gap:6px;flex-wrap:wrap}.crm59-detail.waiting{background:#fffaf0;border-color:#ead8ae}.crm59-detail.replied{background:#eef9f2;border-color:#c1dfca}.crm59-detail.completed{background:#f2f6f9}.crm59-detail.stopped{background:#f6f6f6}.crm59-detail.empty{border-style:dashed}
#crm58 table{min-width:1110px}.crm59-settings input:disabled{background:#f2f5f7;color:#657985}.crm59-settings .c20switch input{width:auto!important}
@media(max-width:720px){.crm59-detail{align-items:stretch;flex-direction:column}.crm59-summary{align-items:flex-start;flex-direction:column}}

/* CRM sector creation */
#crm58 .crm58-sector-add{align-self:flex-end;height:38px;background:#fff7e8;border-color:#efc56d;color:#8a5700;font-weight:800}
#crm58 .crm58-sector-add:hover{background:#ffefcc!important}
.crm58-sector-form input{font-size:11px!important}


/* CRM sent-date filtering and sorting V61 */
#crm58 .crm61-dates{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;padding:12px 14px;border:1px solid #d7e3ea;border-radius:10px;margin-top:10px;background:#fff}
#crm58 .crm61-dates label{display:grid;gap:5px}#crm58 .crm61-dates label>span{font-size:12px;font-weight:600;color:#456071}
#crm58 .crm61-date-help{align-self:center;color:#607987;font-size:11px}
#crm58 button.crm61-sort{border:0;background:transparent;padding:0;font-weight:700;color:inherit;text-align:left}#crm58 .crm61-sort span{color:#176858}
#crm58 .crm61-date{white-space:nowrap}#crm58 table{min-width:1260px}
#view-crm.crm58-tasks-mode .crm61-dates{display:none!important}
@media(max-width:800px){#crm58 .crm61-dates label{flex:1;min-width:145px}#crm58 .crm61-date-help{width:100%}}


/* CRM delete actions V62 */
#crm58 .crm62-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;align-items:stretch;width:100%}
#crm58 .crm62-actions button{display:inline-flex;align-items:center;justify-content:center;width:100%;height:34px;min-height:34px!important;padding:7px 8px!important;white-space:nowrap;overflow-wrap:normal;word-break:normal;line-height:1!important}
#crm58 .crm62-actions .crm62-mail{grid-column:1/-1}
#crm58 .crm58-table-scroll table{width:100%;min-width:1080px;table-layout:fixed}
#crm58 .crm58-col-select{width:44px}
#crm58 .crm58-col-company{width:220px}
#crm58 .crm58-col-country{width:95px}
#crm58 .crm58-col-stage{width:130px}
#crm58 .crm58-col-sector{width:105px}
#crm58 .crm58-col-tasks{width:82px}
#crm58 .crm58-col-follow{width:110px}
#crm58 .crm58-col-email{width:120px}
#crm58 .crm58-col-activity{width:120px}
#crm58 .crm58-col-actions{width:132px}
#crm58 td.crm58-country,#crm58 td.crm58-sector{overflow-wrap:normal;word-break:normal;hyphens:none}
#crm58 td.crm58-sector{white-space:normal}
#crm58 button.crm62-delete,#crmModal #crmDeleteCurrent{color:#aa3428;border:1px solid #e7b9b1;background:#fff7f5}
#crm58 button.crm62-delete:hover:not(:disabled),#crmModal #crmDeleteCurrent:hover:not(:disabled){background:#fde8e2}
#crmModal #crmDeleteCurrent:disabled{opacity:.5;cursor:default}
.crm59-dashboard{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.crm59-dashboard article{border:1px solid #d7e3e9;border-radius:9px;background:#fff;padding:10px}.crm59-dashboard span{display:block;font-size:8px;color:#6d808b;font-weight:900}.crm59-dashboard strong{display:block;margin-top:5px;font-size:18px;color:#183b4e}


/* Missing CRM contact information V63 */
#crm58 #crm63missing{min-width:230px}
#crm58 #crm63help{flex-basis:100%;color:#607987;font-size:11px;line-height:1.5}
#crm58 .crm63-missing-badges{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
#crm58 .crm63-missing-badges>span{display:inline-flex;border:1px solid #ebd1a3;border-radius:5px;padding:2px 6px;background:#fff8e9;color:#825700;font-size:10px;font-weight:600;line-height:1.5}
@media(max-width:800px){#crm58 #crm63missing{min-width:0;width:100%}}

/* CRM compact command header V78.1 */
#view-crm>.view-head{align-items:center;margin-bottom:10px;padding-bottom:12px;border-bottom:1px solid #dce6eb}
#view-crm>.view-head>div:first-child{min-width:220px}
#view-crm>.view-head>div:first-child p{max-width:420px}
#view-crm .crm-top-actions{justify-content:flex-end;flex-wrap:nowrap}
#view-crm .crm-import-menu,#crm58 .crm58-more{position:relative}
#view-crm .crm-import-menu>summary,#crm58 .crm58-more>summary{list-style:none;cursor:pointer;border:1px solid #cddbe4;border-radius:7px;padding:9px 13px;background:#fff;color:#24485f;font-weight:700;line-height:1.4;white-space:nowrap}
#view-crm .crm-import-menu>summary::-webkit-details-marker,#crm58 .crm58-more>summary::-webkit-details-marker{display:none}
#view-crm .crm-import-menu>summary::after,#crm58 .crm58-more>summary::after{content:'⌄';margin-left:8px;color:#6b8190}
#view-crm .crm-import-menu[open]>summary,#crm58 .crm58-more[open]>summary{background:#edf5f5;border-color:#9fcac2}
#view-crm .crm-import-menu-panel,#crm58 .crm58-views{position:absolute;right:0;top:calc(100% + 7px);z-index:30;width:250px;display:grid;gap:6px;padding:9px;background:#fff;border:1px solid #cfdee6;border-radius:10px;box-shadow:0 14px 36px rgba(17,48,67,.18)}
#view-crm .crm-import-menu-panel button,#crm58 .crm58-views button{width:100%;text-align:left;white-space:normal}
.crm58-nav-shell{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-shrink:0}
.crm58-primary-views{display:flex;gap:6px}
@media(max-width:900px){
 #view-crm>.view-head{align-items:flex-start;flex-direction:column}
 #view-crm .crm-top-actions{width:100%;justify-content:flex-start}
 .crm58-title{align-items:flex-start;flex-direction:column}
 .crm58-nav-shell{width:100%;justify-content:flex-start;flex-wrap:wrap}
}
@media(max-width:560px){
 #view-crm .crm-top-actions{display:flex;flex-wrap:wrap}
 #view-crm .crm-top-actions>button{flex:1}
 .crm58-primary-views{width:100%;overflow-x:auto}
 .crm58-primary-views button{flex:1;white-space:nowrap}
 #view-crm .crm-import-menu-panel,#crm58 .crm58-views{left:0;right:auto;width:min(270px,calc(100vw - 44px))}
}

/* V75 follow-up explanation and bounded dialog */
#c20modal .modal-card.crm59-modal{max-height:calc(100vh - 36px);display:flex;flex-direction:column;overflow:hidden}
#c20modal .crm59-modal #c20mb{overflow:auto;min-height:0;padding:16px}
.crm59-recent-scroll{max-width:100%;overflow:auto;max-height:48vh}
.crm59-recent table{width:100%;min-width:1120px;border-collapse:collapse}
.crm59-recent th,.crm59-recent td{text-align:left;vertical-align:top;padding:10px;border-bottom:1px solid #dbe5ec;font-size:12px}
.crm59-recent td strong,.crm59-recent td small{display:block;overflow-wrap:anywhere}
.crm59-recent td small{margin-top:4px;color:#647887}
.crm59-recent .crm75-reason{min-width:200px;max-width:310px;overflow-wrap:anywhere}

/* V78 sector-aware outgoing mail history */
.crm78-history{display:flex;flex-direction:column;gap:12px;padding:4px 2px 12px;min-width:0}.crm78-history-filters{display:grid;grid-template-columns:repeat(3,minmax(130px,1fr));gap:10px;align-items:end}.crm78-history-filters label{display:flex;flex-direction:column;gap:5px;min-width:0}.crm78-history-filters label span{font-size:12px;color:var(--muted,#667085);font-weight:600}.crm78-history-filters input,.crm78-history-filters select{min-width:0;width:100%;height:38px;border:1px solid var(--border,#d0d5dd);border-radius:8px;padding:7px 9px;background:var(--surface,#fff);color:var(--text,#1d2939)}.crm78-history-filters .crm78-search{grid-column:span 2}.crm78-history-filters button,.crm78-pager button{min-height:36px;border:1px solid var(--border,#d0d5dd);border-radius:8px;padding:7px 12px;background:var(--surface,#fff);color:var(--text,#1d2939);cursor:pointer}.crm78-history-filters button:disabled,.crm78-pager button:disabled{opacity:.45;cursor:not-allowed}.crm78-summary{font-weight:650;font-size:13px;padding:8px 0;color:var(--text,#1d2939)}.crm78-table-scroll{max-width:100%;overflow:auto;border:1px solid var(--border,#eaecf0);border-radius:10px}.crm78-table-scroll table{width:100%;min-width:1050px;border-collapse:collapse;font-size:12px}.crm78-table-scroll th,.crm78-table-scroll td{padding:9px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border,#eaecf0)}.crm78-table-scroll th{position:sticky;top:0;background:var(--surface,#fff);z-index:1;white-space:nowrap}.crm78-table-scroll td small{display:block;margin-top:3px;color:var(--muted,#667085);font-size:11px}.crm78-table-scroll td strong{font-weight:650}.crm78-table-scroll details{margin-top:6px;max-width:260px}.crm78-table-scroll details summary{cursor:pointer;color:var(--muted,#667085)}.crm78-table-scroll details pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;font:11px/1.5 ui-monospace,monospace;background:var(--surface-secondary,#f9fafb);padding:8px;border-radius:6px}.crm78-status{display:inline-block;border:1px solid var(--border,#d0d5dd);border-radius:999px;padding:3px 7px;white-space:nowrap}.crm78-empty{text-align:center;padding:22px!important;color:var(--muted,#667085)}.crm78-pager{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:12px}.crm78-pager div{display:flex;gap:8px}.crm78-footnote{font-size:11px;color:var(--muted,#667085);line-height:1.5;margin:0}@media(max-width:760px){.crm78-history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.crm78-history-filters .crm78-search{grid-column:span 2}.crm78-history-filters button{width:100%}.crm78-pager{align-items:flex-start;flex-direction:column}.crm78-pager div{width:100%}.crm78-pager button{flex:1}}
