/* Modern CRM shell */
header.crm.crm-modern-header {
  height: auto;
  min-height: 74px;
  margin: 0;
  padding: 14px 24px 0;
  background: #eef5f8;
  border-bottom: 1px solid #d8e4eb;
  box-shadow: 0 10px 30px rgba(17, 34, 51, 0.08);
}

.crm-header-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 58px;
}

header.crm .crm-brand,
header.crm .crm-brand:hover,
header.crm .crm-brand:focus {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  float: none;
  height: auto;
  padding: 0;
  color: #102033;
  text-decoration: none;
}

.crm-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0f7cae;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.crm-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.crm-brand-copy strong {
  font-size: 18px;
  letter-spacing: 0;
}

.crm-brand-copy small {
  margin-top: 4px;
  color: #627084;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.crm-modern-header .crm-primary-nav,
.crm-modern-header .crm-mobile-nav {
  display: block;
  clear: none;
  float: none;
  margin: 0;
  border: 0;
}

.crm-modern-header .crm-primary-nav {
  flex: 1;
}

.crm-header-spacer {
  flex: 1 1 auto;
}

.crm-modern-header .crm-nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  float: none;
  margin: 0;
  padding: 0;
}

.crm-modern-header .crm-nav-list li {
  display: block;
  margin: 0;
  padding: 0;
}

header.crm .crm-nav-list li a,
header.crm .crm-nav-list li a:hover,
header.crm .crm-nav-list li a:focus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  top: auto;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  color: #2e3b4e;
  font-weight: 800;
  text-decoration: none;
}

header.crm .crm-nav-list li.active a,
header.crm .crm-nav-list li.active a:hover,
header.crm .crm-nav-list li.active a:focus {
  background: #ffffff !important;
  color: #0f7cae !important;
  box-shadow: 0 8px 18px rgba(17, 34, 51, 0.08);
}

.crm-modern-header .crm-admin-menu {
  position: relative;
  float: none;
  margin: 0;
}

.crm-admin-toggle,
.crm-admin-toggle:hover,
.crm-admin-toggle:focus,
header.crm .crm-admin-toggle:hover,
header.crm .crm-admin-toggle:focus {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 12px 7px 8px;
  border: 1px solid #d5e2ea;
  border-radius: 8px;
  background: #ffffff;
  color: #1c2b3a;
  font-weight: 800;
  text-decoration: none;
}

.crm-admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eaf5fa;
  color: #0f7cae;
  font-size: 12px;
  font-weight: 900;
}

.crm-admin-dropdown.dropdown-menu {
  top: 46px;
  right: 0;
  left: auto;
  min-width: 170px;
  padding: 8px;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(17, 34, 51, 0.16);
}

.crm-admin-dropdown.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px !important;
  border-radius: 6px;
  color: #2e3b4e;
  font-weight: 800;
}

.crm-modern-header .crm-mobile-drawer {
  display: none;
}

.crm-app-shell {
  min-height: calc(100vh - 74px);
  padding: 28px 24px 42px;
  background: #eef5f8;
  color: #102033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.crm-app-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.crm-screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.crm-page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid #d9e5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(17, 34, 51, 0.08);
}

.crm-eyebrow {
  margin: 0 0 8px;
  color: #0f7cae;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.crm-page-hero h1 {
  margin: 0;
  color: #102033;
  font-size: 36px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: 0;
}

.crm-page-subtitle {
  margin: 10px 0 0;
  max-width: 720px;
  color: #627084;
  font-size: 15px;
  line-height: 1.5;
}

.crm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #7b8797;
  font-size: 13px;
  font-weight: 800;
}

.crm-breadcrumb a {
  color: #0f7cae;
  text-decoration: none;
}

.crm-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d9e5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 34, 51, 0.06);
}

.crm-toolbar--filters {
  flex-wrap: wrap;
  align-items: flex-end;
}

.crm-search-field {
  position: relative;
  flex: 1;
  min-width: 260px;
  margin: 0;
}

.crm-search-field i {
  position: absolute;
  left: 14px;
  top: 50%;
  color: #8a98a9;
  transform: translateY(-50%);
}

.crm-search-field input,
.crm-filter-field select,
.crm-field .form-control,
.bs-ready .form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d5e2ea;
  border-radius: 8px;
  background: #f8fbfd;
  color: #102033;
  box-shadow: none;
  font-size: 14px;
}

.crm-search-field input {
  padding: 10px 12px 10px 40px;
}

.crm-search-field input:focus,
.crm-filter-field select:focus,
.crm-field .form-control:focus,
.bs-ready .form-control:focus {
  border-color: #0f7cae;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 124, 174, 0.12);
  outline: none;
}

.crm-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #3b495b;
  font-weight: 800;
}

.crm-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.crm-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
  margin: 0;
}

.crm-filter-field span {
  color: #66758a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-date-filter {
  min-width: 210px;
}

.crm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.crm-button--primary,
.crm-button--primary:visited {
  background: #0f7cae;
  border-color: #0f7cae;
  color: #ffffff;
}

.crm-button--primary:hover,
.crm-button--primary:focus {
  background: #0b658f;
  border-color: #0b658f;
  color: #ffffff;
  text-decoration: none;
}

.crm-button--soft,
.crm-button--soft:visited {
  background: #edf6fa;
  border-color: #c7e1ec;
  color: #0f6f9a;
}

.crm-button--soft:hover,
.crm-button--soft:focus {
  background: #dff0f7;
  border-color: #a8d1e1;
  color: #0b658f;
  text-decoration: none;
}

.crm-button:disabled,
.crm-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.crm-card {
  border: 1px solid #d9e5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(17, 34, 51, 0.08);
}

.crm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e4edf2;
}

.crm-card-header h2 {
  margin: 0;
  color: #102033;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.crm-card-header p {
  margin: 5px 0 0;
  color: #718095;
  font-size: 13px;
}

.crm-table-scroll {
  width: 100%;
  overflow: auto;
}

.crm-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.crm-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 0;
  border-bottom: 1px solid #dfe8ee;
  background: #f8fbfd;
  color: #657386;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.crm-table tbody td,
.crm-table tbody th {
  border: 0;
  border-bottom: 1px solid #edf2f5;
  color: #243449;
  font-size: 14px;
  vertical-align: middle;
}

.crm-table tbody tr:hover td,
.crm-table tbody tr:hover th {
  background: #f4fafc;
}

.crm-clickable-row {
  cursor: pointer;
}

.crm-row--revoked td,
.crm-row--revoked th {
  background: #fff5f5;
}

.crm-row--active td:first-child,
.crm-row--active th:first-child {
  box-shadow: inset 4px 0 0 #2f9e44;
}

.crm-row--revoked td:first-child,
.crm-row--revoked th:first-child {
  box-shadow: inset 4px 0 0 #c92a2a;
}

.crm-table-action {
  text-align: right;
  white-space: nowrap;
}

.crm-client-table .crm-table-action {
  min-width: 110px;
}

.crm-client-table .crm-table-action .crm-icon-button {
  min-width: 74px;
  white-space: nowrap;
}

.crm-person-cell,
.crm-site-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-site-cell {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.crm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eaf5fa;
  color: #0f7cae;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.crm-badge,
span.isTrial,
span.isFree {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.crm-badge--trial,
span.isTrial {
  background: #fff4d6;
  border-color: #f4d47c;
  color: #7a5600;
}

.crm-badge--free,
span.isFree {
  background: #edf7ed;
  border-color: #c8e6c9;
  color: #226b28;
}

.crm-badge--revoked {
  background: #fff0f0;
  border-color: #f1b2b2;
  color: #9d1c1c;
}

.crm-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.crm-status-badge--active {
  background: #edf7ed;
  border-color: #bfe3c2;
  color: #1f6b2a;
}

.crm-status-badge--trial {
  background: #fff4d6;
  border-color: #f4d47c;
  color: #7a5600;
}

.crm-status-badge--free {
  background: #edf6fa;
  border-color: #b9ddec;
  color: #0f6f9a;
}

.crm-status-badge--revoked {
  background: #fff0f0;
  border-color: #f1b2b2;
  color: #9d1c1c;
}

.crm-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #d1e7ef;
  border-radius: 8px;
  background: #edf6fa;
  color: #0f6f9a;
  font-weight: 850;
}

.crm-icon-button:hover,
.crm-icon-button:focus {
  border-color: #a8d1e1;
  background: #dff0f7;
  color: #0b658f;
}

.crm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  gap: 8px;
  color: #708095;
  text-align: center;
}

.crm-empty-state i {
  color: #0f7cae;
  font-size: 24px;
}

.crm-client-detail-loading-card .crm-empty-state {
  min-height: 360px;
}

.crm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
}

.crm-field--wide {
  grid-column: 1 / -1;
}

.crm-field label,
.bs-ready label {
  display: block;
  margin-bottom: 7px;
  color: #657386;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.crm-field .help-block,
.bs-ready .help-block {
  margin: 7px 0 0;
  font-size: 12px;
}

.crm-sites-card .crm-table th,
.crm-sites-card .crm-table td {
  min-width: 116px;
}

.crm-sites-card .crm-table th:first-child,
.crm-sites-card .crm-table td:first-child {
  min-width: 220px;
}

.crm-sort-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0;
  text-align: left;
  text-transform: inherit;
}

.crm-sort-header:hover,
.crm-sort-header:focus {
  color: #0f7cae;
  outline: none;
}

.crm-sort-header i {
  color: #8a98a9;
  font-size: 12px;
}

.crm-inline-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-action-group {
  display: inline-flex;
}

.crm-action-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.crm-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #d1e7ef;
  border-radius: 8px;
  background: #ffffff;
  color: #0f6f9a;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.crm-action-button:hover,
.crm-action-button:focus {
  outline: none;
  text-decoration: none;
}

.crm-action-button--edit {
  background: #edf6fa;
  color: #0f6f9a;
}

.crm-action-button--edit:hover,
.crm-action-button--edit:focus {
  border-color: #9fcbde;
  background: #dff0f7;
  color: #0b658f;
}

.crm-action-button--danger {
  border-color: #f1b2b2;
  background: #fff5f5;
  color: #9d1c1c;
}

.crm-action-button--danger:hover,
.crm-action-button--danger:focus {
  background: #ffe8e8;
  color: #801414;
}

.crm-action-button--restore {
  border-color: #bfe3c2;
  background: #edf7ed;
  color: #1f6b2a;
}

.crm-action-button--restore:hover,
.crm-action-button--restore:focus {
  background: #dff1e0;
  color: #175520;
}

.crm-button--split {
  min-width: 36px;
  padding-right: 10px;
  padding-left: 10px;
  border-left-color: rgba(255, 255, 255, 0.35);
}

.crm-row-menu.dropdown-menu {
  min-width: 180px;
  padding: 8px;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(17, 34, 51, 0.16);
}

.crm-row-menu.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px !important;
  border-radius: 6px;
  color: #2e3b4e;
  font-weight: 800;
}

.crm-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
}

.crm-chart-card {
  min-width: 0;
}

.crm-chart-viewport {
  min-height: 620px;
  padding: 18px;
  overflow: auto;
}

.crm-chart-viewport--wide {
  min-height: 680px;
}

.crm-chart-viewport > div {
  max-width: 100%;
}

.crm-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 16px 18px 0;
}

.crm-segmented button {
  min-height: 36px;
  border: 1px solid #d5e2ea;
  border-radius: 8px;
  background: #f8fbfd;
  color: #536276;
  font-weight: 850;
}

.crm-segmented button.crm-segmented__button--active {
  border-color: #0f7cae;
  background: #0f7cae;
  color: #ffffff;
}

.crm-radio-group {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 8px 0 12px;
}

.crm-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #536276;
  font-weight: 800;
}

.crm-radio-group input {
  margin: 0;
}

.crm-error-text {
  margin: 6px 0;
  color: #c92a2a;
  font-size: 12px;
  font-weight: 800;
}

.crm-legacy-popup .modal-title {
  margin: 0;
  color: #102033;
  font-weight: 850;
}

.crm-legacy-popup {
  display: none;
  padding-right: 0;
}

.crm-legacy-popup .modal-dialog {
  max-width: 620px;
}

.crm-legacy-popup .modal-content {
  overflow: hidden;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(17, 34, 51, 0.22);
}

.crm-legacy-popup .modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid #e2ebf0;
  background: #f8fbfd;
}

.crm-legacy-popup .modal-body {
  padding: 20px 22px;
}

.crm-legacy-popup .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid #e2ebf0;
}

.crm-legacy-popup .btn {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 850;
}

.crm-popup-content {
  padding-top: 8px;
}

/* CRM modal polish */
.modal-content .bs-ready .modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid #e2ebf0;
  background: #f8fbfd;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.modal-content .bs-ready .modal-title {
  margin: 0;
  color: #102033;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: 0;
}

.modal-content .bs-ready .modal-body {
  padding: 20px 22px;
}

.modal-content .bs-ready .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid #e2ebf0;
}

.modal-content .bs-ready .btn {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 850;
}

.crm-modal .crm-eyebrow {
  margin-bottom: 6px;
}

.crm-modal .modal-header .crm-modal-help {
  margin: 8px 0 0;
}

.crm-site-modal-window .modal-dialog {
  width: 860px;
  max-width: calc(100vw - 32px);
}

.modal.crm-site-modal-window {
  z-index: 10820 !important;
}

.modal-backdrop.crm-site-modal-backdrop {
  z-index: 10810 !important;
}

.modal.crm-site-delete-modal-window,
.modal.crm-site-revoke-modal-window {
  z-index: 10840 !important;
}

.modal-backdrop.crm-site-action-modal-backdrop {
  z-index: 10830 !important;
  background-color: #07111f;
  opacity: 0.76 !important;
}

body.crm-site-action-modal-open > .modal-backdrop {
  z-index: 10830 !important;
  background-color: #07111f;
  opacity: 0.76 !important;
}

