/*
 * MyMedic Clinical Clean UI
 * Regras visuais compartilhadas e opt-in. Consulte docs/design-system.md.
 * Nenhuma tela legada deve ser estilizada sem .mm-clinical ou .mm-clinical-modal.
 */

.mm-clinical,
.mm-clinical-modal {
  --mm-color-primary: #087df1;
  --mm-color-primary-hover: #066ed5;
  --mm-color-primary-active: #055fb9;
  --mm-color-cyan: #0b9ee8;
  --mm-color-navy: #10234c;
  --mm-color-text: #304462;
  --mm-color-muted: #70809f;
  --mm-color-page: #fbfdff;
  --mm-color-surface: #ffffff;
  --mm-color-border: #dfe7f3;
  --mm-color-border-strong: #cbdcf0;
  --mm-color-primary-soft: #f0f7ff;
  --mm-color-cyan-soft: #e8fbfd;
  --mm-color-success: #25b87a;
  --mm-color-success-soft: #e9f8f2;
  --mm-color-danger: #e95d6a;
  --mm-color-danger-soft: #fff0f2;
  --mm-color-warning: #e5a72f;
  --mm-color-warning-soft: #fff7e7;
  --mm-color-purple: #8a68d8;
  --mm-color-purple-soft: #f3effd;
  --mm-radius-control: 8px;
  --mm-radius-card: 10px;
  --mm-radius-surface: 12px;
  --mm-shadow-surface: 0 10px 28px rgba(15, 35, 75, 0.045);
  --mm-shadow-control: 0 3px 10px rgba(15, 35, 75, 0.045);
  --mm-font: "Segoe UI", Arial, sans-serif;
  --mm-transition: 160ms ease;
  --mm-compact-page-x: clamp(14px, 1.5vw, 22px);
  --mm-compact-page-y: clamp(14px, 1.35vw, 20px);
  --mm-compact-gap: clamp(8px, 0.85vw, 12px);
  --mm-compact-control-height: clamp(38px, 3vw, 42px);
  --mm-compact-kpi-height: clamp(74px, 6vw, 88px);
  --mm-compact-kpi-icon: clamp(34px, 3vw, 42px);
  color: var(--mm-color-text);
  font-family: var(--mm-font);
  font-synthesis: none;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
}

.mm-clinical *,
.mm-clinical *::before,
.mm-clinical *::after,
.mm-clinical-modal *,
.mm-clinical-modal *::before,
.mm-clinical-modal *::after {
  box-sizing: border-box;
}

.mm-clinical button,
.mm-clinical input,
.mm-clinical select,
.mm-clinical textarea,
.mm-clinical .table,
.mm-clinical-modal button,
.mm-clinical-modal input,
.mm-clinical-modal select,
.mm-clinical-modal textarea {
  font-family: "Segoe UI", Arial, sans-serif !important;
  font-synthesis: none;
}

/* A listagem de pacientes replica diretamente a tipografia do menu Gestão. */
#mm-patients,
#mm-patients button,
#mm-patients input,
#mm-patients select,
#mm-patients textarea,
#mm-patients .table {
  font-family: "Segoe UI", Arial, sans-serif !important;
  font-synthesis: none;
}

.mm-clinical-modal,
.mm-clinical-modal button,
.mm-clinical-modal input,
.mm-clinical-modal select,
.mm-clinical-modal textarea,
.mm-clinical-modal .table {
  font-family: "Segoe UI", Arial, sans-serif !important;
  font-synthesis: none;
}

.mm-clinical :focus-visible,
.mm-clinical-modal :focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.22);
  outline-offset: 2px;
}

/* Estrutura de pagina */
#apresenta.app-main__inner:has(> #mm-patients) {
  padding: 0 !important;
  background: var(--mm-color-page, #fbfdff) !important;
}

/*
 * Rolagem das páginas de gestão já migradas para o Clinical Clean.
 * No desktop, o cabeçalho do sistema permanece fixo e somente a área de
 * conteúdo rola. Em telas menores, o shell mobile mantém a rolagem natural.
 */
@media (min-width: 1281px) {
  body:has(#mm-patients),
  body:has(#mm-users),
  body:has(#mm-procedures) {
    overflow: hidden !important;
  }

  #apresenta.app-main__inner:has(> #mm-patients),
  #apresenta.app-main__inner:has(> #mm-users),
  #apresenta.app-main__inner:has(> #mm-procedures) {
    height: calc(100vh - 55px) !important;
    min-height: 0 !important;
    max-height: calc(100vh - 55px) !important;
    flex: none !important;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    scrollbar-gutter: stable;
  }
}

.mmcc-page {
  width: 100%;
  min-width: 0;
  padding: 24px;
  border-radius: var(--mm-radius-surface);
  background: var(--mm-color-page);
}

#mm-patients.mmcc-page {
  min-height: calc(100vh - 55px);
  margin: 0;
  padding: 32px;
  border-radius: 0;
}

.mmcc-page__surface {
  width: 100%;
  min-width: 0;
}

.mmcc-page__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.mmcc-page__intro {
  min-width: 0;
}

.mmcc-page__title {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

.mmcc-page__subtitle {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--mm-color-muted);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
}

.mmcc-page__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Botoes */
.mmcc-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid var(--mm-color-border-strong);
  border-radius: var(--mm-radius-control);
  background: var(--mm-color-surface);
  color: var(--mm-color-text);
  box-shadow: none;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--mm-transition), border-color var(--mm-transition), color var(--mm-transition), box-shadow var(--mm-transition), transform var(--mm-transition);
}

.mmcc-btn:hover {
  border-color: #b7d5f4;
  background: #f8fbff;
  color: var(--mm-color-primary);
  box-shadow: var(--mm-shadow-control);
  text-decoration: none;
  transform: translateY(-1px);
}

.mmcc-btn:active {
  transform: translateY(0);
}

.mmcc-btn--primary {
  border-color: #b9d9fb;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  box-shadow: none;
  font-weight: 500;
}

.mmcc-btn--primary:hover {
  border-color: #91c4f7;
  background: #e5f2ff;
  color: var(--mm-color-primary-hover);
}

.mmcc-btn--primary:active {
  border-color: #74b4f2;
  background: #dceeff;
}

.mmcc-btn--secondary {
  background: var(--mm-color-surface);
}

.mmcc-btn--danger {
  border-color: #f1bec4;
  background: var(--mm-color-danger-soft);
  color: #b93645;
}

.mmcc-btn__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  color: var(--mm-color-primary);
  font-size: 14px;
}

.mmcc-btn--primary .mmcc-btn__icon {
  color: var(--mm-color-primary);
}

/* Indicadores */
.mmcc-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mmcc-stat {
  min-width: 0;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-card);
  background: var(--mm-color-surface);
  box-shadow: none;
}

.mmcc-stat__icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  font-size: 14px;
}

.mmcc-stat__content {
  min-width: 0;
}

.mmcc-stat__value {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.1;
}

.mmcc-stat__label {
  margin-top: 3px;
  overflow: hidden;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mmcc-stat--cyan .mmcc-stat__icon {
  background: var(--mm-color-cyan-soft);
  color: var(--mm-color-cyan);
}

.mmcc-stat--success .mmcc-stat__icon {
  background: var(--mm-color-success-soft);
  color: var(--mm-color-success);
}

.mmcc-stat--warning .mmcc-stat__icon {
  background: var(--mm-color-warning-soft);
  color: var(--mm-color-warning);
}

.mmcc-stat--danger .mmcc-stat__icon {
  background: var(--mm-color-danger-soft);
  color: var(--mm-color-danger);
}

.mmcc-stat--purple .mmcc-stat__icon {
  background: var(--mm-color-purple-soft);
  color: var(--mm-color-purple);
}

/* Superficie orientada a dados */
.mmcc-data-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-surface);
  background: var(--mm-color-surface);
  box-shadow: none;
}

.mmcc-data-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--mm-color-border);
}

.mmcc-search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mmcc-search__control {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--mm-color-border-strong);
  border-radius: var(--mm-radius-control);
  background: #fff;
  transition: border-color var(--mm-transition), box-shadow var(--mm-transition);
}

.mmcc-search__control:focus-within {
  border-color: var(--mm-color-primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.mmcc-search__icon {
  color: #7184a2;
  font-size: 14px;
}

.mmcc-search__input.form-control {
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--mm-color-text);
  box-shadow: none !important;
  font-size: 12.5px;
}

.mmcc-search__control .mmcc-search__input:focus-visible {
  outline: none;
}

.mmcc-search__input::placeholder {
  color: #94a2b7;
}

.mmcc-table-region {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  background: var(--mm-color-surface);
  -webkit-overflow-scrolling: touch;
}

.mmcc-table.table {
  width: 100%;
  min-width: 1160px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--mm-color-surface);
  color: var(--mm-color-text);
  font-size: 12px;
}

.mmcc-table.table thead th {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--mm-color-border);
  background: #f8fbfe;
  color: #49617f;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.mmcc-table.table tbody td {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  color: #53647c;
  line-height: 1.45;
  vertical-align: middle;
}

.mmcc-table.table tbody td.mmcc-empty-state {
  padding: 28px 18px;
  color: var(--mm-color-muted);
  text-align: center;
}

.mmcc-table.table tbody tr:last-child td {
  border-bottom: 0;
}

.mmcc-table.table tbody tr {
  background: #fff;
  transition: background-color var(--mm-transition);
}

.mmcc-table.table tbody tr:hover {
  background: #f8fbff;
}

.mmcc-table.table strong {
  color: var(--mm-color-navy);
  font-weight: 500;
}

/* Peso e ritmo tipográfico exclusivos da listagem de pacientes. */
#mm-patients .mmcc-page__title,
#mm-patients .mmcc-btn,
#mm-patients .mmcc-stat__value,
#mm-patients .mmcc-search__button,
#mm-patients .mmcc-table.table thead th,
#mm-patients .mmcc-table.table strong {
  font-weight: 400;
  letter-spacing: -0.01em;
}

#mm-patients .mmcc-page__subtitle,
#mm-patients .mmcc-search__input {
  font-size: 12px;
}

