:root {
  /* PRIMARY */
  --ecmr-cloud-color: #ce2128;
  --ecmr-cloud-textcolor: #ffffff;
  --ecmr-cloud-titlecolor: #ce2128;
  --ecmr-cloud-accentcolor: #ffffff;

  /* SECONDARY */
  --ecmr-cloud-secondary-color: #f4f4f4;
  --ecmr-cloud-secondary-textcolor: #ce2128;

  /* MINI TEXT */
  --ecmr-cloud-mini-textcolor: #777777;
  --ecmr-cloud-mini-textstyle: italic;

  /* COMMON */
  --ecmr-cloud-radius: 30px;
  --ecmr-cloud-font-size: 14px;
  --ecmr-cloud-font-weight: bold;
  --ecmr-cloud-border: none;
  --ecmr-cloud-outline: none;
}

html {
  margin: 0px;
  height: 100%;
}

body {
  margin: 0px;
  height: 100%;
}

#mainDiv {
  margin: 0px;
  height: 100%;
}

.webix_form input {
  font-size: 15px;
}

.action-btn {
  padding: 6px 10px;
  font-size: 14px;
  margin-right: 4px;
}

.main-menu-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  vertical-align: middle;
}

.lang-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.lang-selector-template:hover {
  background-color: #f4f4f4;
  cursor: pointer;
}

.legal-scroll-area .webix_template {
  background: #fff;
}

.legal-checkbox .webix_label_right {
  font-size: 14px;
  white-space: normal !important;
}

.ecmr_card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}
.ecmr_card_title {
  font-weight: 600;
  font-size: 16px;
}

.signature-canvas-wrap {
  width: 100%;
}

.signature-canvas-box {
  position: relative;
  width: 100%;
}

.signature-canvas-element {
  width: 100%;
  height: 220px;
  display: block;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  box-sizing: border-box;
}

.signature-canvas-help {
  margin-top: 8px;
  font-size: 12px;
  color: #777777;
  text-align: center;
}

.signature-blockchain-help {
  display: flex;
  align-items: center; /* vertical center */
  height: 100%; /* take full template height */
  font-size: 12px;
  color: #777777;
  text-align: left;
}

.signature-clear-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

.signature-clear-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.signature-clear-icon:hover {
  background: #f5f5f5;
}

.signature-attachment-dataview .webix_dataview_item {
  border: none;
  background: transparent;
  padding: 6px;
}

.signature-attachment-item {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-sizing: border-box;
}

.signature-attachment-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.signature-attachment-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 3;
}

.signature-attachment-remove-img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.signature-attachment-remove:hover {
  background: rgba(245, 245, 245, 0.96);
}

.ecmr-topbar {
  background: #ffffff;
}

.ecmr-topbar-back-button .webix_button {
  min-height: 40px;
  padding-left: 12px;
  padding-right: 12px;
}

.ecmr-topbar-logo {
  height: 50px;
  width: auto;
  display: block;
  object-fit: contain;
}

.ecmr-topbar-user-trigger {
  cursor: pointer;
}

.ecmr-topbar-user-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
}

.ecmr-topbar-user-inner:hover {
  background-color: #eee;
}

.ecmr-topbar-user-icon {
  width: 21px;
  height: 21px;
  object-fit: contain;
  display: block;
}

.ecmr-topbar-user-name {
  font-size: 14px;
  font-weight: 500;
  color: #333333;
  white-space: nowrap;
}

.ecmr-topbar-user-menu-list .webix_list_item {
  display: flex;
  align-items: center;
}

.ecmr-cloud-icon-button .webix_button {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecmr-cloud-button-with-icon .webix_button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecmr-cloud-button-inner {
  display: inline-flex;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.ecmr-cloud-button-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: inline-block;
}

.ecmr-cloud-icon-button .webix_button {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecmr-cloud-toolbar-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.view-base-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #222222;
  margin-bottom: 8px;
}

.view-base-sub-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: #222222;
}

.view-base-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: #444444;
}