.crm-site-modal-window .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(17, 34, 51, 0.28);
}

.modal-content .crm-site-edit-modal .modal-header,
.modal-content .crm-new-client-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  background: #ffffff;
}

.modal-content .crm-site-edit-modal .modal-body,
.modal-content .crm-new-client-modal .modal-body {
  padding: 22px 28px;
  background: #f6fafc;
}

.modal-content .crm-site-edit-modal .modal-footer,
.modal-content .crm-new-client-modal .modal-footer {
  padding: 18px 28px;
  background: #ffffff;
}

.crm-site-edit-modal .crm-site-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: auto;
}

.crm-site-edit-modal .crm-site-revoke-button {
  border-color: #efb1ae;
  background: #ffffff;
  color: #a52b27;
}

.crm-site-edit-modal .crm-site-revoke-button:hover,
.crm-site-edit-modal .crm-site-revoke-button:focus {
  border-color: #dc8580;
  background: #fff5f4;
  color: #85211e;
}

.crm-site-edit-modal .modal-footer {
  flex-wrap: wrap;
}

.crm-site-delete-modal-window .modal-dialog {
  width: 760px;
  max-width: calc(100vw - 32px);
}

.crm-site-delete-modal-window .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(17, 34, 51, 0.32);
}

.crm-site-delete-modal .modal-body {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  background: #f8fafc;
}

.crm-delete-warning {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid #f2b8b5;
  border-radius: 9px;
  background: #fff2f1;
  color: #9d2420;
}

.crm-delete-warning > i {
  flex: 0 0 auto;
  margin-top: 3px;
  font-size: 19px;
}

.crm-delete-warning strong {
  display: block;
  margin-bottom: 4px;
  color: #84211e;
  font-size: 15px;
}

.crm-delete-warning p {
  margin: 0;
  color: #9d3a36;
  line-height: 1.5;
}

.crm-delete-site-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid #dce7ee;
  border-radius: 9px;
  background: #ffffff;
}

.crm-delete-site-summary > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: #b4231e;
  color: #ffffff;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-delete-site-summary strong,
.crm-delete-site-summary small {
  display: block;
}

.crm-delete-site-summary strong {
  color: #102033;
  font-size: 15px;
}

.crm-delete-site-summary small {
  margin-top: 2px;
  color: #657386;
  font-weight: 750;
}

.crm-delete-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.crm-delete-impact-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0e9ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.crm-delete-impact-grid strong,
.crm-delete-impact-grid span {
  display: block;
}

.crm-delete-impact-grid strong {
  color: #102033;
  font-size: 20px;
  font-weight: 900;
}

.crm-delete-impact-grid span {
  margin-top: 2px;
  color: #657386;
  font-size: 12px;
  font-weight: 800;
}

.crm-delete-stripe {
  padding: 13px 14px;
  border: 1px solid #f0d18b;
  border-radius: 8px;
  background: #fff9e9;
  color: #74540a;
}

.crm-delete-stripe h5 {
  margin: 0 0 6px;
  color: #624708;
  font-size: 14px;
  font-weight: 900;
}

.crm-delete-stripe p {
  margin: 3px 0 0;
}

.crm-delete-confirmation {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.bs-ready label.crm-delete-acknowledgement {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 13px;
  border: 1px solid #e2b4b1;
  border-radius: 8px;
  background: #fff8f7;
  color: #752b28;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-transform: none;
}

.crm-delete-acknowledgement input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #b4231e;
}

.crm-site-edit-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #dce7ee;
  border-radius: 10px;
  background: #ffffff;
}

.crm-site-edit-summary__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #0f7cae;
  color: #ffffff;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-site-edit-summary strong {
  display: block;
  color: #102033;
  font-size: 16px;
  font-weight: 850;
}

.crm-site-edit-summary span:not(.crm-site-edit-summary__mark) {
  color: #657386;
  font-size: 13px;
  font-weight: 800;
}

.crm-new-client-summary .crm-site-edit-summary__mark {
  background: #102033;
}

.crm-site-edit-modal .crm-modal-section,
.crm-new-client-modal .crm-modal-section {
  border: 0;
  box-shadow: 0 10px 24px rgba(17, 34, 51, 0.06);
}

.crm-modal-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid #e2ebf0;
  border-radius: 8px;
  background: #ffffff;
}

.crm-modal-section + .crm-modal-section {
  margin-top: 16px;
}

.crm-modal-section h4 {
  margin: 0;
  color: #102033;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
}

.crm-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.crm-modal-section--compact .crm-modal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-modal .form-group {
  margin-bottom: 0;
}

.crm-modal-field--wide {
  grid-column: 1 / -1;
}

.crm-modal-help {
  margin: 7px 0 0;
  color: #718095;
  font-size: 13px;
  line-height: 1.45;
}

.crm-toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #d5e2ea;
  border-radius: 8px;
  background: #f8fbfd;
  color: #102033;
  font-size: 14px;
  font-weight: 850;
  text-transform: none;
}

.bs-ready label.crm-toggle-field {
  display: flex;
  align-items: center;
  margin: 0;
}

.crm-toggle-field input[type="checkbox"] {
  position: static;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  accent-color: #0f7cae;
}

.crm-toggle-field span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  line-height: 18px;
}

.crm-file-field input[type="file"] {
  min-height: 44px;
  padding: 9px 10px;
  cursor: pointer;
}

.crm-file-upload {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  min-height: 42px;
  margin: 0 10px 0 0 !important;
  padding: 10px 14px;
  border: 1px solid #b9ddec;
  border-radius: 8px;
  background: #edf6fa;
  color: #0f6f9a !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  text-transform: none !important;
  cursor: pointer;
}

.crm-file-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.crm-current-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: #0f7cae;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.crm-current-logo-link:hover,
.crm-current-logo-link:focus {
  color: #0b658f;
  text-decoration: none;
}

.crm-file-field a {
  display: inline-flex;
  max-width: 100%;
  margin-top: 8px;
  color: #0f7cae;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

#size_error,
#excel_size_error {
  display: none;
  color: #c92a2a;
  font-weight: 800;
}

.horizontal-slide {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.horizontal-slide li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #dfe8ee;
  border-radius: 8px;
  background: #f8fbfd;
  color: #3b495b;
  font-size: 13px;
  font-weight: 800;
}

.crm-modal-footer--stack {
  flex-wrap: wrap;
  justify-content: flex-start !important;
}

.crm-confirm-modal .modal-body {
  text-align: left;
}

.crm-confirm-message {
  margin: 0;
  color: #3b495b;
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .crm-analytics-grid {
    grid-template-columns: 1fr;
  }

  .crm-chart-viewport,
  .crm-chart-viewport--wide {
    min-height: 520px;
  }
}

@media (max-width: 860px) {
  .crm-delete-impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-site-edit-modal .crm-site-delete-button {
    width: 100%;
    margin-right: 0;
  }

  header.crm.crm-modern-header {
    padding: 12px 14px;
  }

  .crm-header-bar {
    min-height: 50px;
  }

  .crm-menu-toggle.toggle-menu {
    display: block;
    position: static;
    flex: 0 0 auto;
    padding: 5px;
  }

  header.crm .crm-menu-toggle div.bar1,
  header.crm .crm-menu-toggle div.bar2,
  header.crm .crm-menu-toggle div.bar3 {
    width: 26px;
    height: 3px;
    background: #102033;
    margin: 5px 0;
  }

  .crm-modern-header .crm-primary-nav,
  .crm-modern-header .crm-admin-menu {
    display: none;
  }

  .crm-modern-header .crm-mobile-drawer {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #d9e5ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(17, 34, 51, 0.12);
  }

  .crm-modern-header .crm-mobile-nav {
    display: block !important;
    width: 100%;
    margin: 0 !important;
  }

  .crm-modern-header .crm-mobile-nav .crm-nav-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }

  .crm-modern-header .crm-mobile-nav .crm-nav-list > li:first-of-type {
    padding-top: 0;
  }

  .crm-modern-header .crm-mobile-nav .crm-nav-list li a,
  .crm-mobile-admin > span > a {
    width: 100%;
    justify-content: flex-start;
  }

  .crm-mobile-admin.dropdown-wrapper.bottom {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .crm-mobile-admin .dropdown-menu {
    position: static !important;
    width: 100%;
    margin-top: 6px;
  }

  .crm-app-shell {
    min-height: calc(100vh - 74px);
    padding: 16px 12px 28px;
  }

  .crm-page-hero,
  .crm-toolbar,
  .crm-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-page-hero h1 {
    font-size: 30px;
  }

  .crm-search-field {
    min-width: 0;
    width: 100%;
  }

  .crm-form-grid {
    grid-template-columns: 1fr;
  }

  .crm-modal-grid {
    grid-template-columns: 1fr;
  }

  .crm-site-modal-window .modal-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 12px;
  }

  .modal-content .crm-site-edit-modal .modal-header,
  .modal-content .crm-site-edit-modal .modal-body,
  .modal-content .crm-site-edit-modal .modal-footer,
  .modal-content .crm-new-client-modal .modal-header,
  .modal-content .crm-new-client-modal .modal-body,
  .modal-content .crm-new-client-modal .modal-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .crm-modal-section--compact .crm-modal-grid {
    grid-template-columns: 1fr;
  }

  .crm-table {
    border-spacing: 0 10px;
  }

  .crm-table thead {
    display: none;
  }

  .crm-table tbody,
  .crm-table tr,
  .crm-table td,
  .crm-table th {
    display: block;
    width: 100%;
  }

  .crm-table tbody tr {
    overflow: hidden;
    border: 1px solid #dfe8ee;
    border-radius: 8px;
    background: #ffffff;
  }

  .crm-table tbody td,
  .crm-table tbody th {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 11px 14px;
    border-bottom: 1px solid #edf2f5;
    text-align: right;
    white-space: normal;
  }

  .crm-table tbody td::before,
  .crm-table tbody th::before {
    content: attr(data-label);
    flex: 0 0 122px;
    color: #657386;
    font-size: 12px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
  }

  .crm-client-table tbody td:first-child,
  .crm-sites-table tbody td:first-child {
    display: block;
    text-align: left;
  }

  .crm-client-table tbody td:first-child::before,
  .crm-sites-table tbody td:first-child::before {
    display: block;
    margin-bottom: 8px;
  }

  .crm-table-action {
    text-align: right;
  }

  .crm-inline-actions,
  .crm-action-group,
  .crm-action-row {
    justify-content: flex-end;
  }
}

/* Partner onboarding and Partner Hub */
.crm-partner-setup-hero {
  align-items: flex-start;
}

.crm-setup-status {
  display: flex;
  gap: 8px;
}

.crm-setup-status span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #d9e5ec;
  border-radius: 6px;
  background: #ffffff;
  color: #68798d;
  font-size: 13px;
  font-weight: 800;
}

.crm-setup-status span.is-complete {
  border-color: #bfe3c2;
  background: #edf7ed;
  color: #1f6b2a;
}

.crm-setup-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #efd49f;
  border-left: 4px solid #d97d00;
  border-radius: 6px;
  background: #fff8ec;
  color: #24314a;
}

.crm-setup-notice > i {
  margin-top: 2px;
  color: #d97d00;
  font-size: 19px;
}

.crm-setup-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #101a33;
}

.crm-setup-notice p {
  margin: 0;
  color: #7d8999;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.crm-partner-setup-screen .crm-setup-field-help {
  margin: 4px 0 0;
  color: #8792a1;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.crm-partner-setup-layout {
  display: grid;
  gap: 22px;
}

.crm-setup-panel {
  padding: 28px;
  border: 1px solid #dfe8ee;
  border-radius: 8px;
  background: #ffffff;
}

.crm-section-heading,
.crm-hub-resource-heading,
.crm-resource-actions,
.crm-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.crm-section-heading {
  margin-bottom: 24px;
}

.crm-section-heading h2,
.crm-hub-resource-heading h2 {
  margin: 0;
  color: #102033;
  font-size: 23px;
  line-height: 1.25;
}

.crm-required-note {
  color: #718096;
  font-size: 12px;
}

.crm-form-grid--partner {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-form-field--wide {
  grid-column: 1 / -1;
}

.crm-form-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.crm-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d9e5ec;
  border-radius: 6px;
  background: #ffffff;
  color: #304158;
}

.crm-icon-button:hover,
.crm-icon-button:focus {
  border-color: #0f7cae;
  color: #0f7cae;
}

.crm-agreement-preview {
  overflow: hidden;
  min-height: 620px;
  border: 1px solid #ccd9e1;
  border-radius: 6px;
  background: #eef3f8;
}

.crm-agreement-preview iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: #ffffff;
}

.crm-acceptance-form {
  max-width: 760px;
  margin: 26px auto 0;
}

.crm-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 14px;
  color: #3f4d60;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.crm-consent-row input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.crm-button--wide {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.crm-payment-setup-content,
.crm-payment-summary-main {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.crm-payment-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #edf7ed;
  color: #1f6b2a;
  font-size: 22px;
}

.crm-payment-setup-content h3,
.crm-payment-summary h2 {
  margin: 0 0 8px;
  color: #102033;
  font-size: 20px;
  line-height: 1.3;
}

.crm-payment-setup-content p,
.crm-payment-summary p {
  max-width: 720px;
  margin: 0;
  color: #66758a;
  line-height: 1.55;
}

.crm-payment-setup-content p + p {
  margin-top: 8px;
}

.crm-payment-warning {
  color: #8b5a00 !important;
  font-weight: 700;
}

.crm-payment-actions {
  gap: 10px;
  margin-top: 24px;
}

.crm-payment-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #f0dcb8;
  border-radius: 6px;
  background: #fff7e9;
  color: #8b5a00;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.crm-payment-state--enabled {
  border-color: #bfe3c2;
  background: #edf7ed;
  color: #1f6b2a;
}