#mm-patients .mmcc-btn,
#mm-patients .mmcc-search__button {
  font-size: 13px;
}

#mm-patients .mmcc-table.table {
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mmcc-table__primary {
  min-width: 235px;
}

.mmcc-patient-card__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mmcc-patient-card__summary strong {
  min-width: 0;
}

.mmcc-patient-card__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: var(--mm-radius-control);
  background: transparent;
  color: var(--mm-color-primary);
  cursor: pointer;
}

.mmcc-patient-card__toggle:focus-visible {
  outline: 2px solid var(--mm-color-primary);
  outline-offset: 2px;
}

.mmcc-patient-card__toggle i {
  transition: transform 0.2s ease;
}

.mmcc-table__email {
  min-width: 170px;
  overflow-wrap: anywhere;
}

.mmcc-table__actions {
  min-width: 142px;
}

.mmcc-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.mmcc-icon-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--mm-color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--mm-color-primary);
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--mm-transition), border-color var(--mm-transition), color var(--mm-transition), box-shadow var(--mm-transition), transform var(--mm-transition);
}

.mmcc-icon-button:hover {
  border-color: #bad2ef;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary-hover);
  box-shadow: var(--mm-shadow-control);
  text-decoration: none;
  transform: translateY(-1px);
}

.mmcc-icon-button i {
  color: currentColor;
  font-size: 14px;
}

/* Formularios, filtros e estados */
.mmcc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mmcc-field {
  min-width: 0;
}

.mmcc-field--actions {
  display: flex;
  align-items: flex-end;
}

.mmcc-field label,
.mm-clinical-modal .modal-body label {
  display: block;
  margin: 0 0 7px;
  color: var(--mm-color-text);
  font-size: 12px;
  font-weight: 500;
}

.mmcc-field .form-control,
.mm-clinical-modal .modal-body .form-control {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--mm-color-border-strong);
  border-radius: var(--mm-radius-control);
  background: #fff;
  color: var(--mm-color-text);
  box-shadow: none;
  font-size: 12.5px;
  transition: border-color var(--mm-transition), box-shadow var(--mm-transition);
}

.mmcc-field .form-control:focus,
.mm-clinical-modal .modal-body .form-control:focus {
  border-color: var(--mm-color-primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.modal.mm-clinical-modal .mmcc-search__control .mmcc-search__input.form-control {
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mmcc-empty-state,
.mmcc-loading-state {
  padding: 28px 18px;
  color: var(--mm-color-muted);
  font-size: 12.5px;
  text-align: center;
}

.mm-clinical-shell-loading {
  width: 100%;
  min-height: calc(100vh - 55px);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: var(--mm-color-page);
}

.mm-clinical-shell-loading .mmcc-loading-state {
  min-width: min(320px, 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px 22px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-card);
  background: var(--mm-color-surface);
  box-shadow: var(--mm-shadow-surface);
}

.mm-clinical-shell-loading .mmcc-loading-state i {
  color: var(--mm-color-primary);
  font-size: 15px;
}

.mm-clinical-shell-loading .mmcc-loading-state span {
  color: var(--mm-color-muted);
  font-size: 12.5px;
  font-weight: 400;
}

.mm-clinical-shell-loading .mmcc-loading-state.is-error i,
.mm-clinical-shell-loading .mmcc-loading-state.is-error span {
  color: var(--mm-color-danger);
}

.mmcc-table.table tbody tr.is-today td {
  background: var(--mm-color-success-soft);
}

/* Modais Bootstrap opt-in */
.modal.mm-clinical-modal .modal-dialog {
  max-width: 900px;
}

.modal.mm-clinical-modal .modal-content {
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-surface);
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 35, 75, 0.12);
}

.modal.mm-clinical-modal .modal-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--mm-color-border);
  background: #fff;
}

.mmcc-modal-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.mmcc-modal-heading__icon,
.mmcc-flow-intro__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  font-size: 14px;
}

.mmcc-modal-heading > div {
  min-width: 0;
}

.mmcc-modal-heading p {
  margin: 3px 0 0;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
}

.modal.mm-clinical-modal .modal-title {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 16px;
  font-weight: 400;
}

.modal.mm-clinical-modal .close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -4px -4px -4px auto;
  padding: 0;
  border: 1px solid var(--mm-color-border);
  border-radius: 9px;
  background: #fff;
  color: var(--mm-color-muted);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
  opacity: 1;
}

.modal.mm-clinical-modal .close:hover {
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
}

.modal.mm-clinical-modal .modal-body {
  padding: 20px;
  background: var(--mm-color-page);
}

.modal.mm-clinical-modal .modal-footer {
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid var(--mm-color-border);
  background: #fbfdff;
}

.modal.mm-clinical-modal .modal-footer > * {
  margin: 0;
}

.modal.mm-clinical-modal .multiselect-native-select,
.modal.mm-clinical-modal .btn-group,
.modal.mm-clinical-modal .btn-group > .multiselect {
  width: 100%;
}

.modal.mm-clinical-modal .btn-group > .multiselect {
  min-height: 40px;
  overflow: hidden;
  border: 1px solid var(--mm-color-border-strong);
  border-radius: var(--mm-radius-control);
  background: #fff;
  color: var(--mm-color-text);
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.mm-clinical-modal .btn-group > .multiselect:hover,
.modal.mm-clinical-modal .btn-group.show > .multiselect {
  border-color: var(--mm-color-primary);
  background: #fff;
  color: var(--mm-color-text);
}

.modal.mm-clinical-modal .multiselect-container {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-control);
  box-shadow: var(--mm-shadow-surface);
}

.modal.mm-clinical-modal .multiselect-container > li > a > label {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--mm-color-text);
  font-size: 12px;
  font-weight: 400;
}

.modal.mm-clinical-modal .multiselect-container > li > a:hover,
.modal.mm-clinical-modal .multiselect-container > li.active > a {
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
}

.mmcc-modal-section {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-card);
  background: #fff;
}

.mmcc-modal-results {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-card);
  background: #fff;
}

.mmcc-modal-results .mmcc-table.table {
  min-width: 0;
}

.mmcc-modal-results:empty {
  display: none;
}

.mmcc-empty-state--soft {
  border: 1px dashed var(--mm-color-border-strong);
  border-radius: var(--mm-radius-control);
  background: #fbfdff;
}

.mmcc-report-filter-grid {
  row-gap: 18px;
}

#filtrapacientes .modal-content > form {
  min-height: 0;
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

#filtrapacientes .modal-body {
  overflow-y: auto;
}

.mm-patients-birthday-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  margin-bottom: 20px;
}

.mm-patients-birthday-form .mmcc-btn {
  min-width: 110px;
}

#modalUnificarPacientes .modal-dialog {
  max-width: 1120px;
}

#modalUnificarPacientes .unificar-modal-body {
  min-height: 180px;
}

#modalUnificarPacientes .modal-content {
  min-height: min(700px, calc(100vh - 40px));
}

.mmcc-merge-flow {
  min-width: 0;
}

.mmcc-flow-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #dceafa;
  border-radius: var(--mm-radius-card);
  background: #f7fbff;
}

.mmcc-flow-intro h6 {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.35;
}

.mmcc-flow-intro p {
  margin: 4px 0 0;
  color: var(--mm-color-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.mmcc-merge-search {
  margin-bottom: 18px;
}

.mmcc-merge-search > label {
  margin-bottom: 7px;
}

.mmcc-merge-search .mmcc-btn {
  min-width: 104px;
}

.mmcc-merge-results {
  display: grid;
  gap: 10px;
}

.mmcc-merge-results__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 1px 6px;
  color: var(--mm-color-muted);
  font-size: 11.5px;
}

.mmcc-merge-results__summary strong {
  color: var(--mm-color-navy);
  font-size: 12.5px;
  font-weight: 400;
}

.mmcc-merge-candidate {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(165px, 0.8fr) minmax(360px, 1.8fr) minmax(165px, auto);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-card);
  background: #fff;
  transition: border-color var(--mm-transition), background-color var(--mm-transition), box-shadow var(--mm-transition);
}

.mmcc-merge-candidate:hover {
  border-color: #c8ddf3;
  box-shadow: var(--mm-shadow-control);
}

.mmcc-merge-candidate.is-selected {
  border-color: #94c5f6;
  background: #f8fbff;
}

.mmcc-merge-candidate__select {
  align-self: start;
  padding-top: 5px;
}

.mmcc-merge-candidate__select .custom-control {
  min-height: 22px;
  padding-left: 24px;
}

.mmcc-merge-candidate__select .custom-control-label {
  margin: 0;
}

.mmcc-merge-candidate__select .custom-control-label::before,
.mmcc-merge-candidate__select .custom-control-label::after {
  top: 0;
  left: -24px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.mmcc-merge-candidate__identity {
  min-width: 0;
  align-self: start;
}

.mmcc-merge-candidate__identity strong,
.mmcc-merge-candidate__id {
  display: block;
}

.mmcc-merge-candidate__identity strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--mm-color-navy);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.mmcc-merge-candidate__id {
  color: var(--mm-color-muted);
  font-size: 10.5px;
  line-height: 1.2;
  text-transform: uppercase;
}

.mmcc-merge-candidate__details {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.mmcc-merge-candidate__details div {
  min-width: 0;
}

.mmcc-merge-candidate__details dt {
  margin: 0 0 2px;
  color: var(--mm-color-muted);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.25;
}

.mmcc-merge-candidate__details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--mm-color-text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.mmcc-merge-candidate__principal {
  min-width: 0;
}

.mmcc-merge-principal.btn {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--mm-color-border-strong);
  border-radius: var(--mm-radius-control);
  background: #fff;
  color: var(--mm-color-text);
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.25;
  white-space: normal;
}

.mmcc-merge-principal.btn.active {
  border-color: #89c2f8;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  box-shadow: none;
}

.mmcc-merge-principal.disabled-btn,
.mmcc-merge-principal.disabled-btn:hover,
.mmcc-merge-principal.disabled-btn:focus,
.mmcc-merge-principal.disabled-btn:active {
  pointer-events: none;
  border-color: var(--mm-color-border) !important;
  background: #f7f9fc !important;
  color: #98a5b8 !important;
  box-shadow: none !important;
  cursor: default;
  opacity: 1;
}