.signature-terms-text {
  padding-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
}

.signature-terms-text .open-terms-link {
  color: #ce2128;
  text-decoration: none;
  cursor: pointer;
}

.signature-terms-text .open-terms-link:hover {
  text-decoration: underline;
}

.ecmr-topbar-logo-wrap {
  height: 100%;
}

.ecmr-topbar-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  overflow: visible;
}

.ecmr-topbar-logo-template {
  overflow: visible;
}

.password-strength-wrap {
  margin-top: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-sizing: border-box;
}

.password-strength-bar-bg {
  width: 100%;
  height: 8px;
  background: #eceff3;
  border-radius: 999px;
  overflow: hidden;
}

.password-strength-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.password-strength-text {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  background: transparent;
}

.password-strength-empty {
  color: #888888;
}

.password-strength-weak {
  color: #dc3545;
}

.password-strength-average {
  color: #fd7e14;
}

.password-strength-good {
  color: #6fae5d;
}

.password-strength-very-strong {
  color: #107847;
}

.password-strength-bar-fill.password-strength-empty {
  background: transparent;
}

.password-strength-bar-fill.password-strength-weak {
  background: #dc3545;
}

.password-strength-bar-fill.password-strength-average {
  background: #fd7e14;
}

.password-strength-bar-fill.password-strength-good {
  background: #6fae5d;
}

.password-strength-bar-fill.password-strength-very-strong {
  background: #107847;
}

.register-password-note {
  opacity: 0.85;
  font-size: 12px;
  line-height: 1.5;
  padding: 4px 2px;
  color: #555555;
}

.register-password-note-link {
  margin-left: 4px;
  color: #ce2128;
  text-decoration: none;
  cursor: pointer;
}

.register-password-note-link:hover {
  text-decoration: underline;
}

.view-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--ecmr-cloud-titlecolor);
  text-transform: capitalize;
  text-align: center;
  word-break: keep-all;
  vertical-align: middle;
}

.window-header-title {
  font-weight: bold;
}

.signature-template-no-padding.webix_template {
  padding: 0 !important;
  margin: 0 !important;
}

.signature-template-no-padding.webix_template > div {
  padding: 0 !important;
  margin: 0 !important;
}

.order-row-actions,
.order-row-actions-mobile {
  display: flex;
  align-items: center; /* vertical center */
  justify-content: center; /* horizontal center */
  width: 100%;
  height: 100%;
}

.webix_cell .order-row-actions,
.webix_cell .order-row-actions-mobile {
  height: 100%;
}

/* .webix_icon_button .webix_icon {
  color: white !important;
} */

.webix_icon_button:hover:before {
  background-color: #ce2128;
}

.webix_popup_button {
  border-radius: var(--ecmr-cloud-radius) !important;
  overflow: hidden;
  /* height: 50px; */
}