.crm-payment-state--restricted,
.crm-payment-state--error {
  border-color: #efc3bf;
  background: #fff2f1;
  color: #a22f2a;
}

.crm-payment-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(330px, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px;
}

.crm-payment-kicker,
.crm-payment-summary-details span {
  display: block;
  margin-bottom: 5px;
  color: #68798d;
  font-size: 12px;
  font-weight: 800;
}

.crm-payment-summary-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.crm-payment-summary-details strong {
  color: #102033;
  font-size: 15px;
}

.crm-payment-summary-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.crm-partner-hub-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  margin-bottom: 18px;
}

.crm-partner-progress,
.crm-agreement-link {
  min-height: 82px;
  padding: 17px 20px;
  border: 1px solid #dfe8ee;
  border-radius: 8px;
  background: #ffffff;
}

.crm-partner-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.crm-partner-progress span {
  color: #68798d;
  font-size: 13px;
  font-weight: 800;
}

.crm-partner-progress strong {
  color: #102033;
}

.crm-progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 4px;
  background: #e6edf2;
}

.crm-progress-track span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #16865a;
  transition: width 180ms ease;
}

.crm-agreement-link {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border-color: #f0dcb8;
  background: #fffaf0;
  color: #142039;
  text-align: left;
}

.crm-agreement-link > i:first-child {
  color: #d97d00;
  font-size: 23px;
}

.crm-agreement-link span {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.crm-agreement-link small {
  margin-top: 2px;
  color: #68798d;
}

.crm-hub-tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 6px;
  border: 1px solid #dfe8ee;
  border-radius: 8px;
  background: #ffffff;
}

.crm-hub-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #526276;
  font-weight: 800;
  white-space: nowrap;
}

.crm-hub-tabs button.is-active {
  background: #142039;
  color: #ffffff;
}

.crm-hub-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  min-height: 540px;
  margin-top: 18px;
  border: 1px solid #dfe8ee;
  border-radius: 8px;
  background: #ffffff;
}

.crm-hub-resource-list {
  padding: 12px;
  border-right: 1px solid #dfe8ee;
  background: #f7f9fb;
}

.crm-hub-resource-list > button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  margin-bottom: 7px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #526276;
  text-align: left;
}

.crm-hub-resource-list > button.is-active {
  border-color: #bcddea;
  background: #ffffff;
  color: #102033;
  box-shadow: 0 6px 16px rgba(17, 34, 51, 0.07);
}

.crm-hub-resource-list > button.is-inactive {
  opacity: 0.58;
}

.crm-hub-resource-list > button > i:first-child {
  color: #0f7cae;
  font-size: 17px;
}

.crm-hub-resource-list > button.is-complete > i:first-child {
  color: #16865a;
}

.crm-hub-resource-list > button span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.crm-hub-resource-list > button strong {
  overflow-wrap: anywhere;
}

.crm-hub-resource-list > button small {
  color: #78869a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.crm-hub-resource {
  padding: 30px;
}

.crm-hub-resource-heading {
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid #e7edf1;
}

.crm-hub-resource-heading p {
  max-width: 720px;
  margin: 8px 0 0;
  color: #68798d;
  line-height: 1.55;
}

.crm-resource-type {
  display: block;
  margin-bottom: 7px;
  color: #d97d00;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-resource-body {
  max-width: 820px;
  padding: 26px 0;
  color: #334155;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-line;
}

.crm-resource-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid #e7edf1;
}

.crm-button--complete {
  border-color: #bfe3c2;
  background: #edf7ed;
  color: #1f6b2a;
}

.crm-resource-textarea {
  min-height: 190px;
  resize: vertical;
}

.crm-status-badge--pending {
  border-color: #f0dcb8;
  background: #fff7e9;
  color: #8b5a00;
}

@media (max-width: 860px) {
  .crm-setup-status,
  .crm-partner-hub-summary,
  .crm-hub-layout {
    grid-template-columns: 1fr;
  }

  .crm-setup-status {
    display: grid;
    width: 100%;
  }

  .crm-form-grid--partner {
    grid-template-columns: 1fr;
  }

  .crm-payment-summary,
  .crm-payment-summary-details {
    grid-template-columns: 1fr;
  }

  .crm-payment-summary-action {
    align-items: flex-start;
  }

  .crm-hub-layout {
    min-height: 0;
  }

  .crm-hub-resource-list {
    border-right: 0;
    border-bottom: 1px solid #dfe8ee;
  }

  .crm-hub-resource,
  .crm-setup-panel {
    padding: 20px 16px;
  }

  .crm-agreement-preview {
    min-height: 440px;
  }

  .crm-agreement-preview iframe {
    height: 520px;
  }

  .crm-payment-setup-content,
  .crm-payment-summary-main {
    flex-direction: column;
  }

  .crm-section-heading,
  .crm-hub-resource-heading {
    align-items: flex-start;
  }
}

/* Restricted business-partner CRM */
header.crm.crm-modern-header .crm-role-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 22px;
}

.crm-partner-hub-link {
  position: relative;
}

.crm-nav-count {
  position: absolute;
  top: -8px;
  right: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 2px solid #ffd37a;
  border-radius: 12px;
  background: #16865a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(22, 134, 90, 0.28);
}

header.crm.crm-modern-header .crm-role-navigation a.is-active .crm-nav-count {
  border-color: #ffd37a;
}

header.crm.crm-modern-header .crm-role-navigation a,
header.crm.crm-modern-header .crm-role-navigation a:hover,
header.crm.crm-modern-header .crm-role-navigation a:focus {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 9px;
  color: #304158;
  font-weight: 800;
  text-decoration: none;
}

header.crm.crm-modern-header .crm-role-navigation a.is-active {
  background: #ffffff;
  color: #0f7cae;
  box-shadow: 0 8px 18px rgba(17, 34, 51, 0.08);
}

.crm-partner-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid #bcddea;
  border-radius: 10px;
  background: #eff8fb;
  color: #28465b;
}

.crm-partner-notice > i {
  color: #0f7cae;
  font-size: 18px;
}

.crm-partner-notice div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crm-partner-notice strong {
  color: #102033;
}

.crm-partner-notice span,
.crm-table-secondary {
  color: #68798d;
  font-size: 13px;
}

.crm-table-secondary {
  display: block;
  margin-top: 3px;
}

.crm-partner-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.crm-partner-metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
}

.crm-partner-metric span {
  color: #68798d;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-partner-metric strong {
  color: #102033;
  font-size: 24px;
}

.crm-action-row--wrap {
  flex-wrap: wrap;
}

.crm-action-button--danger {
  border-color: #efb3b3;
  background: #fff4f4;
  color: #a82626;
}

.crm-status-badge--suspended {
  background: #fff4d6;
  border-color: #f4d47c;
  color: #7a5600;
}

.crm-status-badge--earned {
  background: #edf6fa;
  border-color: #b9ddec;
  color: #0f6f9a;
}

.crm-status-badge--paid {
  background: #edf7ed;
  border-color: #bfe3c2;
  color: #1f6b2a;
}

.crm-status-badge--reversed {
  background: #fff0f0;
  border-color: #f1b2b2;
  color: #9d1c1c;
}

@media (max-width: 860px) {
  header.crm.crm-modern-header .crm-role-navigation {
    display: none;
  }

  .crm-partner-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .crm-brand-copy strong {
    font-size: 16px;
  }

  .crm-page-hero,
  .crm-card-header,
  .crm-toolbar,
  .crm-form-grid,
  .crm-chart-viewport {
    padding: 16px;
  }

  .crm-page-hero h1 {
    font-size: 26px;
  }

  .crm-button {
    width: 100%;
  }

  .crm-action-row {
    width: 100%;
  }

  .crm-action-button {
    flex: 1 1 0;
  }

  .crm-segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-content .bs-ready .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-content .bs-ready .btn {
    width: 100%;
  }

  .crm-modal-section {
    padding: 14px;
  }
}

/* CRM header correction: keep desktop to one refined row and isolate it from legacy header rules. */
header.crm.crm-modern-header {
  height: 76px !important;
  min-height: 76px !important;
  padding: 0 32px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid #dce7ee !important;
  box-shadow: 0 14px 34px rgba(17, 34, 51, 0.08) !important;
}

header.crm.crm-modern-header .crm-header-bar {
  height: 76px !important;
  min-height: 76px !important;
  max-width: none !important;
  gap: 28px !important;
}

header.crm.crm-modern-header .crm-header-spacer {
  flex: 1 1 auto !important;
}

header.crm.crm-modern-header .crm-menu-toggle {
  display: none !important;
}

header.crm.crm-modern-header .crm-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 0 0 auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

header.crm.crm-modern-header .crm-brand-mark {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
  background: #0f7cae !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(15, 124, 174, 0.18) !important;
}

header.crm.crm-modern-header .crm-brand-copy strong {
  color: #102033 !important;
  font-size: 19px !important;
  font-weight: 850 !important;
}