.mmcc-merge-selection-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-card);
  background: #fbfdff;
}

.mmcc-merge-flow .alert {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: var(--mm-radius-control);
  font-size: 12px;
  font-weight: 400;
}

.unificar-modal {
  position: fixed;
  inset: 0;
  z-index: 1065;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 35, 76, 0.36);
}

.unificar-modal.is-open {
  display: flex;
}

.unificar-modal-card {
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-surface);
  background: #fff;
  box-shadow: 0 20px 54px rgba(15, 35, 75, 0.18);
}

.unificar-modal-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--mm-color-border);
  color: var(--mm-color-navy);
  font-size: 14px;
  font-weight: 400;
}

.unificar-modal-head__icon {
  color: var(--mm-color-danger);
}

.unificar-confirm__body {
  padding: 18px;
  color: var(--mm-color-text);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
}

.unificar-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--mm-color-border);
  background: #fbfdff;
}

.unificar-progress {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 6px;
  background: #dfe8f3;
}

.unificar-progress-bar {
  width: 35%;
  height: 100%;
  background: var(--mm-color-primary);
  transform: translateX(-120%);
  animation: unificar-progress 1.2s linear infinite;
}

@keyframes unificar-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* Responsividade */
@media (max-width: 1199.98px) {
  .mmcc-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .mmcc-page {
    padding: 18px;
  }

  #mm-patients.mmcc-page {
    min-height: calc(100dvh - var(--mm-h, 64px));
    padding: 20px;
  }

  .mmcc-table-region {
    overflow: visible;
    padding: 12px;
    background: var(--mm-color-page);
  }

  .mmcc-table.table {
    min-width: 0;
    border-collapse: separate;
  }

  .mmcc-table.table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .mmcc-table.table,
  .mmcc-table.table tbody {
    display: block;
    width: 100%;
  }

  .mmcc-table.table tbody tr {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--mm-color-border);
    border-radius: var(--mm-radius-card);
    background: #fff;
    box-shadow: none;
  }

  .mmcc-table.table tbody tr:last-child {
    margin-bottom: 0;
  }

  .mmcc-table.table tbody td {
    min-width: 0;
    display: block;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .mmcc-table.table tbody td[data-th]::before {
    content: attr(data-th);
    display: block;
    margin-bottom: 3px;
    color: var(--mm-color-muted);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.3;
  }

  .mmcc-table.table .mmcc-table__primary,
  .mmcc-table.table .mmcc-table__email,
  .mmcc-table.table .mmcc-table__actions {
    grid-column: 1 / -1;
  }

  .mmcc-row-actions {
    justify-content: flex-start;
  }

  .mmcc-icon-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .mmcc-merge-candidate {
    grid-template-columns: 28px minmax(150px, 0.7fr) minmax(300px, 1.3fr);
  }

  .mmcc-merge-candidate__principal {
    grid-column: 2 / -1;
  }

  .mmcc-modal-results .mmcc-table-region {
    padding: 0;
    background: transparent;
  }

  .mmcc-modal-results .mmcc-table.table tbody tr.is-today {
    background: var(--mm-color-success-soft);
  }

  .mmcc-modal-results .mmcc-table.table tbody tr.is-today td {
    background: transparent;
  }
}

@media (max-width: 767.98px) {
  .mmcc-page {
    padding: 14px;
    border-radius: 0;
  }

  #mm-patients.mmcc-page {
    padding: 16px;
  }

  #mm-patients .mmcc-patient-row {
    gap: 0;
  }

  #mm-patients .mmcc-patient-row > td:not(.mmcc-table__primary) {
    display: none;
  }

  #mm-patients .mmcc-patient-row.is-expanded {
    gap: 12px 18px;
  }

  #mm-patients .mmcc-patient-row.is-expanded > td:not(.mmcc-table__primary) {
    display: block;
  }

  #mm-patients .mmcc-patient-row .mmcc-table__primary::before {
    display: none;
  }

  #mm-patients .mmcc-patient-card__summary {
    min-height: 44px;
    cursor: pointer;
  }

  #mm-patients .mmcc-patient-card__id {
    display: none;
  }

  #mm-patients .mmcc-patient-row.is-expanded .mmcc-patient-card__id {
    display: inline;
  }

  #mm-patients .mmcc-patient-card__toggle {
    display: inline-flex;
  }

  #mm-patients .mmcc-patient-row.is-expanded .mmcc-patient-card__toggle i {
    transform: rotate(180deg);
  }

  .mmcc-page__header {
    gap: 16px;
    margin-bottom: 18px;
  }

  .mmcc-page__title {
    font-size: 20px;
  }

  .mmcc-page__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mmcc-page__actions .mmcc-btn {
    width: 100%;
  }

  .mmcc-page__actions .mmcc-btn--primary {
    grid-column: auto;
  }

  .mmcc-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mmcc-stat {
    min-height: 70px;
    gap: 10px;
    padding: 11px;
  }

  .mmcc-stat__icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .mmcc-data-toolbar {
    padding: 12px;
  }

  .mmcc-search {
    align-items: stretch;
  }

  .mmcc-search .mmcc-btn {
    min-width: 84px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .mmcc-form-grid,
  .mm-patients-birthday-form {
    grid-template-columns: 1fr;
  }

  .mmcc-field--actions,
  .mm-patients-birthday-form .mmcc-btn {
    width: 100%;
  }

  .modal.mm-clinical-modal .modal-dialog {
    max-width: none;
    margin: 10px;
  }

  .modal.mm-clinical-modal .modal-header,
  .modal.mm-clinical-modal .modal-body,
  .modal.mm-clinical-modal .modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  #modalUnificarPacientes .modal-content {
    min-height: calc(100dvh - 20px);
  }

  .mmcc-modal-section {
    padding: 14px;
  }

  .mmcc-merge-candidate {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .mmcc-merge-candidate__details,
  .mmcc-merge-candidate__principal {
    grid-column: 1 / -1;
  }

  .mmcc-merge-candidate__details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 11px;
    border-top: 1px solid var(--mm-color-border);
  }

  .mmcc-merge-results__summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .mmcc-merge-selection-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mmcc-merge-selection-actions .mmcc-btn {
    width: 100%;
  }
}

@media (max-width: 479.98px) {
  .mmcc-page__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mmcc-page__actions .mmcc-btn--primary {
    grid-column: auto;
  }

  .mmcc-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mmcc-table.table tbody tr {
    grid-template-columns: 1fr;
  }

  .mmcc-table.table .mmcc-table__primary,
  .mmcc-table.table .mmcc-table__email,
  .mmcc-table.table .mmcc-table__actions {
    grid-column: auto;
  }

  .mmcc-modal-heading__icon {
    display: none;
  }

  .mmcc-merge-search .mmcc-btn {
    min-width: 72px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .mmcc-merge-candidate__details {
    grid-template-columns: 1fr;
  }

  .mmcc-merge-selection-actions,
  .unificar-modal-actions,
  #filtrapacientes .modal-footer {
    grid-template-columns: 1fr;
  }

  .unificar-modal-actions,
  #filtrapacientes .modal-footer {
    display: grid;
  }

  .unificar-modal-actions .mmcc-btn,
  #filtrapacientes .modal-footer .mmcc-btn {
    width: 100%;
  }
}

/* Gestão de usuários */
#apresenta.app-main__inner:has(> #mm-users) {
  padding: 0 !important;
  background: var(--mm-color-page, #fbfdff) !important;
}

#mm-users,
#mm-users button,
#mm-users input,
#mm-users select,
#mm-users textarea,
#mm-users .table {
  font-family: "Segoe UI", Arial, sans-serif !important;
  font-synthesis: none;
}

#mm-users.mmcc-page {
  min-height: calc(100vh - 55px);
  margin: 0;
  padding: 30px 32px;
  border-radius: 0;
}

#mm-users .mm-users__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

#mm-users .mm-users__heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

#mm-users .mmcc-page__title {
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

#mm-users .mmcc-btn {
  min-height: 42px;
  font-size: 13px;
  font-weight: 400;
}

#mm-users .mm-users__license {
  min-width: 230px;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(90px, 140px) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--mm-radius-control);
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-text);
  box-shadow: none;
  font-size: 12.5px;
  font-weight: 400;
  cursor: default;
}

#mm-users .mm-users__license.is-clickable {
  cursor: pointer;
  transition: background-color var(--mm-transition), color var(--mm-transition);
}

#mm-users .mm-users__license.is-clickable:hover {
  background: #e4f1ff;
  color: var(--mm-color-primary);
}

#mm-users .mm-users__license.is-disabled {
  opacity: 0.72;
}

#mm-users .mm-users__license strong {
  color: var(--mm-color-navy);
  font-size: 13px;
  font-weight: 500;
}

#mm-users .mm-users__license-bar {
  width: 100%;
  height: 7px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #e7edf5;
}

#mm-users .mm-users__license-bar::-webkit-progress-bar {
  border-radius: inherit;
  background: #e7edf5;
}

#mm-users .mm-users__license-bar::-webkit-progress-value {
  border-radius: inherit;
  background: var(--mm-color-primary);
}

#mm-users .mm-users__license-bar::-moz-progress-bar {
  border-radius: inherit;
  background: var(--mm-color-primary);
}

#mm-users .mm-users__workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 370px);
  align-items: start;
  gap: 20px;
}

#mm-users .mm-users__directory,
#mm-users .mm-users__detail {
  min-width: 0;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-surface);
  background: var(--mm-color-surface);
  box-shadow: var(--mm-shadow-surface);
}

#mm-users .mm-users__directory {
  overflow: hidden;
}

#mm-users .mm-users__toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(520px, 1.35fr);
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--mm-color-border);
}

#mm-users .mm-users__search {
  min-height: 42px;
}

#mm-users .mm-users__search .mmcc-search__input {
  height: 38px;
  font-size: 12.5px;
}

#mm-users .mm-users__filters {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-control);
  background: #fff;
}