.orders-header-with-action {
  position: relative;
  width: 100%;
  min-height: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

.orders-header-title {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 24px;
}

.orders-header-company-link {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.orders-header-company-link-icon {
  width: 14px;
  height: 14px;
  display: block;
}

.orders-header-with-action {
  display: flex;
  align-items: center; /* vertical center */
  justify-content: space-between;
  height: 100%;
}

.orders-header-title {
  display: flex;
  align-items: center; /* ensures text itself is centered */
  height: 100%;
}

.orders-header-company-link {
  display: flex;
  align-items: center;
  height: 100%;
}

.orders-header-company-link-icon {
  width: 14px;
  height: 14px;
  display: block;
}

.view-section-title {
  font-weight: bold;
}

#ordersFilterBar .webix_multicombo_input {
  overflow: hidden !important;
  white-space: nowrap !important;
}

.webix_dtable .orders-actions-split-column {
  border-left: 1px solid rgba(204, 32, 39, 0.45) !important;
  text-align: center;
}

.webix_dtable .orders-actions-split-header {
  border-left: 1px solid rgba(204, 32, 39, 0.45) !important;
  border-bottom: 0 !important;
  text-align: center;
}

.webix_dtable .webix_hs_right .webix_hcell.webix_first,
.webix_dtable div.webix_ss_vscroll_header {
  border-bottom: 0 !important;
}

.ecmr-refresh-button .webix_button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.ecmr-refresh-button-icon {
  display: block;
  font-size: 20px;
  line-height: 20px;
  transform: scale(0.4);
  text-align: center;
}

.ecmr-refresh-button:hover .ecmr-refresh-button-icon,
.ecmr-refresh-button .webix_button:hover .ecmr-refresh-button-icon {
  filter: brightness(0) invert(1);
}

.ecmr-close-button .webix_button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.ecmr-close-button-icon {
  display: block;
  font-size: 20px;
  line-height: 20px;
  transform: scale(0.4);
  text-align: center;
}

.ecmr-close-button:hover .ecmr-close-button-icon,
.ecmr-close-button .webix_button:hover .ecmr-close-button-icon {
  filter: brightness(0) invert(1);
}

.ecmr-hiding-button .webix_button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.ecmr-hiding-button-icon {
  display: block;
  font-size: 20px;
  line-height: 20px;
  transform: scale(0.4);
  text-align: center;
}

.ecmr-hiding-button:hover .ecmr-hiding-button-icon,
.ecmr-hiding-button .webix_button:hover .ecmr-hiding-button-icon {
  filter: brightness(0) invert(1);
}

.ecmr-icon-button:hover img,
.ecmr-icon-button .webix_button:hover img {
  filter: brightness(0) invert(1);
}

.ecmr-topbar-back-button:hover img {
  filter: brightness(0) invert(1);
}

.ecmr-blockchain-button:hover img {
  filter: brightness(0) invert(1);
}

.ecmr-subsequent-button:hover img {
  filter: brightness(0) invert(1);
}

.ecmr-cloud-icon-button:hover img {
  filter: brightness(0) invert(1);
}

.orders-header-company-action {
  position: relative !important;
  padding-right: 34px !important;
  overflow: hidden !important;
}

.orders-header-company-action::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  background-image: url("../assets/icons/table-header-companies.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  z-index: 5;
  pointer-events: auto;
}

.ecmr-window-close-button .webix_button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;

  background: #eee;
  color: #000000 !important;
}

.ecmr-window-close-icon {
  font-size: 18px !important;
  line-height: 18px !important;
  color: #000000 !important;
}

.ecmr-window-close-button:hover .webix_button,
.ecmr-window-close-button .webix_button:hover {
  background: var(--ecmr-cloud-accentcolor) !important;
  color: var(--ecmr-cloud-color) !important;
}

.ecmr-window-close-button:hover .ecmr-window-close-icon,
.ecmr-window-close-button .webix_button:hover .ecmr-window-close-icon {
  color: var(--ecmr-cloud-color) !important;
}

.webix_popup_title,
.webix_window .webix_win_head {
  background-color: transparent !important;
}

.ecmr-cloud-signature-icon {
  background-color: transparent;
  width: 30px;
  height: 30px;
  cursor: default;
}

.template-no-padding .webix_template {
  padding-left: 0 !important;
}

.ecmr-signature-info-row {
  display: flex;
  align-items: center;
  height: 100%;
  font-weight: bold;
}

.ecmr-signature-info-row img {
  flex: 0 0 auto;
}

.ecmr-signature-info-text {
  display: inline-block;
  font-weight: bold;
  line-height: normal;
}

.signature-wait-spinner {
  font-size: 32px !important;
  margin-bottom: 12px;
  display: inline-block !important;
}

.signature-wait-spinner:before {
  display: inline-block !important;
  animation: signatureWaitSpin 1s linear infinite;
  transform-origin: center center;
}

.ecmr-signature-icon-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ecmr-signature-icon-cell .webix_template {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
}

.ecmr-signature-multiline-text {
  height: 100%;
  display: flex;
  align-items: center;
  white-space: normal;
  line-height: 1.25;
  overflow: hidden;
  word-break: break-word;
}

