/* CRM V75 requested enhancements. Additive styles only. */

/* Topbar icon and search corrections */
#topbar .search-wrap{
  position:relative!important;
}
#topbar .search-wrap .search-icon{
  position:absolute!important;
  left:14px!important;
  top:50%!important;
  width:20px!important;
  height:20px!important;
  display:grid!important;
  place-items:center!important;
  transform:translateY(-50%)!important;
  margin:0!important;
  padding:0!important;
  pointer-events:none!important;
  z-index:3!important;
  color:#62748b!important;
  opacity:1!important;
  font-size:0!important;
  line-height:1!important;
}
#topbar .search-wrap .search-icon svg{
  width:18px!important;
  height:18px!important;
  display:block!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
#topbar .search-wrap input,
#topbar #global-search{
  padding-left:46px!important;
  padding-right:16px!important;
  color:#24364e!important;
  background:#f8fafc!important;
  border-color:#d7e1ec!important;
  font-size:13px!important;
  font-weight:650!important;
}
#topbar .search-wrap input::placeholder,
#topbar #global-search::placeholder{
  color:#8a9ab0!important;
  opacity:1!important;
  font-size:13px!important;
  font-weight:600!important;
}
#topbar .hub-quick-add{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 38px!important;
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  min-height:38px!important;
  padding:0!important;
  font-size:0!important;
  line-height:0!important;
  overflow:hidden!important;
}
#topbar .hub-quick-add svg{
  display:block!important;
  width:18px!important;
  height:18px!important;
  margin:0!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body.crm-night-mode #topbar .search-wrap input,
body.crm-night-mode #topbar #global-search{
  color:#f7fafc!important;
  background:#363c44!important;
  border-color:#68717d!important;
}
body.crm-night-mode #topbar .search-wrap input::placeholder,
body.crm-night-mode #topbar #global-search::placeholder{
  color:#c5ced9!important;
}
body.crm-night-mode #topbar .search-wrap .search-icon{color:#d7e0eb!important;}

/* Calendar is embedded inside All Appointments */
#page-calendar{display:none!important;}
#page-allappointments #crm-v75-inline-calendar{
  display:none;
  margin:0 0 14px;
}
#page-allappointments.crm-v75-calendar-mode #crm-v75-inline-calendar{
  display:block!important;
}
#page-allappointments.crm-v75-calendar-mode > .all-appt-toolbar,
#page-allappointments.crm-v75-calendar-mode > .all-appt-results,
#page-allappointments.crm-v75-calendar-mode > #all-appt-metrics{
  display:none!important;
}
#page-allappointments #crm-v75-inline-calendar > .card{
  margin:0!important;
  border:1px solid #dbe4ef!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 5px 18px rgba(15,23,42,.035)!important;
  overflow:visible!important;
}
#page-allappointments #crm-v75-inline-calendar .cal-header{
  padding:14px 16px!important;
  border-bottom:1px solid #e7edf4!important;
}
#page-allappointments #crm-v75-inline-calendar #cal-doctor-filter{
  height:38px!important;
  min-height:38px!important;
  border-radius:10px!important;
  font-size:12px!important;
}
#page-allappointments #crm-v75-inline-calendar #cal-month-view,
#page-allappointments #crm-v75-inline-calendar #cal-week-view{
  padding:0 12px 12px!important;
}
body.crm-night-mode #page-allappointments #crm-v75-inline-calendar > .card{
  background:#252c35!important;
  border-color:#46515e!important;
}

/* Therapy schedule button */
#page-therapy #crm-v75-schedule-therapy{
  min-width:142px!important;
}