header.crm.crm-modern-header .crm-brand-copy small {
  color: #0f7cae !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

header.crm.crm-modern-header .crm-primary-nav {
  display: block !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
}

header.crm.crm-modern-header .crm-nav-list {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

header.crm.crm-modern-header .crm-nav-list li {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: top !important;
}

header.crm.crm-modern-header .crm-nav-list li a,
header.crm.crm-modern-header .crm-nav-list li a:hover,
header.crm.crm-modern-header .crm-nav-list li a:focus {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 42px !important;
  padding: 10px 16px !important;
  position: static !important;
  top: auto !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #43536a !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}

header.crm.crm-modern-header .crm-nav-list li a:hover,
header.crm.crm-modern-header .crm-nav-list li a:focus {
  border-color: #cce2ec !important;
  background: #f2f8fb !important;
  color: #0f7cae !important;
}

header.crm.crm-modern-header .crm-nav-list li.active a,
header.crm.crm-modern-header .crm-nav-list li.active a:hover,
header.crm.crm-modern-header .crm-nav-list li.active a:focus {
  border-color: #cce2ec !important;
  background: #eaf5fa !important;
  color: #0f7cae !important;
  box-shadow: inset 0 0 0 1px rgba(15, 124, 174, 0.04) !important;
}

header.crm.crm-modern-header .crm-admin-menu {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

header.crm.crm-modern-header .crm-admin-toggle,
header.crm.crm-modern-header .crm-admin-toggle:hover,
header.crm.crm-modern-header .crm-admin-toggle:focus {
  min-height: 42px !important;
  padding: 7px 14px 7px 8px !important;
  border: 1px solid #d5e2ea !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #102033 !important;
  box-shadow: 0 8px 22px rgba(17, 34, 51, 0.08) !important;
}

header.crm.crm-modern-header .crm-mobile-drawer {
  display: none !important;
}

.crm-logo-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d5e2ea;
  border-radius: 10px;
  background: #f8fbfd;
}

.crm-logo-choice .crm-logo-default-choice {
  flex: 1 1 280px;
  min-height: 46px;
  margin: 0;
}

.crm-logo-choice .crm-current-logo-link {
  flex: 0 0 auto;
  margin: 0;
}

.crm-logo-choice p {
  flex: 1 0 100%;
  margin: 0;
  color: #697b91;
  font-size: 14px;
  line-height: 1.45;
}

.crm-file-field.has-error .crm-logo-choice {
  border-color: #e6a2a2;
  background: #fff7f7;
}

@media (max-width: 860px) {
  header.crm.crm-modern-header {
    height: auto !important;
    min-height: 72px !important;
    padding: 0 16px !important;
  }

  header.crm.crm-modern-header .crm-header-bar {
    height: 72px !important;
    min-height: 72px !important;
    gap: 12px !important;
  }

  header.crm.crm-modern-header .crm-menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    position: static !important;
    border-radius: 10px !important;
    background: #eef7fb !important;
    box-shadow: none !important;
  }

  header.crm.crm-modern-header .crm-menu-toggle div.bar1,
  header.crm.crm-modern-header .crm-menu-toggle div.bar2,
  header.crm.crm-modern-header .crm-menu-toggle div.bar3 {
    background: #102033 !important;
  }

  header.crm.crm-modern-header .crm-brand {
    flex: 1 1 auto !important;
  }

  header.crm.crm-modern-header .crm-primary-nav,
  header.crm.crm-modern-header .crm-admin-menu {
    display: none !important;
  }

  header.crm.crm-modern-header .crm-mobile-drawer {
    display: none !important;
    width: 100% !important;
    margin: 0 0 14px !important;
    padding: 10px !important;
    border: 1px solid #dce7ee !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 14px 34px rgba(17, 34, 51, 0.12) !important;
  }

  header.crm.crm-modern-header.mobile-menu-open .crm-mobile-drawer {
    display: block !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav {
    display: block !important;
    margin: 0 !important;
    width: 100% !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list li a,
  header.crm.crm-modern-header .crm-mobile-admin > span > a {
    justify-content: flex-start !important;
    width: 100% !important;
    border-radius: 10px !important;
  }
}

/* Internal CRM visual refresh */
:root {
  --stak-navy: #0f1830;
  --stak-navy-2: #18233d;
  --stak-ink: #101a33;
  --stak-muted: #66758a;
  --stak-line: #dce4ee;
  --stak-cream: #fff8ec;
  --stak-yellow: #ffd37a;
  --stak-teal: #eaf8f7;
  --stak-blue: #1780ad;
}

body:has(.crm-app-shell),
.crm-app-shell {
  background:
    radial-gradient(circle at 4% 2%, rgba(255, 211, 122, 0.24), transparent 30%),
    linear-gradient(180deg, #f7fafc 0%, #eef5f4 100%) !important;
}

header.crm.crm-modern-header {
  padding: 0 28px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
  box-shadow: 0 12px 34px rgba(15, 24, 48, 0.08) !important;
  backdrop-filter: blur(12px);
}

header.crm.crm-modern-header .crm-header-bar {
  max-width: 1500px !important;
  min-height: 78px !important;
}

header.crm.crm-modern-header .crm-brand-mark,
header.crm.crm-modern-header .crm-admin-avatar {
  border-radius: 12px !important;
  background: var(--stak-navy) !important;
  color: var(--stak-yellow) !important;
}

header.crm.crm-modern-header .crm-brand-copy strong {
  color: var(--stak-ink) !important;
  font-size: 19px !important;
  font-weight: 900 !important;
}

header.crm.crm-modern-header .crm-brand-copy small {
  color: #a85f05 !important;
  letter-spacing: 0.16em !important;
}

header.crm.crm-modern-header .crm-nav-list li a,
header.crm.crm-modern-header .crm-nav-list li a:hover,
header.crm.crm-modern-header .crm-nav-list li a:focus {
  min-height: 44px !important;
  padding: 11px 17px !important;
  color: #4a5870 !important;
}

header.crm.crm-modern-header .crm-nav-list li a:hover,
header.crm.crm-modern-header .crm-nav-list li a:focus {
  border-color: rgba(15, 24, 48, 0.1) !important;
  background: var(--stak-cream) !important;
  color: var(--stak-ink) !important;
}

header.crm.crm-modern-header .crm-nav-list li.active a,
header.crm.crm-modern-header .crm-nav-list li.active a:hover,
header.crm.crm-modern-header .crm-nav-list li.active a:focus {
  border-color: rgba(255, 211, 122, 0.72) !important;
  background: var(--stak-navy) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(15, 24, 48, 0.16) !important;
}

.crm-app-shell {
  min-height: calc(100vh - 78px) !important;
  padding: 30px 32px 56px !important;
  color: var(--stak-ink) !important;
}

.crm-app-container {
  max-width: 1500px !important;
}

.crm-screen {
  gap: 20px !important;
}

.crm-page-hero {
  position: relative !important;
  overflow: hidden !important;
  align-items: center !important;
  min-height: 148px !important;
  padding: 30px 34px !important;
  border: 1px solid rgba(15, 24, 48, 0.08) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(135deg, rgba(15, 24, 48, 0.98), rgba(28, 41, 70, 0.96)),
    var(--stak-navy) !important;
  box-shadow: 0 24px 52px rgba(15, 24, 48, 0.18) !important;
}

.crm-page-hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 8px;
  background: linear-gradient(90deg, var(--stak-yellow), #ffe6a8 42%, var(--stak-teal));
}

.crm-page-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -170px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 211, 122, 0.18);
  border-radius: 999px;
  background: rgba(255, 211, 122, 0.08);
}

.crm-page-hero > * {
  position: relative;
  z-index: 1;
}

.crm-eyebrow {
  margin-bottom: 10px !important;
  color: var(--stak-yellow) !important;
  font-size: 13px !important;
  letter-spacing: 0.16em !important;
}

.crm-page-hero h1 {
  color: #ffffff !important;
  font-size: 46px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.crm-page-subtitle {
  color: rgba(255, 255, 255, 0.72) !important;
}

.crm-button {
  border-radius: 12px !important;
  font-weight: 900 !important;
}

.crm-button--primary,
.crm-button--primary:visited {
  min-height: 50px !important;
  padding: 14px 22px !important;
  border-color: var(--stak-yellow) !important;
  background: var(--stak-yellow) !important;
  color: var(--stak-ink) !important;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18) !important;
}

.crm-button--primary:hover,
.crm-button--primary:focus {
  border-color: #ffe09a !important;
  background: #ffe09a !important;
  color: var(--stak-ink) !important;
  transform: translateY(-1px);
}

.crm-toolbar {
  gap: 18px !important;
  padding: 16px !important;
  border: 1px solid rgba(15, 24, 48, 0.1) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 16px 36px rgba(15, 24, 48, 0.08) !important;
}

.crm-search-field {
  min-width: 320px !important;
}

.crm-search-field input,
.crm-filter-field select,
.crm-field .form-control,
.bs-ready .form-control {
  min-height: 52px !important;
  border: 1px solid rgba(15, 24, 48, 0.12) !important;
  border-radius: 13px !important;
  background: #f8fafc !important;
  color: var(--stak-ink) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

.crm-search-field input {
  padding-left: 46px !important;
}

.crm-search-field i {
  left: 17px !important;
  color: #8492a6 !important;
}

.crm-search-field input:focus,
.crm-filter-field select:focus,
.crm-field .form-control:focus,
.bs-ready .form-control:focus {
  border-color: rgba(255, 211, 122, 0.96) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(255, 211, 122, 0.26) !important;
}

.crm-checkbox {
  min-height: 52px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(15, 24, 48, 0.1) !important;
  border-radius: 13px !important;
  background: var(--stak-cream) !important;
  color: #3f4e64 !important;
  white-space: nowrap !important;
}

.crm-checkbox input {
  accent-color: var(--stak-navy);
}

.crm-card {
  overflow: hidden !important;
  border: 1px solid rgba(15, 24, 48, 0.1) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 22px 46px rgba(15, 24, 48, 0.1) !important;
}

.crm-card-header {
  padding: 23px 26px !important;
  border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
  background: linear-gradient(180deg, #ffffff, #fbfcfd) !important;
}

.crm-card-header h2 {
  color: var(--stak-ink) !important;
  font-size: 22px !important;
  font-weight: 900 !important;
}

.crm-card-header p {
  margin-top: 7px !important;
  color: var(--stak-muted) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.crm-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.crm-table thead th {
  padding: 15px 20px !important;
  border-bottom: 1px solid rgba(15, 24, 48, 0.1) !important;
  background: #f7f8fb !important;
  color: #68768a !important;
  font-size: 12px !important;
  letter-spacing: 0.08em !important;
}

.crm-table tbody td,
.crm-table tbody th {
  padding: 16px 20px !important;
  border-bottom: 1px solid rgba(15, 24, 48, 0.07) !important;
  color: #26354b !important;
  font-size: 15px !important;
}

.crm-table tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.crm-table tbody tr:hover td,
.crm-table tbody tr:hover th {
  background: #fffaf1 !important;
}

.crm-row--active td:first-child,
.crm-row--active th:first-child {
  box-shadow: inset 5px 0 0 #35b974 !important;
}

.crm-row--revoked td,
.crm-row--revoked th {
  background: #fff6f6 !important;
}

.crm-row--revoked td:first-child,
.crm-row--revoked th:first-child {
  box-shadow: inset 5px 0 0 #d64b4b !important;
}

.crm-person-cell,
.crm-site-cell {
  gap: 14px !important;
}

.crm-person-cell strong {
  color: var(--stak-ink) !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.crm-avatar {
  width: 40px !important;
  height: 40px !important;
  border: 1px solid rgba(23, 128, 173, 0.12) !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #eaf8f7, #eef7ff) !important;
  color: var(--stak-blue) !important;
}

.crm-badge {
  min-height: 24px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.crm-icon-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 40px !important;
  padding: 10px 14px !important;
  border: 1px solid rgba(15, 24, 48, 0.08) !important;
  border-radius: 12px !important;
  background: var(--stak-navy) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(15, 24, 48, 0.14) !important;
  font-weight: 900 !important;
}

.crm-icon-button:hover,
.crm-icon-button:focus {
  background: #1b2948 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.crm-partner-notice {
  border-color: rgba(255, 211, 122, 0.72) !important;
  border-radius: 16px !important;
  background: var(--stak-cream) !important;
  box-shadow: 0 14px 30px rgba(15, 24, 48, 0.07) !important;
}

.crm-empty-state {
  border-radius: 16px !important;
  background: #f8fafc !important;
}

@media (max-width: 860px) {
  header.crm.crm-modern-header {
    padding: 0 16px !important;
  }

  .crm-app-shell {
    padding: 18px 14px 38px !important;
  }

  .crm-page-hero {
    min-height: auto !important;
    padding: 24px 22px 28px !important;
    align-items: flex-start !important;
  }

  .crm-page-hero h1 {
    font-size: 36px !important;
  }

  .crm-toolbar {
    align-items: stretch !important;
  }

  .crm-search-field {
    min-width: 100% !important;
  }

  .crm-checkbox {
    justify-content: flex-start !important;
    width: 100% !important;
  }

  .crm-card-header {
    padding: 20px !important;
  }

  .crm-table tbody td,
  .crm-table tbody th {
    padding: 13px 16px !important;
  }
}

/* Internal CRM dialog refresh */
.modal-backdrop.in,
.modal-backdrop.crm-site-modal-backdrop,
.modal-backdrop.crm-site-action-modal-backdrop {
  background: #07111f !important;
  opacity: 0.72 !important;
}

.modal-content:has(.crm-modal),
.modal-content:has(.team-member-modal--confirm),
.crm-site-modal-window .modal-content,
.crm-site-delete-modal-window .modal-content,
.crm-partner-modal-window .modal-content,
.crm-legacy-popup .modal-content {
  overflow: hidden !important;
  border: 1px solid rgba(255, 211, 122, 0.24) !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 34px 90px rgba(7, 17, 31, 0.38) !important;
}

.modal-content .crm-modal .modal-header,
.crm-legacy-popup .modal-header {
  position: relative !important;
  overflow: hidden !important;
  padding: 26px 30px 28px !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
  background:
    radial-gradient(circle at 95% 0%, rgba(255, 211, 122, 0.15), transparent 36%),
    linear-gradient(135deg, #0f1830 0%, #1b2948 100%) !important;
  color: #ffffff !important;
}

.modal-content .crm-modal .modal-header::after,
.crm-legacy-popup .modal-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--stak-yellow), #ffe6a8 45%, var(--stak-teal));
}

.modal-content .crm-modal .modal-header > *,
.crm-legacy-popup .modal-header > * {
  position: relative;
  z-index: 1;
}

.modal-content .crm-modal .modal-title,
.crm-legacy-popup .modal-title {
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  line-height: 1.08 !important;
}

.modal-content .crm-modal .crm-eyebrow,
.crm-legacy-popup .crm-eyebrow {
  margin: 0 0 9px !important;
  color: var(--stak-yellow) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.16em !important;
}

.modal-content .crm-modal .modal-header .crm-modal-help {
  max-width: 660px !important;
  color: rgba(255, 255, 255, 0.72) !important;
  font-weight: 700 !important;
}

.modal-content .crm-modal .modal-body,
.crm-legacy-popup .modal-body {
  padding: 24px 30px !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(234, 248, 247, 0.72), transparent 34%),
    #f7fafc !important;
}

.modal-content .crm-modal .modal-footer,
.crm-legacy-popup .modal-footer {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  padding: 18px 30px 22px !important;
  border-top: 1px solid rgba(15, 24, 48, 0.08) !important;
  background: #ffffff !important;
}

.modal-content .crm-modal .crm-modal-section {
  padding: 18px !important;
  border: 1px solid rgba(15, 24, 48, 0.08) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 14px 30px rgba(15, 24, 48, 0.07) !important;
}

.modal-content .crm-modal .crm-modal-section h4 {
  color: var(--stak-ink) !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.modal-content .crm-modal .control-label,
.modal-content .crm-modal label:not(.crm-toggle-field):not(.crm-file-upload):not(.crm-delete-acknowledgement) {
  color: #26354b !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.modal-content .crm-modal .form-control,
.modal-content .crm-modal select.form-control,
.modal-content .crm-modal input.form-control {
  min-height: 48px !important;
  border: 1px solid rgba(15, 24, 48, 0.12) !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  color: var(--stak-ink) !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

.modal-content .crm-modal .form-control:focus,
.modal-content .crm-modal select.form-control:focus,
.modal-content .crm-modal input.form-control:focus {
  border-color: rgba(255, 211, 122, 0.96) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(255, 211, 122, 0.24) !important;
}

.modal-content .crm-modal .help-block,
.modal-content .crm-modal .crm-modal-help {
  color: #69778b !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.modal-content .crm-modal .help-block.has-error,
.modal-content .crm-modal .has-error,
.modal-content .crm-modal .has-error .control-label {
  color: #b42318 !important;
}

.modal-content .crm-modal .has-error .form-control {
  border-color: #e5a3a3 !important;
  background: #fff8f8 !important;
}

.modal-content .crm-modal .crm-site-edit-summary,
.modal-content .crm-modal .crm-delete-site-summary {
  border: 1px solid rgba(255, 211, 122, 0.5) !important;
  border-radius: 16px !important;
  background: #fff8ec !important;
  box-shadow: 0 12px 24px rgba(15, 24, 48, 0.06) !important;
}

.modal-content .crm-modal .crm-site-edit-summary__mark,
.modal-content .crm-modal .crm-delete-site-summary span,
.modal-content .crm-modal .crm-new-client-summary .crm-site-edit-summary__mark {
  background: var(--stak-navy) !important;
  color: var(--stak-yellow) !important;
}

.modal-content .crm-modal .crm-toggle-field,
.modal-content .crm-modal .crm-logo-choice,
.modal-content .crm-modal .crm-file-upload,
.modal-content .crm-modal .crm-current-logo-link {
  border-radius: 13px !important;
}

.modal-content .crm-modal .crm-toggle-field,
.modal-content .crm-modal .crm-logo-choice {
  border-color: rgba(15, 24, 48, 0.1) !important;
  background: #f8fafc !important;
}

.modal-content .crm-modal .crm-toggle-field input,
.modal-content .crm-modal input[type="checkbox"],
.modal-content .crm-modal input[type="radio"] {
  accent-color: var(--stak-navy) !important;
}

.modal-content .crm-modal .crm-file-upload,
.modal-content .crm-modal .crm-current-logo-link {
  border-color: rgba(23, 128, 173, 0.2) !important;
  background: #edf8fb !important;
  color: var(--stak-blue) !important;
}

.modal-content .crm-modal .crm-delete-warning {
  border-radius: 15px !important;
  border-color: rgba(212, 77, 77, 0.28) !important;
  background: #fff3f1 !important;
}

.modal-content .crm-modal .crm-delete-acknowledgement {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  margin: 0 !important;
  color: #26354b !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
}

.modal-content .crm-modal .btn,
.crm-legacy-popup .btn {
  min-height: 44px !important;
  padding: 11px 18px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.modal-content .crm-modal .btn-primary,
.crm-legacy-popup .btn-primary {
  border-color: var(--stak-navy) !important;
  background: var(--stak-navy) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(15, 24, 48, 0.18) !important;
}

.modal-content .crm-modal .btn-primary:hover,
.modal-content .crm-modal .btn-primary:focus,
.crm-legacy-popup .btn-primary:hover,
.crm-legacy-popup .btn-primary:focus {
  border-color: #1b2948 !important;
  background: #1b2948 !important;
  color: #ffffff !important;
}

.modal-content .crm-modal .btn-default,
.crm-legacy-popup .btn-default {
  border-color: rgba(15, 24, 48, 0.14) !important;
  background: #ffffff !important;
  color: var(--stak-ink) !important;
}

.modal-content .crm-modal .btn-default:hover,
.modal-content .crm-modal .btn-default:focus,
.crm-legacy-popup .btn-default:hover,
.crm-legacy-popup .btn-default:focus {
  border-color: rgba(255, 211, 122, 0.72) !important;
  background: var(--stak-cream) !important;
}

.modal-content .crm-modal .btn-danger {
  border-color: #d4423c !important;
  background: #d4423c !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(180, 35, 24, 0.16) !important;
}

.modal-content .crm-modal .btn-danger:hover,
.modal-content .crm-modal .btn-danger:focus {
  border-color: #b42318 !important;
  background: #b42318 !important;
  color: #ffffff !important;
}

.modal-content .team-member-modal--confirm {
  overflow: hidden !important;
  border-radius: 20px !important;
  background: #ffffff !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__header {
  padding: 28px 30px !important;
  background:
    radial-gradient(circle at 95% 0%, rgba(255, 211, 122, 0.15), transparent 36%),
    linear-gradient(135deg, #0f1830 0%, #1b2948 100%) !important;
  color: #ffffff !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__eyebrow {
  color: var(--stak-yellow) !important;
  letter-spacing: 0.16em !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__title {
  color: #ffffff !important;
  font-weight: 900 !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__subtitle {
  color: rgba(255, 255, 255, 0.76) !important;
  font-weight: 700 !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__footer {
  padding: 18px 30px 24px !important;
  border-top: 1px solid rgba(15, 24, 48, 0.08) !important;
  background: #ffffff !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button {
  min-height: 44px !important;
  border-radius: 12px !important;
  font-weight: 900 !important;
}

@media (max-width: 860px) {
  .modal-content:has(.crm-modal),
  .modal-content:has(.team-member-modal--confirm),
  .crm-site-modal-window .modal-content,
  .crm-site-delete-modal-window .modal-content,
  .crm-partner-modal-window .modal-content {
    border-radius: 16px !important;
  }

  .modal-content .crm-modal .modal-header,
  .crm-legacy-popup .modal-header,
  .modal-content .team-member-modal--confirm .team-member-modal__header {
    padding: 22px 20px 24px !important;
  }

  .modal-content .crm-modal .modal-body,
  .crm-legacy-popup .modal-body {
    padding: 18px !important;
  }

  .modal-content .crm-modal .modal-footer,
  .crm-legacy-popup .modal-footer,
  .modal-content .team-member-modal--confirm .team-member-modal__footer {
    padding: 16px 18px 20px !important;
  }

  .modal-content .crm-modal .modal-footer .btn {
    width: 100% !important;
  }
}

/* Internal CRM component refinement */
header.crm.crm-modern-header {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
}

header.crm.crm-modern-header .crm-header-bar {
  gap: 24px !important;
}

header.crm.crm-modern-header .crm-role-navigation {
  gap: 6px !important;
  margin-left: 12px !important;
  padding: 6px !important;
  border: 1px solid rgba(15, 24, 48, 0.08) !important;
  border-radius: 16px !important;
  background: #f7f3ea !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74) !important;
}

header.crm.crm-modern-header .crm-role-navigation a,
header.crm.crm-modern-header .crm-role-navigation a:hover,
header.crm.crm-modern-header .crm-role-navigation a:focus {
  min-height: 44px !important;
  padding: 11px 18px !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #314056 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

header.crm.crm-modern-header .crm-role-navigation a:hover,
header.crm.crm-modern-header .crm-role-navigation a:focus {
  border-color: rgba(255, 211, 122, 0.72) !important;
  background: #fff8ec !important;
  color: var(--stak-ink) !important;
}

header.crm.crm-modern-header .crm-role-navigation a.is-active,
header.crm.crm-modern-header .crm-role-navigation a.is-active:hover,
header.crm.crm-modern-header .crm-role-navigation a.is-active:focus {
  border-color: var(--stak-navy) !important;
  background: var(--stak-navy) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(15, 24, 48, 0.18) !important;
}

header.crm.crm-modern-header .crm-admin-toggle,
header.crm.crm-modern-header .crm-admin-toggle:hover,
header.crm.crm-modern-header .crm-admin-toggle:focus {
  min-height: 48px !important;
  padding: 7px 16px 7px 8px !important;
  border: 1px solid rgba(15, 24, 48, 0.1) !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: var(--stak-ink) !important;
  box-shadow: 0 12px 26px rgba(15, 24, 48, 0.12) !important;
}

header.crm.crm-modern-header .crm-admin-toggle:hover,
header.crm.crm-modern-header .crm-admin-toggle:focus {
  border-color: rgba(255, 211, 122, 0.82) !important;
  background: #fffaf2 !important;
}

header.crm.crm-modern-header .crm-admin-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 999px !important;
  background: var(--stak-navy) !important;
  color: var(--stak-yellow) !important;
  box-shadow: none !important;
}

.crm-admin-dropdown.dropdown-menu {
  top: 58px !important;
  right: 0 !important;
  min-width: 230px !important;
  padding: 10px !important;
  border: 1px solid rgba(15, 24, 48, 0.1) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 54px rgba(15, 24, 48, 0.22) !important;
}

.crm-admin-dropdown.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -9px;
  right: 42px;
  width: 18px;
  height: 18px;
  border-left: 1px solid rgba(15, 24, 48, 0.1);
  border-top: 1px solid rgba(15, 24, 48, 0.1);
  background: #ffffff;
  transform: rotate(45deg);
}

.crm-admin-dropdown.dropdown-menu li a,
.crm-admin-dropdown.dropdown-menu li a:hover,
.crm-admin-dropdown.dropdown-menu li a:focus {
  gap: 10px !important;
  min-height: 46px !important;
  padding: 12px 14px !important;
  border-left: 4px solid transparent !important;
  border-radius: 11px !important;
  background: #fffaf2 !important;
  color: var(--stak-ink) !important;
  font-weight: 900 !important;
}

.crm-admin-dropdown.dropdown-menu li a:hover,
.crm-admin-dropdown.dropdown-menu li a:focus {
  border-left-color: var(--stak-yellow) !important;
  background: var(--stak-navy) !important;
  color: #ffffff !important;
}

.crm-admin-dropdown.dropdown-menu li a i {
  color: inherit !important;
}

.crm-card--table {
  border-radius: 18px !important;
  border-color: rgba(15, 24, 48, 0.08) !important;
  box-shadow: 0 20px 42px rgba(15, 24, 48, 0.1) !important;
}

.crm-table-scroll {
  background: #ffffff !important;
}

.crm-table {
  table-layout: auto !important;
  background: #ffffff !important;
}

.crm-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  padding: 14px 22px !important;
  border-bottom: 1px solid rgba(15, 24, 48, 0.12) !important;
  background: #f7f3ea !important;
  color: #596474 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

.crm-table tbody tr {
  background: #ffffff !important;
  box-shadow: inset 0 -1px 0 rgba(15, 24, 48, 0.07) !important;
}

.crm-table tbody td,
.crm-table tbody th {
  padding: 18px 22px !important;
  border-bottom: 0 !important;
  color: #26354b !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
}

.crm-table tbody tr:hover td,
.crm-table tbody tr:hover th {
  background: #fffaf2 !important;
}

.crm-table tbody td strong,
.crm-table tbody th strong {
  color: var(--stak-ink) !important;
  font-weight: 900 !important;
}

.crm-table-secondary {
  margin-top: 5px !important;
  color: #718095 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.crm-table-action {
  width: 1% !important;
  min-width: 190px !important;
}

.crm-action-row,
.crm-action-row--wrap {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.crm-action-button,
.crm-action-button:visited,
.crm-icon-button,
.crm-icon-button:visited {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 38px !important;
  padding: 9px 13px !important;
  border: 1px solid rgba(15, 24, 48, 0.12) !important;
  border-radius: 11px !important;
  background: #ffffff !important;
  color: var(--stak-ink) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.crm-action-button:hover,
.crm-action-button:focus,
.crm-icon-button:hover,
.crm-icon-button:focus {
  border-color: rgba(255, 211, 122, 0.8) !important;
  background: #fff8ec !important;
  color: var(--stak-ink) !important;
  transform: translateY(-1px);
}

.crm-action-button--edit,
.crm-icon-button {
  border-color: rgba(15, 24, 48, 0.16) !important;
  background: var(--stak-navy) !important;
  color: #ffffff !important;
}

.crm-action-button--edit:hover,
.crm-action-button--edit:focus,
.crm-icon-button:hover,
.crm-icon-button:focus {
  border-color: var(--stak-navy) !important;
  background: #1b2948 !important;
  color: #ffffff !important;
}

.crm-action-button--restore {
  border-color: rgba(47, 148, 97, 0.26) !important;
  background: #f1fbf4 !important;
  color: #21653b !important;
}

.crm-action-button--restore:hover,
.crm-action-button--restore:focus {
  background: #e8f7ed !important;
  color: #194e2d !important;
}

.crm-action-button--danger {
  border-color: rgba(180, 35, 24, 0.22) !important;
  background: #fff5f3 !important;
  color: #b42318 !important;
}

.crm-action-button--danger:hover,
.crm-action-button--danger:focus {
  background: #ffe9e6 !important;
  color: #8f1c13 !important;
}

.crm-action-button--delete {
  border-color: rgba(146, 20, 12, 0.34) !important;
  background: #b42318 !important;
  color: #ffffff !important;
}

.crm-action-button--delete:hover,
.crm-action-button--delete:focus {
  background: #8f1c13 !important;
  color: #ffffff !important;
}

.crm-partner-detail-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 24px !important;
  margin-bottom: 24px !important;
}

.crm-partner-detail-card {
  min-height: 100% !important;
}

.crm-detail-list {
  display: grid !important;
  gap: 14px !important;
  padding: 24px !important;
}

.crm-detail-list > div {
  display: grid !important;
  gap: 6px !important;
}

.crm-detail-list span,
.crm-delete-summary p,
.crm-delete-summary li {
  color: #68798d !important;
  font-weight: 800 !important;
}

.crm-detail-list strong {
  color: var(--stak-ink) !important;
  font-weight: 900 !important;
  overflow-wrap: anywhere !important;
}

.crm-partner-metric-grid {
  display: grid !important;
  gap: 14px !important;
  padding: 24px !important;
}

.crm-delete-summary {
  display: grid !important;
  gap: 14px !important;
  padding: 24px !important;
}

.crm-delete-summary ul {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
  padding-left: 18px !important;
}

.crm-partner-delete-modal__body {
  display: grid !important;
  gap: 16px !important;
  padding: 22px 24px 8px !important;
}

.crm-partner-delete-loading,
.crm-partner-delete-error,
.crm-partner-delete-decision,
.crm-partner-delete-check {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
}

.crm-partner-delete-loading {
  min-height: 120px !important;
  align-content: center !important;
  justify-content: center !important;
  color: var(--stak-ink) !important;
}

.crm-partner-delete-loading i {
  color: var(--stak-gold-dark) !important;
  font-size: 20px !important;
}

.crm-partner-delete-checks {
  display: grid !important;
  gap: 10px !important;
}

.crm-partner-delete-check {
  border: 1px solid #dce3ec !important;
  border-radius: 6px !important;
  padding: 13px 14px !important;
  background: #ffffff !important;
}

.crm-partner-delete-check i,
.crm-partner-delete-decision i,
.crm-partner-delete-error i {
  margin-top: 2px !important;
  font-size: 18px !important;
}

.crm-partner-delete-check strong,
.crm-partner-delete-decision strong,
.crm-partner-delete-error strong {
  display: block !important;
  color: var(--stak-ink) !important;
  font-weight: 900 !important;
}

.crm-partner-delete-check p,
.crm-partner-delete-decision p,
.crm-partner-delete-error p {
  margin: 4px 0 0 !important;
  color: #68798d !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
}

.crm-partner-delete-check--passed i,
.crm-partner-delete-decision--ready i {
  color: #237a45 !important;
}

.crm-partner-delete-check--failed i,
.crm-partner-delete-decision--blocked i,
.crm-partner-delete-error i {
  color: #b42318 !important;
}

.crm-partner-delete-decision,
.crm-partner-delete-error {
  border-radius: 6px !important;
  padding: 14px !important;
}

.crm-partner-delete-decision--ready {
  border: 1px solid #b7dec3 !important;
  background: #f2faf4 !important;
}

.crm-partner-delete-decision--blocked,
.crm-partner-delete-error {
  border: 1px solid #efc3bd !important;
  background: #fff5f3 !important;
}

.crm-partner-delete-modal-window .modal-dialog {
  width: min(680px, calc(100vw - 32px)) !important;
}

.crm-partner-clients-table tbody td:nth-child(3),
.crm-partner-clients-table tbody td:nth-child(4) {
  color: #3b485d !important;
  font-weight: 750 !important;
}

@media (max-width: 1080px) {
  .crm-partner-detail-grid {
    grid-template-columns: 1fr !important;
  }
}

.crm-status-badge,
.crm-badge {
  min-height: 28px !important;
  padding: 6px 11px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-transform: capitalize !important;
}

.crm-status-badge--active,
.crm-status-badge--paid,
.crm-badge--free,
span.isFree {
  border-color: rgba(47, 148, 97, 0.22) !important;
  background: #f1fbf4 !important;
  color: #21653b !important;
}

.crm-status-badge--trial,
.crm-status-badge--suspended,
.crm-badge--trial,
span.isTrial {
  border-color: rgba(255, 211, 122, 0.72) !important;
  background: #fff8ec !important;
  color: #8a5700 !important;
}

.crm-status-badge--free,
.crm-status-badge--earned {
  border-color: rgba(15, 24, 48, 0.14) !important;
  background: #f7f3ea !important;
  color: var(--stak-ink) !important;
}

.crm-status-badge--revoked,
.crm-status-badge--reversed,
.crm-badge--revoked {
  border-color: rgba(180, 35, 24, 0.22) !important;
  background: #fff5f3 !important;
  color: #b42318 !important;
}

.crm-partner-metrics {
  gap: 18px !important;
}

.crm-partner-metric {
  position: relative !important;
  overflow: hidden !important;
  min-height: 118px !important;
  padding: 22px 24px !important;
  border-radius: 18px !important;
  background: #ffffff !important;
}

.crm-partner-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(180deg, var(--stak-yellow), #fff0be);
}

.crm-partner-metric span {
  color: #7b5a1d !important;
  font-size: 12px !important;
  letter-spacing: 0.12em !important;
}

.crm-partner-metric strong {
  color: var(--stak-ink) !important;
  font-size: 30px !important;
  font-weight: 900 !important;
}

.crm-partner-notice,
.crm-toolbar {
  border-color: rgba(15, 24, 48, 0.08) !important;
  background: #ffffff !important;
}

.crm-partner-notice > i,
.crm-empty-state i {
  color: var(--stak-yellow) !important;
}

.crm-empty-state {
  color: #69778b !important;
}

.crm-sort-header,
.crm-sort-header:hover,
.crm-sort-header:focus {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  font-weight: 900 !important;
  text-transform: inherit !important;
}

@media (max-width: 860px) {
  header.crm.crm-modern-header .crm-role-navigation {
    width: 100% !important;
    margin: 10px 0 0 !important;
    overflow-x: auto !important;
  }

  header.crm.crm-modern-header .crm-role-navigation a {
    white-space: nowrap !important;
  }

  .crm-table-action {
    width: auto !important;
    min-width: 0 !important;
  }

  .crm-action-row,
  .crm-action-row--wrap {
    justify-content: flex-start !important;
  }

  .crm-action-button,
  .crm-icon-button {
    min-height: 36px !important;
    padding: 8px 11px !important;
  }
}

/* StakTask toast notifications */
#toast-container {
  z-index: 110000 !important;
  pointer-events: none !important;
}

#toast-container.toast-top-center {
  top: 24px !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
}

#toast-container.toast-top-right {
  top: 24px !important;
  right: 24px !important;
}

#toast-container.toast-bottom-right {
  right: 24px !important;
  bottom: 24px !important;
}

#toast-container > div,
#toast-container.toast-top-center > div,
#toast-container.toast-bottom-center > div {
  position: relative !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  width: min(520px, calc(100vw - 32px)) !important;
  min-height: 78px !important;
  margin: 0 auto 12px !important;
  padding: 18px 48px 18px 76px !important;
  border: 1px solid rgba(15, 24, 48, 0.1) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  background-image: none !important;
  color: var(--stak-ink) !important;
  box-shadow: 0 28px 70px rgba(7, 17, 31, 0.24) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0);
}

#toast-container.toast-top-right > div,
#toast-container.toast-bottom-right > div {
  margin-right: 0 !important;
}

#toast-container > div::before {
  position: absolute;
  left: 18px;
  top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-family: FontAwesome;
  font-size: 17px;
  line-height: 1;
}

#toast-container > div::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 18px 0 0 18px;
}

#toast-container > .toast-success {
  border-color: rgba(47, 148, 97, 0.2) !important;
}

#toast-container > .toast-success::before {
  content: "\f00c";
  background: #f1fbf4;
  color: #21653b;
}

#toast-container > .toast-success::after {
  background: #35b974;
}

#toast-container > .toast-error {
  border-color: rgba(180, 35, 24, 0.2) !important;
}

#toast-container > .toast-error::before {
  content: "\f12a";
  background: #fff5f3;
  color: #b42318;
}