#mm-users .filter-chip {
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  border-right: 1px solid var(--mm-color-border);
  border-radius: 0;
  background: #fff;
  color: var(--mm-color-text);
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--mm-transition), color var(--mm-transition);
}

#mm-users .filter-chip:last-child {
  border-right: 0;
}

#mm-users .filter-chip:hover:not(:disabled),
#mm-users .filter-chip.active {
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
}

#mm-users .filter-chip.active {
  box-shadow: inset 0 0 0 1px #a9d2fb;
}

#mm-users .filter-chip:disabled {
  color: var(--mm-color-muted);
  cursor: default;
  opacity: 0.75;
}

#mm-users .filter-chip .count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5fa;
  color: var(--mm-color-text);
  font-size: 11.5px;
  font-weight: 500;
}

#mm-users .filter-chip.active .count {
  background: #dceeff;
  color: var(--mm-color-primary);
}

#mm-users .listaUsuarios {
  min-height: 350px;
}

#mm-users .mm-users__table-region {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

#mm-users .mm-users__table.table {
  width: 100%;
  min-width: 820px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--mm-color-text);
  font-size: 12.5px;
  font-weight: 400;
}

#mm-users .mm-users__table.table thead th {
  height: 42px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--mm-color-border);
  background: #f7faff;
  color: #667a98;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}

#mm-users .mm-users__table.table thead th:nth-child(1) { width: 31%; }
#mm-users .mm-users__table.table thead th:nth-child(2) { width: 19%; }
#mm-users .mm-users__table.table thead th:nth-child(3) { width: 19%; }
#mm-users .mm-users__table.table thead th:nth-child(4) { width: 15%; }
#mm-users .mm-users__table.table thead th:nth-child(5) { width: 16%; }

#mm-users .mm-users__table.table tbody td {
  height: 72px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #eaf0f7;
  background: transparent;
  color: var(--mm-color-text);
  vertical-align: middle;
}

#mm-users .mm-users__table.table tbody tr:last-child td {
  border-bottom: 0;
}

#mm-users .mm-users__row {
  position: relative;
  background: #fff;
  cursor: pointer;
  transition: background-color var(--mm-transition), box-shadow var(--mm-transition);
}

#mm-users .mm-users__row:hover {
  background: #f8fbff;
}

#mm-users .mm-users__row.is-selected {
  background: var(--mm-color-primary-soft);
  box-shadow: inset 3px 0 0 var(--mm-color-primary);
}

#mm-users .mm-users__row.is-selected td {
  background: transparent;
}

#mm-users .mm-users__row:focus-visible {
  outline: 2px solid var(--mm-color-primary);
  outline-offset: -2px;
}

#mm-users .mm-users__person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

#mm-users .mm-users__avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #e5f7f5;
  color: #0d8e85;
  font-size: 13px;
  font-weight: 500;
}

#mm-users .mm-users__avatar--large {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  border-radius: 18px;
  font-size: 17px;
}

#mm-users .mm-users__identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#mm-users .mm-users__identity strong {
  overflow: hidden;
  color: var(--mm-color-navy);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#mm-users .mm-users__identity > span {
  overflow: hidden;
  color: var(--mm-color-muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#mm-users .mm-users__company {
  color: var(--mm-color-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

#mm-users .mm-users__contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mm-color-muted);
}

#mm-users .mm-users__contact i {
  color: #8ba0bd;
  font-size: 13px;
}

#mm-users .mm-users__profile {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #3976b7;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

#mm-users .mm-users__status-cell,
#mm-users .mm-users__detail-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

#mm-users .mm-users__status-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#mm-users .mm-users__status-toggle,
#mm-users .mm-users__detail-status-track {
  width: 42px;
  height: 23px;
  flex: 0 0 42px;
  position: relative;
  display: inline-block;
  margin: 0;
  border-radius: 999px;
  background: #d9e2ee;
  cursor: pointer;
  transition: background-color var(--mm-transition);
}

#mm-users .mm-users__status-toggle::after,
#mm-users .mm-users__detail-status-track > span {
  content: "";
  width: 17px;
  height: 17px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 35, 75, 0.16);
  transition: transform var(--mm-transition);
}

#mm-users .mm-users__status-input:checked + .mm-users__status-toggle,
#mm-users .mm-users__detail-status.is-active .mm-users__detail-status-track {
  background: var(--mm-color-success);
}

#mm-users .mm-users__status-input:checked + .mm-users__status-toggle::after,
#mm-users .mm-users__detail-status.is-active .mm-users__detail-status-track > span {
  transform: translateX(19px);
}

#mm-users .mm-users__status-input:focus-visible + .mm-users__status-toggle {
  outline: 3px solid rgba(22, 119, 255, 0.22);
  outline-offset: 2px;
}

#mm-users .mm-users__status-label,
#mm-users .mm-users__detail-status,
#mm-users .mm-users__status-badge {
  color: var(--mm-color-text);
  font-size: 12px;
  font-weight: 400;
}

#mm-users .mm-users__status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf1f6;
  color: var(--mm-color-muted);
}

#mm-users .mm-users__status-badge.is-active {
  background: var(--mm-color-success-soft);
  color: #16835a;
}

#mm-users .mm-users__mobile-toggle,
#mm-users .mm-users__mobile-only {
  display: none;
}

#mm-users .mm-users__detail {
  min-height: 548px;
  padding: 22px;
}

#mm-users .mm-users__detail.is-empty .mm-users__detail-content,
#mm-users .mm-users__detail:not(.is-empty) .mm-users__detail-empty {
  display: none;
}

#mm-users .mm-users__detail-empty {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--mm-color-muted);
  text-align: center;
}

#mm-users .mm-users__detail-empty i {
  margin-bottom: 4px;
  color: #a4b4ca;
  font-size: 28px;
}

#mm-users .mm-users__detail-empty strong {
  color: var(--mm-color-text);
  font-size: 13px;
  font-weight: 500;
}

#mm-users .mm-users__detail-empty span {
  font-size: 12px;
}

#mm-users .mm-users__detail-person {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--mm-color-border);
}

#mm-users .mm-users__detail-person h2 {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
}

#mm-users .mm-users__detail-person p {
  margin: 5px 0 0;
  color: var(--mm-color-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

#mm-users .mm-users__detail-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--mm-color-border);
}

#mm-users .mm-users__detail-list > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 14px;
}

#mm-users .mm-users__detail-list dt,
#mm-users .mm-users__detail-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
}

#mm-users .mm-users__detail-list dt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--mm-color-muted);
}

#mm-users .mm-users__detail-list dt i {
  width: 16px;
  color: #7f94b3;
  text-align: center;
}

#mm-users .mm-users__detail-list dd {
  min-width: 0;
  color: var(--mm-color-text);
  overflow-wrap: anywhere;
}

#mm-users .mm-users__detail-status {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

#mm-users .mm-users__detail-status:disabled {
  cursor: default;
  opacity: 0.72;
}

#mm-users .mm-users__detail-actions {
  display: grid;
  gap: 8px;
  padding-top: 20px;
}

#mm-users .mm-users__detail-action {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-control);
  background: #fff;
  color: var(--mm-color-text);
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--mm-transition), background-color var(--mm-transition), color var(--mm-transition);
}

#mm-users .mm-users__detail-action:hover:not(:disabled) {
  border-color: #b8d5f3;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
}

#mm-users .mm-users__detail-action i:last-child {
  color: #8da0ba;
  font-size: 10px;
}

#mm-users .mm-users__detail-action--danger {
  border-color: #f3c8ce;
  color: var(--mm-color-danger);
}

#mm-users .mm-users__detail-action--danger:hover:not(:disabled) {
  border-color: #efaab4;
  background: var(--mm-color-danger-soft);
  color: #d84958;
}

#mm-users .mm-users__detail-action:disabled {
  cursor: default;
  opacity: 0.48;
}

#mm-users .mm-users__empty {
  min-height: 350px;
  border: 0;
  border-radius: 0;
}

@media (max-width: 1279.98px) {
  #mm-users .mm-users__workspace {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  #mm-users .mm-users__toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  #mm-users.mmcc-page {
    min-height: calc(100vh - 55px);
    padding: 18px 16px 28px;
  }

  #mm-users .mm-users__header,
  #mm-users .mm-users__heading {
    align-items: stretch;
  }

  #mm-users .mm-users__header {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
  }

  #mm-users .mm-users__heading {
    flex-direction: column;
    gap: 12px;
  }

  #mm-users .mmcc-page__title {
    font-size: 20px;
  }

  #mm-users .mmcc-page__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #mm-users .mmcc-page__actions .mmcc-btn {
    width: 100%;
  }

  #mm-users .mm-users__license {
    width: 100%;
    min-width: 0;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    padding: 10px 12px;
  }

  #mm-users .mm-users__workspace {
    display: block;
  }

  #mm-users .mm-users__detail {
    display: none;
  }

  #mm-users .mm-users__toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  #mm-users .mm-users__filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border: 0;
    background: var(--mm-color-border);
  }

  #mm-users .filter-chip,
  #mm-users .filter-chip:last-child {
    border: 0;
  }

  #mm-users .filter-chip:last-child {
    grid-column: 1 / -1;
  }

  #mm-users .listaUsuarios {
    min-height: 0;
    padding: 12px;
    background: var(--mm-color-page);
  }

  #mm-users .mm-users__table-region {
    overflow: visible;
  }

  #mm-users .mm-users__table.table,
  #mm-users .mm-users__table.table tbody {
    min-width: 0;
    display: block;
  }

  #mm-users .mm-users__table.table thead {
    display: none;
  }

  #mm-users .mm-users__table.table tbody {
    display: grid;
    gap: 10px;
  }

  #mm-users .mm-users__table.table tbody tr {
    width: 100%;
    display: block;
    overflow: hidden;
    border: 1px solid var(--mm-color-border);
    border-radius: var(--mm-radius-card);
    background: #fff;
    box-shadow: none;
    cursor: default;
  }

  #mm-users .mm-users__table.table tbody tr.is-selected {
    background: #fff;
    box-shadow: none;
  }

  #mm-users .mm-users__table.table tbody td {
    width: 100%;
    height: auto;
    min-height: 44px;
    display: none;
    grid-template-columns: minmax(88px, 0.45fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf2f8;
  }

  #mm-users .mm-users__table.table tbody td::before {
    content: attr(data-label);
    color: var(--mm-color-muted);
    font-size: 11.5px;
    font-weight: 400;
  }

  #mm-users .mm-users__table.table tbody td.mm-users__user-cell {
    min-height: 66px;
    display: block;
    padding: 12px 14px;
    border-bottom: 0;
  }

  #mm-users .mm-users__table.table tbody tr.is-expanded td {
    display: grid;
  }

  #mm-users .mm-users__table.table tbody tr.is-expanded td.mm-users__user-cell {
    display: block;
    border-bottom: 1px solid #edf2f8;
  }

  #mm-users .mm-users__person {
    width: 100%;
  }

  #mm-users .mm-users__mobile-toggle {
    width: 42px;
    height: 42px;
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: var(--mm-radius-control);
    background: transparent;
    color: var(--mm-color-primary);
    box-shadow: none;
  }

  #mm-users .mm-users__mobile-toggle i {
    transition: transform var(--mm-transition);
  }

  #mm-users .mm-users__row.is-expanded .mm-users__mobile-toggle i {
    transform: rotate(180deg);
  }

  #mm-users .mm-users__mobile-actions.mm-users__mobile-only {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }

  #mm-users .mm-users__mobile-action-list {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #mm-users .mm-users__mobile-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--mm-color-border);
    border-radius: var(--mm-radius-control);
    background: #fff;
    color: var(--mm-color-text);
    box-shadow: none;
    font-size: 11.5px;
    font-weight: 400;
    text-align: left;
  }

  #mm-users .mm-users__mobile-action--danger {
    border-color: #f3c8ce;
    color: var(--mm-color-danger);
  }

  #mm-users .mm-users__mobile-action:disabled {
    opacity: 0.48;
  }

  #mm-users .mm-users__empty {
    min-height: 240px;
    padding: 24px 16px;
    background: #fff;
    border-radius: var(--mm-radius-card);
  }
}