/* Newsletter page */
#page-newsletter .crm-v75-newsletter-layout{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(330px,.8fr);
  gap:14px;
  align-items:start;
}
.crm-v75-panel{
  border:1px solid #dbe4ef;
  border-radius:16px;
  background:#fff;
  box-shadow:0 6px 18px rgba(15,23,42,.035);
  overflow:hidden;
}
.crm-v75-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid #e7edf4;
}
.crm-v75-panel-title{font-size:14px;font-weight:900;color:#10243f;}
.crm-v75-panel-sub{margin-top:3px;font-size:11px;color:#71849d;font-weight:650;}
.crm-v75-panel-body{padding:16px;}
.crm-v75-newsletter-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.crm-v75-field{min-width:0;}
.crm-v75-field.full{grid-column:1/-1;}
.crm-v75-field label{
  display:block;
  margin:0 0 6px;
  color:#8194ad;
  font-size:9px;
  line-height:1;
  font-weight:900;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.crm-v75-field input,
.crm-v75-field select,
.crm-v75-field textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid #d6e0ec;
  border-radius:11px;
  background:#fbfcfe;
  color:#17304b;
  font-size:12px;
  font-weight:650;
  outline:none;
}
.crm-v75-field input,.crm-v75-field select{height:42px;padding:0 12px;}
.crm-v75-field textarea{min-height:220px;padding:12px;resize:vertical;line-height:1.55;}
.crm-v75-field input:focus,.crm-v75-field select:focus,.crm-v75-field textarea:focus{
  border-color:#ff9d82;
  background:#fff;
  box-shadow:0 0 0 3px rgba(255,92,53,.09);
}
.crm-v75-newsletter-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}
.crm-v75-newsletter-actions .btn{height:40px!important;min-height:40px!important;border-radius:10px!important;}
.crm-v75-newsletter-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.crm-v75-newsletter-metric{
  padding:13px;
  border:1px solid #dbe4ef;
  border-radius:13px;
  background:#fbfcfe;
}
.crm-v75-newsletter-metric strong{display:block;font-size:22px;line-height:1;font-weight:950;color:#10243f;}
.crm-v75-newsletter-metric span{display:block;margin-top:7px;font-size:10px;color:#71849d;font-weight:800;}
.crm-v75-campaign-list{display:flex;flex-direction:column;gap:8px;max-height:610px;overflow:auto;}
.crm-v75-campaign-item{padding:12px;border:1px solid #e2e9f1;border-radius:12px;background:#fff;}
.crm-v75-campaign-row{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;}
.crm-v75-campaign-subject{font-size:12px;font-weight:900;color:#17304b;line-height:1.35;}
.crm-v75-campaign-meta{margin-top:5px;font-size:10px;color:#7f90a7;line-height:1.45;}
.crm-v75-status-pill{display:inline-flex;align-items:center;min-height:26px;padding:0 9px;border-radius:999px;background:#f2f6fa;border:1px solid #dbe4ef;color:#4a6079;font-size:9px;font-weight:900;white-space:nowrap;}
.crm-v75-status-pill.sent{background:#ecfdf5;border-color:#bbf7d0;color:#047857;}
.crm-v75-status-pill.failed{background:#fef2f2;border-color:#fecaca;color:#b42318;}
.crm-v75-newsletter-empty{padding:30px 12px;text-align:center;color:#7f90a7;font-size:12px;}

/* AI provider settings */
.crm-ai-mode{gap:8px!important;flex-wrap:wrap!important;}
.crm-ai-mode .crm-v75-ai-provider-status{margin-right:auto;font-weight:850!important;}
.crm-v75-ai-settings-btn{
  height:30px!important;
  min-height:30px!important;
  padding:0 10px!important;
  border:1px solid #d4dee9!important;
  border-radius:8px!important;
  background:#fff!important;
  color:#344b65!important;
  font-size:10px!important;
  font-weight:850!important;
  cursor:pointer!important;
}
.crm-v75-ai-modal{
  position:fixed;
  inset:0;
  z-index:2147483645;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.crm-v75-ai-modal.open{display:flex;}
.crm-v75-ai-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.52);backdrop-filter:blur(3px);}
.crm-v75-ai-modal-card{position:relative;width:min(560px,100%);border:1px solid #dbe4ef;border-radius:18px;background:#fff;box-shadow:0 26px 70px rgba(15,23,42,.28);overflow:hidden;}
.crm-v75-ai-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid #e7edf4;}
.crm-v75-ai-modal-head strong{font-size:17px;color:#10243f;}
.crm-v75-ai-modal-head span{display:block;margin-top:3px;font-size:11px;color:#71849d;}
.crm-v75-ai-modal-close{width:34px;height:34px;border:1px solid #dbe4ef;border-radius:9px;background:#fff;color:#344b65;font-size:18px;cursor:pointer;}
.crm-v75-ai-modal-body{padding:18px;}
.crm-v75-ai-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.crm-v75-ai-key-row{display:grid;grid-template-columns:1fr auto;gap:8px;}
.crm-v75-ai-help{margin-top:7px;font-size:10.5px;line-height:1.5;color:#71849d;}
.crm-v75-ai-modal-actions{display:flex;justify-content:flex-end;gap:8px;padding:14px 18px;border-top:1px solid #e7edf4;background:#fbfcfe;}
.crm-v75-switch-row{display:flex;align-items:center;gap:9px;min-height:42px;padding:0 11px;border:1px solid #d6e0ec;border-radius:11px;background:#fbfcfe;font-size:12px;font-weight:800;color:#344b65;}

body.crm-night-mode .crm-v75-panel,
body.crm-night-mode .crm-v75-campaign-item,
body.crm-night-mode .crm-v75-ai-modal-card{background:#2b323a;border-color:#46515e;}
body.crm-night-mode .crm-v75-field input,
body.crm-night-mode .crm-v75-field select,
body.crm-night-mode .crm-v75-field textarea,
body.crm-night-mode .crm-v75-newsletter-metric,
body.crm-night-mode .crm-v75-switch-row{background:#252c33;border-color:#46515e;color:#f2f5f8;}
body.crm-night-mode .crm-v75-panel-title,
body.crm-night-mode .crm-v75-campaign-subject,
body.crm-night-mode .crm-v75-newsletter-metric strong,
body.crm-night-mode .crm-v75-ai-modal-head strong{color:#f2f5f8;}

@media(max-width:1050px){
  #page-newsletter .crm-v75-newsletter-layout{grid-template-columns:1fr;}
}
@media(max-width:760px){
  #topbar .search-wrap input,#topbar #global-search{padding-left:43px!important;}
  #page-allappointments #crm-v75-inline-calendar .cal-header{align-items:flex-start!important;gap:10px!important;flex-wrap:wrap!important;}
  .crm-v75-newsletter-grid,.crm-v75-ai-settings-grid{grid-template-columns:1fr;}
  .crm-v75-newsletter-metrics{grid-template-columns:1fr;}
  .crm-v75-newsletter-actions,.crm-v75-ai-modal-actions{display:grid;grid-template-columns:1fr;}
  .crm-v75-newsletter-actions .btn,.crm-v75-ai-modal-actions .btn{width:100%!important;}
}