#toast-container > .toast-error::after {
  background: #d4423c;
}

#toast-container > .toast-warning {
  border-color: rgba(255, 211, 122, 0.72) !important;
}

#toast-container > .toast-warning::before {
  content: "\f071";
  background: #fff8ec;
  color: #8a5700;
}

#toast-container > .toast-warning::after {
  background: var(--stak-yellow);
}

#toast-container > .toast-info {
  border-color: rgba(15, 24, 48, 0.14) !important;
}

#toast-container > .toast-info::before {
  content: "\f129";
  background: #f7f3ea;
  color: var(--stak-ink);
}

#toast-container > .toast-info::after {
  background: var(--stak-navy);
}

#toast-container .toast-title {
  margin: 0 0 4px !important;
  color: var(--stak-ink) !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
}

#toast-container .toast-message {
  max-width: 390px !important;
  margin: 0 !important;
  color: #3d4a5f !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.38 !important;
}

#toast-container .toast-message a,
#toast-container .toast-message label {
  color: var(--stak-ink) !important;
  font-weight: 900 !important;
}

#toast-container .toast-close-button {
  position: absolute !important;
  top: 15px !important;
  right: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 999px !important;
  background: #f7f3ea !important;
  color: var(--stak-ink) !important;
  font-size: 18px !important;
  line-height: 1 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