/* Perfis de acesso e permissões individuais */
.modal.mm-clinical-modal.mm-access-modal .modal-dialog {
  width: calc(100vw - 48px);
  max-width: 1180px;
  margin: 24px auto;
}

.modal.mm-clinical-modal.mm-access-modal .modal-content {
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: 16px;
  background: var(--mm-color-surface);
  box-shadow: 0 24px 68px rgba(15, 35, 75, 0.16);
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--mm-color-border);
  background: var(--mm-color-surface);
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  font-size: 15px;
}

.modal.mm-clinical-modal.mm-access-modal .modal-title {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__heading p {
  margin: 2px 0 0;
  color: var(--mm-color-muted);
  font-size: 12px;
  font-weight: 400;
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__close {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--mm-radius-control);
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-muted);
  font-size: 14px;
  opacity: 1;
  text-shadow: none;
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__close:hover {
  background: #e4f1ff;
  color: var(--mm-color-primary);
}

.modal.mm-clinical-modal.mm-access-modal .modal-body {
  min-height: 520px;
  max-height: calc(100vh - 164px);
  padding: 0;
  overflow: auto;
  background: var(--mm-color-page);
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__footer {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
  border-top: 1px solid var(--mm-color-border);
  background: #fff;
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__footer > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--mm-color-muted);
  font-size: 11.5px;
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__footer > span i {
  color: var(--mm-color-primary);
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-modal__debug:empty {
  display: none;
}

.modal.mm-clinical-modal.mm-access-modal .mm-access-loading,
.modal.mm-clinical-modal.mm-access-modal > .mmcc-loading-state,
.modal.mm-clinical-modal.mm-access-modal .modal-body > .mmcc-loading-state {
  min-height: 420px;
  border: 0;
  background: transparent;
}

.mm-access-profiles {
  min-height: 520px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.mm-access-profiles__sidebar {
  min-width: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--mm-color-border);
  background: #fff;
}

.mm-access-profiles__sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
  color: var(--mm-color-muted);
  font-size: 11.5px;
}

.mm-access-profiles__sidebar-heading strong {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  font-size: 11px;
  font-weight: 500;
}

.modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa li {
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}

.modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--mm-radius-card);
  background: transparent;
  color: var(--mm-color-text);
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--mm-transition), color var(--mm-transition);
}

.modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa:hover,
.modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa.is-active {
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
}

.modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa.is-active {
  box-shadow: inset 3px 0 0 var(--mm-color-primary);
}

.modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa > i {
  color: #9aabc1;
  font-size: 9px;
}

.mm-access-profiles__avatar,
.mm-permissions-editor__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #e5f7f5;
  color: #0d8e85;
  font-weight: 500;
}

.mm-access-profiles__avatar {
  width: 32px;
  height: 32px;
  font-size: 11.5px;
}

.mm-access-profiles__content {
  min-width: 0;
  padding: 18px;
}

.modal.mm-clinical-modal.mm-access-modal .acessousuario {
  padding: 18px;
}

.mm-access-profiles__welcome {
  min-height: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--mm-color-muted);
  text-align: center;
}

.mm-access-profiles__welcome > span {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  font-size: 16px;
}

.mm-access-profiles__welcome strong {
  color: var(--mm-color-text);
  font-size: 13px;
  font-weight: 500;
}

.mm-access-profiles__welcome p,
.mm-access-profiles__empty {
  margin: 0;
  color: var(--mm-color-muted);
  font-size: 12px;
}

.mm-permissions-editor {
  min-width: 0;
}

.mm-permissions-editor__header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--mm-radius-surface);
  background: var(--mm-color-primary-soft);
}

.mm-permissions-editor__person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mm-permissions-editor__avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 14px;
}

.mm-permissions-editor__eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--mm-color-primary);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mm-permissions-editor__header h3 {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.mm-permissions-editor__header p {
  margin: 3px 0 0;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
}

.mm-permissions-editor__header p strong {
  color: var(--mm-color-text);
  font-weight: 500;
}

.mm-permissions-editor__save-status {
  min-width: 84px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--mm-color-success);
  font-size: 11.5px;
  white-space: nowrap;
}

.mm-permissions-editor__save-status.is-saving {
  color: var(--mm-color-primary);
}

.mm-permissions-editor__save-status.is-error {
  color: var(--mm-color-danger);
}

.mm-permissions-editor__groups {
  display: grid;
  gap: 10px;
}

.mm-permission-group {
  min-width: 0;
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-card);
  background: #fff;
}

.mm-permission-group__header {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.mm-permission-group__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  font-size: 13px;
}

.mm-permission-group__header h4 {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
}

.mm-permission-group__header p {
  margin: 2px 0 0;
  color: var(--mm-color-muted);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.35;
}

.mm-permission-group__header > strong {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5fa;
  color: var(--mm-color-muted);
  font-size: 10.5px;
  font-weight: 500;
}

.mm-permission-group__fields {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px 10px;
  padding-left: 16px;
  border-left: 1px solid var(--mm-color-border);
}

.mm-permission-group__fields .custom-control {
  min-height: 32px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 5px 6px 5px 29px;
  border-radius: 7px;
  transition: background-color var(--mm-transition);
}

.mm-permission-group__fields .custom-control:hover {
  background: #f7faff;
}

.mm-permission-group__fields .custom-control-label {
  width: 100%;
  color: var(--mm-color-text);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
  cursor: pointer;
}

.mm-permission-group__fields .custom-control-label::before,
.mm-permission-group__fields .custom-control-label::after {
  top: 0;
  left: -23px;
  width: 16px;
  height: 16px;
}

.mm-permission-group__fields .custom-control-input:checked ~ .custom-control-label {
  color: var(--mm-color-navy);
}

.mm-permission-group__fields .custom-control-input:checked ~ .custom-control-label::before {
  border-color: var(--mm-color-primary);
  background-color: var(--mm-color-primary);
}

.mm-permission-group__fields--agenda {
  display: block;
}

.mm-agenda-access {
  width: 100%;
  max-width: 680px;
}

.mm-agenda-access__label {
  display: block;
  margin-bottom: 6px;
  color: var(--mm-color-text);
  font-size: 11.5px;
  font-weight: 500;
}

.mm-agenda-access__trigger {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--mm-color-border);
  border-radius: 10px;
  background: var(--mm-color-surface);
  color: var(--mm-color-text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--mm-transition), box-shadow var(--mm-transition), background-color var(--mm-transition);
}

.mm-agenda-access__trigger:hover {
  border-color: #b7d7f7;
  background: #fbfdff;
}

.mm-agenda-access__trigger:focus-visible,
.mm-agenda-access.is-open .mm-agenda-access__trigger {
  outline: 0;
  border-color: var(--mm-color-primary);
  box-shadow: 0 0 0 3px rgba(8, 125, 241, 0.12);
}

.mm-agenda-access__trigger-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  font-size: 14px;
}

.mm-agenda-access__trigger-copy {
  min-width: 0;
}

.mm-agenda-access__trigger-copy strong,
.mm-agenda-access__trigger-copy small {
  display: block;
}

.mm-agenda-access__trigger-copy strong {
  overflow: hidden;
  color: var(--mm-color-navy);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-agenda-access__trigger-copy small {
  margin-top: 2px;
  color: var(--mm-color-muted);
  font-size: 10.5px;
}

.mm-agenda-access__chevron {
  color: var(--mm-color-muted);
  font-size: 10px;
  transition: transform var(--mm-transition);
}

.mm-agenda-access.is-open .mm-agenda-access__chevron {
  transform: rotate(180deg);
}

.mm-agenda-access__panel {
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: 10px;
  background: var(--mm-color-surface);
  box-shadow: 0 12px 30px rgba(31, 59, 96, 0.1);
}

.mm-agenda-access__panel[hidden] {
  display: none !important;
}

.mm-agenda-access__search {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 11px;
  border-bottom: 1px solid var(--mm-color-border);
  color: var(--mm-color-muted);
}

.mm-agenda-access__search input {
  min-width: 0;
  width: 100%;
  height: 28px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mm-color-text);
  font: inherit;
  font-size: 11.5px;
}