.ecmr-signature-icon-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecmr-cloud-signature-icon {
  display: block;
}

.ecmr_form_switch .webix_label_right {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  line-height: normal !important;
}

.webix_el_switch .webix_label_right {
  margin-top: 0px !important;
  padding-top: 0px !important;
  padding-left: 10px !important;
}

.ecmr-history-toolbar {
  background: #ffffff;
}

.ecmr-history-title {
  font-weight: 600;
}

.ecmr-history-summary {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.ecmr-history-summary-inner {
  padding: 14px 18px;
}

.ecmr-history-summary-main {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ecmr-history-summary-sub {
  font-size: 13px;
  color: #64748b;
}

.ecmr-history-timeline .webix_timeline_details {
  overflow: visible !important;
  height: auto !important;
}

.ecmr-history-card {
  width: 100%;
  box-sizing: border-box;
  min-height: 70px;
  overflow: visible;
}

.ecmr-history-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: start;
}

.ecmr-history-value {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ecmr-history-muted {
  color: #64748b;
  font-size: 13px;
}

.ecmr-history-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.ecmr-history-badge-created {
  background: #e0f2fe;
  color: #075985;
}

.ecmr-history-badge-changed {
  background: #fef3c7;
  color: #92400e;
}

.ecmr-history-badge-signed {
  background: #dcfce7;
  color: #166534;
}

.ecmr-history-badge-pending {
  background: #f1f5f9;
  color: #64748b;
}

.ecmr-history-timeline .done .webix_timeline_icon {
  border-color: #22c55e !important;
  background: #22c55e !important;
}

.ecmr-history-timeline .current .webix_timeline_icon {
  border-color: #f59e0b !important;
  background: #f59e0b !important;
}

.ecmr-history-timeline .pending .webix_timeline_icon {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}

.ecmr-history-timeline .done .webix_timeline_value {
  color: #166534;
}

.ecmr-history-timeline .current .webix_timeline_value {
  color: #92400e;
}

.ecmr-history-timeline .pending .webix_timeline_value {
  color: #64748b;
}

.ecmr-history-timeline .webix_timeline_item {
  min-height: 96px;
}

.ecmr-history-timeline .webix_timeline_line {
  top: 0 !important;
  bottom: 0 !important;
  height: 100% !important;
}

.ecmr-history-timeline .webix_timeline_icon {
  z-index: 2;
}

.ecmr-history-details-btn {
  color: black;
  font-weight: bold;
  height: 32px;
  margin-top: 8px;
  max-width: 120px;
  border-radius: 12px;
}

.ecmr-change-popup-body {
  padding: 16px;
}

.ecmr-change-popup-date {
  color: #64748b;
  margin-bottom: 14px;
}

.ecmr-change-section {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #ffffff;
}

.ecmr-change-section-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.ecmr-change-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
}

.ecmr-change-field {
  font-weight: 600;
  color: #475569;
}

.ecmr-change-values {
  color: #334155;
  word-break: break-word;
}

.ecmr-change-row {
  display: block;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}

.ecmr-change-field {
  display: block;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  word-break: break-word;
}

.ecmr-change-values {
  display: block;
  color: #334155;
  line-height: 1.45;
  word-break: break-word;
}

.ecmr-change-values div {
  margin-bottom: 2px;
}

@media (max-width: 768px) {
  .ecmr-history-row {
    display: block;
  }

  .ecmr-history-label {
    min-width: 0;
    margin-bottom: 2px;
  }

  .ecmr-history-timeline {
    padding: 10px;
  }
}

@media (max-width: 600px) {
  .signature-clear-icon {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
  }

  .signature-clear-icon-img {
    width: 14px;
    height: 14px;
  }

  .signature-attachment-item {
    width: 120px;
    height: 120px;
  }

  .action-btn {
    display: block;
    width: 100%;
    margin: 5px 0;
  }
}

@keyframes signatureWaitSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