#toast-container .toast-close-button:hover,
#toast-container .toast-close-button:focus {
  background: var(--stak-navy) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

#toast-container .toast-progress {
  right: 12px !important;
  bottom: 8px !important;
  left: 76px !important;
  width: auto !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: rgba(15, 24, 48, 0.18) !important;
  opacity: 1 !important;
}

#toast-container .toast.ng-enter {
  opacity: 0 !important;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease !important;
}

#toast-container .toast.ng-enter.ng-enter-active {
  opacity: 1 !important;
  transform: translateY(0) scale(1);
}

#toast-container .toast.ng-leave {
  opacity: 1 !important;
  transform: translateY(0) scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease !important;
}

#toast-container .toast.ng-leave.ng-leave-active {
  opacity: 0 !important;
  transform: translateY(-8px) scale(0.98);
}

@media (max-width: 560px) {
  #toast-container.toast-top-right,
  #toast-container.toast-top-center,
  #toast-container.toast-bottom-right {
    top: 12px !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
  }

  #toast-container > div,
  #toast-container.toast-top-center > div,
  #toast-container.toast-bottom-center > div {
    width: calc(100vw - 24px) !important;
    min-height: 72px !important;
    padding: 16px 42px 16px 66px !important;
    border-radius: 16px !important;
  }

  #toast-container > div::before {
    left: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
  }

  #toast-container .toast-progress {
    left: 66px !important;
  }
}

/* Keep CRM account menu above page cards */
header.crm.crm-modern-header {
  position: relative !important;
  z-index: 12000 !important;
  overflow: visible !important;
}

header.crm.crm-modern-header .crm-header-bar,
header.crm.crm-modern-header .crm-admin-menu,
header.crm.crm-modern-header .dropdown-wrapper {
  position: relative !important;
  overflow: visible !important;
  z-index: 12010 !important;
}

header.crm.crm-modern-header .crm-admin-dropdown.dropdown-menu {
  z-index: 12020 !important;
}

.crm-app-shell {
  position: relative !important;
  z-index: 1 !important;
}

.crm-page-hero,
.crm-card,
.crm-toolbar {
  z-index: auto !important;
}