.mm-agenda-access__search input::placeholder {
  color: var(--mm-color-muted);
}

.mm-agenda-access__options {
  max-height: 286px;
  overflow-y: auto;
  padding: 5px 6px;
  scrollbar-width: thin;
  scrollbar-color: #cad7e8 transparent;
}

.mm-agenda-access__option {
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color var(--mm-transition);
}

.mm-agenda-access__option--all {
  margin-bottom: 3px;
  background: var(--mm-color-primary-soft);
}

.mm-agenda-access__option:hover {
  background: #f7faff;
}

.mm-agenda-access__option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.mm-agenda-access__check {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfcbda;
  border-radius: 5px;
  background: #fff;
  color: transparent;
  font-size: 9px;
  transition: border-color var(--mm-transition), background-color var(--mm-transition), color var(--mm-transition);
}

.mm-agenda-access__option input:focus-visible + .mm-agenda-access__check {
  outline: 2px solid rgba(8, 125, 241, 0.25);
  outline-offset: 2px;
}

.mm-agenda-access__option input:checked + .mm-agenda-access__check {
  border-color: var(--mm-color-primary);
  background: var(--mm-color-primary);
  color: #fff;
}

.mm-agenda-access__name {
  min-width: 0;
  overflow: hidden;
  color: var(--mm-color-navy);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-agenda-access__empty {
  margin: 0;
  padding: 16px 10px;
  color: var(--mm-color-muted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 991.98px) {
  .modal.mm-clinical-modal.mm-access-modal .modal-dialog {
    width: calc(100vw - 20px);
    max-width: none;
    margin: 10px auto;
  }

  .modal.mm-clinical-modal.mm-access-modal .modal-content {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .modal.mm-clinical-modal.mm-access-modal .modal-body {
    min-height: 0;
    max-height: calc(100vh - 144px);
  }

  .mm-access-profiles {
    min-height: 0;
    display: block;
  }

  .mm-access-profiles__sidebar {
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--mm-color-border);
  }

  .modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa ul::-webkit-scrollbar {
    display: none;
  }

  .modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa {
    width: auto;
    min-width: 150px;
    grid-template-columns: 30px minmax(76px, 1fr);
    min-height: 44px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid var(--mm-color-border);
  }

  .modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa > i {
    display: none;
  }

  .modal.mm-clinical-modal.mm-access-modal .listaPerfilEmpresa .selecionaperfilempresa.is-active {
    border-color: #a9d2fb;
    box-shadow: none;
  }

  .mm-access-profiles__content,
  .modal.mm-clinical-modal.mm-access-modal .acessousuario {
    padding: 12px;
  }

  .mm-permission-group {
    grid-template-columns: 175px minmax(0, 1fr);
  }

  .mm-permission-group__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .modal.mm-clinical-modal.mm-access-modal .mm-access-modal__header {
    min-height: 62px;
    padding: 10px 12px;
  }

  .modal.mm-clinical-modal.mm-access-modal .mm-access-modal__icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .modal.mm-clinical-modal.mm-access-modal .modal-title {
    font-size: 14.5px;
  }

  .modal.mm-clinical-modal.mm-access-modal .mm-access-modal__heading p,
  .modal.mm-clinical-modal.mm-access-modal .mm-access-modal__footer > span {
    display: none;
  }

  .modal.mm-clinical-modal.mm-access-modal .mm-access-modal__footer {
    min-height: 52px;
    justify-content: flex-end;
    padding: 7px 12px;
  }

  .modal.mm-clinical-modal.mm-access-modal .mm-access-modal__footer .mmcc-btn {
    width: 100%;
  }

  .mm-access-profiles__sidebar-heading {
    padding-bottom: 9px;
  }

  .mm-permissions-editor__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
  }

  .mm-permissions-editor__save-status {
    min-width: 0;
    min-height: 28px;
    align-self: flex-start;
    padding: 4px 9px;
  }

  .mm-permission-group {
    display: block;
    padding: 12px;
  }

  .mm-permission-group__header {
    margin-bottom: 10px;
  }

  .mm-permission-group__fields {
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 9px 0 0;
    border-top: 1px solid var(--mm-color-border);
    border-left: 0;
  }

  .mm-agenda-access {
    max-width: none;
  }

  .mm-agenda-access__trigger {
    min-height: 52px;
  }

  .mm-agenda-access__options {
    max-height: 240px;
  }
}

/* Envio de formulários e anamneses — Agenda e Consulta Médica */
.modal.mm-clinical-modal.mm-form-send-modal .modal-dialog {
  width: calc(100% - 32px);
  max-width: 1300px;
  margin: 16px auto;
}

.modal.mm-clinical-modal.mm-form-send-modal .modal-content {
  max-height: calc(100dvh - 32px);
}

.modal.mm-clinical-modal.mm-form-send-modal .sendzapFormulario {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal.mm-clinical-modal.mm-form-send-modal .modal-header {
  flex: 0 0 auto;
  min-height: 62px;
  padding: 13px 22px;
}

.modal.mm-clinical-modal.mm-form-send-modal .mmcc-modal-heading__icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 8px;
}

.modal.mm-clinical-modal.mm-form-send-modal .modal-title {
  font-size: 17px;
  font-weight: 500;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-modal__close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--mm-color-border);
  border-radius: 50%;
  background: #fff;
  color: var(--mm-color-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--mm-transition), border-color var(--mm-transition), color var(--mm-transition);
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-modal__close:hover {
  border-color: #b7d5f4;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
}

.modal.mm-clinical-modal.mm-form-send-modal .modal-body {
  min-height: 0;
  flex: 1 1 auto;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.modal.mm-clinical-modal.mm-form-send-modal .modal-footer {
  flex: 0 0 auto;
  min-height: 62px;
  padding: 11px 22px;
  background: #fff;
}

.modal.mm-clinical-modal.mm-form-send-modal .modal-footer .mmcc-btn {
  min-width: 88px;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-open-link {
  margin-right: auto;
  border-color: #b9d9fb;
  color: var(--mm-color-primary);
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-open-link[aria-disabled="true"] {
  border-color: var(--mm-color-border);
  background: #f6f9fc;
  color: #8b9ab0;
  box-shadow: none;
  cursor: not-allowed;
  opacity: .72;
  pointer-events: none;
  transform: none;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-modal__submit {
  border-color: var(--mm-color-primary);
  background: var(--mm-color-primary);
  color: #fff;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-modal__submit:hover {
  border-color: var(--mm-color-primary-hover);
  background: var(--mm-color-primary-hover);
  color: #fff;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-modal__submit:disabled {
  border-color: #c9d8e9;
  background: #dbe5f0;
  color: #7c8ba3;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.mm-form-send-layout {
  min-width: 0;
  height: min(620px, calc(100dvh - 158px));
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(300px, 37%) minmax(0, 63%);
  overflow: hidden;
  background: #fff;
}

.mm-form-send-composer {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid var(--mm-color-border);
  background: #fff;
}

.mm-form-send-composer .debug:empty {
  display: none;
}

.mm-form-send-field + .mm-form-send-field {
  margin-top: 18px;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-field label {
  margin-bottom: 7px;
  color: var(--mm-color-text);
  font-size: 12px;
  font-weight: 500;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-field .form-control {
  min-height: 42px;
  font-size: 13px;
  font-weight: 400;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-field--message textarea.form-control {
  height: 190px;
  min-height: 150px;
  max-height: 280px;
  resize: vertical;
  line-height: 1.55;
}

.modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-field--message textarea.form-control:disabled {
  background: #f6f9fc;
  color: var(--mm-color-muted);
  opacity: 1;
}

.mm-form-send-preview-host,
.mm-form-send-preview {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.mm-form-send-preview {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.mm-form-send-preview__header {
  flex: 0 0 auto;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--mm-color-border);
  background: #fff;
}

.mm-form-send-preview__header h3 {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.3;
}

.mm-form-send-preview__meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
}

.mm-form-send-preview__meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--mm-color-text);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-form-send-preview__meta > span {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: var(--mm-color-primary);
}

.mm-form-send-preview__meta small {
  flex: 0 0 auto;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
}

.mm-form-send-preview__scroll {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  background: #fff;
}

.mm-form-send-preview__scroll::-webkit-scrollbar {
  width: 9px;
}

.mm-form-send-preview__scroll::-webkit-scrollbar-track {
  background: #f3f7fb;
}

.mm-form-send-preview__scroll::-webkit-scrollbar-thumb {
  border: 2px solid #f3f7fb;
  border-radius: 999px;
  background: #9bb5cf;
}

.mm-form-send-question {
  min-width: 0;
  padding: 17px 24px;
  border-bottom: 1px solid var(--mm-color-border);
  background: #fff;
}

.mm-form-send-question:last-child {
  border-bottom: 0;
}

.mm-form-send-question h4 {
  margin: 0 0 12px;
  color: var(--mm-color-navy);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
}

.mm-form-send-question h4 > span:first-child {
  margin-right: 3px;
  color: var(--mm-color-primary);
}

.mm-form-send-question .mm-form-send-question__required {
  margin-left: 3px;
  color: var(--mm-color-danger);
}

.mm-form-send-question__image {
  max-width: min(420px, 100%);
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-control);
  background: #f7faff;
}

.mm-form-send-question__image img {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
}

.mm-form-send-question__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.mm-form-send-question__options label {
  min-width: 0;
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  margin: 0 !important;
  color: var(--mm-color-text) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4;
}

.mm-form-send-question__options input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 1px 0 0;
  accent-color: var(--mm-color-primary);
  opacity: 1;
}

.mm-form-send-question__input,
.mm-form-send-question__complement textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-control);
  background: #fbfdff;
  color: var(--mm-color-muted);
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  opacity: 1;
}

.mm-form-send-question__complement {
  display: block !important;
  margin: 13px 0 0 !important;
}

.mm-form-send-question__complement > span {
  display: block;
  margin-bottom: 7px;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
}

.mm-form-send-question__complement textarea {
  min-height: 66px;
  resize: none;
}

.mm-form-send-state,
.mm-form-send-loading {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 24px;
  color: var(--mm-color-muted);
  font-size: 12.5px;
  font-weight: 400;
  text-align: center;
}

.mm-form-send-state i,
.mm-form-send-loading i {
  color: var(--mm-color-primary);
  font-size: 15px;
}

.mm-form-send-state--error,
.mm-form-send-state--error i {
  color: var(--mm-color-danger);
}

/* Leitura de formulários respondidos — Agenda e Consulta Médica */
.modal.mm-clinical-modal.mm-form-response-modal .modal-dialog {
  width: calc(100% - 32px);
  max-width: 1300px;
  margin: 16px auto;
}

.modal.mm-clinical-modal.mm-form-response-modal .modal-content {
  max-height: calc(100dvh - 32px);
}

.modal.mm-clinical-modal.mm-form-response-modal .modal-header {
  flex: 0 0 auto;
  min-height: 62px;
  padding: 13px 22px;
}

.modal.mm-clinical-modal.mm-form-response-modal .mmcc-modal-heading__icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 8px;
}

.modal.mm-clinical-modal.mm-form-response-modal .modal-title {
  font-size: 17px;
  font-weight: 500;
}

.modal.mm-clinical-modal.mm-form-response-modal .mm-form-response-modal__close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--mm-color-border);
  border-radius: 50%;
  background: #fff;
  color: var(--mm-color-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--mm-transition), border-color var(--mm-transition), color var(--mm-transition);
}