/* CRM mobile and tablet layout refinement */
@media (max-width: 1100px) {
  header.crm.crm-modern-header {
    height: auto !important;
    min-height: 86px !important;
    padding: 14px 18px !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 14px 34px rgba(15, 24, 48, 0.1) !important;
  }

  header.crm.crm-modern-header .crm-header-bar {
    display: flex !important;
    align-items: center !important;
    min-height: 58px !important;
    height: auto !important;
    gap: 12px !important;
  }

  header.crm.crm-modern-header .crm-menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(15, 24, 48, 0.1) !important;
    border-radius: 16px !important;
    background: #fff8ec !important;
    box-shadow: 0 12px 24px rgba(15, 24, 48, 0.1) !important;
  }

  header.crm.crm-modern-header .crm-menu-toggle div.bar1,
  header.crm.crm-modern-header .crm-menu-toggle div.bar2,
  header.crm.crm-modern-header .crm-menu-toggle div.bar3 {
    width: 28px !important;
    height: 3px !important;
    margin: 4px 0 !important;
    border-radius: 999px !important;
    background: var(--stak-navy) !important;
  }

  header.crm.crm-modern-header .crm-brand {
    display: inline-flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  header.crm.crm-modern-header .crm-brand-mark {
    width: 42px !important;
    height: 42px !important;
    border-radius: 13px !important;
  }

  header.crm.crm-modern-header .crm-brand-copy strong {
    font-size: 18px !important;
  }

  header.crm.crm-modern-header .crm-brand-copy small {
    color: #8a5700 !important;
  }

  header.crm.crm-modern-header .crm-role-navigation,
  header.crm.crm-modern-header .crm-admin-menu,
  header.crm.crm-modern-header .crm-primary-nav {
    display: none !important;
  }

  header.crm.crm-modern-header .crm-mobile-drawer {
    position: fixed !important;
    top: 86px !important;
    right: 14px !important;
    bottom: 14px !important;
    left: 14px !important;
    display: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 18px !important;
    overflow-y: auto !important;
    border: 1px solid rgba(15, 24, 48, 0.1) !important;
    border-radius: 22px !important;
    background:
      linear-gradient(180deg, #ffffff 0%, #fbfaf6 100%) !important;
    box-shadow: 0 34px 80px rgba(7, 17, 31, 0.26) !important;
  }

  header.crm.crm-modern-header.mobile-menu-open .crm-mobile-drawer {
    display: block !important;
  }

  header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle {
    background: var(--stak-navy) !important;
  }

  header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle div.bar1,
  header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle div.bar2,
  header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle div.bar3 {
    background: #ffffff !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav,
  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 10px !important;
    float: none !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list li {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin {
    padding: 14px !important;
    border: 1px solid rgba(255, 211, 122, 0.58) !important;
    border-radius: 18px !important;
    background: #fff8ec !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin > span {
    display: block !important;
    width: 100% !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin > span > a,
  header.crm.crm-modern-header .crm-mobile-admin > span > a:hover,
  header.crm.crm-modern-header .crm-mobile-admin > span > a:focus {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 52px !important;
    width: 100% !important;
    padding: 6px 12px 6px 6px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: transparent !important;
    color: var(--stak-ink) !important;
    box-shadow: none !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin .crm-admin-avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 15px !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu {
    position: static !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 12px 0 0 !important;
    padding: 8px !important;
    border: 1px solid rgba(15, 24, 48, 0.1) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu::before {
    display: none !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:not(.crm-mobile-admin) > a,
  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:not(.crm-mobile-admin) > a:hover,
  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:not(.crm-mobile-admin) > a:focus {
    display: flex !important;
    align-items: center !important;
    min-height: 58px !important;
    width: 100% !important;
    padding: 0 18px !important;
    border: 1px solid rgba(15, 24, 48, 0.08) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    color: #35455c !important;
    box-shadow: 0 10px 22px rgba(15, 24, 48, 0.06) !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:not(.crm-mobile-admin) > a:hover,
  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:not(.crm-mobile-admin) > a:focus {
    border-color: rgba(255, 211, 122, 0.72) !important;
    background: #fff8ec !important;
    color: var(--stak-ink) !important;
  }

  header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:not(.crm-mobile-admin) > a::after {
    content: "\f105";
    margin-left: auto;
    color: #8a5700;
    font-family: FontAwesome;
    font-size: 18px;
    font-weight: normal;
  }

  .crm-app-shell {
    padding: 18px 14px 36px !important;
  }

  .crm-page-hero {
    min-height: auto !important;
    padding: 26px 22px 28px !important;
    border-radius: 22px !important;
  }

  .crm-page-hero h1 {
    font-size: 38px !important;
  }

  .crm-page-hero .crm-button {
    width: 100% !important;
  }

  .crm-toolbar,
  .crm-card {
    border-radius: 18px !important;
  }
}

@media (max-width: 560px) {
  header.crm.crm-modern-header {
    min-height: 78px !important;
    padding: 11px 12px !important;
  }

  header.crm.crm-modern-header .crm-header-bar {
    min-height: 56px !important;
  }

  header.crm.crm-modern-header .crm-menu-toggle {
    width: 52px !important;
    height: 52px !important;
  }

  header.crm.crm-modern-header .crm-brand-copy strong {
    font-size: 16px !important;
  }

  header.crm.crm-modern-header .crm-mobile-drawer {
    top: 78px !important;
    right: 10px !important;
    bottom: 10px !important;
    left: 10px !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .crm-page-hero {
    padding: 24px 18px !important;
  }

  .crm-page-hero h1 {
    font-size: 34px !important;
  }
}

/* CRM modal positioning and shared confirmation polish */
.modal-backdrop.in,
.modal-backdrop.crm-site-modal-backdrop,
.modal-backdrop.crm-site-action-modal-backdrop {
  z-index: 12900 !important;
}

.modal:has(.crm-modal),
.modal:has(.team-member-modal--confirm),
.modal.crm-site-modal-window,
.modal.crm-site-delete-modal-window,
.modal.crm-site-revoke-modal-window,
.modal.crm-partner-modal-window,
.modal.crm-legacy-popup {
  z-index: 13000 !important;
  padding-top: 112px !important;
  padding-right: 16px !important;
  padding-left: 16px !important;
}

.modal:has(.crm-modal) .modal-dialog,
.modal:has(.team-member-modal--confirm) .modal-dialog,
.modal.crm-site-modal-window .modal-dialog,
.modal.crm-site-delete-modal-window .modal-dialog,
.modal.crm-site-revoke-modal-window .modal-dialog,
.modal.crm-partner-modal-window .modal-dialog,
.modal.crm-legacy-popup .modal-dialog {
  margin: 0 auto 42px !important;
}

.modal:has(.team-member-modal--confirm) .modal-dialog,
.modal:has(.team-member-modal--confirm) .modal-dialog.modal-sm {
  width: min(620px, calc(100vw - 32px)) !important;
}

.modal-content:has(.team-member-modal--confirm) {
  overflow: hidden !important;
  border: 1px solid rgba(255, 211, 122, 0.42) !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  box-shadow: 0 38px 92px rgba(7, 17, 31, 0.42) !important;
}

.modal-content .team-member-modal--confirm {
  overflow: hidden !important;
  border-radius: 22px !important;
  background: #ffffff !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__header {
  position: relative !important;
  overflow: hidden !important;
  padding: 30px 34px 34px !important;
  border-bottom: 0 !important;
  background:
    radial-gradient(circle at 96% 0%, rgba(255, 211, 122, 0.2), transparent 34%),
    linear-gradient(135deg, #0f1830 0%, #1b2948 100%) !important;
  color: #ffffff !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--stak-yellow), #ffe6a8 45%, var(--stak-teal));
}

.modal-content .team-member-modal--confirm .team-member-modal__eyebrow {
  display: block !important;
  margin: 0 0 10px !important;
  color: var(--stak-yellow) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.16em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__title {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(34px, 4vw, 52px) !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  line-height: 1.02 !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__subtitle {
  max-width: 520px !important;
  margin: 18px 0 0 !important;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__footer {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  padding: 24px 34px 28px !important;
  border-top: 0 !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(234, 248, 247, 0.58), transparent 36%),
    #ffffff !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-width: 154px !important;
  min-height: 52px !important;
  padding: 13px 22px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button--primary {
  border-color: var(--stak-navy) !important;
  background: var(--stak-navy) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 30px rgba(15, 24, 48, 0.2) !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button--primary:hover,
.modal-content .team-member-modal--confirm .team-member-modal__button--primary:focus {
  border-color: #1b2948 !important;
  background: #1b2948 !important;
  color: #ffffff !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button--warning {
  border-color: var(--stak-yellow) !important;
  background: linear-gradient(180deg, var(--stak-yellow), #fff0be) !important;
  color: var(--stak-ink) !important;
  box-shadow: 0 16px 30px rgba(255, 211, 122, 0.2) !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button--danger {
  border-color: #d4423c !important;
  background: #d4423c !important;
  color: #ffffff !important;
  box-shadow: 0 16px 30px rgba(180, 35, 24, 0.18) !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button--secondary {
  border-color: rgba(15, 24, 48, 0.14) !important;
  background: #ffffff !important;
  color: var(--stak-ink) !important;
}

.modal-content .team-member-modal--confirm .team-member-modal__button--secondary:hover,
.modal-content .team-member-modal--confirm .team-member-modal__button--secondary:focus {
  border-color: rgba(255, 211, 122, 0.82) !important;
  background: var(--stak-cream) !important;
  color: var(--stak-ink) !important;
}

@media (max-width: 1100px) {
  .modal:has(.crm-modal),
  .modal:has(.team-member-modal--confirm),
  .modal.crm-site-modal-window,
  .modal.crm-site-delete-modal-window,
  .modal.crm-site-revoke-modal-window,
  .modal.crm-partner-modal-window,
  .modal.crm-legacy-popup {
    padding-top: 102px !important;
  }
}

@media (max-width: 560px) {
  .modal:has(.crm-modal),
  .modal:has(.team-member-modal--confirm),
  .modal.crm-site-modal-window,
  .modal.crm-site-delete-modal-window,
  .modal.crm-site-revoke-modal-window,
  .modal.crm-partner-modal-window,
  .modal.crm-legacy-popup {
    padding-top: 92px !important;
    padding-right: 10px !important;
    padding-left: 10px !important;
  }

  .modal:has(.team-member-modal--confirm) .modal-dialog,
  .modal:has(.team-member-modal--confirm) .modal-dialog.modal-sm {
    width: calc(100vw - 20px) !important;
  }

  .modal-content:has(.team-member-modal--confirm),
  .modal-content .team-member-modal--confirm {
    border-radius: 18px !important;
  }

  .modal-content .team-member-modal--confirm .team-member-modal__header {
    padding: 24px 22px 28px !important;
  }

  .modal-content .team-member-modal--confirm .team-member-modal__title {
    font-size: 36px !important;
  }

  .modal-content .team-member-modal--confirm .team-member-modal__subtitle {
    font-size: 18px !important;
  }

  .modal-content .team-member-modal--confirm .team-member-modal__footer {
    padding: 18px 20px 22px !important;
  }

  .modal-content .team-member-modal--confirm .team-member-modal__button {
    width: 100% !important;
  }
}

/* CRM stacked modal ordering */
.modal.crm-site-modal-window {
  z-index: 13000 !important;
}

.modal-backdrop.crm-site-modal-backdrop {
  z-index: 12900 !important;
}

.modal-backdrop.crm-site-action-modal-backdrop,
body.crm-site-action-modal-open > .modal-backdrop.crm-site-action-modal-backdrop {
  z-index: 13060 !important;
  background-color: #07111f !important;
  opacity: 0.78 !important;
}

.modal.crm-site-delete-modal-window,
.modal.crm-site-revoke-modal-window,
.modal:has(.team-member-modal--confirm) {
  z-index: 13120 !important;
}

/* Mobile CRM header and drawer final override */
@media (max-width: 1100px) {
  html body header.crm.crm-modern-header {
    min-height: 84px !important;
    height: auto !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 8px 24px rgba(15, 24, 48, 0.08) !important;
  }

  html body header.crm.crm-modern-header .crm-header-bar,
  html body header.crm.crm-modern-header .crm-brand,
  html body header.crm.crm-modern-header .crm-brand-copy,
  html body header.crm.crm-modern-header .crm-brand-copy strong,
  html body header.crm.crm-modern-header .crm-brand-copy small {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-menu-toggle,
  html body header.crm.crm-modern-header .crm-menu-toggle:hover,
  html body header.crm.crm-modern-header .crm-menu-toggle:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(15, 24, 48, 0.12) !important;
  }

  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle,
  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle:hover,
  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle:focus {
    background: var(--stak-navy) !important;
    background-color: var(--stak-navy) !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-drawer {
    top: 84px !important;
    padding: 18px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 24px 60px rgba(15, 24, 48, 0.16) !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-nav,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:hover {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin {
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span > a,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a:focus,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span:focus {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--stak-ink) !important;
    text-align: left !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span > a {
    min-height: 58px !important;
    width: 100% !important;
    padding: 6px !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li:hover {
    padding: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:focus {
    min-height: 56px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 1px solid rgba(15, 24, 48, 0.12) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #2a6f8f !important;
    text-align: left !important;
    box-shadow: 0 8px 18px rgba(15, 24, 48, 0.05) !important;
  }
}

@media (max-width: 560px) {
  html body header.crm.crm-modern-header {
    min-height: 80px !important;
    padding: 12px !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-drawer {
    top: 80px !important;
    right: 10px !important;
    left: 10px !important;
  }
}

/* Final mobile CRM header and drawer reset */
@media (max-width: 1100px) {
  html body header.crm.crm-modern-header {
    min-height: 84px !important;
    height: auto !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 8px 24px rgba(15, 24, 48, 0.08) !important;
  }

  html body header.crm.crm-modern-header .crm-header-bar,
  html body header.crm.crm-modern-header .crm-brand,
  html body header.crm.crm-modern-header .crm-brand-copy,
  html body header.crm.crm-modern-header .crm-brand-copy strong,
  html body header.crm.crm-modern-header .crm-brand-copy small {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-menu-toggle,
  html body header.crm.crm-modern-header .crm-menu-toggle:hover,
  html body header.crm.crm-modern-header .crm-menu-toggle:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(15, 24, 48, 0.12) !important;
  }

  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle,
  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle:hover,
  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle:focus {
    background: var(--stak-navy) !important;
    background-color: var(--stak-navy) !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-drawer {
    top: 84px !important;
    padding: 18px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 24px 60px rgba(15, 24, 48, 0.16) !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-nav,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:hover {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin {
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span > a,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a:focus,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span:focus {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--stak-ink) !important;
    text-align: left !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span > a {
    min-height: 58px !important;
    width: 100% !important;
    padding: 6px !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li:hover {
    padding: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:focus {
    min-height: 56px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 1px solid rgba(15, 24, 48, 0.12) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #2a6f8f !important;
    text-align: left !important;
    box-shadow: 0 8px 18px rgba(15, 24, 48, 0.05) !important;
  }
}

@media (max-width: 560px) {
  html body header.crm.crm-modern-header {
    min-height: 80px !important;
    padding: 12px !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-drawer {
    top: 80px !important;
    right: 10px !important;
    left: 10px !important;
  }
}

@media (max-width: 1100px) {
  header.crm.crm-modern-header {
    min-height: 76px !important;
    padding: 10px 16px !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 10px 26px rgba(15, 24, 48, 0.08) !important;
  }

  header.crm.crm-modern-header .crm-header-bar {
    min-height: 56px !important;
    height: auto !important;
  }

  header.crm.crm-modern-header .crm-menu-toggle,
  header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle {
    background: #ffffff !important;
    border: 1px solid rgba(15, 24, 48, 0.12) !important;
    box-shadow: 0 8px 20px rgba(15, 24, 48, 0.08) !important;
  }

  header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle {
    background: var(--stak-navy) !important;
  }

  header.crm.crm-modern-header .crm-mobile-drawer {
    top: 76px !important;
    border-color: rgba(15, 24, 48, 0.08) !important;
    background: #ffffff !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin {
    padding: 10px !important;
    border-color: rgba(15, 24, 48, 0.08) !important;
    background: #ffffff !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin > span > a,
  header.crm.crm-modern-header .crm-mobile-admin > span > a:hover,
  header.crm.crm-modern-header .crm-mobile-admin > span > a:focus {
    padding: 6px 10px 6px 6px !important;
    background: #ffffff !important;
    color: var(--stak-ink) !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin > span > a > span:not(.crm-admin-avatar) {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: var(--stak-ink) !important;
    line-height: 1.15 !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu {
    margin-top: 10px !important;
    padding: 10px !important;
    background: #ffffff !important;
  }

  header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a,
  header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:hover,
  header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:focus {
    min-height: 54px !important;
    padding: 13px 18px !important;
    border: 1px solid rgba(15, 24, 48, 0.08) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #2a6f8f !important;
  }
}

@media (max-width: 560px) {
  header.crm.crm-modern-header {
    min-height: 76px !important;
    padding: 10px 12px !important;
  }

  header.crm.crm-modern-header .crm-mobile-drawer {
    top: 76px !important;
  }
}

/* Temporary sales demo accounts */
.crm-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-button--secondary,
.crm-button--secondary:visited {
  border-color: rgba(15, 124, 174, 0.3);
  background: #ffffff;
  color: #0b658f;
}

.crm-button--secondary:hover,
.crm-button--secondary:focus {
  border-color: #0f7cae;
  background: #edf6fa;
  color: #0b658f;
}

.crm-badge--demo {
  border-color: rgba(15, 124, 174, 0.28) !important;
  background: #edf6fa !important;
  color: #0b658f !important;
}

.crm-demo-countdown {
  display: inline-flex;
  align-items: center;
  color: #5f6f82;
  font-size: 12px;
  font-weight: 800;
}

.crm-demo-countdown--error {
  color: #b42318;
}

.crm-demo-cleanup-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-left: 4px solid #b42318;
  background: #fff5f3;
  color: #7a271a;
}

.crm-demo-cleanup-alert div {
  display: grid;
  gap: 3px;
}

.crm-demo-cleanup-alert span {
  color: #7a4a42;
  font-size: 13px;
}

.crm-client-table .crm-icon-button--danger {
  min-width: 38px !important;
  width: 38px !important;
  padding: 9px !important;
  border-color: rgba(180, 35, 24, 0.24) !important;
  color: #b42318 !important;
}

.crm-demo-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-left: 4px solid #d99a12;
  background: #fff8e8;
  color: #49370d;
}

.crm-demo-warning > i {
  margin-top: 2px;
  color: #9b6a00;
  font-size: 18px;
}

.crm-demo-warning div {
  display: grid;
  gap: 3px;
}

.crm-demo-warning span,
.crm-demo-site__heading span {
  color: #66758a;
  font-size: 13px;
}

.crm-demo-auto-email {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cce5df;
  background: #eef9f6;
  color: #174c41;
}

.crm-demo-auto-email > i {
  margin-top: 2px;
  color: #16865a;
  font-size: 18px;
}

.crm-demo-auto-email div {
  display: grid;
  gap: 3px;
}

.crm-demo-auto-email span {
  color: #587169;
  font-size: 13px;
}

.crm-demo-auto-email code {
  color: #174c41;
  background: transparent;
  font-weight: 800;
}

.crm-demo-section-heading,
.crm-demo-site__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-demo-section-heading h4 {
  margin: 0;
}

.crm-segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, 36px);
  border: 1px solid #cbd7df;
  border-radius: 8px;
  overflow: hidden;
}

.crm-segmented-control button {
  width: 36px;
  height: 34px;
  padding: 0;
  border: 0;
  border-right: 1px solid #cbd7df;
  background: #ffffff;
  color: #4e5f73;
  font-weight: 850;
}

.crm-segmented-control button:last-child {
  border-right: 0;
}

.crm-segmented-control button.is-active {
  background: #102033;
  color: #ffffff;
}

.crm-demo-site {
  padding: 18px 0;
  border-bottom: 1px solid #dfe7ec;
}

.crm-demo-site:last-child {
  border-bottom: 0;
}

.crm-demo-site__heading {
  margin-bottom: 14px;
}

.crm-demo-token-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.crm-demo-token-field .crm-icon-button {
  width: 42px !important;
  min-width: 42px !important;
  padding: 9px !important;
}

.crm-demo-credentials {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 22px 0 8px;
}

.crm-demo-credentials dt,
.crm-demo-credentials dd {
  margin: 0;
}

.crm-demo-credentials dt {
  color: #66758a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-demo-password {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

@media (max-width: 700px) {
  .crm-page-actions {
    width: 100%;
  }

  .crm-page-actions .crm-button {
    flex: 1 1 100%;
  }

  .crm-demo-section-heading,
  .crm-demo-site__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-demo-credentials {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .crm-demo-credentials dd {
    margin-bottom: 10px;
  }
}

/* Strong focus layer for destructive CRM dialogs opened from edit modals */
.modal-backdrop.crm-site-action-modal-backdrop,
.modal-backdrop.crm-site-action-modal-backdrop.in,
body.crm-site-action-modal-open > .modal-backdrop.crm-site-action-modal-backdrop,
body.crm-site-action-modal-open > .modal-backdrop.crm-site-action-modal-backdrop.in {
  z-index: 13080 !important;
  background: #020714 !important;
  opacity: 0.9 !important;
}

@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .modal-backdrop.crm-site-action-modal-backdrop,
  .modal-backdrop.crm-site-action-modal-backdrop.in,
  body.crm-site-action-modal-open > .modal-backdrop.crm-site-action-modal-backdrop,
  body.crm-site-action-modal-open > .modal-backdrop.crm-site-action-modal-backdrop.in {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
}

.modal.crm-site-delete-modal-window,
.modal.crm-site-revoke-modal-window {
  z-index: 13140 !important;
}

.modal.crm-site-delete-modal-window::before,
.modal.crm-site-revoke-modal-window::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(2, 7, 20, 0.74);
  pointer-events: auto;
}

@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))) {
  .modal.crm-site-delete-modal-window::before,
  .modal.crm-site-revoke-modal-window::before {
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
}

.modal.crm-site-delete-modal-window .modal-dialog,
.modal.crm-site-revoke-modal-window .modal-dialog {
  position: relative !important;
  z-index: 2 !important;
}

.modal.crm-site-delete-modal-window .modal-dialog,
.modal.crm-site-revoke-modal-window .modal-dialog,
.modal:has(.team-member-modal--confirm) .modal-dialog {
  position: relative !important;
  z-index: 1 !important;
}

/* CRM final consistency polish */
.crm-screen {
  row-gap: 22px !important;
}

.crm-page-hero {
  min-height: 136px !important;
  border-radius: 20px !important;
}

.crm-page-hero h1 {
  letter-spacing: 0 !important;
}

.crm-breadcrumb {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
  color: rgba(255, 255, 255, 0.68) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

.crm-breadcrumb a,
.crm-breadcrumb a:hover,
.crm-breadcrumb a:focus {
  color: var(--stak-yellow) !important;
  text-decoration: none !important;
}

.crm-toolbar {
  align-items: center !important;
  border-radius: 18px !important;
}

.crm-search-field input::placeholder,
.modal-content .crm-modal .form-control::placeholder,
.modal-content .crm-modal input.form-control::placeholder,
.crm-field .form-control::placeholder {
  color: #9aa7b8 !important;
  opacity: 1 !important;
}

.crm-client-profile-card {
  overflow: visible !important;
}

.crm-client-profile-card .crm-card-header,
.crm-sites-card .crm-card-header {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 211, 122, 0.13), transparent 35%),
    linear-gradient(180deg, #ffffff, #fbfcfd) !important;
}

.crm-form-grid {
  gap: 18px !important;
  padding: 24px 26px 28px !important;
  background: #ffffff !important;
}

.crm-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.crm-field label,
.modal-content .crm-modal .control-label,
.modal-content .crm-modal label:not(.crm-toggle-field):not(.crm-file-upload):not(.crm-delete-acknowledgement) {
  margin: 0 !important;
  color: #29384f !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.05em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

.crm-field .form-control,
.modal-content .crm-modal .form-control,
.modal-content .crm-modal select.form-control,
.modal-content .crm-modal input.form-control {
  min-height: 50px !important;
  border-radius: 14px !important;
  background: #f9fbfd !important;
}

.crm-field.has-error .form-control,
.modal-content .crm-modal .has-error .form-control {
  border-color: #efb3af !important;
  background: #fff8f7 !important;
  box-shadow: 0 0 0 4px rgba(212, 66, 60, 0.08) !important;
}

.crm-field.has-success .form-control,
.modal-content .crm-modal .has-success .form-control {
  border-color: rgba(47, 148, 97, 0.28) !important;
  background: #fbfffc !important;
}

.crm-field .help-block,
.modal-content .crm-modal .help-block {
  margin: 2px 0 0 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.crm-card--table {
  border-radius: 20px !important;
}

.crm-table-scroll {
  scrollbar-color: rgba(15, 24, 48, 0.26) transparent;
  scrollbar-width: thin;
}

.crm-table-scroll::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.crm-table-scroll::-webkit-scrollbar-thumb {
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: rgba(15, 24, 48, 0.24);
}

.crm-table thead th {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid rgba(15, 24, 48, 0.1) !important;
  background:
    linear-gradient(180deg, #fbf7ef 0%, #f6f2ea 100%) !important;
  color: #586274 !important;
}

.crm-table tbody td,
.crm-table tbody th {
  vertical-align: middle !important;
}

.crm-clickable-row {
  cursor: pointer !important;
}

.crm-clickable-row:hover td,
.crm-clickable-row:hover th {
  background: #fff7e8 !important;
}

.crm-client-table tbody td:nth-child(2),
.crm-client-table tbody td:nth-child(3),
.crm-sites-table tbody td:nth-child(2),
.crm-sites-table tbody td:nth-child(3),
.crm-partners-table tbody td:nth-child(n+3):nth-child(-n+6) {
  color: #3b485d !important;
  font-weight: 750 !important;
}

.crm-sites-table .crm-action-row,
.crm-partners-table .crm-action-row,
.crm-commissions-screen .crm-action-row {
  width: 100% !important;
}

.crm-action-button,
.crm-icon-button,
.crm-button {
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease !important;
}

.crm-action-button:active,
.crm-icon-button:active,
.crm-button:active {
  transform: translateY(0) scale(0.99) !important;
}

.crm-action-button:focus-visible,
.crm-icon-button:focus-visible,
.crm-button:focus-visible,
.crm-sort-header:focus-visible,
.crm-checkbox:focus-within,
.crm-search-field:focus-within {
  outline: 3px solid rgba(255, 211, 122, 0.48) !important;
  outline-offset: 3px !important;
}

.crm-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 74px !important;
}

.crm-row--revoked .crm-action-button--edit {
  background: #172239 !important;
}

.crm-empty-state {
  min-height: 190px !important;
  margin: 18px !important;
  border: 1px dashed rgba(15, 24, 48, 0.14) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 211, 122, 0.14), transparent 42%),
    #f9fbfd !important;
  color: #69778b !important;
}

.crm-empty-state strong {
  color: var(--stak-ink) !important;
  font-size: 18px !important;
  font-weight: 900 !important;
}

.crm-empty-state span {
  max-width: 460px !important;
  color: #67768b !important;
  font-weight: 750 !important;
  line-height: 1.45 !important;
}

.crm-empty-state--loading i {
  color: var(--stak-navy) !important;
}

.crm-partner-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.crm-partner-metric {
  box-shadow: 0 18px 38px rgba(15, 24, 48, 0.09) !important;
}

.modal-content .crm-modal .modal-body {
  background:
    radial-gradient(circle at 0% 0%, rgba(234, 248, 247, 0.68), transparent 34%),
    linear-gradient(180deg, #f8fafc, #ffffff) !important;
}

.modal-content .crm-modal .crm-modal-section {
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 12px 28px rgba(15, 24, 48, 0.06) !important;
}

.modal-content .crm-modal .crm-modal-section h4 {
  margin-bottom: 14px !important;
  font-size: 14px !important;
  letter-spacing: 0 !important;
}

.modal-content .crm-modal .modal-footer {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 3 !important;
  border-top: 1px solid rgba(15, 24, 48, 0.08) !important;
  box-shadow: 0 -16px 30px rgba(15, 24, 48, 0.05) !important;
}

.crm-site-edit-modal .crm-site-danger-actions {
  border-radius: 18px !important;
  background: #fff8f7 !important;
}

.crm-delete-warning {
  border-radius: 16px !important;
}

.crm-delete-site-summary,
.crm-site-edit-summary {
  border-radius: 16px !important;
}

.crm-delete-acknowledgement {
  border-radius: 14px !important;
}

.crm-error-text {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 8px !important;
  color: #b42318 !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

.crm-error-text::before {
  content: "\f06a";
  font-family: FontAwesome;
}

@media (max-width: 1100px) {
  .crm-partner-metrics {
    grid-template-columns: 1fr !important;
  }

  .crm-page-hero {
    gap: 18px !important;
  }
}

@media (max-width: 860px) {
  .crm-form-grid {
    padding: 20px !important;
  }

  .crm-table tbody tr {
    border: 1px solid rgba(15, 24, 48, 0.1) !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 30px rgba(15, 24, 48, 0.08) !important;
  }

  .crm-table tbody td,
  .crm-table tbody th {
    min-height: 48px !important;
    padding: 12px 16px !important;
  }

  .crm-table tbody td::before,
  .crm-table tbody th::before {
    color: #7b8494 !important;
    font-size: 11px !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
  }

  .crm-action-row,
  .crm-action-row--wrap,
  .crm-sites-table .crm-action-row,
  .crm-partners-table .crm-action-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  .crm-action-row .crm-action-button,
  .crm-action-row .crm-icon-button {
    width: 100% !important;
  }

  .crm-table-action {
    padding-top: 16px !important;
  }
}

@media (max-width: 560px) {
  .crm-page-hero {
    border-radius: 18px !important;
  }

  .crm-page-hero .crm-button,
  .crm-card-header .crm-button {
    width: 100% !important;
  }

  .crm-card-header {
    align-items: stretch !important;
    gap: 16px !important;
  }

  .crm-action-row,
  .crm-action-row--wrap,
  .crm-sites-table .crm-action-row,
  .crm-partners-table .crm-action-row {
    grid-template-columns: 1fr !important;
  }

  .modal-content .crm-modal .modal-footer {
    align-items: stretch !important;
  }
}

/* Keep non-CRM portal modals clickable above the raised backdrop */
.modal.in,
.modal[modal-window],
.modal.logout-confirm-modal-window {
  z-index: 13000 !important;
}

.modal.logout-confirm-modal-window .modal-dialog,
.modal.in .modal-dialog {
  position: relative !important;
  z-index: 1 !important;
  pointer-events: auto !important;
}

.modal.crm-site-delete-modal-window,
.modal.crm-site-revoke-modal-window,
.modal:has(.team-member-modal--confirm) {
  z-index: 13120 !important;
}

/* Mobile CRM header and drawer end override */
@media (max-width: 1100px) {
  html body header.crm.crm-modern-header {
    min-height: 84px !important;
    height: auto !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 8px 24px rgba(15, 24, 48, 0.08) !important;
  }

  html body header.crm.crm-modern-header .crm-header-bar,
  html body header.crm.crm-modern-header .crm-brand,
  html body header.crm.crm-modern-header .crm-brand-copy,
  html body header.crm.crm-modern-header .crm-brand-copy strong,
  html body header.crm.crm-modern-header .crm-brand-copy small {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-menu-toggle,
  html body header.crm.crm-modern-header .crm-menu-toggle:hover,
  html body header.crm.crm-modern-header .crm-menu-toggle:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(15, 24, 48, 0.12) !important;
  }

  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle,
  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle:hover,
  html body header.crm.crm-modern-header.mobile-menu-open .crm-menu-toggle:focus {
    background: var(--stak-navy) !important;
    background-color: var(--stak-navy) !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-drawer {
    top: 84px !important;
    padding: 18px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(15, 24, 48, 0.08) !important;
    box-shadow: 0 24px 60px rgba(15, 24, 48, 0.16) !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-nav,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li,
  html body header.crm.crm-modern-header .crm-mobile-nav .crm-nav-list > li:hover {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin {
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span > a,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a:focus,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin > span > a span:focus {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--stak-ink) !important;
    text-align: left !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin > span > a {
    min-height: 58px !important;
    width: 100% !important;
    padding: 6px !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li:hover {
    padding: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:hover,
  html body header.crm.crm-modern-header .crm-mobile-admin .crm-admin-dropdown.dropdown-menu li a:focus {
    min-height: 56px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 1px solid rgba(15, 24, 48, 0.12) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #2a6f8f !important;
    text-align: left !important;
    box-shadow: 0 8px 18px rgba(15, 24, 48, 0.05) !important;
  }
}

@media (max-width: 560px) {
  html body header.crm.crm-modern-header {
    min-height: 80px !important;
    padding: 12px !important;
  }

  html body header.crm.crm-modern-header .crm-mobile-drawer {
    top: 80px !important;
    right: 10px !important;
    left: 10px !important;
  }
}