.modal.mm-clinical-modal.mm-form-response-modal .mm-form-response-modal__close:hover {
  border-color: #b7d5f4;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
}

.modal.mm-clinical-modal.mm-form-response-modal .modal-body {
  min-height: 0;
  flex: 1 1 auto;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.modal.mm-clinical-modal.mm-form-response-modal .modal-footer {
  flex: 0 0 auto;
  min-height: 62px;
  padding: 11px 22px;
  background: #fff;
}

.mm-form-response-workspace {
  min-width: 0;
  height: min(620px, calc(100dvh - 158px));
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(280px, 32%) minmax(0, 68%);
  overflow: hidden;
  background: #fff;
}

.mm-form-response-list-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--mm-color-border);
  background: #fbfdff;
}

.mm-form-response-list-header {
  min-height: 84px;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--mm-color-border);
  background: #fff;
}

.mm-form-response-list-header h3 {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.mm-form-response-list-header p {
  margin: 5px 0 0;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
}

.mm-form-response-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mm-form-response-item {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--mm-color-border);
  background: transparent;
  color: var(--mm-color-text);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--mm-transition), color var(--mm-transition);
}

.mm-form-response-item:hover,
.mm-form-response-item:focus-visible {
  outline: 0;
  background: #f4f9ff;
}

.mm-form-response-item:focus-visible {
  box-shadow: inset 3px 0 0 var(--mm-color-primary);
}

.mm-form-response-item.is-active {
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary);
  box-shadow: inset 3px 0 0 var(--mm-color-primary);
}

.mm-form-response-item__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #eaf5ff;
  color: var(--mm-color-primary);
  font-size: 14px;
}

.mm-form-response-item__content {
  min-width: 0;
  display: block;
}

.mm-form-response-item__content strong {
  display: block;
  overflow: hidden;
  color: var(--mm-color-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-form-response-item__content small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--mm-color-muted);
  font-size: 11px;
  font-weight: 400;
}

.mm-form-response-item.is-active .mm-form-response-item__content strong,
.mm-form-response-item.is-active .mm-form-response-item__arrow {
  color: var(--mm-color-primary);
}

.mm-form-response-item__arrow {
  color: #a7b4c7;
  font-size: 11px;
}

.mm-form-response-detail-host {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}

.mm-form-response-state,
.mm-form-response-empty {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 28px;
  color: var(--mm-color-muted);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

.mm-form-response-state > i,
.mm-form-response-empty > i {
  color: var(--mm-color-primary);
  font-size: 20px;
}

.mm-form-response-state > div,
.mm-form-response-empty {
  flex-direction: column;
}

.mm-form-response-state strong,
.mm-form-response-empty strong {
  color: var(--mm-color-text);
  font-size: 13px;
  font-weight: 500;
}

.mm-form-response-state span,
.mm-form-response-empty span {
  display: block;
  margin-top: 3px;
  line-height: 1.45;
}

.mm-form-response-state--error,
.mm-form-response-state--error > i {
  color: var(--mm-color-danger);
}

.mm-form-response-detail {
  min-width: 0;
  min-height: 100%;
  background: #fff;
}

.mm-form-response-detail__header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--mm-color-border);
  background: #fff;
}

.mm-form-response-detail__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--mm-color-primary);
  font-size: 11px;
  font-weight: 500;
}

.mm-form-response-detail__header h3 {
  margin: 0;
  color: var(--mm-color-navy);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.mm-form-response-detail__date {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
  white-space: nowrap;
}

.mm-form-response-detail__date i {
  color: var(--mm-color-primary);
}

.mm-form-response-question {
  min-width: 0;
  padding: 17px 22px 18px;
  border-bottom: 1px solid var(--mm-color-border);
  background: #fff;
}

.mm-form-response-question:last-child {
  border-bottom: 0;
}

.mm-form-response-question h4 {
  margin: 0 0 12px;
  color: var(--mm-color-navy);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
}

.mm-form-response-question h4 > span:first-child {
  margin-right: 3px;
  color: var(--mm-color-primary);
}

.mm-form-response-question__required {
  margin-left: 3px;
  color: var(--mm-color-danger);
}

.mm-form-response-question__image {
  max-width: min(420px, 100%);
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-control);
  background: #f7faff;
}

.mm-form-response-question__image img {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
}

.mm-form-response-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.mm-form-response-option {
  min-width: 0;
  min-height: 38px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--mm-radius-control);
  color: var(--mm-color-text) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4;
}

.mm-form-response-option.is-selected {
  border-color: #b9d9fb;
  background: var(--mm-color-primary-soft);
  color: var(--mm-color-primary) !important;
}

.mm-form-response-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  accent-color: var(--mm-color-primary);
  opacity: 1;
}

.mm-form-response-input,
.mm-form-response-complement textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-control);
  background: #fbfdff;
  color: var(--mm-color-text);
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  opacity: 1;
}

.mm-form-response-complement {
  display: block !important;
  margin: 13px 0 0 !important;
}

.mm-form-response-complement > span {
  display: block;
  margin-bottom: 7px;
  color: var(--mm-color-muted);
  font-size: 11.5px;
  font-weight: 400;
}

.mm-form-response-complement textarea {
  min-height: 66px;
  resize: none;
}

@media (max-width: 767.98px) {
  .modal.mm-clinical-modal.mm-form-send-modal {
    overflow-y: hidden;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .modal-dialog {
    width: auto;
    max-width: none;
    margin: 8px;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .modal-content {
    max-height: calc(100dvh - 16px);
  }

  .modal.mm-clinical-modal.mm-form-send-modal .modal-header {
    min-height: 58px;
    padding: 10px 14px;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .mmcc-modal-heading__icon {
    display: inline-flex;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .modal-title {
    font-size: 15px;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-modal__close {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .modal-body {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .modal-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 62px;
    padding: 9px 12px;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .modal-footer .mmcc-btn {
    min-width: 0;
    min-height: 44px;
    flex: 1 1 0;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-open-link {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  .mm-form-send-layout {
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
  }

  .mm-form-send-composer {
    padding: 18px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--mm-color-border);
  }

  .mm-form-send-field + .mm-form-send-field {
    margin-top: 15px;
  }

  .modal.mm-clinical-modal.mm-form-send-modal .mm-form-send-field--message textarea.form-control {
    height: 160px;
    min-height: 140px;
  }

  .mm-form-send-preview-host,
  .mm-form-send-preview {
    height: auto;
    min-height: 360px;
  }

  .mm-form-send-preview__header {
    padding: 17px 14px 13px;
  }

  .mm-form-send-preview__meta {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .mm-form-send-preview__meta strong {
    width: 100%;
    white-space: normal;
  }

  .mm-form-send-preview__meta > span {
    display: none;
  }

  .mm-form-send-preview__scroll {
    overflow: visible;
  }

  .mm-form-send-question {
    padding: 16px 14px;
  }

  .mm-form-send-question__options {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .mm-form-send-question__options label {
    min-height: 42px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--mm-color-border);
    border-radius: var(--mm-radius-control);
    background: #fff;
  }

  .mm-form-send-question__options input {
    margin-top: 0;
  }

  .modal.mm-clinical-modal.mm-form-response-modal {
    overflow-y: hidden;
  }

  .modal.mm-clinical-modal.mm-form-response-modal .modal-dialog {
    width: auto;
    max-width: none;
    margin: 8px;
  }

  .modal.mm-clinical-modal.mm-form-response-modal .modal-content {
    max-height: calc(100dvh - 16px);
  }

  .modal.mm-clinical-modal.mm-form-response-modal .modal-header {
    min-height: 58px;
    padding: 10px 14px;
  }

  .modal.mm-clinical-modal.mm-form-response-modal .modal-title {
    font-size: 15px;
  }

  .modal.mm-clinical-modal.mm-form-response-modal .mm-form-response-modal__close {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .modal.mm-clinical-modal.mm-form-response-modal .modal-body {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .modal.mm-clinical-modal.mm-form-response-modal .modal-footer {
    min-height: 62px;
    padding: 9px 12px;
  }

  .modal.mm-clinical-modal.mm-form-response-modal .modal-footer .mmcc-btn {
    width: 100%;
    min-height: 44px;
  }

  .mm-form-response-workspace {
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
  }

  .mm-form-response-list-panel {
    max-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--mm-color-border);
  }

  .mm-form-response-list-header {
    min-height: 0;
    padding: 15px 14px 13px;
  }

  .mm-form-response-item {
    min-height: 64px;
    padding: 10px 12px;
  }

  .mm-form-response-detail-host {
    min-height: 360px;
    overflow: visible;
  }

  .mm-form-response-detail__header {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 15px 14px;
  }

  .mm-form-response-detail__header h3 {
    font-size: 15px;
  }

  .mm-form-response-question {
    padding: 16px 14px;
  }

  .mm-form-response-options {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mm-form-response-option {
    min-height: 42px;
  }
}

/* Chamada do médico para a Secretaria */
.telafundomedico.mm-clinical {
  --mm-call-primary: #17a6d8;
  --mm-call-primary-dark: #118fbd;
  --mm-call-primary-soft: #eaf7fd;
  --mm-call-cyan: #21b2d3;
  --mm-call-mint: #e7f8f5;
  --mm-call-teal: #13aaa6;
  --mm-call-attention: #f59e0b;
  --mm-call-attention-dark: #d97706;
  --mm-call-attention-soft: #fff7e6;
  position: fixed;
  inset: 52px 0 0;
  z-index: 2147483000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  overflow: hidden;
  background: rgba(48, 68, 98, 0.12);
  color: var(--mm-color-text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.telafundomedico.mm-clinical[hidden] {
  display: none !important;
}

.telafundomedico.mm-clinical.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mm-medical-call {
  width: min(100%, 360px);
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  min-height: 0;
  padding: 8px 8px 9px;
  overflow: hidden;
  border: 0;
  border-left: 1px solid #e7eaf1;
  background: rgba(248, 249, 252, 0.96);
  color: var(--mm-color-text);
  outline: 0;
  transform: translate3d(105%, 0, 0);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.telafundomedico.mm-clinical.is-open .mm-medical-call {
  transform: translate3d(0, 0, 0);
}

.mm-medical-call__surface {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31, 45, 72, 0.08);
}

.telafundomedico.mm-clinical.is-alerting .mm-medical-call__surface {
  animation: mm-medical-call-panel-attention 1800ms ease-in-out 4;
}

.telafundomedico.mm-clinical.is-reminding .mm-medical-call__surface {
  animation: mm-medical-call-panel-attention 1500ms ease-in-out 1;
}

.mm-medical-call__header {
  min-height: 170px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 22px 18px 18px;
  background-color: #fff;
  background-image: url("../../images/medical-call-header.jpg");
  background-position: center top;
  background-size: cover;
}

.mm-medical-call__icon {
  position: relative;
  width: 88px;
  height: 88px;
  display: block;
  border: 1px solid #d8eef8;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 7px rgba(235, 247, 253, 0.76),
    0 8px 24px rgba(23, 166, 216, 0.1);
  color: var(--mm-call-primary);
}

.mm-medical-call__icon .fa-stethoscope {
  position: absolute;
  top: 22px;
  left: 23px;
  font-size: 31px;
  line-height: 1;
}

.mm-medical-call__icon .bi-bell {
  position: absolute;
  right: 10px;
  bottom: 9px;
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--mm-call-attention-soft);
  color: var(--mm-call-attention);
  box-shadow: 0 4px 11px rgba(217, 119, 6, 0.18);
  font-size: 18px;
  line-height: 1;
  transform-origin: 50% 12%;
}

.telafundomedico.mm-clinical.is-open .mm-medical-call__icon {
  animation: mm-medical-call-icon-pulse 1800ms ease-in-out infinite;
}

.telafundomedico.mm-clinical.is-alerting .mm-medical-call__icon {
  animation: mm-medical-call-icon-rings 1500ms ease-out 4;
}

.telafundomedico.mm-clinical.is-alerting .mm-medical-call__icon .bi-bell {
  animation: mm-medical-call-bell-ring 700ms ease-in-out 4;
}

.telafundomedico.mm-clinical.is-reminding .mm-medical-call__icon {
  animation: mm-medical-call-icon-rings 1300ms ease-out 1;
}

.telafundomedico.mm-clinical.is-reminding .mm-medical-call__icon .bi-bell {
  animation: mm-medical-call-bell-ring 700ms ease-in-out 2;
}

.mm-medical-call__heading {
  min-width: 0;
}

.mm-medical-call__eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(235, 247, 253, 0.94);
  color: var(--mm-call-primary-dark);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mm-medical-call__attention-dot {
  color: var(--mm-call-attention);
  font-size: 7px;
  line-height: 1;
  animation: mm-medical-call-attention-dot 1600ms ease-in-out infinite;
}

.mm-medical-call__heading p {
  margin: 11px 0 0;
  color: var(--mm-color-navy);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.mm-medical-call__description {
  display: block;
  margin-top: 5px;
  color: #667895;
  font-size: 10.5px;
  line-height: 1.35;
}

.mm-medical-call__signal {
  display: flex;
  gap: 9px;
  margin-top: 17px;
}

.mm-medical-call__signal i {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 50%;
  background: #dceff7;
}

.mm-medical-call__signal i:first-child {
  background: var(--mm-call-attention);
}

@keyframes mm-medical-call-bell-ring {
  0%,
  100% {
    color: var(--mm-call-attention);
    transform: rotate(0);
  }

  22% {
    color: var(--mm-call-attention-dark);
    transform: rotate(13deg) scale(1.06);
  }

  48% {
    transform: rotate(-11deg) scale(1.06);
  }

  72% {
    transform: rotate(8deg);
  }
}

@keyframes mm-medical-call-icon-rings {
  0% {
    box-shadow:
      0 0 0 7px rgba(235, 247, 253, 0.76),
      0 8px 24px rgba(23, 166, 216, 0.1);
  }

  55% {
    box-shadow:
      0 0 0 8px rgba(245, 158, 11, 0.18),
      0 0 0 20px rgba(245, 158, 11, 0.09),
      0 8px 24px rgba(23, 166, 216, 0.1);
  }

  100% {
    box-shadow:
      0 0 0 22px rgba(245, 158, 11, 0),
      0 8px 24px rgba(23, 166, 216, 0.1);
  }
}

@keyframes mm-medical-call-icon-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 7px rgba(235, 247, 253, 0.76),
      0 8px 24px rgba(23, 166, 216, 0.1);
  }

  50% {
    box-shadow:
      0 0 0 9px rgba(245, 158, 11, 0.22),
      0 0 0 18px rgba(245, 158, 11, 0.08),
      0 8px 24px rgba(23, 166, 216, 0.1);
  }
}

@keyframes mm-medical-call-panel-attention {
  0%,
  100% {
    box-shadow:
      inset 0 3px 0 rgba(245, 158, 11, 0),
      0 8px 28px rgba(31, 45, 72, 0.08);
  }

  50% {
    box-shadow:
      inset 0 3px 0 rgba(245, 158, 11, 0.82),
      -4px 8px 30px rgba(245, 158, 11, 0.14);
  }
}

@keyframes mm-medical-call-attention-dot {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.22);
  }
}

.mm-medical-call__details {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 10px 18px;
  overflow-x: hidden;
  overflow-y: auto;
}

.mm-medical-call__detail {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 12px;
  border: 1px solid #e6e9f0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 7px rgba(39, 52, 79, 0.035);
}

.mm-medical-call__detail[hidden] {
  display: none !important;
}

.mm-medical-call__detail-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 23px;
  line-height: 1;
}

.mm-medical-call__detail-icon--patient,
.mm-medical-call__detail-icon--doctor {
  background: var(--mm-call-primary-soft);
  color: var(--mm-call-primary);
}

.mm-medical-call__detail-icon--room {
  background: var(--mm-call-mint);
  color: var(--mm-call-teal);
}

.mm-medical-call__detail div {
  min-width: 0;
}

.mm-medical-call__detail div > span {
  display: block;
  margin-bottom: 5px;
  color: #647694;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
}

.mm-medical-call__detail strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--mm-color-navy);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.mm-medical-call__footer {
  margin-top: auto;
  padding: 11px 18px 18px;
}

.mm-medical-call__feedback {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid var(--mm-color-danger);
  border-radius: var(--mm-radius-control);
  background: var(--mm-color-danger-soft);
  color: #a63d49;
  font-size: 12px;
  line-height: 1.4;
}

.mm-medical-call__feedback[hidden] {
  display: none !important;
}

.mm-medical-call__confirm {
  width: 100%;
  min-height: 51px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border: 1px solid var(--mm-call-primary);
  border-radius: 8px;
  background: linear-gradient(100deg, var(--mm-call-primary), #1fafd9 55%, var(--mm-call-cyan));
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 166, 216, 0.2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--mm-transition), border-color var(--mm-transition), box-shadow var(--mm-transition), transform var(--mm-transition);
}

.mm-medical-call__confirm .bi {
  font-size: 20px;
}

.mm-medical-call__confirm:hover {
  border-color: var(--mm-call-primary-dark);
  background: linear-gradient(100deg, var(--mm-call-primary-dark), #169fc8 55%, #18a5c4);
  color: #fff;
  box-shadow: 0 10px 24px rgba(23, 166, 216, 0.26);
  transform: translateY(-1px);
}

.mm-medical-call__confirm:active {
  transform: translateY(0);
}

.mm-medical-call__confirm:focus-visible {
  outline: 3px solid rgba(23, 166, 216, 0.24);
  outline-offset: 3px;
}

.mm-medical-call__confirm:disabled {
  border-color: #9acddd;
  background: #9acddd;
  box-shadow: none;
  cursor: wait;
  transform: none;
}

@media (max-width: 600px) {
  .telafundomedico.mm-clinical {
    background: rgba(48, 68, 98, 0.1);
  }

  .mm-medical-call {
    width: 100%;
    border-left: 0;
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (max-height: 670px) {
  .mm-medical-call__header {
    min-height: 161px;
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .mm-medical-call__icon {
    width: 76px;
    height: 76px;
  }

  .mm-medical-call__icon .fa-stethoscope {
    top: 19px;
    left: 20px;
    font-size: 27px;
  }

  .mm-medical-call__icon .bi-bell {
    right: 8px;
    bottom: 7px;
    width: 26px;
    height: 26px;
    font-size: 16px;
  }

  .mm-medical-call__signal {
    margin-top: 11px;
  }

  .mm-medical-call__detail {
    min-height: 80px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .mm-medical-call__footer {
    padding-top: 8px;
    padding-bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mm-clinical *,
  .mm-clinical *::before,
  .mm-clinical *::after,
  .mm-clinical-modal *,
  .mm-clinical-modal *::before,
  .mm-clinical-modal *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .telafundomedico.mm-clinical .mm-medical-call {
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
}
